Classes | Public Types | Public Member Functions | Private Attributes | List of all members
hit::DumpHits Class Reference

Prints the content of all the hits on screen. More...

Inheritance diagram for hit::DumpHits:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Classes

struct  Config
 

Public Types

using Parameters = art::EDAnalyzer::Table< Config >
 
- Public Types inherited from art::EDAnalyzer
using WorkerType = WorkerT< EDAnalyzer >
 
using ModuleType = EDAnalyzer
 

Public Member Functions

 DumpHits (Parameters const &config)
 Default constructor. More...
 
void analyze (const art::Event &evt)
 Does the printing. More...
 
- 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 fHitsModuleLabel
 name of module that produced the hits More...
 
std::string fOutputCategory
 category for LogInfo output More...
 
bool bCheckRawDigits
 check associations with raw digits More...
 
bool bCheckWires
 check associations with wires More...
 

Additional Inherited Members

- 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

Prints the content of all the hits on screen.

This analyser prints the content of all the hits into the LogInfo/LogVerbatim stream.

Configuration parameters

Definition at line 46 of file DumpHits_module.cc.

Member Typedef Documentation

Definition at line 78 of file DumpHits_module.cc.

Constructor & Destructor Documentation

hit::DumpHits::DumpHits ( Parameters const &  config)
explicit

Default constructor.

Definition at line 121 of file DumpHits_module.cc.

122  : EDAnalyzer (config)
123  , fHitsModuleLabel (config().HitModuleLabel())
124  , fOutputCategory (config().OutputCategory())
125  , bCheckRawDigits (config().CheckRawDigitAssociation())
126  , bCheckWires (config().CheckWireAssociation())
127  {}
art::InputTag fHitsModuleLabel
name of module that produced the hits
std::string fOutputCategory
category for LogInfo output
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:25
static Config * config
Definition: config.cpp:1054
bool bCheckWires
check associations with wires
bool bCheckRawDigits
check associations with raw digits

Member Function Documentation

void hit::DumpHits::analyze ( const art::Event evt)

Does the printing.

Definition at line 131 of file DumpHits_module.cc.

131  {
132 
133  // fetch the data to be dumped on screen
134  auto Hits = evt.getValidHandle<std::vector<recob::Hit>>(fHitsModuleLabel);
135 
137  << "The event contains " << Hits->size() << " '"
138  << fHitsModuleLabel.encode() << "' hits";
139 
140  std::unique_ptr<art::FindOne<raw::RawDigit>> HitToRawDigit;
141  if (bCheckRawDigits) {
142  HitToRawDigit.reset
143  (new art::FindOne<raw::RawDigit>(Hits, evt, fHitsModuleLabel));
144  if (!HitToRawDigit->isValid()) {
146  << "DumpHits: can't find associations between raw digits and hits from '"
147  << fHitsModuleLabel << "'";
148  }
149  } // if check raw digits
150 
151  std::unique_ptr<art::FindOne<recob::Wire>> HitToWire;
152  if (bCheckWires) {
153  HitToWire.reset(new art::FindOne<recob::Wire>(Hits, evt, fHitsModuleLabel));
154  if (!HitToWire->isValid()) {
156  << "DumpHits: can't find associations between wires and hits from '"
157  << fHitsModuleLabel << "'";
158  }
159  } // if check wires
160 
161  unsigned int iHit = 0;
162  for (const recob::Hit& hit: *Hits) {
163 
164  // print a header for the cluster
166  << "Hit #" << iHit << ": " << hit;
167 
168  if (HitToRawDigit) {
169  raw::ChannelID_t assChannelID = HitToRawDigit->at(iHit).ref().Channel();
170  if (assChannelID != hit.Channel()) {
172  << "Hit #" << iHit << " on channel " << hit.Channel()
173  << " is associated with raw digit on channel " << assChannelID
174  << "!!";
175  } // mismatch
176  } // raw digit check
177 
178  if (HitToWire) {
179  raw::ChannelID_t assChannelID = HitToWire->at(iHit).ref().Channel();
180  if (assChannelID != hit.Channel()) {
182  << "Hit #" << iHit << " on channel " << hit.Channel()
183  << " is associated with wire on channel " << assChannelID
184  << "!!";
185  } // mismatch
186  } // wire check
187 
188  ++iHit;
189  } // for hits
190 
191  } // DumpHits::analyze()
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
art::InputTag fHitsModuleLabel
name of module that produced the hits
std::string fOutputCategory
category for LogInfo output
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::string encode() const
Definition: InputTag.cc:97
details::FindAllP< recob::Hit, recob::Wire > HitToWire
Query object connecting a hit to a wire.
Definition: HitUtils.h:56
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:441
size_type size() const
Definition: PtrVector.h:302
Detector simulation of raw signals on wires.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
art::PtrVector< recob::Hit > Hits
bool bCheckWires
check associations with wires
bool bCheckRawDigits
check associations with raw digits
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
unsigned int ChannelID_t
Type representing the ID of a readout channel.
Definition: RawTypes.h:28

Member Data Documentation

bool hit::DumpHits::bCheckRawDigits
private

check associations with raw digits

Definition at line 91 of file DumpHits_module.cc.

bool hit::DumpHits::bCheckWires
private

check associations with wires

Definition at line 92 of file DumpHits_module.cc.

art::InputTag hit::DumpHits::fHitsModuleLabel
private

name of module that produced the hits

Definition at line 89 of file DumpHits_module.cc.

std::string hit::DumpHits::fOutputCategory
private

category for LogInfo output

Definition at line 90 of file DumpHits_module.cc.


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