LArSoft  v09_90_00
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 26 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  // Need geometry service to convert channel to wire ID
338 
339  // Get particles, tracks, space points, hits (and wires)
340  // ====================================================
341  TrackVector trackVector, trackVectorExtra;
342  ShowerVector showerVector, showerVectorExtra;
343  PFParticleVector particleVector;
344  SpacePointVector spacePointVector;
345  HitVector hitVector;
346  WireVector wireVector;
347 
348  PFParticlesToTracks particlesToTracks;
349  PFParticlesToShowers particlesToShowers;
350  PFParticlesToSpacePoints particlesToSpacePoints;
351  PFParticlesToHits particlesToHits, particlesToHitsClusters;
352  TracksToHits tracksToHits;
353  ShowersToHits showersToHits;
354  HitsToPFParticles hitsToParticles, hitsToParticlesClusters;
355  SpacePointsToHits spacePointsToHits;
356 
359  evt, m_spacepointLabel, spacePointVector, spacePointsToHits);
360  LArPandoraHelper::CollectTracks(evt, m_trackLabel, trackVector, particlesToTracks);
361  LArPandoraHelper::CollectTracks(evt, m_trackLabel, trackVectorExtra, tracksToHits);
362  LArPandoraHelper::CollectShowers(evt, m_showerLabel, showerVector, particlesToShowers);
363  LArPandoraHelper::CollectShowers(evt, m_showerLabel, showerVectorExtra, showersToHits);
365  evt, m_particleLabel, particleVector, particlesToSpacePoints);
369  particlesToHits,
370  hitsToParticles,
371  LArPandoraHelper::DaughterMode::kUseDaughters,
372  false);
374  evt, m_particleLabel, m_clusterLabel, particlesToHitsClusters, hitsToParticlesClusters);
375 
377 
378  if (m_printDebug) std::cout << " PFParticles: " << particleVector.size() << std::endl;
379 
380  // Loop over Tracks (Fill 3D Track Tree)
381  // =====================================
382  if (m_printDebug) std::cout << " PFParticleHitDumper::FillRecoTracks(...) " << std::endl;
383  this->FillRecoTracks(particlesToTracks);
384 
385  // Loop over PFParticles (Fill 3D Reco Tree)
386  // =========================================
387  if (m_printDebug) std::cout << " PFParticleHitDumper::FillReco3D(...) " << std::endl;
388  this->FillReco3D(particleVector, particlesToSpacePoints, spacePointsToHits);
389 
390  // Loop over Hits (Fill 2D Reco Tree)
391  // ==================================
392  if (m_printDebug) std::cout << " PFParticleHitDumper::FillReco2D(...) " << std::endl;
393  this->FillReco2D(evt, hitVector, hitsToParticles);
394 
395  // Loop over Hits (Fill Associated 2D Hits Tree)
396  // =============================================
397  if (m_printDebug)
398  std::cout << " PFParticleHitDumper::FillAssociated2DHits(...) " << std::endl;
399  this->FillAssociated2DHits(evt,
400  particleVector,
401  particlesToHits,
402  particlesToHitsClusters,
403  particlesToTracks,
404  tracksToHits,
405  particlesToShowers,
406  showersToHits);
407 
408  // Loop over Wires (Fill Reco Wire Tree)
409  // =====================================
410  if (m_printDebug) std::cout << " PFParticleHitDumper::FillRecoWires(...) " << std::endl;
411  this->FillRecoWires(evt, wireVector);
412  }
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 546 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().

554  {
555  // Create dummy entry if there are no 2D hits
556  if (particleVector.empty()) { m_pRecoComparison->Fill(); }
557 
558  for (unsigned int i = 0; i < particleVector.size(); ++i) {
559  //initialise variables
560  m_particle = -1;
561  m_pdgcode = 0;
563  m_hitsFromClusters = 0;
565 
566  const art::Ptr<recob::PFParticle> particle = particleVector.at(i);
567  m_particle = particle->Self();
568  m_pdgcode = particle->PdgCode();
569 
570  PFParticlesToHits::const_iterator pIter = particlesToHits.find(particle);
571  PFParticlesToHits::const_iterator pIter2 = particlesToHitsClusters.find(particle);
572  if (particlesToHits.end() != pIter) m_hitsFromSpacePoints = pIter->second.size();
573  if (particlesToHitsClusters.end() != pIter2) m_hitsFromClusters = pIter2->second.size();
574 
575  if (m_pdgcode == 13) {
576  PFParticlesToTracks::const_iterator iter = particlesToTracks.find(particle);
577  const art::Ptr<recob::Track> track = *(iter->second.begin());
578 
579  TracksToHits::const_iterator iter2 = tracksToHits.find(track);
580  if (tracksToHits.end() != iter2) {
581  const HitVector& hitVector = iter2->second;
582  m_hitsFromTrackOrShower = hitVector.size();
583  }
584  }
585  else if (m_pdgcode == 11) {
586  PFParticlesToShowers::const_iterator iter = particlesToShowers.find(particle);
587  const art::Ptr<recob::Shower> shower = *(iter->second.begin());
588 
589  ShowersToHits::const_iterator iter2 = showersToHits.find(shower);
590  if (showersToHits.end() != iter2) {
591  const HitVector& hitVector = iter2->second;
592  m_hitsFromTrackOrShower = hitVector.size();
593  }
594  }
595 
596  if (m_printDebug)
597  std::cout << " PFParticle " << m_particle << " (PDG " << m_pdgcode << ") has "
598  << m_hitsFromSpacePoints << " hits from space points and " << m_hitsFromClusters
599  << " hits from clusters, and its recob::Track/Shower has "
600  << m_hitsFromTrackOrShower << " associated hits " << std::endl;
601 
602  m_pRecoComparison->Fill();
603  }
604  }
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 608 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().

611  {
612  // Initialise variables
613  m_particle = -1;
614  m_pdgcode = 0;
615  m_cstat = 0;
616  m_tpc = 0;
617  m_plane = 0;
618  m_wire = 0;
619  m_x = 0.0;
620  m_w = 0.0;
621  m_q = 0.0;
622 
623  // Create dummy entry if there are no 2D hits
624  if (hitVector.empty()) { m_pReco2D->Fill(); }
625 
626  // Need DetectorProperties service to convert from ticks to X
627  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(e);
628 
629  // Loop over 2D hits
630  for (unsigned int i = 0; i < hitVector.size(); ++i) {
631  const art::Ptr<recob::Hit> hit = hitVector.at(i);
632 
633  m_particle = -1;
634  m_pdgcode = 0;
635 
636  HitsToPFParticles::const_iterator pIter = hitsToParticles.find(hit);
637  if (hitsToParticles.end() != pIter) {
638  const art::Ptr<recob::PFParticle> particle = pIter->second;
639  m_particle = particle->Self();
640  m_pdgcode = particle->PdgCode();
641  }
642 
643  const geo::WireID& wireID(hit->WireID());
644  m_cstat = wireID.Cryostat;
645  m_tpc = wireID.TPC;
646  m_plane = wireID.Plane;
647  m_wire = wireID.Wire;
648 
649  m_q = hit->Integral();
650  m_x = detProp.ConvertTicksToX(hit->PeakTime(), wireID.Plane, wireID.TPC, wireID.Cryostat);
651  m_w = this->GetUVW(wireID);
652 
653  m_pReco2D->Fill();
654  }
655  }
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:244
intermediate_table::const_iterator const_iterator
geo::WireID const & WireID() const
Initial tdc tick for hit.
Definition: Hit.h:280
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:220
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 461 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().

464  {
465  // Initialise variables
466  m_particle = -1;
467  m_primary = 0;
468  m_pdgcode = 0;
469  m_cstat = 0;
470  m_tpc = 0;
471  m_plane = 0;
472  m_x = 0.0;
473  m_u = 0.0;
474  m_v = 0.0;
475  m_y = 0.0;
476  m_z = 0.0;
477 
478  // Create dummy entry if there are no particles
479  if (particleVector.empty()) { m_pReco3D->Fill(); }
480 
481  // Store associations between particle and particle ID
482  PFParticleMap theParticleMap;
483 
484  for (unsigned int i = 0; i < particleVector.size(); ++i) {
485  const art::Ptr<recob::PFParticle> particle = particleVector.at(i);
486  theParticleMap[particle->Self()] = particle;
487  }
488 
489  // Loop over particles
490  for (PFParticlesToSpacePoints::const_iterator iter1 = particlesToSpacePoints.begin(),
491  iterEnd1 = particlesToSpacePoints.end();
492  iter1 != iterEnd1;
493  ++iter1) {
494  const art::Ptr<recob::PFParticle> particle = iter1->first;
495  const SpacePointVector& spacepoints = iter1->second;
496 
497  m_particle = particle->Self();
498  m_pdgcode = particle->PdgCode();
499  m_primary = 0;
500 
501  if (particle->IsPrimary()) { m_primary = 1; }
502  else {
503  const size_t parentID(particle->Parent());
504  PFParticleMap::const_iterator pIter = theParticleMap.find(parentID);
505  if (theParticleMap.end() == pIter)
506  throw cet::exception("LArPandora")
507  << " PFParticleHitDumper::analyze --- Found particle with ID code";
508 
509  const art::Ptr<recob::PFParticle> particleParent = pIter->second;
510  if (LArPandoraHelper::IsNeutrino(particleParent)) m_primary = 1;
511  }
512 
513  if (m_printDebug)
514  std::cout << " PFPARTICLE [" << m_particle << "] [Primary=" << m_primary << "] ("
515  << spacepoints.size() << " Space Points)" << std::endl;
516 
517  for (unsigned int j = 0; j < spacepoints.size(); ++j) {
518  const art::Ptr<recob::SpacePoint> spacepoint = spacepoints.at(j);
519 
520  m_x = spacepoint->XYZ()[0];
521  m_y = spacepoint->XYZ()[1];
522  m_z = spacepoint->XYZ()[2];
523 
524  SpacePointsToHits::const_iterator iter2 = spacePointsToHits.find(spacepoint);
525  if (spacePointsToHits.end() == iter2)
526  throw cet::exception("LArPandora")
527  << " PFParticleHitDumper::analyze --- Found space point without associated hit";
528 
529  const art::Ptr<recob::Hit> hit = iter2->second;
530  const geo::WireID& wireID(hit->WireID());
531 
532  m_cstat = wireID.Cryostat;
533  m_tpc = wireID.TPC;
534  m_plane = wireID.Plane;
535 
536  m_u = this->YZtoU(m_cstat, m_tpc, m_y, m_z);
537  m_v = this->YZtoV(m_cstat, m_tpc, m_y, m_z);
538 
539  m_pReco3D->Fill();
540  }
541  }
542  }
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:280
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 416 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().

417  {
418  // Initialise variables
419  m_particle = -1;
420  m_x = 0.0;
421  m_y = 0.0;
422  m_z = 0.0;
423 
424  // Create dummy entry if there are no particles
425  if (particlesToTracks.empty()) { m_pRecoTracks->Fill(); }
426 
427  // Loop over tracks
428  for (PFParticlesToTracks::const_iterator iter = particlesToTracks.begin(),
429  iterEnd = particlesToTracks.end();
430  iter != iterEnd;
431  ++iter) {
432  const art::Ptr<recob::PFParticle> particle = iter->first;
433  const TrackVector& trackVector = iter->second;
434 
435  m_particle = particle->Self();
436 
437  if (!trackVector.empty()) {
438  if (trackVector.size() != 1 && m_printDebug)
439  std::cout << " Warning: Found particle with more than one associated track " << std::endl;
440 
441  const art::Ptr<recob::Track> track = *(trackVector.begin());
442 
443  if (m_printDebug)
444  std::cout << " PFPARTICLE [" << m_particle << "] (" << track->NumberTrajectoryPoints()
445  << " Trajectory Points)" << std::endl;
446 
447  for (unsigned int p = 0; p < track->NumberTrajectoryPoints(); ++p) {
448  const auto position(track->LocationAtPoint(p));
449  m_x = position.x();
450  m_y = position.y();
451  m_z = position.z();
452 
453  m_pRecoTracks->Fill();
454  }
455  }
456  }
457  }
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 659 of file PFParticleHitDumper_module.cc.

References recob::Wire::Channel(), geo::GeometryCore::ChannelToWire(), geo::CryostatID::Cryostat, 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().

660  {
661 
662  // Create dummy entry if there are no wires
663  if (wireVector.empty()) { m_pRecoWire->Fill(); }
664 
665  // Need geometry service to convert channel to wire ID
667 
668  // Need DetectorProperties service to convert from ticks to X
669  auto const detProp = art::ServiceHandle<detinfo::DetectorPropertiesService const>()->DataFor(e);
670 
671  // Loop over wires
672  int signalCounter(0);
673 
674  for (unsigned int i = 0; i < wireVector.size(); ++i) {
675  const art::Ptr<recob::Wire> wire = wireVector.at(i);
676 
677  const std::vector<float>& signals(wire->Signal());
678  const std::vector<geo::WireID> wireIds = theGeometry->ChannelToWire(wire->Channel());
679 
680  if ((signalCounter++) < 10 && m_printDebug)
681  std::cout << " numWires=" << wireVector.size() << " numSignals=" << signals.size()
682  << std::endl;
683 
684  double time(0.0);
685 
686  m_q = 0.0;
687 
688  for (std::vector<float>::const_iterator tIter = signals.begin(), tIterEnd = signals.end();
689  tIter != tIterEnd;
690  ++tIter) {
691  time += 1.0;
692  m_q = *tIter;
693 
694  if (m_q < 2.0) // seems to remove most noise
695  continue;
696 
697  for (std::vector<geo::WireID>::const_iterator wIter = wireIds.begin(),
698  wIterEnd = wireIds.end();
699  wIter != wIterEnd;
700  ++wIter) {
701  const geo::WireID& wireID = *wIter;
702  m_cstat = wireID.Cryostat;
703  m_tpc = wireID.TPC;
704  m_plane = wireID.Plane;
705  m_wire = wireID.Wire;
706 
707  m_x = detProp.ConvertTicksToX(time, wireID.Plane, wireID.TPC, wireID.Cryostat);
708  m_w = this->GetUVW(wireID);
709 
710  m_pRecoWire->Fill();
711  }
712  }
713  }
714  }
std::vector< WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:211
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:563
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:481
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:399
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 718 of file PFParticleHitDumper_module.cc.

References geo::WireGeo::GetEnd(), geo::WireGeo::GetStart(), pmtana::sign(), and geo::GeometryCore::Wire().

Referenced by FillReco2D(), and FillRecoWires().

719  {
720  // define UVW as closest distance from (0,0) to wire axis
722 
723  auto const xyzStart = theGeometry->Wire(wireID).GetStart();
724  const double ay(xyzStart.Y());
725  const double az(xyzStart.Z());
726 
727  auto const xyzEnd = theGeometry->Wire(wireID).GetEnd();
728  const double by(xyzEnd.Y());
729  const double bz(xyzEnd.Z());
730 
731  const double ny(by - ay);
732  const double nz(bz - az);
733  const double N2(ny * ny + nz * nz);
734 
735  const double ry(ay - (ay * ny + az * nz) * ny / N2);
736  const double rz(az - (ay * ny + az * nz) * nz / N2);
737  const double sign((rz > 0.0) ? +1.0 : -1.0);
738 
739  return sign * std::sqrt(ry * ry + rz * rz);
740  }
WireGeo const & Wire(WireID const &wireid) const
Returns the specified wire.
Point_t GetStart() const
Returns the world coordinate of one end of the wire [cm].
Definition: WireGeo.h:226
Point_t GetEnd() const
Returns the world coordinate of one end of the wire [cm].
Definition: WireGeo.h:231
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 744 of file PFParticleHitDumper_module.cc.

References geo::kU, and geo::GeometryCore::WireAngleToVertical().

Referenced by FillReco3D().

748  {
749  // TODO: Check that this stills works in DUNE
751  const double m_theta(theGeometry->WireAngleToVertical(geo::kU, geo::TPCID{cstat, tpc}));
752  return z * std::sin(m_theta) - y * std::cos(m_theta);
753  }
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
Planes which measure U.
Definition: geo_types.h:135
double WireAngleToVertical(View_t view, TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
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 757 of file PFParticleHitDumper_module.cc.

References geo::kV, and geo::GeometryCore::WireAngleToVertical().

Referenced by FillReco3D().

761  {
762  // TODO; Check that this still works in DUNE
764  const double m_theta(theGeometry->WireAngleToVertical(geo::kV, geo::TPCID{cstat, tpc}));
765  return z * std::sin(m_theta) - y * std::cos(m_theta);
766  }
Planes which measure V.
Definition: geo_types.h:136
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:276
double WireAngleToVertical(View_t view, TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
The data type to uniquely identify a TPC.
Definition: geo_types.h:381

Member Data Documentation

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

Definition at line 161 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

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

Definition at line 163 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 139 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and beginJob().

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

Definition at line 162 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

int lar_pandora::PFParticleHitDumper::m_hitsFromClusters
private

Definition at line 158 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

int lar_pandora::PFParticleHitDumper::m_hitsFromSpacePoints
private

Definition at line 157 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

int lar_pandora::PFParticleHitDumper::m_hitsFromTrackOrShower
private

Definition at line 159 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 165 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 134 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillReco2D().

TTree* lar_pandora::PFParticleHitDumper::m_pReco3D
private

Definition at line 133 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillReco3D().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoComparison
private

Definition at line 135 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoTracks
private

Definition at line 132 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillRecoTracks().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoWire
private

Definition at line 136 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillRecoWires().

int lar_pandora::PFParticleHitDumper::m_primary
private

Definition at line 141 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 170 of file PFParticleHitDumper_module.cc.

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

double lar_pandora::PFParticleHitDumper::m_q
private

Definition at line 155 of file PFParticleHitDumper_module.cc.

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

int lar_pandora::PFParticleHitDumper::m_run
private

Definition at line 138 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and beginJob().

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

Definition at line 167 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

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

Definition at line 164 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

bool lar_pandora::PFParticleHitDumper::m_storeWires
private

Definition at line 169 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 166 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

double lar_pandora::PFParticleHitDumper::m_u
private

Definition at line 149 of file PFParticleHitDumper_module.cc.

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

double lar_pandora::PFParticleHitDumper::m_v
private

Definition at line 150 of file PFParticleHitDumper_module.cc.

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

double lar_pandora::PFParticleHitDumper::m_w
private

Definition at line 151 of file PFParticleHitDumper_module.cc.

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

int lar_pandora::PFParticleHitDumper::m_wire
private

Definition at line 147 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 153 of file PFParticleHitDumper_module.cc.

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

double lar_pandora::PFParticleHitDumper::m_z
private

Definition at line 154 of file PFParticleHitDumper_module.cc.

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


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