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

Public Member Functions

 HitAnaPDSP (fhicl::ParameterSet const &p)
 
 HitAnaPDSP (HitAnaPDSP const &)=delete
 
 HitAnaPDSP (HitAnaPDSP &&)=delete
 
HitAnaPDSPoperator= (HitAnaPDSP const &)=delete
 
HitAnaPDSPoperator= (HitAnaPDSP &&)=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

art::InputTag fHitModuleLabel
 
TTree * ftree
 
int run
 
int subrun
 
int event
 
std::vector< short > channel
 
std::vector< short > tpc
 
std::vector< short > plane
 
std::vector< short > wire
 
std::vector< double > charge
 
std::vector< double > peakt
 
std::vector< double > rms
 
std::vector< double > startt
 
std::vector< double > endt
 
std::vector< short > origin
 
std::vector< int > pdg
 

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 29 of file HitAnaPDSP_module.cc.

Constructor & Destructor Documentation

pdsp::HitAnaPDSP::HitAnaPDSP ( fhicl::ParameterSet const &  p)
explicit

Definition at line 69 of file HitAnaPDSP_module.cc.

70  : EDAnalyzer{p} ,
71  fHitModuleLabel(p.get< art::InputTag >("HitModuleLabel"))
72 {
73  // Call appropriate consumes<>() for any products to be retrieved by this module.
74 }
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
art::InputTag fHitModuleLabel
pdsp::HitAnaPDSP::HitAnaPDSP ( HitAnaPDSP const &  )
delete
pdsp::HitAnaPDSP::HitAnaPDSP ( HitAnaPDSP &&  )
delete

Member Function Documentation

void pdsp::HitAnaPDSP::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 76 of file HitAnaPDSP_module.cc.

77 {
78  run = e.run();
79  subrun = e.subRun();
80  event = e.id().event();
81  channel.clear();
82  tpc.clear();
83  plane.clear();
84  wire.clear();
85  charge.clear();
86  peakt.clear();
87  rms.clear();
88  startt.clear();
89  endt.clear();
90  origin.clear();
91  pdg.clear();
92 
93  // Reconstruciton information
94  std::vector < art::Ptr < recob::Hit > > hitList;
95  auto hitListHandle = e.getHandle < std::vector < recob::Hit > >(fHitModuleLabel);
96  if (hitListHandle) {
97  art::fill_ptr_vector(hitList, hitListHandle);
98  }
99  else return;
100 
101  for (auto const & hit : hitList){
102  channel.push_back(hit->Channel());
103  tpc.push_back(hit->WireID().TPC);
104  plane.push_back(hit->WireID().Plane);
105  wire.push_back(hit->WireID().Wire);
106  charge.push_back(hit->Integral());
107  peakt.push_back(hit->PeakTime());
108  rms.push_back(hit->RMS());
109  startt.push_back(hit->StartTick());
110  endt.push_back(hit->EndTick());
111  }
112 
113  if (!channel.empty()) ftree->Fill();
114 
115 }
std::vector< double > startt
std::vector< short > plane
std::vector< short > channel
const double e
std::vector< short > tpc
std::vector< int > pdg
std::vector< double > charge
Detector simulation of raw signals on wires.
std::vector< double > rms
std::vector< short > origin
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:297
art::InputTag fHitModuleLabel
std::vector< short > wire
std::vector< double > peakt
std::vector< double > endt
void pdsp::HitAnaPDSP::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 117 of file HitAnaPDSP_module.cc.

118 {
119  art::ServiceHandle<art::TFileService> fileServiceHandle;
120  ftree = fileServiceHandle->make<TTree>("ftree", "hit info");
121  ftree->Branch("run", &run, "run/I");
122  ftree->Branch("event", &event, "event/I");
123  ftree->Branch("channel", &channel);
124  ftree->Branch("tpc", &tpc);
125  ftree->Branch("plane", &plane);
126  ftree->Branch("wire", &wire);
127  ftree->Branch("charge", &charge);
128  ftree->Branch("peakt", &peakt);
129  ftree->Branch("rms", &rms);
130  ftree->Branch("startt", &startt);
131  ftree->Branch("endt", &endt);
132  ftree->Branch("origin", &origin);
133  ftree->Branch("pdf", &pdg);
134 }
std::vector< double > startt
std::vector< short > plane
std::vector< short > channel
std::vector< short > tpc
std::vector< int > pdg
std::vector< double > charge
std::vector< double > rms
std::vector< short > origin
std::vector< short > wire
std::vector< double > peakt
std::vector< double > endt
Event finding and building.
HitAnaPDSP& pdsp::HitAnaPDSP::operator= ( HitAnaPDSP const &  )
delete
HitAnaPDSP& pdsp::HitAnaPDSP::operator= ( HitAnaPDSP &&  )
delete

Member Data Documentation

std::vector<short> pdsp::HitAnaPDSP::channel
private

Definition at line 55 of file HitAnaPDSP_module.cc.

std::vector<double> pdsp::HitAnaPDSP::charge
private

Definition at line 59 of file HitAnaPDSP_module.cc.

std::vector<double> pdsp::HitAnaPDSP::endt
private

Definition at line 63 of file HitAnaPDSP_module.cc.

int pdsp::HitAnaPDSP::event
private

Definition at line 54 of file HitAnaPDSP_module.cc.

art::InputTag pdsp::HitAnaPDSP::fHitModuleLabel
private

Definition at line 49 of file HitAnaPDSP_module.cc.

TTree* pdsp::HitAnaPDSP::ftree
private

Definition at line 51 of file HitAnaPDSP_module.cc.

std::vector<short> pdsp::HitAnaPDSP::origin
private

Definition at line 64 of file HitAnaPDSP_module.cc.

std::vector<int> pdsp::HitAnaPDSP::pdg
private

Definition at line 65 of file HitAnaPDSP_module.cc.

std::vector<double> pdsp::HitAnaPDSP::peakt
private

Definition at line 60 of file HitAnaPDSP_module.cc.

std::vector<short> pdsp::HitAnaPDSP::plane
private

Definition at line 57 of file HitAnaPDSP_module.cc.

std::vector<double> pdsp::HitAnaPDSP::rms
private

Definition at line 61 of file HitAnaPDSP_module.cc.

int pdsp::HitAnaPDSP::run
private

Definition at line 52 of file HitAnaPDSP_module.cc.

std::vector<double> pdsp::HitAnaPDSP::startt
private

Definition at line 62 of file HitAnaPDSP_module.cc.

int pdsp::HitAnaPDSP::subrun
private

Definition at line 53 of file HitAnaPDSP_module.cc.

std::vector<short> pdsp::HitAnaPDSP::tpc
private

Definition at line 56 of file HitAnaPDSP_module.cc.

std::vector<short> pdsp::HitAnaPDSP::wire
private

Definition at line 58 of file HitAnaPDSP_module.cc.


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