LArSoft  v10_04_05
Liquid Argon Software toolkit - https://larsoft.org/
lar_pandora::PFParticleHitDumper Class Reference

PFParticleHitDumper class. More...

Inheritance diagram for lar_pandora::PFParticleHitDumper:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Types

using ModuleType = EDAnalyzer
 

Public Member Functions

 PFParticleHitDumper (fhicl::ParameterSet const &pset)
 Constructor. More...
 
virtual ~PFParticleHitDumper ()
 Destructor. More...
 
void beginJob ()
 
void endJob ()
 
void analyze (const art::Event &evt)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
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)
 
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)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
ConsumesCollector & consumesCollector ()
 
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 ()
 

Private Member Functions

void FillRecoTracks (const PFParticlesToTracks &particlesToTracks)
 Store 3D track hits. More...
 
void FillReco3D (const PFParticleVector &particleVector, const PFParticlesToSpacePoints &particlesToSpacePoints, const SpacePointsToHits &spacePointsToHits)
 Store 3D hits. More...
 
void FillReco2D (const art::Event &event, const HitVector &hitVector, const HitsToPFParticles &hitsToParticles)
 Store 2D hits. More...
 
void FillAssociated2DHits (const art::Event &evt, const PFParticleVector &particleVector, const PFParticlesToHits &particlesToHits, const PFParticlesToHits &particlesToHitsClusters, const PFParticlesToTracks &particlesToTracks, const TracksToHits &tracksToHits, const PFParticlesToShowers &particlesToShowers, const ShowersToHits &showersToHits)
 Store number of 2D hits associated to PFParticle in different ways. More...
 
void FillRecoWires (const art::Event &event, const WireVector &wireVector)
 Store raw data. More...
 
double GetUVW (const geo::WireID &wireID) const
 Conversion from wire ID to U/V/W coordinate. More...
 
double YZtoU (const unsigned int cstat, const unsigned int tpc, const double y, const double z) const
 Convert from (Y,Z) to U coordinate. More...
 
double YZtoV (const unsigned int cstat, const unsigned int tpc, const double y, const double z) const
 Convert from (Y,Z) to V coordinate. More...
 

Private Attributes

TTree * m_pRecoTracks
 
TTree * m_pReco3D
 
TTree * m_pReco2D
 
TTree * m_pRecoComparison
 
TTree * m_pRecoWire
 
int m_run
 
int m_event
 
int m_particle
 
int m_primary
 
int m_pdgcode
 
int m_cstat
 
int m_tpc
 
int m_plane
 
int m_wire
 
double m_u
 
double m_v
 
double m_w
 
double m_x
 
double m_y
 
double m_z
 
double m_q
 
int m_hitsFromSpacePoints
 
int m_hitsFromClusters
 
int m_hitsFromTrackOrShower
 
std::string m_calwireLabel
 
std::string m_hitfinderLabel
 
std::string m_clusterLabel
 
std::string m_spacepointLabel
 
std::string m_particleLabel
 
std::string m_trackLabel
 
std::string m_showerLabel
 
bool m_storeWires
 
bool m_printDebug
 switch for print statements (TODO: use message service!) More...
 

Detailed Description

PFParticleHitDumper class.

Definition at line 27 of file PFParticleHitDumper_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

lar_pandora::PFParticleHitDumper::PFParticleHitDumper ( fhicl::ParameterSet const &  pset)

Constructor.

Parameters
pset

Definition at line 209 of file PFParticleHitDumper_module.cc.

References reconfigure().

209  : art::EDAnalyzer(pset)
210  {
211  this->reconfigure(pset);
212  }
void reconfigure(fhicl::ParameterSet const &pset)
lar_pandora::PFParticleHitDumper::~PFParticleHitDumper ( )
virtual

Destructor.

Definition at line 216 of file PFParticleHitDumper_module.cc.

216 {}

Member Function Documentation

void lar_pandora::PFParticleHitDumper::analyze ( const art::Event evt)

Definition at line 307 of file PFParticleHitDumper_module.cc.

References lar_pandora::LArPandoraHelper::BuildPFParticleHitMaps(), lar_pandora::LArPandoraHelper::CollectHits(), lar_pandora::LArPandoraHelper::CollectPFParticles(), lar_pandora::LArPandoraHelper::CollectShowers(), lar_pandora::LArPandoraHelper::CollectSpacePoints(), lar_pandora::LArPandoraHelper::CollectTracks(), lar_pandora::LArPandoraHelper::CollectWires(), art::EventID::event(), FillAssociated2DHits(), FillReco2D(), FillReco3D(), FillRecoTracks(), FillRecoWires(), art::Event::id(), m_calwireLabel, m_clusterLabel, m_cstat, m_event, m_hitfinderLabel, m_particle, m_particleLabel, m_pdgcode, m_plane, m_primary, m_printDebug, m_q, m_run, m_showerLabel, m_spacepointLabel, m_storeWires, m_tpc, m_trackLabel, m_u, m_v, m_w, m_wire, m_x, m_y, m_z, and art::Event::run().

308  {
309  if (m_printDebug) std::cout << " *** PFParticleHitDumper::analyze(...) *** " << std::endl;
310 
311  m_run = evt.run();
312  m_event = evt.id().event();
313 
314  m_particle = -1;
315  m_primary = 0;
316  m_pdgcode = 0;
317 
318  m_cstat = 0;
319  m_tpc = 0;
320  m_plane = 0;
321  m_wire = 0;
322 
323  m_x = 0.0;
324  m_y = 0.0;
325  m_u = 0.0;
326  m_v = 0.0;
327  m_z = 0.0;
328  m_w = 0.0;
329  m_q = 0.0;
330 
331  if (m_printDebug) {
332  std::cout << " Run: " << m_run << std::endl;
333  std::cout << " Event: " << m_event << std::endl;
334  }
335 
336  // Get particles, tracks, space points, hits (and wires)
337  // ====================================================
338  TrackVector trackVector, trackVectorExtra;
339  ShowerVector showerVector, showerVectorExtra;
340  PFParticleVector particleVector;
341  SpacePointVector spacePointVector;
342  HitVector hitVector;
343  WireVector wireVector;
344 
345  PFParticlesToTracks particlesToTracks;
346  PFParticlesToShowers particlesToShowers;
347  PFParticlesToSpacePoints particlesToSpacePoints;
348  PFParticlesToHits particlesToHits, particlesToHitsClusters;
349  TracksToHits tracksToHits;
350  ShowersToHits showersToHits;
351  HitsToPFParticles hitsToParticles, hitsToParticlesClusters;
352  SpacePointsToHits spacePointsToHits;
353 
356  evt, m_spacepointLabel, spacePointVector, spacePointsToHits);
357  LArPandoraHelper::CollectTracks(evt, m_trackLabel, trackVector, particlesToTracks);
358  LArPandoraHelper::CollectTracks(evt, m_trackLabel, trackVectorExtra, tracksToHits);
359  LArPandoraHelper::CollectShowers(evt, m_showerLabel, showerVector, particlesToShowers);
360  LArPandoraHelper::CollectShowers(evt, m_showerLabel, showerVectorExtra, showersToHits);
362  evt, m_particleLabel, particleVector, particlesToSpacePoints);
366  particlesToHits,
367  hitsToParticles,
368  LArPandoraHelper::DaughterMode::kUseDaughters,
369  false);
371  evt, m_particleLabel, m_clusterLabel, particlesToHitsClusters, hitsToParticlesClusters);
372 
374 
375  if (m_printDebug) std::cout << " PFParticles: " << particleVector.size() << std::endl;
376 
377  // Loop over Tracks (Fill 3D Track Tree)
378  // =====================================
379  if (m_printDebug) std::cout << " PFParticleHitDumper::FillRecoTracks(...) " << std::endl;
380  this->FillRecoTracks(particlesToTracks);
381 
382  // Loop over PFParticles (Fill 3D Reco Tree)
383  // =========================================
384  if (m_printDebug) std::cout << " PFParticleHitDumper::FillReco3D(...) " << std::endl;
385  this->FillReco3D(particleVector, particlesToSpacePoints, spacePointsToHits);
386 
387  // Loop over Hits (Fill 2D Reco Tree)
388  // ==================================
389  if (m_printDebug) std::cout << " PFParticleHitDumper::FillReco2D(...) " << std::endl;
390  this->FillReco2D(evt, hitVector, hitsToParticles);
391 
392  // Loop over Hits (Fill Associated 2D Hits Tree)
393  // =============================================
394  if (m_printDebug)
395  std::cout << " PFParticleHitDumper::FillAssociated2DHits(...) " << std::endl;
396  this->FillAssociated2DHits(evt,
397  particleVector,
398  particlesToHits,
399  particlesToHitsClusters,
400  particlesToTracks,
401  tracksToHits,
402  particlesToShowers,
403  showersToHits);
404 
405  // Loop over Wires (Fill Reco Wire Tree)
406  // =====================================
407  if (m_printDebug) std::cout << " PFParticleHitDumper::FillRecoWires(...) " << std::endl;
408  this->FillRecoWires(evt, wireVector);
409  }
static void BuildPFParticleHitMaps(const PFParticleVector &particleVector, const PFParticlesToSpacePoints &particlesToSpacePoints, const SpacePointsToHits &spacePointsToHits, PFParticlesToHits &particlesToHits, HitsToPFParticles &hitsToParticles, const DaughterMode daughterMode=kUseDaughters)
Build mapping between PFParticles and Hits using PFParticle/SpacePoint/Hit maps.
void FillReco2D(const art::Event &event, const HitVector &hitVector, const HitsToPFParticles &hitsToParticles)
Store 2D hits.
static void CollectWires(const art::Event &evt, const std::string &label, WireVector &wireVector)
Collect the reconstructed wires from the ART event record.
std::vector< art::Ptr< recob::Shower > > ShowerVector
void FillRecoWires(const art::Event &event, const WireVector &wireVector)
Store raw data.
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
static void CollectSpacePoints(const art::Event &evt, const std::string &label, SpacePointVector &spacePointVector, SpacePointsToHits &spacePointsToHits)
Collect the reconstructed SpacePoints and associated hits from the ART event record.
void FillAssociated2DHits(const art::Event &evt, const PFParticleVector &particleVector, const PFParticlesToHits &particlesToHits, const PFParticlesToHits &particlesToHitsClusters, const PFParticlesToTracks &particlesToTracks, const TracksToHits &tracksToHits, const PFParticlesToShowers &particlesToShowers, const ShowersToHits &showersToHits)
Store number of 2D hits associated to PFParticle in different ways.
bool m_printDebug
switch for print statements (TODO: use message service!)
std::map< art::Ptr< recob::PFParticle >, ShowerVector > PFParticlesToShowers
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
std::map< art::Ptr< recob::Shower >, HitVector > ShowersToHits
static void CollectShowers(const art::Event &evt, const std::string &label, ShowerVector &showerVector, PFParticlesToShowers &particlesToShowers)
Collect the reconstructed PFParticles and associated Showers from the ART event record.
std::vector< art::Ptr< recob::SpacePoint > > SpacePointVector
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
void FillReco3D(const PFParticleVector &particleVector, const PFParticlesToSpacePoints &particlesToSpacePoints, const SpacePointsToHits &spacePointsToHits)
Store 3D hits.
std::vector< art::Ptr< recob::Track > > TrackVector
std::map< art::Ptr< recob::PFParticle >, SpacePointVector > PFParticlesToSpacePoints
std::map< art::Ptr< recob::Track >, HitVector > TracksToHits
static void CollectTracks(const art::Event &evt, const std::string &label, TrackVector &trackVector, PFParticlesToTracks &particlesToTracks)
Collect the reconstructed PFParticles and associated Tracks from the ART event record.
static void CollectPFParticles(const art::Event &evt, const std::string &label, PFParticleVector &particleVector)
Collect the reconstructed PFParticles from the ART event record.
static void CollectHits(const art::Event &evt, const std::string &label, HitVector &hitVector)
Collect the reconstructed Hits from the ART event record.
void FillRecoTracks(const PFParticlesToTracks &particlesToTracks)
Store 3D track hits.
std::vector< art::Ptr< recob::Hit > > HitVector
std::vector< art::Ptr< recob::Wire > > WireVector
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::PFParticle > > HitsToPFParticles
EventNumber_t event() const
Definition: EventID.h:116
RunNumber_t run() const
Definition: Event.cc:29
EventID id() const
Definition: Event.cc:23
std::map< art::Ptr< recob::SpacePoint >, art::Ptr< recob::Hit > > SpacePointsToHits
void lar_pandora::PFParticleHitDumper::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 235 of file PFParticleHitDumper_module.cc.

References m_cstat, m_event, m_hitsFromClusters, m_hitsFromSpacePoints, m_hitsFromTrackOrShower, m_particle, m_pdgcode, m_plane, m_pReco2D, m_pReco3D, m_pRecoComparison, m_pRecoTracks, m_pRecoWire, m_primary, m_q, m_run, m_tpc, m_u, m_v, m_w, m_wire, m_x, m_y, and m_z.

236  {
237  mf::LogDebug("LArPandora") << " *** PFParticleHitDumper::beginJob() *** " << std::endl;
238 
239  //
241 
242  m_pRecoTracks = tfs->make<TTree>("pandoraTracks", "LAr Reco Tracks");
243  m_pRecoTracks->Branch("run", &m_run, "run/I");
244  m_pRecoTracks->Branch("event", &m_event, "event/I");
245  m_pRecoTracks->Branch("particle", &m_particle, "particle/I");
246  m_pRecoTracks->Branch("x", &m_x, "x/D");
247  m_pRecoTracks->Branch("y", &m_y, "y/D");
248  m_pRecoTracks->Branch("z", &m_z, "z/D");
249 
250  m_pReco3D = tfs->make<TTree>("pandora3D", "LAr Reco 3D");
251  m_pReco3D->Branch("run", &m_run, "run/I");
252  m_pReco3D->Branch("event", &m_event, "event/I");
253  m_pReco3D->Branch("particle", &m_particle, "particle/I");
254  m_pReco3D->Branch("primary", &m_primary, "primary/I");
255  m_pReco3D->Branch("pdgcode", &m_pdgcode, "pdgcode/I");
256  m_pReco3D->Branch("cstat", &m_cstat, "cstat/I");
257  m_pReco3D->Branch("tpc", &m_tpc, "tpc/I");
258  m_pReco3D->Branch("plane", &m_plane, "plane/I");
259  m_pReco3D->Branch("x", &m_x, "x/D");
260  m_pReco3D->Branch("y", &m_y, "y/D");
261  m_pReco3D->Branch("u", &m_u, "u/D");
262  m_pReco3D->Branch("v", &m_v, "v/D");
263  m_pReco3D->Branch("z", &m_z, "z/D");
264 
265  m_pReco2D = tfs->make<TTree>("pandora2D", "LAr Reco 2D");
266  m_pReco2D->Branch("run", &m_run, "run/I");
267  m_pReco2D->Branch("event", &m_event, "event/I");
268  m_pReco2D->Branch("particle", &m_particle, "particle/I");
269  m_pReco2D->Branch("pdgcode", &m_pdgcode, "pdgcode/I");
270  m_pReco2D->Branch("cstat", &m_cstat, "cstat/I");
271  m_pReco2D->Branch("tpc", &m_tpc, "tpc/I");
272  m_pReco2D->Branch("plane", &m_plane, "plane/I");
273  m_pReco2D->Branch("wire", &m_wire, "wire/I");
274  m_pReco2D->Branch("x", &m_x, "x/D");
275  m_pReco2D->Branch("w", &m_w, "w/D");
276  m_pReco2D->Branch("q", &m_q, "q/D");
277 
278  m_pRecoComparison = tfs->make<TTree>("pandora2Dcomparison", "LAr Reco 2D (comparison)");
279  m_pRecoComparison->Branch("run", &m_run, "run/I");
280  m_pRecoComparison->Branch("event", &m_event, "event/I");
281  m_pRecoComparison->Branch("particle", &m_particle, "particle/I");
282  m_pRecoComparison->Branch("pdgcode", &m_pdgcode, "pdgcode/I");
283  m_pRecoComparison->Branch(
284  "hitsFromSpacePoints", &m_hitsFromSpacePoints, "hitsFromSpacePoints/I");
285  m_pRecoComparison->Branch("hitsFromClusters", &m_hitsFromClusters, "hitsFromClusters/I");
286  m_pRecoComparison->Branch(
287  "hitsFromTrackOrShower", &m_hitsFromTrackOrShower, "hitsFromTrackOrShower/I");
288 
289  m_pRecoWire = tfs->make<TTree>("rawdata", "LAr Reco Wires");
290  m_pRecoWire->Branch("run", &m_run, "run/I");
291  m_pRecoWire->Branch("event", &m_event, "event/I");
292  m_pRecoWire->Branch("cstat", &m_cstat, "cstat/I");
293  m_pRecoWire->Branch("tpc", &m_tpc, "tpc/I");
294  m_pRecoWire->Branch("plane", &m_plane, "plane/I");
295  m_pRecoWire->Branch("wire", &m_wire, "wire/I");
296  m_pRecoWire->Branch("x", &m_x, "x/D");
297  m_pRecoWire->Branch("w", &m_w, "w/D");
298  m_pRecoWire->Branch("q", &m_q, "q/D");
299  }
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::consumes ( InputTag const &  tag)
protectedinherited

Definition at line 61 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumes().

62  {
63  return collector_.consumes<T, BT>(tag);
64  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ProductToken< T > consumes(InputTag const &)
ConsumesCollector & art::ModuleBase::consumesCollector ( )
protectedinherited

Definition at line 57 of file ModuleBase.cc.

References art::ModuleBase::collector_.

58  {
59  return collector_;
60  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::consumesMany ( )
protectedinherited

Definition at line 75 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesMany().

76  {
77  collector_.consumesMany<T, BT>();
78  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::consumesView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::consumesView ( InputTag const &  tag)
inherited

Definition at line 68 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::consumesView().

69  {
70  return collector_.consumesView<T, BT>(tag);
71  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > consumesView(InputTag const &)
void art::detail::Analyzer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 25 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

26  {
27  setupQueues(resources);
28  ProcessingFrame const frame{ScheduleID{}};
29  beginJobWithFrame(frame);
30  }
virtual void beginJobWithFrame(ProcessingFrame const &)=0
virtual void setupQueues(SharedResources const &)=0
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

69  {
70  ProcessingFrame const frame{mc.scheduleID()};
71  beginRunWithFrame(std::as_const(rp).makeRun(mc), frame);
72  return true;
73  }
virtual void beginRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

34  {
35  ProcessingFrame const frame{ScheduleID{}};
36  endJobWithFrame(frame);
37  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

77  {
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(std::as_const(rp).makeRun(mc), frame);
80  return true;
81  }
virtual void endRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

93  {
94  ProcessingFrame const frame{mc.scheduleID()};
95  endSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
96  return true;
97  }
virtual void endSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::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 
)
inherited

Definition at line 100 of file Analyzer.cc.

References e, and art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

105  {
106  auto const e = std::as_const(ep).makeEvent(mc);
107  if (wantEvent(mc.scheduleID(), e)) {
108  ++counts_run;
109  ProcessingFrame const frame{mc.scheduleID()};
110  analyzeWithFrame(e, frame);
111  ++counts_passed;
112  }
113  return true;
114  }
bool wantEvent(ScheduleID id, Event const &e) const
Definition: Observer.cc:63
Float_t e
Definition: plot.C:35
virtual void analyzeWithFrame(Event const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 47 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

48  {
49  ProcessingFrame const frame{ScheduleID{}};
51  }
TFile fb("Li6.root")
virtual void respondToCloseInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 61 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

62  {
63  ProcessingFrame const frame{ScheduleID{}};
65  }
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::detail::Analyzer::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 40 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

41  {
42  ProcessingFrame const frame{ScheduleID{}};
44  }
TFile fb("Li6.root")
virtual void respondToOpenInputFileWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToOpenOutputFiles ( FileBlock const &  fb)
inherited

Definition at line 54 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void lar_pandora::PFParticleHitDumper::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 303 of file PFParticleHitDumper_module.cc.

303 {}
void lar_pandora::PFParticleHitDumper::FillAssociated2DHits ( const art::Event evt,
const PFParticleVector particleVector,
const PFParticlesToHits particlesToHits,
const PFParticlesToHits particlesToHitsClusters,
const PFParticlesToTracks particlesToTracks,
const TracksToHits tracksToHits,
const PFParticlesToShowers particlesToShowers,
const ShowersToHits showersToHits 
)
private

Store number of 2D hits associated to PFParticle in different ways.

Parameters
particleVectorthe input vector of PFParticles
particlesToHitsmapping between PFParticles and 2D hits through space points
particlesToHitsClustersmapping between PFParticles and 2D hits through clusters
particlesToTracksmapping between PFParticles and tracks
particlesToShowersmapping between PFParticles and showers

Definition at line 543 of file PFParticleHitDumper_module.cc.

References m_hitsFromClusters, m_hitsFromSpacePoints, m_hitsFromTrackOrShower, m_particle, m_pdgcode, m_pRecoComparison, m_printDebug, recob::PFParticle::PdgCode(), recob::PFParticle::Self(), and track.

Referenced by analyze().

551  {
552  // Create dummy entry if there are no 2D hits
553  if (particleVector.empty()) { m_pRecoComparison->Fill(); }
554 
555  for (unsigned int i = 0; i < particleVector.size(); ++i) {
556  //initialise variables
557  m_particle = -1;
558  m_pdgcode = 0;
560  m_hitsFromClusters = 0;
562 
563  const art::Ptr<recob::PFParticle> particle = particleVector.at(i);
564  m_particle = particle->Self();
565  m_pdgcode = particle->PdgCode();
566 
567  PFParticlesToHits::const_iterator pIter = particlesToHits.find(particle);
568  PFParticlesToHits::const_iterator pIter2 = particlesToHitsClusters.find(particle);
569  if (particlesToHits.end() != pIter) m_hitsFromSpacePoints = pIter->second.size();
570  if (particlesToHitsClusters.end() != pIter2) m_hitsFromClusters = pIter2->second.size();
571 
572  if (m_pdgcode == 13) {
573  PFParticlesToTracks::const_iterator iter = particlesToTracks.find(particle);
574  const art::Ptr<recob::Track> track = *(iter->second.begin());
575 
576  TracksToHits::const_iterator iter2 = tracksToHits.find(track);
577  if (tracksToHits.end() != iter2) {
578  const HitVector& hitVector = iter2->second;
579  m_hitsFromTrackOrShower = hitVector.size();
580  }
581  }
582  else if (m_pdgcode == 11) {
583  PFParticlesToShowers::const_iterator iter = particlesToShowers.find(particle);
584  const art::Ptr<recob::Shower> shower = *(iter->second.begin());
585 
586  ShowersToHits::const_iterator iter2 = showersToHits.find(shower);
587  if (showersToHits.end() != iter2) {
588  const HitVector& hitVector = iter2->second;
589  m_hitsFromTrackOrShower = hitVector.size();
590  }
591  }
592 
593  if (m_printDebug)
594  std::cout << " PFParticle " << m_particle << " (PDG " << m_pdgcode << ") has "
595  << m_hitsFromSpacePoints << " hits from space points and " << m_hitsFromClusters
596  << " hits from clusters, and its recob::Track/Shower has "
597  << m_hitsFromTrackOrShower << " associated hits " << std::endl;
598 
599  m_pRecoComparison->Fill();
600  }
601  }
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:88
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:79
intermediate_table::const_iterator const_iterator
bool m_printDebug
switch for print statements (TODO: use message service!)
std::vector< art::Ptr< recob::Hit > > HitVector
Float_t track
Definition: plot.C:35
void lar_pandora::PFParticleHitDumper::FillReco2D ( const art::Event event,
const HitVector hitVector,
const HitsToPFParticles hitsToParticles 
)
private

Store 2D hits.

Parameters
hitVectorthe input vector of 2D hits
hitsToParticlesmapping between 2D hits and PFParticles

Definition at line 605 of file PFParticleHitDumper_module.cc.

References GetUVW(), recob::Hit::Integral(), m_cstat, m_particle, m_pdgcode, m_plane, m_pReco2D, m_q, m_tpc, m_w, m_wire, m_x, recob::PFParticle::PdgCode(), recob::Hit::PeakTime(), recob::PFParticle::Self(), and recob::Hit::WireID().

Referenced by analyze().

608  {
609  // Initialise variables
610  m_particle = -1;
611  m_pdgcode = 0;
612  m_cstat = 0;
613  m_tpc = 0;
614  m_plane = 0;
615  m_wire = 0;
616  m_x = 0.0;
617  m_w = 0.0;
618  m_q = 0.0;
619 
620  // Create dummy entry if there are no 2D hits
621  if (hitVector.empty()) { m_pReco2D->Fill(); }
622 
623  // Need DetectorProperties service to convert from ticks to X
624  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(e);
625 
626  // Loop over 2D hits
627  for (unsigned int i = 0; i < hitVector.size(); ++i) {
628  const art::Ptr<recob::Hit> hit = hitVector.at(i);
629 
630  m_particle = -1;
631  m_pdgcode = 0;
632 
633  HitsToPFParticles::const_iterator pIter = hitsToParticles.find(hit);
634  if (hitsToParticles.end() != pIter) {
635  const art::Ptr<recob::PFParticle> particle = pIter->second;
636  m_particle = particle->Self();
637  m_pdgcode = particle->PdgCode();
638  }
639 
640  const geo::WireID& wireID(hit->WireID());
641  m_cstat = wireID.Cryostat;
642  m_tpc = wireID.TPC;
643  m_plane = wireID.Plane;
644  m_wire = wireID.Wire;
645 
646  m_q = hit->Integral();
647  m_x = detProp.ConvertTicksToX(hit->PeakTime(), wireID.Plane, wireID.TPC, wireID.Cryostat);
648  m_w = this->GetUVW(wireID);
649 
650  m_pReco2D->Fill();
651  }
652  }
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:88
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:79
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:254
intermediate_table::const_iterator const_iterator
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:290
double GetUVW(const geo::WireID &wireID) const
Conversion from wire ID to U/V/W coordinate.
Detector simulation of raw signals on wires.
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:226
Float_t e
Definition: plot.C:35
void lar_pandora::PFParticleHitDumper::FillReco3D ( const PFParticleVector particleVector,
const PFParticlesToSpacePoints particlesToSpacePoints,
const SpacePointsToHits spacePointsToHits 
)
private

Store 3D hits.

Parameters
particleVectorthe input vector of PFParticles
particlesToSpacePointsmapping between 3D hits and PFParticles
spacePointsToHitsmapping between 3D hits and 2D hits

Definition at line 458 of file PFParticleHitDumper_module.cc.

References lar_pandora::LArPandoraHelper::IsNeutrino(), recob::PFParticle::IsPrimary(), m_cstat, m_particle, m_pdgcode, m_plane, m_pReco3D, m_primary, m_printDebug, m_tpc, m_u, m_v, m_x, m_y, m_z, recob::PFParticle::Parent(), recob::PFParticle::PdgCode(), recob::PFParticle::Self(), recob::Hit::WireID(), recob::SpacePoint::XYZ(), YZtoU(), and YZtoV().

Referenced by analyze().

461  {
462  // Initialise variables
463  m_particle = -1;
464  m_primary = 0;
465  m_pdgcode = 0;
466  m_cstat = 0;
467  m_tpc = 0;
468  m_plane = 0;
469  m_x = 0.0;
470  m_u = 0.0;
471  m_v = 0.0;
472  m_y = 0.0;
473  m_z = 0.0;
474 
475  // Create dummy entry if there are no particles
476  if (particleVector.empty()) { m_pReco3D->Fill(); }
477 
478  // Store associations between particle and particle ID
479  PFParticleMap theParticleMap;
480 
481  for (unsigned int i = 0; i < particleVector.size(); ++i) {
482  const art::Ptr<recob::PFParticle> particle = particleVector.at(i);
483  theParticleMap[particle->Self()] = particle;
484  }
485 
486  // Loop over particles
487  for (PFParticlesToSpacePoints::const_iterator iter1 = particlesToSpacePoints.begin(),
488  iterEnd1 = particlesToSpacePoints.end();
489  iter1 != iterEnd1;
490  ++iter1) {
491  const art::Ptr<recob::PFParticle> particle = iter1->first;
492  const SpacePointVector& spacepoints = iter1->second;
493 
494  m_particle = particle->Self();
495  m_pdgcode = particle->PdgCode();
496  m_primary = 0;
497 
498  if (particle->IsPrimary()) { m_primary = 1; }
499  else {
500  const size_t parentID(particle->Parent());
501  PFParticleMap::const_iterator pIter = theParticleMap.find(parentID);
502  if (theParticleMap.end() == pIter)
503  throw cet::exception("LArPandora")
504  << " PFParticleHitDumper::analyze --- Found particle with ID code";
505 
506  const art::Ptr<recob::PFParticle> particleParent = pIter->second;
507  if (LArPandoraHelper::IsNeutrino(particleParent)) m_primary = 1;
508  }
509 
510  if (m_printDebug)
511  std::cout << " PFPARTICLE [" << m_particle << "] [Primary=" << m_primary << "] ("
512  << spacepoints.size() << " Space Points)" << std::endl;
513 
514  for (unsigned int j = 0; j < spacepoints.size(); ++j) {
515  const art::Ptr<recob::SpacePoint> spacepoint = spacepoints.at(j);
516 
517  m_x = spacepoint->XYZ()[0];
518  m_y = spacepoint->XYZ()[1];
519  m_z = spacepoint->XYZ()[2];
520 
521  SpacePointsToHits::const_iterator iter2 = spacePointsToHits.find(spacepoint);
522  if (spacePointsToHits.end() == iter2)
523  throw cet::exception("LArPandora")
524  << " PFParticleHitDumper::analyze --- Found space point without associated hit";
525 
526  const art::Ptr<recob::Hit> hit = iter2->second;
527  const geo::WireID& wireID(hit->WireID());
528 
529  m_cstat = wireID.Cryostat;
530  m_tpc = wireID.TPC;
531  m_plane = wireID.Plane;
532 
533  m_u = this->YZtoU(m_cstat, m_tpc, m_y, m_z);
534  m_v = this->YZtoV(m_cstat, m_tpc, m_y, m_z);
535 
536  m_pReco3D->Fill();
537  }
538  }
539  }
double YZtoU(const unsigned int cstat, const unsigned int tpc, const double y, const double z) const
Convert from (Y,Z) to U coordinate.
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:88
static bool IsNeutrino(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as a neutrino.
double YZtoV(const unsigned int cstat, const unsigned int tpc, const double y, const double z) const
Convert from (Y,Z) to V coordinate.
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:79
intermediate_table::const_iterator const_iterator
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:290
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
bool m_printDebug
switch for print statements (TODO: use message service!)
size_t Parent() const
Definition: PFParticle.h:92
std::vector< art::Ptr< recob::SpacePoint > > SpacePointVector
bool IsPrimary() const
Returns whether the particle is the root of the flow.
Definition: PFParticle.h:82
const Double32_t * XYZ() const
Definition: SpacePoint.h:78
Detector simulation of raw signals on wires.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void lar_pandora::PFParticleHitDumper::FillRecoTracks ( const PFParticlesToTracks particlesToTracks)
private

Store 3D track hits.

Parameters
particlesToTracksmapping between 3D track hits and PFParticles

Definition at line 413 of file PFParticleHitDumper_module.cc.

References recob::Track::LocationAtPoint(), m_particle, m_pRecoTracks, m_printDebug, m_x, m_y, m_z, recob::Track::NumberTrajectoryPoints(), recob::PFParticle::Self(), and track.

Referenced by analyze().

414  {
415  // Initialise variables
416  m_particle = -1;
417  m_x = 0.0;
418  m_y = 0.0;
419  m_z = 0.0;
420 
421  // Create dummy entry if there are no particles
422  if (particlesToTracks.empty()) { m_pRecoTracks->Fill(); }
423 
424  // Loop over tracks
425  for (PFParticlesToTracks::const_iterator iter = particlesToTracks.begin(),
426  iterEnd = particlesToTracks.end();
427  iter != iterEnd;
428  ++iter) {
429  const art::Ptr<recob::PFParticle> particle = iter->first;
430  const TrackVector& trackVector = iter->second;
431 
432  m_particle = particle->Self();
433 
434  if (!trackVector.empty()) {
435  if (trackVector.size() != 1 && m_printDebug)
436  std::cout << " Warning: Found particle with more than one associated track " << std::endl;
437 
438  const art::Ptr<recob::Track> track = *(trackVector.begin());
439 
440  if (m_printDebug)
441  std::cout << " PFPARTICLE [" << m_particle << "] (" << track->NumberTrajectoryPoints()
442  << " Trajectory Points)" << std::endl;
443 
444  for (unsigned int p = 0; p < track->NumberTrajectoryPoints(); ++p) {
445  const auto position(track->LocationAtPoint(p));
446  m_x = position.x();
447  m_y = position.y();
448  m_z = position.z();
449 
450  m_pRecoTracks->Fill();
451  }
452  }
453  }
454  }
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:88
Point_t const & LocationAtPoint(size_t i) const
Access to track position at different points.
Definition: Track.h:160
size_t NumberTrajectoryPoints() const
Various functions related to the presence and the number of (valid) points.
Definition: Track.h:136
intermediate_table::const_iterator const_iterator
bool m_printDebug
switch for print statements (TODO: use message service!)
std::vector< art::Ptr< recob::Track > > TrackVector
Float_t track
Definition: plot.C:35
void lar_pandora::PFParticleHitDumper::FillRecoWires ( const art::Event event,
const WireVector wireVector 
)
private

Store raw data.

Parameters
wireVectorthe input vector of reconstructed wires

Definition at line 656 of file PFParticleHitDumper_module.cc.

References recob::Wire::Channel(), geo::CryostatID::Cryostat, Get, GetUVW(), m_cstat, m_plane, m_pRecoWire, m_printDebug, m_q, m_tpc, m_w, m_wire, m_x, geo::PlaneID::Plane, recob::Wire::Signal(), geo::TPCID::TPC, and geo::WireID::Wire.

Referenced by analyze().

657  {
658 
659  // Create dummy entry if there are no wires
660  if (wireVector.empty()) { m_pRecoWire->Fill(); }
661 
662  // Need DetectorProperties service to convert from ticks to X
663  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(e);
664 
665  // Loop over wires
666  int signalCounter(0);
667 
668  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout const>()->Get();
669  for (unsigned int i = 0; i < wireVector.size(); ++i) {
670  const art::Ptr<recob::Wire> wire = wireVector.at(i);
671 
672  const std::vector<float>& signals(wire->Signal());
673  const std::vector<geo::WireID> wireIds = wireReadoutGeom.ChannelToWire(wire->Channel());
674 
675  if ((signalCounter++) < 10 && m_printDebug)
676  std::cout << " numWires=" << wireVector.size() << " numSignals=" << signals.size()
677  << std::endl;
678 
679  double time(0.0);
680 
681  m_q = 0.0;
682 
683  for (std::vector<float>::const_iterator tIter = signals.begin(), tIterEnd = signals.end();
684  tIter != tIterEnd;
685  ++tIter) {
686  time += 1.0;
687  m_q = *tIter;
688 
689  if (m_q < 2.0) // seems to remove most noise
690  continue;
691 
692  for (std::vector<geo::WireID>::const_iterator wIter = wireIds.begin(),
693  wIterEnd = wireIds.end();
694  wIter != wIterEnd;
695  ++wIter) {
696  const geo::WireID& wireID = *wIter;
697  m_cstat = wireID.Cryostat;
698  m_tpc = wireID.TPC;
699  m_plane = wireID.Plane;
700  m_wire = wireID.Wire;
701 
702  m_x = detProp.ConvertTicksToX(time, wireID.Plane, wireID.TPC, wireID.Cryostat);
703  m_w = this->GetUVW(wireID);
704 
705  m_pRecoWire->Fill();
706  }
707  }
708  }
709  }
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:195
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:430
intermediate_table::const_iterator const_iterator
double GetUVW(const geo::WireID &wireID) const
Conversion from wire ID to U/V/W coordinate.
bool m_printDebug
switch for print statements (TODO: use message service!)
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:223
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:373
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Definition: Wire.cxx:30
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:315
Float_t e
Definition: plot.C:35
Definition: fwd.h:26
std::array< std::vector< ProductInfo >, NumBranchTypes > const & art::ModuleBase::getConsumables ( ) const
inherited

Definition at line 43 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::getConsumables().

44  {
45  return collector_.getConsumables();
46  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables() const
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protectedinherited

Definition at line 75 of file Observer.cc.

References art::ProductRetriever::get(), and art::Observer::selectors_.

Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

76  {
77  if (selectors_) {
78  return selectors_->getOneTriggerResults(e);
79  }
80 
81  // The following applies for cases where no SelectEvents entries
82  // exist.
83  Handle<TriggerResults> h;
84  if (e.get(empty_process_name, h)) {
85  return h;
86  }
87  return Handle<TriggerResults>{};
88  }
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
double lar_pandora::PFParticleHitDumper::GetUVW ( const geo::WireID wireID) const
private

Conversion from wire ID to U/V/W coordinate.

Parameters
wireIDthe input wire ID

Definition at line 713 of file PFParticleHitDumper_module.cc.

References Get, and pmtana::sign().

Referenced by FillReco2D(), and FillRecoWires().

714  {
715  // define UVW as closest distance from (0,0) to wire axis
716  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout>()->Get();
717 
718  auto const xyzStart = wireReadoutGeom.Wire(wireID).GetStart();
719  const double ay(xyzStart.Y());
720  const double az(xyzStart.Z());
721 
722  auto const xyzEnd = wireReadoutGeom.Wire(wireID).GetEnd();
723  const double by(xyzEnd.Y());
724  const double bz(xyzEnd.Z());
725 
726  const double ny(by - ay);
727  const double nz(bz - az);
728  const double N2(ny * ny + nz * nz);
729 
730  const double ry(ay - (ay * ny + az * nz) * ny / N2);
731  const double rz(az - (ay * ny + az * nz) * nz / N2);
732  const double sign((rz > 0.0) ? +1.0 : -1.0);
733 
734  return sign * std::sqrt(ry * ry + rz * rz);
735  }
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
int sign(double val)
Definition: UtilFunc.cxx:104
std::unique_ptr< Worker > art::ModuleBase::makeWorker ( WorkerParams const &  wp)
inherited

Definition at line 37 of file ModuleBase.cc.

References art::ModuleBase::doMakeWorker(), and art::NumBranchTypes.

38  {
39  return doMakeWorker(wp);
40  }
virtual std::unique_ptr< Worker > doMakeWorker(WorkerParams const &wp)=0
template<typename T , BranchType BT>
ProductToken< T > art::ModuleBase::mayConsume ( InputTag const &  tag)
protectedinherited

Definition at line 82 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsume().

83  {
84  return collector_.mayConsume<T, BT>(tag);
85  }
ProductToken< T > mayConsume(InputTag const &)
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename T , BranchType BT>
void art::ModuleBase::mayConsumeMany ( )
protectedinherited

Definition at line 96 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeMany().

97  {
98  collector_.mayConsumeMany<T, BT>();
99  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::ModuleBase::mayConsumeView ( InputTag const &  )
protectedinherited
template<typename T , BranchType BT>
ViewToken<T> art::ModuleBase::mayConsumeView ( InputTag const &  tag)
inherited

Definition at line 89 of file ModuleBase.h.

References art::ModuleBase::collector_, and art::ConsumesCollector::mayConsumeView().

90  {
91  return collector_.mayConsumeView<T, BT>(tag);
92  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
ViewToken< Element > mayConsumeView(InputTag const &)
ModuleDescription const & art::ModuleBase::moduleDescription ( ) const
inherited

Definition at line 13 of file ModuleBase.cc.

References art::errors::LogicError.

Referenced by art::OutputModule::doRespondToOpenInputFile(), art::OutputModule::doWriteEvent(), art::Modifier::fillProductDescriptions(), art::OutputModule::makePlugins_(), art::OutputWorker::OutputWorker(), reco::shower::LArPandoraModularShowerCreation::produce(), art::Modifier::registerProducts(), and art::OutputModule::registerProducts().

14  {
15  if (md_.has_value()) {
16  return *md_;
17  }
18 
20  "There was an error while calling moduleDescription().\n"}
21  << "The moduleDescription() base-class member function cannot be called\n"
22  "during module construction. To determine which module is "
23  "responsible\n"
24  "for calling it, find the '<module type>:<module "
25  "label>@Construction'\n"
26  "tag in the message prefix above. Please contact artists@fnal.gov\n"
27  "for guidance.\n";
28  }
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
string const & art::Observer::processName ( ) const
protectedinherited

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

Referenced by art::FileDumperOutput::printPrincipal().

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
void lar_pandora::PFParticleHitDumper::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 220 of file PFParticleHitDumper_module.cc.

References fhicl::ParameterSet::get(), m_calwireLabel, m_clusterLabel, m_hitfinderLabel, m_particleLabel, m_printDebug, m_showerLabel, m_spacepointLabel, m_storeWires, and m_trackLabel.

Referenced by PFParticleHitDumper().

221  {
222  m_storeWires = pset.get<bool>("StoreWires", false);
223  m_trackLabel = pset.get<std::string>("TrackModule", "pandoraTrack");
224  m_showerLabel = pset.get<std::string>("ShowerModule", "pandoraShower");
225  m_particleLabel = pset.get<std::string>("PFParticleModule", "pandora");
226  m_spacepointLabel = pset.get<std::string>("SpacePointModule", "pandora");
227  m_clusterLabel = pset.get<std::string>("ClusterModule", "pandora");
228  m_hitfinderLabel = pset.get<std::string>("HitFinderModule", "gaushit");
229  m_calwireLabel = pset.get<std::string>("CalWireModule", "caldata");
230  m_printDebug = pset.get<bool>("PrintDebug", false);
231  }
bool m_printDebug
switch for print statements (TODO: use message service!)
void art::ModuleBase::setModuleDescription ( ModuleDescription const &  md)
inherited

Definition at line 31 of file ModuleBase.cc.

References art::ModuleBase::md_.

32  {
33  md_ = md;
34  }
std::optional< ModuleDescription > md_
Definition: ModuleBase.h:55
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexceptinherited

Definition at line 31 of file Observer.h.

References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().

32  {
33  return wantAllEvents_;
34  }
bool wantAllEvents_
Definition: Observer.h:75
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protectedinherited

Definition at line 63 of file Observer.cc.

References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.

Referenced by art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

64  {
65  if (wantAllEvents_) {
66  return true;
67  }
68  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
69  bool const reject_event =
70  rejectors_ ? rejectors_->matchEvent(id, e) : false;
71  return select_event and not reject_event;
72  }
bool wantAllEvents_
Definition: Observer.h:75
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:80
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
double lar_pandora::PFParticleHitDumper::YZtoU ( const unsigned int  cstat,
const unsigned int  tpc,
const double  y,
const double  z 
) const
private

Convert from (Y,Z) to U coordinate.

Parameters
cstatthe cryostat
tpcthe tpc
ythe y coordinate
zthe z coordinate

Definition at line 739 of file PFParticleHitDumper_module.cc.

References Get, and geo::kU.

Referenced by FillReco3D().

743  {
744  // TODO: Check that this stills works in DUNE
745  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout>()->Get();
746  const double m_theta(wireReadoutGeom.WireAngleToVertical(geo::kU, geo::TPCID{cstat, tpc}));
747  return z * std::sin(m_theta) - y * std::cos(m_theta);
748  }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
Planes which measure U.
Definition: geo_types.h:131
The data type to uniquely identify a TPC.
Definition: geo_types.h:306
double lar_pandora::PFParticleHitDumper::YZtoV ( const unsigned int  cstat,
const unsigned int  tpc,
const double  y,
const double  z 
) const
private

Convert from (Y,Z) to V coordinate.

Parameters
cstatthe crystat
tpcthe tpc
ythe y coordinate
zthe z coordinate

Definition at line 752 of file PFParticleHitDumper_module.cc.

References Get, and geo::kV.

Referenced by FillReco3D().

756  {
757  // TODO; Check that this still works in DUNE
758  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout>()->Get();
759  const double m_theta(wireReadoutGeom.WireAngleToVertical(geo::kV, geo::TPCID{cstat, tpc}));
760  return z * std::sin(m_theta) - y * std::cos(m_theta);
761  }
Planes which measure V.
Definition: geo_types.h:132
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
The data type to uniquely identify a TPC.
Definition: geo_types.h:306

Member Data Documentation

std::string lar_pandora::PFParticleHitDumper::m_calwireLabel
private

Definition at line 162 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

std::string lar_pandora::PFParticleHitDumper::m_clusterLabel
private

Definition at line 164 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

int lar_pandora::PFParticleHitDumper::m_cstat
private
int lar_pandora::PFParticleHitDumper::m_event
private

Definition at line 140 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and beginJob().

std::string lar_pandora::PFParticleHitDumper::m_hitfinderLabel
private

Definition at line 163 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

int lar_pandora::PFParticleHitDumper::m_hitsFromClusters
private

Definition at line 159 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

int lar_pandora::PFParticleHitDumper::m_hitsFromSpacePoints
private

Definition at line 158 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

int lar_pandora::PFParticleHitDumper::m_hitsFromTrackOrShower
private

Definition at line 160 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

int lar_pandora::PFParticleHitDumper::m_particle
private
std::string lar_pandora::PFParticleHitDumper::m_particleLabel
private

Definition at line 166 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

int lar_pandora::PFParticleHitDumper::m_pdgcode
private
int lar_pandora::PFParticleHitDumper::m_plane
private
TTree* lar_pandora::PFParticleHitDumper::m_pReco2D
private

Definition at line 135 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillReco2D().

TTree* lar_pandora::PFParticleHitDumper::m_pReco3D
private

Definition at line 134 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillReco3D().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoComparison
private

Definition at line 136 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoTracks
private

Definition at line 133 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillRecoTracks().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoWire
private

Definition at line 137 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillRecoWires().

int lar_pandora::PFParticleHitDumper::m_primary
private

Definition at line 142 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), beginJob(), and FillReco3D().

bool lar_pandora::PFParticleHitDumper::m_printDebug
private

switch for print statements (TODO: use message service!)

Definition at line 171 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), FillAssociated2DHits(), FillReco3D(), FillRecoTracks(), FillRecoWires(), and reconfigure().

double lar_pandora::PFParticleHitDumper::m_q
private

Definition at line 156 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), beginJob(), FillReco2D(), and FillRecoWires().

int lar_pandora::PFParticleHitDumper::m_run
private

Definition at line 139 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and beginJob().

std::string lar_pandora::PFParticleHitDumper::m_showerLabel
private

Definition at line 168 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

std::string lar_pandora::PFParticleHitDumper::m_spacepointLabel
private

Definition at line 165 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

bool lar_pandora::PFParticleHitDumper::m_storeWires
private

Definition at line 170 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

int lar_pandora::PFParticleHitDumper::m_tpc
private
std::string lar_pandora::PFParticleHitDumper::m_trackLabel
private

Definition at line 167 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

double lar_pandora::PFParticleHitDumper::m_u
private

Definition at line 150 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), beginJob(), and FillReco3D().

double lar_pandora::PFParticleHitDumper::m_v
private

Definition at line 151 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), beginJob(), and FillReco3D().

double lar_pandora::PFParticleHitDumper::m_w
private

Definition at line 152 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), beginJob(), FillReco2D(), and FillRecoWires().

int lar_pandora::PFParticleHitDumper::m_wire
private

Definition at line 148 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), beginJob(), FillReco2D(), and FillRecoWires().

double lar_pandora::PFParticleHitDumper::m_x
private
double lar_pandora::PFParticleHitDumper::m_y
private

Definition at line 154 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), beginJob(), FillReco3D(), and FillRecoTracks().

double lar_pandora::PFParticleHitDumper::m_z
private

Definition at line 155 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), beginJob(), FillReco3D(), and FillRecoTracks().


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