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

Public Member Functions

 recobWireCheck (fhicl::ParameterSet const &p)
 
 recobWireCheck (recobWireCheck const &)=delete
 
 recobWireCheck (recobWireCheck &&)=delete
 
recobWireCheckoperator= (recobWireCheck const &)=delete
 
recobWireCheckoperator= (recobWireCheck &&)=delete
 
void analyze (art::Event const &e) override
 
void beginJob () override
 
void endJob () 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

int fLogLevel
 
std::string fInputLabel
 
TTree * fTree
 
float fAdcMax
 
float fAdcSum
 
unsigned fChanId
 
unsigned fTicks
 
int fStartTick
 
int fEndTick
 

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 40 of file recobWireCheck_module.cc.

Constructor & Destructor Documentation

pddp::recobWireCheck::recobWireCheck ( fhicl::ParameterSet const &  p)
explicit

Definition at line 78 of file recobWireCheck_module.cc.

79  : EDAnalyzer{p},
80  fLogLevel( p.get< int >("LogLevel") ),
81  fInputLabel( p.get< std::string >("InputLabel") )
82 {
83  // Call appropriate consumes<>() for any products to be retrieved by this module.
84  //fWireToken = consumes< std::vector<recob::Wire> >(fInputLabel);
85 }
std::string string
Definition: nybbler.cc:12
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
p
Definition: test.py:223
pddp::recobWireCheck::recobWireCheck ( recobWireCheck const &  )
delete
pddp::recobWireCheck::recobWireCheck ( recobWireCheck &&  )
delete

Member Function Documentation

void pddp::recobWireCheck::analyze ( art::Event const &  e)
overridevirtual

Implements art::EDAnalyzer.

Definition at line 88 of file recobWireCheck_module.cc.

89 {
90  //auto const& wireHandle = e.getValidHandle(fWireToken);
91  auto wireHandle = e.getHandle< std::vector<recob::Wire> >(fInputLabel);
92  if( !wireHandle )
93  {
94  std::cerr<<"Product "<<fInputLabel<<" was not found\n";
95  }
96 
97  for(size_t wireIter = 0; wireIter < wireHandle->size(); wireIter++)
98  {
99  art::Ptr<recob::Wire> wire(wireHandle, wireIter);
100  fChanId = wire->Channel();
101  const recob::Wire::RegionsOfInterest_t& signals = wire->SignalROI();
102 
103  if( fLogLevel >= 2 ) {
104  std::cout<<"Channel "<<fChanId<<" has number of ROIs "<<signals.n_ranges()<<std::endl;
105  }
106 
107  // loop over regions of interest
108  for (const auto& range : signals.get_ranges())
109  {
110  fStartTick = range.begin_index();
111  fEndTick = range.end_index();
112  fTicks = range.size();
113 
114  fAdcMax = -9999; //*(std::max_element( range.begin(), range.end() ));
115  fAdcSum = 0;
116  for( float adc: range.data() )
117  {
118  fAdcSum += adc;
119  if( adc > fAdcMax ) fAdcMax = adc;
120  }
121 
122  //
123  fTree->Fill();
124  }
125  }
126 }
size_type n_ranges() const
Returns the internal list of non-void ranges.
int16_t adc
Definition: CRTFragment.hh:202
const range_list_t & get_ranges() const
Returns the internal list of non-void ranges.
const double e
QTextStream & endl(QTextStream &s)
void pddp::recobWireCheck::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 128 of file recobWireCheck_module.cc.

129 {
131  fTree = tfs->make<TTree>("recobWireTree","recobWire summary tree");
132  fTree->Branch("fChanId", &fChanId, "fChanId/i");
133  fTree->Branch("fTicks", &fTicks, "fTicks/i");
134  fTree->Branch("fStartTick", &fStartTick, "fStartTick/I");
135  fTree->Branch("fEndTick", &fEndTick, "fEndTick/I");
136  fTree->Branch("fAdcMax", &fAdcMax, "fAdcMax/F");
137  fTree->Branch("fAdcSum", &fAdcSum, "fAdcSum/F");
138 }
void pddp::recobWireCheck::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 140 of file recobWireCheck_module.cc.

141 {
142  // Implementation of optional member function here.
143 }
recobWireCheck& pddp::recobWireCheck::operator= ( recobWireCheck const &  )
delete
recobWireCheck& pddp::recobWireCheck::operator= ( recobWireCheck &&  )
delete

Member Data Documentation

float pddp::recobWireCheck::fAdcMax
private

Definition at line 68 of file recobWireCheck_module.cc.

float pddp::recobWireCheck::fAdcSum
private

Definition at line 69 of file recobWireCheck_module.cc.

unsigned pddp::recobWireCheck::fChanId
private

Definition at line 70 of file recobWireCheck_module.cc.

int pddp::recobWireCheck::fEndTick
private

Definition at line 73 of file recobWireCheck_module.cc.

std::string pddp::recobWireCheck::fInputLabel
private

Definition at line 63 of file recobWireCheck_module.cc.

int pddp::recobWireCheck::fLogLevel
private

Definition at line 62 of file recobWireCheck_module.cc.

int pddp::recobWireCheck::fStartTick
private

Definition at line 72 of file recobWireCheck_module.cc.

unsigned pddp::recobWireCheck::fTicks
private

Definition at line 71 of file recobWireCheck_module.cc.

TTree* pddp::recobWireCheck::fTree
private

Definition at line 66 of file recobWireCheck_module.cc.


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