Public Member Functions | Private Attributes | List of all members
ClusterHitTime Class Reference
Inheritance diagram for ClusterHitTime:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Member Functions

 ClusterHitTime (fhicl::ParameterSet const &p)
 
 ClusterHitTime (ClusterHitTime const &)=delete
 
 ClusterHitTime (ClusterHitTime &&)=delete
 
ClusterHitTimeoperator= (ClusterHitTime const &)=delete
 
ClusterHitTimeoperator= (ClusterHitTime &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
- Public Member Functions inherited from art::EDAnalyzer
 EDAnalyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 EDAnalyzer (Table< Config > const &config)
 
std::string workerType () const
 
- Public Member Functions inherited from art::detail::Analyzer
virtual ~Analyzer () noexcept
 
 Analyzer (fhicl::ParameterSet const &pset)
 
template<typename Config >
 Analyzer (Table< Config > const &config)
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
- Public Member Functions inherited from art::Observer
 ~Observer () noexcept
 
 Observer (Observer const &)=delete
 
 Observer (Observer &&)=delete
 
Observeroperator= (Observer const &)=delete
 
Observeroperator= (Observer &&)=delete
 
void registerProducts (ProductDescriptions &, ModuleDescription const &)
 
void fillDescriptions (ModuleDescription const &)
 
fhicl::ParameterSetID selectorConfig () const
 
- Public Member Functions inherited from art::ModuleBase
virtual ~ModuleBase () noexcept
 
 ModuleBase ()
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Private Attributes

TH1D * clutime [3]
 
art::InputTag fClusterModuleLabel
 
std::vector< int > fClusterIDs
 

Additional Inherited Members

- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 
- Protected Member Functions inherited from art::Observer
std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResultsgetTriggerResults (Event const &e) const
 
 Observer (fhicl::ParameterSet const &config)
 
 Observer (std::vector< std::string > const &select_paths, std::vector< std::string > const &reject_paths, fhicl::ParameterSet const &config)
 
- Protected Member Functions inherited from art::ModuleBase
ConsumesCollectorconsumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Detailed Description

Definition at line 32 of file ClusterHitTime_module.cc.

Constructor & Destructor Documentation

ClusterHitTime::ClusterHitTime ( fhicl::ParameterSet const &  p)
explicit

Definition at line 58 of file ClusterHitTime_module.cc.

59  : EDAnalyzer{p},
60  fClusterModuleLabel(p.get<art::InputTag>("ClusterModuleLabel","linecluster")),
61  fClusterIDs(p.get<std::vector<int>>("ClusterIDs"))
62 {
63 }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
std::vector< int > fClusterIDs
art::InputTag fClusterModuleLabel
ClusterHitTime::ClusterHitTime ( ClusterHitTime const &  )
delete
ClusterHitTime::ClusterHitTime ( ClusterHitTime &&  )
delete

Member Function Documentation

void ClusterHitTime::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 65 of file ClusterHitTime_module.cc.

66 {
67 
68  std::vector<art::Ptr<recob::Cluster> > clusterlist;
69  auto clusterListHandle = e.getHandle< std::vector<recob::Cluster> >(fClusterModuleLabel);
70  if (clusterListHandle)
71  art::fill_ptr_vector(clusterlist, clusterListHandle);
72 
73  art::FindManyP<recob::Hit> fmhc(clusterListHandle, e, fClusterModuleLabel);
74 
75  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(e);
76  for (const auto & cluster : clusterlist){
77  bool match = false;
78  for (const auto & id : fClusterIDs){
79  if (int(cluster.key()) == id){
80  match = true;
81  }
82  }
83  //std::cout<<cluster.key()<<std::endl;
84  if (!match) continue;
85  auto &hits = fmhc.at(cluster.key());
86  for (const auto & hit : hits){
87  std::cout<<hit->WireID().Plane<<" "<<hit->PeakTime()<<" "<<detProp.GetXTicksOffset(hit->WireID())<<" "<<hit->Integral()<<std::endl;
88  clutime[hit->WireID().Plane]->Fill(hit->PeakTime()-detProp.GetXTicksOffset(hit->WireID())+5000, hit->Integral());
89  }
90  }
91 
92 }
Cluster finding and building.
const double e
std::vector< int > fClusterIDs
Detector simulation of raw signals on wires.
art::InputTag fClusterModuleLabel
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
QTextStream & endl(QTextStream &s)
void ClusterHitTime::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 94 of file ClusterHitTime_module.cc.

95 {
97  clutime[0] = tfs->make<TH1D>("clutime_0","Plane 0;Tick;ADC",2000,0,2000);
98  clutime[1] = tfs->make<TH1D>("clutime_1","Plane 1;Tick;ADC",2000,0,2000);
99  clutime[2] = tfs->make<TH1D>("clutime_2","Plane 2;Tick;ADC",2000,0,2000);
100 
101 }
ClusterHitTime& ClusterHitTime::operator= ( ClusterHitTime const &  )
delete
ClusterHitTime& ClusterHitTime::operator= ( ClusterHitTime &&  )
delete

Member Data Documentation

TH1D* ClusterHitTime::clutime[3]
private

Definition at line 52 of file ClusterHitTime_module.cc.

std::vector<int> ClusterHitTime::fClusterIDs
private

Definition at line 54 of file ClusterHitTime_module.cc.

art::InputTag ClusterHitTime::fClusterModuleLabel
private

Definition at line 53 of file ClusterHitTime_module.cc.


The documentation for this class was generated from the following file: