LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
lar_pandora::PFParticleHitDumper Class Reference

PFParticleHitDumper class. More...

Inheritance diagram for lar_pandora::PFParticleHitDumper:
art::EDAnalyzer art::EventObserverBase art::Consumer art::EngineCreator

Public Types

using WorkerType = WorkerT< EDAnalyzer >
 
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)
 
std::string workerType () const
 
bool modifiesEvent () const
 
void registerProducts (MasterProductRegistry &, ProductDescriptions &, ModuleDescription const &)
 
std::string const & processName () const
 
bool wantAllEvents () const
 
bool wantEvent (Event const &e)
 
fhicl::ParameterSetID selectorConfig () const
 
art::Handle< art::TriggerResultsgetTriggerResults (Event const &e) const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
detail::CachedProducts & cachedProducts ()
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

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 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 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 25 of file PFParticleHitDumper_module.cc.

Member Typedef Documentation

Definition at line 39 of file EDAnalyzer.h.

Definition at line 38 of file EDAnalyzer.h.

Constructor & Destructor Documentation

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

Constructor.

Parameters
pset

Definition at line 196 of file PFParticleHitDumper_module.cc.

References reconfigure().

196  : art::EDAnalyzer(pset)
197 {
198  this->reconfigure(pset);
199 }
void reconfigure(fhicl::ParameterSet const &pset)
lar_pandora::PFParticleHitDumper::~PFParticleHitDumper ( )
virtual

Destructor.

Definition at line 203 of file PFParticleHitDumper_module.cc.

204 {
205 }

Member Function Documentation

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

Definition at line 296 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().

297 {
298  if (m_printDebug)
299  std::cout << " *** PFParticleHitDumper::analyze(...) *** " << std::endl;
300 
301  m_run = evt.run();
302  m_event = evt.id().event();
303 
304  m_particle = -1;
305  m_primary = 0;
306  m_pdgcode = 0;
307 
308  m_cstat = 0;
309  m_tpc = 0;
310  m_plane = 0;
311  m_wire = 0;
312 
313  m_x = 0.0;
314  m_y = 0.0;
315  m_u = 0.0;
316  m_v = 0.0;
317  m_z = 0.0;
318  m_w = 0.0;
319  m_q = 0.0;
320 
321  if (m_printDebug)
322  {
323  std::cout << " Run: " << m_run << std::endl;
324  std::cout << " Event: " << m_event << std::endl;
325  }
326 
327  // Need DetectorProperties service to convert from ticks to X
328  // auto const* theDetector = lar::providerFrom<detinfo::DetectorPropertiesService>();
329 
330  // Need geometry service to convert channel to wire ID
332 
333  // Get particles, tracks, space points, hits (and wires)
334  // ====================================================
335  TrackVector trackVector, trackVectorExtra;
336  ShowerVector showerVector, showerVectorExtra;
337  PFParticleVector particleVector;
338  SpacePointVector spacePointVector;
339  HitVector hitVector;
340  WireVector wireVector;
341 
342  PFParticlesToTracks particlesToTracks;
343  PFParticlesToShowers particlesToShowers;
344  PFParticlesToSpacePoints particlesToSpacePoints;
345  PFParticlesToHits particlesToHits, particlesToHitsClusters;
346  TracksToHits tracksToHits;
347  ShowersToHits showersToHits;
348  HitsToPFParticles hitsToParticles, hitsToParticlesClusters;
349  SpacePointsToHits spacePointsToHits;
350 
352  LArPandoraHelper::CollectSpacePoints(evt, m_spacepointLabel, spacePointVector, spacePointsToHits);
353  LArPandoraHelper::CollectTracks(evt, m_trackLabel, trackVector, particlesToTracks);
354  LArPandoraHelper::CollectTracks(evt, m_trackLabel, trackVectorExtra, tracksToHits);
355  LArPandoraHelper::CollectShowers(evt, m_showerLabel, showerVector, particlesToShowers);
356  LArPandoraHelper::CollectShowers(evt, m_showerLabel, showerVectorExtra, showersToHits);
357  LArPandoraHelper::CollectPFParticles(evt, m_particleLabel, particleVector, particlesToSpacePoints);
358  LArPandoraHelper::BuildPFParticleHitMaps(evt, m_particleLabel, m_spacepointLabel, particlesToHits, hitsToParticles, LArPandoraHelper::DaughterMode::kUseDaughters, false);
359  LArPandoraHelper::BuildPFParticleHitMaps(evt, m_particleLabel, m_clusterLabel, particlesToHitsClusters, hitsToParticlesClusters);
360 
361  if (m_storeWires)
363 
364  if (m_printDebug)
365  std::cout << " PFParticles: " << particleVector.size() << std::endl;
366 
367  // Loop over Tracks (Fill 3D Track Tree)
368  // =====================================
369  if (m_printDebug)
370  std::cout << " PFParticleHitDumper::FillRecoTracks(...) " << std::endl;
371  this->FillRecoTracks(particlesToTracks);
372 
373  // Loop over PFParticles (Fill 3D Reco Tree)
374  // =========================================
375  if (m_printDebug)
376  std::cout << " PFParticleHitDumper::FillReco3D(...) " << std::endl;
377  this->FillReco3D(particleVector, particlesToSpacePoints, spacePointsToHits);
378 
379  // Loop over Hits (Fill 2D Reco Tree)
380  // ==================================
381  if (m_printDebug)
382  std::cout << " PFParticleHitDumper::FillReco2D(...) " << std::endl;
383  this->FillReco2D(hitVector, hitsToParticles);
384 
385  // Loop over Hits (Fill Associated 2D Hits Tree)
386  // =============================================
387  if (m_printDebug)
388  std::cout << " PFParticleHitDumper::FillAssociated2DHits(...) " << std::endl;
389  this->FillAssociated2DHits(evt, particleVector, particlesToHits, particlesToHitsClusters, particlesToTracks, tracksToHits, particlesToShowers, showersToHits);
390 
391  // Loop over Wires (Fill Reco Wire Tree)
392  // =====================================
393  if (m_printDebug)
394  std::cout << " PFParticleHitDumper::FillRecoWires(...) " << std::endl;
395  this->FillRecoWires(wireVector);
396 }
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.
std::map< art::Ptr< recob::SpacePoint >, art::Ptr< recob::Hit > > SpacePointsToHits
std::map< art::Ptr< recob::Hit >, art::Ptr< recob::PFParticle > > HitsToPFParticles
std::map< art::Ptr< recob::Shower >, HitVector > ShowersToHits
std::vector< art::Ptr< recob::PFParticle > > PFParticleVector
static void CollectWires(const art::Event &evt, const std::string &label, WireVector &wireVector)
Collect the reconstructed wires from the ART event record.
void FillRecoWires(const WireVector &wireVector)
Store raw data.
std::map< art::Ptr< recob::Track >, HitVector > TracksToHits
std::vector< art::Ptr< recob::Track > > TrackVector
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!)
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::Wire > > WireVector
void FillReco2D(const HitVector &hitVector, const HitsToPFParticles &hitsToParticles)
Store 2D hits.
void FillReco3D(const PFParticleVector &particleVector, const PFParticlesToSpacePoints &particlesToSpacePoints, const SpacePointsToHits &spacePointsToHits)
Store 3D hits.
std::map< art::Ptr< recob::PFParticle >, ShowerVector > PFParticlesToShowers
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.
std::vector< art::Ptr< recob::Shower > > ShowerVector
std::vector< art::Ptr< recob::SpacePoint > > SpacePointVector
std::vector< art::Ptr< recob::Hit > > HitVector
std::map< art::Ptr< recob::PFParticle >, TrackVector > PFParticlesToTracks
static void CollectHits(const art::Event &evt, const std::string &label, HitVector &hitVector)
Collect the reconstructed Hits from the ART event record.
std::map< art::Ptr< recob::PFParticle >, HitVector > PFParticlesToHits
void FillRecoTracks(const PFParticlesToTracks &particlesToTracks)
Store 3D track hits.
EventNumber_t event() const
Definition: EventID.h:117
std::map< art::Ptr< recob::PFParticle >, SpacePointVector > PFParticlesToSpacePoints
RunNumber_t run() const
Definition: Event.h:77
EventID id() const
Definition: Event.h:56
void lar_pandora::PFParticleHitDumper::beginJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 224 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, m_z, and art::TFileDirectory::make().

225 {
226  mf::LogDebug("LArPandora") << " *** PFParticleHitDumper::beginJob() *** " << std::endl;
227 
228  //
230 
231  m_pRecoTracks = tfs->make<TTree>("pandoraTracks", "LAr Reco Tracks");
232  m_pRecoTracks->Branch("run", &m_run,"run/I");
233  m_pRecoTracks->Branch("event", &m_event,"event/I");
234  m_pRecoTracks->Branch("particle", &m_particle, "particle/I");
235  m_pRecoTracks->Branch("x", &m_x, "x/D");
236  m_pRecoTracks->Branch("y", &m_y, "y/D");
237  m_pRecoTracks->Branch("z", &m_z, "z/D");
238 
239  m_pReco3D = tfs->make<TTree>("pandora3D", "LAr Reco 3D");
240  m_pReco3D->Branch("run", &m_run,"run/I");
241  m_pReco3D->Branch("event", &m_event,"event/I");
242  m_pReco3D->Branch("particle", &m_particle, "particle/I");
243  m_pReco3D->Branch("primary", &m_primary, "primary/I");
244  m_pReco3D->Branch("pdgcode", &m_pdgcode, "pdgcode/I");
245  m_pReco3D->Branch("cstat", &m_cstat, "cstat/I");
246  m_pReco3D->Branch("tpc", &m_tpc, "tpc/I");
247  m_pReco3D->Branch("plane", &m_plane, "plane/I");
248  m_pReco3D->Branch("x", &m_x, "x/D");
249  m_pReco3D->Branch("y", &m_y, "y/D");
250  m_pReco3D->Branch("u", &m_u, "u/D");
251  m_pReco3D->Branch("v", &m_v, "v/D");
252  m_pReco3D->Branch("z", &m_z, "z/D");
253 
254  m_pReco2D = tfs->make<TTree>("pandora2D", "LAr Reco 2D");
255  m_pReco2D->Branch("run", &m_run,"run/I");
256  m_pReco2D->Branch("event", &m_event,"event/I");
257  m_pReco2D->Branch("particle", &m_particle, "particle/I");
258  m_pReco2D->Branch("pdgcode", &m_pdgcode, "pdgcode/I");
259  m_pReco2D->Branch("cstat", &m_cstat, "cstat/I");
260  m_pReco2D->Branch("tpc", &m_tpc, "tpc/I");
261  m_pReco2D->Branch("plane", &m_plane, "plane/I");
262  m_pReco2D->Branch("wire", &m_wire, "wire/I");
263  m_pReco2D->Branch("x", &m_x, "x/D");
264  m_pReco2D->Branch("w", &m_w, "w/D");
265  m_pReco2D->Branch("q", &m_q, "q/D");
266 
267  m_pRecoComparison = tfs->make<TTree>("pandora2Dcomparison", "LAr Reco 2D (comparison)");
268  m_pRecoComparison->Branch("run", &m_run,"run/I");
269  m_pRecoComparison->Branch("event", &m_event,"event/I");
270  m_pRecoComparison->Branch("particle", &m_particle, "particle/I");
271  m_pRecoComparison->Branch("pdgcode", &m_pdgcode, "pdgcode/I");
272  m_pRecoComparison->Branch("hitsFromSpacePoints", &m_hitsFromSpacePoints, "hitsFromSpacePoints/I");
273  m_pRecoComparison->Branch("hitsFromClusters", &m_hitsFromClusters, "hitsFromClusters/I");
274  m_pRecoComparison->Branch("hitsFromTrackOrShower", &m_hitsFromTrackOrShower, "hitsFromTrackOrShower/I");
275 
276  m_pRecoWire = tfs->make<TTree>("rawdata", "LAr Reco Wires");
277  m_pRecoWire->Branch("run", &m_run,"run/I");
278  m_pRecoWire->Branch("event", &m_event,"event/I");
279  m_pRecoWire->Branch("cstat", &m_cstat, "cstat/I");
280  m_pRecoWire->Branch("tpc", &m_tpc, "tpc/I");
281  m_pRecoWire->Branch("plane", &m_plane, "plane/I");
282  m_pRecoWire->Branch("wire", &m_wire, "wire/I");
283  m_pRecoWire->Branch("x", &m_x, "x/D");
284  m_pRecoWire->Branch("w", &m_w, "w/D");
285  m_pRecoWire->Branch("q", &m_q, "q/D");
286 }
T * make(ARGS...args) const
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
detail::CachedProducts& art::EventObserverBase::cachedProducts ( )
inlineprotectedinherited

Definition at line 79 of file EventObserverBase.h.

References art::EventObserverBase::selectors_.

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

80  {
81  return selectors_;
82  }
detail::CachedProducts selectors_
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

148 {
149  if (!moduleContext_)
150  return ProductToken<T>::invalid();
151 
152  consumables_[BT].emplace_back(ConsumableType::Product,
153  TypeID{typeid(T)},
154  it.label(),
155  it.instance(),
156  it.process());
157  return ProductToken<T>{it};
158 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 162 of file Consumer.h.

163 {
164  if (!moduleContext_)
165  return;
166 
167  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
168 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 172 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

173 {
174  if (!moduleContext_)
175  return ViewToken<T>::invalid();
176 
177  consumables_[BT].emplace_back(ConsumableType::ViewElement,
178  TypeID{typeid(T)},
179  it.label(),
180  it.instance(),
181  it.process());
182  return ViewToken<T>{it};
183 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

34 {
35  return rng()->createEngine(
36  placeholder_schedule_id(), seed, kind_of_engine_to_make);
37 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
EngineCreator::base_engine_t & EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

43 {
44  return rng()->createEngine(
45  placeholder_schedule_id(), seed, kind_of_engine_to_make, engine_label);
46 }
long seed
Definition: chem4.cc:68
static art::ServiceHandle< art::RandomNumberGenerator > & rng()
CurrentProcessingContext const * art::EDAnalyzer::currentContext ( ) const
protectedinherited

Definition at line 114 of file EDAnalyzer.cc.

References art::EDAnalyzer::current_context_.

Referenced by art::EDAnalyzer::workerType().

115  {
116  return current_context_.get();
117  }
CPC_exempt_ptr current_context_
Definition: EDAnalyzer.h:179
void lar_pandora::PFParticleHitDumper::endJob ( )
virtual

Reimplemented from art::EDAnalyzer.

Definition at line 290 of file PFParticleHitDumper_module.cc.

291 {
292 }
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 537 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().

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

602 {
603  // Initialise variables
604  m_particle = -1;
605  m_pdgcode = 0;
606  m_cstat = 0;
607  m_tpc = 0;
608  m_plane = 0;
609  m_wire = 0;
610  m_x = 0.0;
611  m_w = 0.0;
612  m_q = 0.0;
613 
614  // Create dummy entry if there are no 2D hits
615  if (hitVector.empty())
616  {
617  m_pReco2D->Fill();
618  }
619 
620  // Need DetectorProperties service to convert from ticks to X
621  auto const* theDetector = lar::providerFrom<detinfo::DetectorPropertiesService>();
622 
623  // Loop over 2D hits
624  for (unsigned int i = 0; i<hitVector.size(); ++i)
625  {
626  const art::Ptr<recob::Hit> hit = hitVector.at(i);
627 
628  m_particle = -1;
629  m_pdgcode = 0;
630 
631  HitsToPFParticles::const_iterator pIter = hitsToParticles.find(hit);
632  if (hitsToParticles.end() != pIter)
633  {
634  const art::Ptr<recob::PFParticle> particle = pIter->second;
635  m_particle = particle->Self();
636  m_pdgcode = particle->PdgCode();
637  }
638 
639  const geo::WireID &wireID(hit->WireID());
640  m_cstat = wireID.Cryostat;
641  m_tpc = wireID.TPC;
642  m_plane = wireID.Plane;
643  m_wire = wireID.Wire;
644 
645  m_q = hit->Integral();
646  m_x = theDetector->ConvertTicksToX(hit->PeakTime(), wireID.Plane, wireID.TPC, wireID.Cryostat);
647  m_w = this->GetUVW(wireID);
648 
649  m_pReco2D->Fill();
650  }
651 }
size_t Self() const
Returns the index of this particle.
Definition: PFParticle.h:92
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
int PdgCode() const
Return the type of particle as a PDG ID.
Definition: PFParticle.h:83
float Integral() const
Integral under the calibrated signal waveform of the hit, in tick x ADC units.
Definition: Hit.h:225
double GetUVW(const geo::WireID &wireID) const
Conversion from wire ID to U/V/W coordinate.
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
float PeakTime() const
Time of the signal peak, in tick units.
Definition: Hit.h:219
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 447 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().

449 {
450  // Initialise variables
451  m_particle = -1;
452  m_primary = 0;
453  m_pdgcode = 0;
454  m_cstat = 0;
455  m_tpc = 0;
456  m_plane = 0;
457  m_x = 0.0;
458  m_u = 0.0;
459  m_v = 0.0;
460  m_y = 0.0;
461  m_z = 0.0;
462 
463  // Create dummy entry if there are no particles
464  if (particleVector.empty())
465  {
466  m_pReco3D->Fill();
467  }
468 
469  // Store associations between particle and particle ID
470  PFParticleMap theParticleMap;
471 
472  for (unsigned int i = 0; i < particleVector.size(); ++i )
473  {
474  const art::Ptr<recob::PFParticle> particle = particleVector.at(i);
475  theParticleMap[particle->Self()] = particle;
476  }
477 
478  // Loop over particles
479  for (PFParticlesToSpacePoints::const_iterator iter1 = particlesToSpacePoints.begin(), iterEnd1 = particlesToSpacePoints.end();
480  iter1 != iterEnd1; ++iter1)
481  {
482  const art::Ptr<recob::PFParticle> particle = iter1->first;
483  const SpacePointVector &spacepoints = iter1->second;
484 
485  m_particle = particle->Self();
486  m_pdgcode = particle->PdgCode();
487  m_primary = 0;
488 
489  if (particle->IsPrimary())
490  {
491  m_primary = 1;
492  }
493  else
494  {
495  const size_t parentID(particle->Parent());
496  PFParticleMap::const_iterator pIter = theParticleMap.find(parentID);
497  if (theParticleMap.end() == pIter)
498  throw cet::exception("LArPandora") << " PFParticleHitDumper::analyze --- Found particle with ID code";
499 
500  const art::Ptr<recob::PFParticle> particleParent = pIter->second;
501  if (LArPandoraHelper::IsNeutrino(particleParent))
502  m_primary = 1;
503  }
504 
505  if (m_printDebug)
506  std::cout << " PFPARTICLE [" << m_particle << "] [Primary=" << m_primary << "] (" << spacepoints.size() << " Space Points)" << std::endl;
507 
508  for (unsigned int j=0; j<spacepoints.size(); ++j)
509  {
510  const art::Ptr<recob::SpacePoint> spacepoint = spacepoints.at(j);
511 
512  m_x = spacepoint->XYZ()[0];
513  m_y = spacepoint->XYZ()[1];
514  m_z = spacepoint->XYZ()[2];
515 
516  SpacePointsToHits::const_iterator iter2 = spacePointsToHits.find(spacepoint);
517  if (spacePointsToHits.end() == iter2)
518  throw cet::exception("LArPandora") << " PFParticleHitDumper::analyze --- Found space point without associated hit";
519 
520  const art::Ptr<recob::Hit> hit = iter2->second;
521  const geo::WireID &wireID(hit->WireID());
522 
523  m_cstat = wireID.Cryostat;
524  m_tpc = wireID.TPC;
525  m_plane = wireID.Plane;
526 
527  m_u = this->YZtoU(m_cstat, m_tpc, m_y, m_z);
528  m_v = this->YZtoV(m_cstat, m_tpc, m_y, m_z);
529 
530  m_pReco3D->Fill();
531  }
532  }
533 }
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:92
static bool IsNeutrino(const art::Ptr< recob::PFParticle > particle)
Determine whether a particle has been reconstructed as a neutrino.
geo::WireID WireID() const
Initial tdc tick for hit.
Definition: Hit.h:234
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:83
std::map< int, art::Ptr< recob::PFParticle > > PFParticleMap
bool m_printDebug
switch for print statements (TODO: use message service!)
intermediate_table::const_iterator const_iterator
size_t Parent() const
Definition: PFParticle.h:96
bool IsPrimary() const
Returns whether the particle is the root of the flow.
Definition: PFParticle.h:86
const Double32_t * XYZ() const
Definition: SpacePoint.h:65
std::vector< art::Ptr< recob::SpacePoint > > SpacePointVector
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 400 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().

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

Store raw data.

Parameters
wireVectorthe input vector of reconstructed wires

Definition at line 655 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().

656 {
657 
658  // Create dummy entry if there are no wires
659  if (wireVector.empty())
660  {
661  m_pRecoWire->Fill();
662  }
663 
664  // Need geometry service to convert channel to wire ID
666 
667  // Need DetectorProperties service to convert from ticks to X
668  auto const* theDetector = lar::providerFrom<detinfo::DetectorPropertiesService>();
669 
670  // Loop over wires
671  int signalCounter(0);
672 
673  for (unsigned int i = 0; i<wireVector.size(); ++i)
674  {
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() << std::endl;
682 
683  double time(0.0);
684 
685  m_q = 0.0;
686 
687  for (std::vector<float>::const_iterator tIter = signals.begin(), tIterEnd = signals.end(); tIter != tIterEnd; ++tIter)
688  {
689  time += 1.0;
690  m_q = *tIter;
691 
692  if (m_q < 2.0) // seems to remove most noise
693  continue;
694 
695  for (std::vector<geo::WireID>::const_iterator wIter = wireIds.begin(), wIterEnd = wireIds.end(); wIter != wIterEnd; ++wIter)
696  {
697  const geo::WireID &wireID = *wIter;
698  m_cstat = wireID.Cryostat;
699  m_tpc = wireID.TPC;
700  m_plane = wireID.Plane;
701  m_wire = wireID.Wire;
702 
703  m_x = theDetector->ConvertTicksToX(time, wireID.Plane, wireID.TPC, wireID.Cryostat);
704  m_w = this->GetUVW(wireID);
705 
706  m_pRecoWire->Fill();
707  }
708  }
709  }
710 }
std::vector< geo::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:130
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:313
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!)
intermediate_table::const_iterator const_iterator
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
Definition: Wire.h:164
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
std::vector< float > Signal() const
Return a zero-padded full length vector filled with RoI signal.
Definition: Wire.cxx:47
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:203
Definition: fwd.h:25
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

Referenced by art::MixFilter< T >::initEngine_().

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
art::Handle<art::TriggerResults> art::EventObserverBase::getTriggerResults ( Event const &  e) const
inlineinherited

Definition at line 61 of file EventObserverBase.h.

References art::detail::CachedProducts::getOneTriggerResults(), and art::EventObserverBase::selectors_.

Referenced by art::OutputModule::doWriteEvent().

62  {
64  }
detail::CachedProducts selectors_
art::Handle< art::TriggerResults > getOneTriggerResults(Event const &) const
Float_t e
Definition: plot.C:34
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 714 of file PFParticleHitDumper_module.cc.

References geo::CryostatID::Cryostat, geo::GeometryCore::Cryostat(), geo::WireGeo::GetEnd(), geo::WireGeo::GetStart(), geo::TPCGeo::Plane(), geo::PlaneID::Plane, pmtana::sign(), geo::CryostatGeo::TPC(), geo::TPCID::TPC, geo::PlaneGeo::Wire(), and geo::WireID::Wire.

Referenced by FillReco2D(), and FillRecoWires().

715 {
716  // define UVW as closest distance from (0,0) to wire axis
718 
719  double xyzStart[3];
720  theGeometry->Cryostat(wireID.Cryostat).TPC(wireID.TPC).Plane(wireID.Plane).Wire(wireID.Wire).GetStart(xyzStart);
721  const double ay(xyzStart[1]);
722  const double az(xyzStart[2]);
723 
724  double xyzEnd[3];
725  theGeometry->Cryostat(wireID.Cryostat).TPC(wireID.TPC).Plane(wireID.Plane).Wire(wireID.Wire).GetEnd(xyzEnd);
726  const double by(xyzEnd[1]);
727  const double bz(xyzEnd[2]);
728 
729  const double ny(by - ay);
730  const double nz(bz - az);
731  const double N2(ny * ny + nz * nz);
732 
733  const double ry(ay - (ay * ny + az * nz) * ny / N2);
734  const double rz(az - (ay * ny + az * nz) * nz / N2);
735  const double sign((rz > 0.0) ? +1.0 : -1.0);
736 
737  return sign * std::sqrt(ry * ry + rz * rz);
738 }
void GetStart(double *xyz) const
Definition: WireGeo.h:129
WireGeo const & Wire(unsigned int iwire) const
Definition: PlaneGeo.cxx:506
CryostatID_t Cryostat
Index of cryostat.
Definition: geo_types.h:130
WireID_t Wire
Index of the wire within its plane.
Definition: geo_types.h:313
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
PlaneID_t Plane
Index of the plane within its TPC.
Definition: geo_types.h:258
int sign(double val)
Definition: UtilFunc.cxx:106
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc&#39;th TPC in the cryostat.
void GetEnd(double *xyz) const
Definition: WireGeo.h:133
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:299
TPCID_t TPC
Index of the TPC within its cryostat.
Definition: geo_types.h:203
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

191 {
192  if (!moduleContext_)
193  return ProductToken<T>::invalid();
194 
195  consumables_[BT].emplace_back(ConsumableType::Product,
196  TypeID{typeid(T)},
197  it.label(),
198  it.instance(),
199  it.process());
200  return ProductToken<T>{it};
201 }
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 205 of file Consumer.h.

206 {
207  if (!moduleContext_)
208  return;
209 
210  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
211 }
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 215 of file Consumer.h.

References art::InputTag::instance(), art::InputTag::label(), and art::InputTag::process().

216 {
217  if (!moduleContext_)
218  return ViewToken<T>::invalid();
219 
220  consumables_[BT].emplace_back(ConsumableType::ViewElement,
221  TypeID{typeid(T)},
222  it.label(),
223  it.instance(),
224  it.process());
225  return ViewToken<T>{it};
226 }
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
bool art::EventObserverBase::modifiesEvent ( ) const
inlineinherited

Definition at line 25 of file EventObserverBase.h.

26  {
27  return false;
28  }
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

Referenced by art::EDProducer::doBeginJob(), art::EDFilter::doBeginJob(), and art::EDAnalyzer::doBeginJob().

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
std::string const& art::EventObserverBase::processName ( ) const
inlineinherited
void lar_pandora::PFParticleHitDumper::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 209 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().

210 {
211  m_storeWires = pset.get<bool>("StoreWires", false);
212  m_trackLabel = pset.get<std::string>("TrackModule", "pandoraTrack");
213  m_showerLabel = pset.get<std::string>("ShowerModule", "pandoraShower");
214  m_particleLabel = pset.get<std::string>("PFParticleModule", "pandora");
215  m_spacepointLabel = pset.get<std::string>("SpacePointModule", "pandora");
216  m_clusterLabel = pset.get<std::string>("ClusterModule", "pandora");
217  m_hitfinderLabel = pset.get<std::string>("HitFinderModule", "gaushit");
218  m_calwireLabel = pset.get<std::string>("CalWireModule", "caldata");
219  m_printDebug = pset.get<bool>("PrintDebug",false);
220 }
bool m_printDebug
switch for print statements (TODO: use message service!)
void art::EventObserverBase::registerProducts ( MasterProductRegistry ,
ProductDescriptions ,
ModuleDescription const &   
)
inlineinherited

Definition at line 33 of file EventObserverBase.h.

36  {}
fhicl::ParameterSetID art::EventObserverBase::selectorConfig ( ) const
inlineinherited

Definition at line 56 of file EventObserverBase.h.

References art::EventObserverBase::selector_config_id_.

Referenced by art::RootOutputFile::writeOne().

57  {
58  return selector_config_id_;
59  }
fhicl::ParameterSetID selector_config_id_
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Definition at line 125 of file Consumer.cc.

Referenced by art::EDProducer::doEndJob(), art::EDFilter::doEndJob(), art::EDAnalyzer::doEndJob(), and art::RootOutput::endJob().

126 {
127  if (!moduleContext_)
128  return;
129 
130  // If none of the branches have missing consumes statements, exit early.
131  if (std::all_of(cbegin(missingConsumes_),
132  cend(missingConsumes_),
133  [](auto const& perBranch) { return perBranch.empty(); }))
134  return;
135 
136  constexpr cet::HorizontalRule rule{60};
137  mf::LogPrint log{"MTdiagnostics"};
138  log << '\n'
139  << rule('=') << '\n'
140  << "The following consumes (or mayConsume) statements are missing from\n"
141  << module_context(moduleDescription_) << '\n'
142  << rule('-') << '\n';
143 
144  cet::for_all_with_index(
145  missingConsumes_, [&log](std::size_t const i, auto const& perBranch) {
146  for (auto const& pi : perBranch) {
147  log << " "
148  << assemble_consumes_statement(static_cast<BranchType>(i), pi)
149  << '\n';
150  }
151  });
152  log << rule('=');
153 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

103 {
104  // Early exits if consumes tracking has been disabled or if the
105  // consumed product is an allowed consumable.
106  if (!moduleContext_)
107  return;
108 
109  if (cet::binary_search_all(consumables_[bt], pi))
110  return;
111 
112  if (requireConsumes_) {
114  "Consumer: an error occurred during validation of a "
115  "retrieved product\n\n")
116  << "The following consumes (or mayConsume) statement is missing from\n"
117  << module_context(moduleDescription_) << ":\n\n"
118  << " " << assemble_consumes_statement(bt, pi) << "\n\n";
119  }
120 
121  missingConsumes_[bt].insert(pi);
122 }
cet::exempt_ptr< ModuleDescription const > moduleDescription_
Definition: Consumer.h:140
bool requireConsumes_
Definition: Consumer.h:137
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
ConsumableProductSets missingConsumes_
Definition: Consumer.h:139
bool art::EventObserverBase::wantAllEvents ( ) const
inlineinherited
bool art::EventObserverBase::wantEvent ( Event const &  e)
inlineinherited
std::string art::EDAnalyzer::workerType ( ) const
inlineinherited

Definition at line 109 of file EDAnalyzer.h.

References art::EDAnalyzer::currentContext().

110  {
111  return "WorkerT<EDAnalyzer>";
112  }
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 742 of file PFParticleHitDumper_module.cc.

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

Referenced by FillReco3D().

743 {
744  // TODO: Check that this stills works in DUNE
746  const double m_theta(theGeometry->WireAngleToVertical(geo::kU, tpc, cstat));
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:279
Planes which measure U.
Definition: geo_types.h:76
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.
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 geo::kV, and geo::GeometryCore::WireAngleToVertical().

Referenced by FillReco3D().

753 {
754  // TODO; Check that this still works in DUNE
756  const double m_theta(theGeometry->WireAngleToVertical(geo::kV, tpc, cstat));
757  return z * std::sin(m_theta) - y * std::cos(m_theta);
758 }
Planes which measure V.
Definition: geo_types.h:77
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
double WireAngleToVertical(geo::View_t view, geo::TPCID const &tpcid) const
Returns the angle of the wires in the specified view from vertical.

Member Data Documentation

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

Definition at line 147 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

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

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

Referenced by analyze(), and beginJob().

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

Definition at line 148 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

int lar_pandora::PFParticleHitDumper::m_hitsFromClusters
private

Definition at line 144 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

int lar_pandora::PFParticleHitDumper::m_hitsFromSpacePoints
private

Definition at line 143 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

int lar_pandora::PFParticleHitDumper::m_hitsFromTrackOrShower
private

Definition at line 145 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 151 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 120 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillReco2D().

TTree* lar_pandora::PFParticleHitDumper::m_pReco3D
private

Definition at line 119 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillReco3D().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoComparison
private

Definition at line 121 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillAssociated2DHits().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoTracks
private

Definition at line 118 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillRecoTracks().

TTree* lar_pandora::PFParticleHitDumper::m_pRecoWire
private

Definition at line 122 of file PFParticleHitDumper_module.cc.

Referenced by beginJob(), and FillRecoWires().

int lar_pandora::PFParticleHitDumper::m_primary
private

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

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

double lar_pandora::PFParticleHitDumper::m_q
private

Definition at line 141 of file PFParticleHitDumper_module.cc.

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

int lar_pandora::PFParticleHitDumper::m_run
private

Definition at line 124 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and beginJob().

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

Definition at line 153 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

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

Definition at line 150 of file PFParticleHitDumper_module.cc.

Referenced by analyze(), and reconfigure().

bool lar_pandora::PFParticleHitDumper::m_storeWires
private

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

Referenced by analyze(), and reconfigure().

double lar_pandora::PFParticleHitDumper::m_u
private

Definition at line 135 of file PFParticleHitDumper_module.cc.

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

double lar_pandora::PFParticleHitDumper::m_v
private

Definition at line 136 of file PFParticleHitDumper_module.cc.

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

double lar_pandora::PFParticleHitDumper::m_w
private

Definition at line 137 of file PFParticleHitDumper_module.cc.

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

int lar_pandora::PFParticleHitDumper::m_wire
private

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

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

double lar_pandora::PFParticleHitDumper::m_z
private

Definition at line 140 of file PFParticleHitDumper_module.cc.

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


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