LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
trkf::PMAlgTrackMaker Class Reference
Inheritance diagram for trkf::PMAlgTrackMaker:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Classes

struct  Config
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 
using ModuleType = EDProducer
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 PMAlgTrackMaker (Parameters const &config)
 
 PMAlgTrackMaker (PMAlgTrackMaker const &)=delete
 
 PMAlgTrackMaker (PMAlgTrackMaker &&)=delete
 
PMAlgTrackMakeroperator= (PMAlgTrackMaker const &)=delete
 
PMAlgTrackMakeroperator= (PMAlgTrackMaker &&)=delete
 
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)
 
void fillProductDescriptions ()
 
void registerProducts (ProductDescriptions &productsToRegister)
 
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

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 produce (art::Event &e) override
 
template<size_t N>
bool init (const art::Event &evt, pma::PMAlgTracker &pmalgTracker) const
 
template<size_t N>
int getPdgFromCnnOnHits (const art::Event &evt, const pma::Track3D &trk) const
 
std::vector< anab::CosmicTagID_tgetCosmicTag (const pma::Track3D::ETag pmaTag) const
 

Private Attributes

art::InputTag fHitModuleLabel
 
art::InputTag fWireModuleLabel
 
art::InputTag fCluModuleLabel
 
art::InputTag fEmModuleLabel
 
pma::ProjectionMatchingAlg::Config fPmaConfig
 
pma::PMAlgTracker::Config fPmaTrackerConfig
 
pma::PMAlgCosmicTagger::Config fPmaTaggingConfig
 
pma::PMAlgVertexing::Config fPmaVtxConfig
 
pma::PMAlgStitching::Config fPmaStitchConfig
 
bool fSaveOnlyBranchingVtx
 
bool fSavePmaNodes
 
geo::GeometryCore const * fGeom
 
std::vector< TH1F * > fAdcInPassingPoints
 
std::vector< TH1F * > fAdcInRejectedPoints
 

Static Private Attributes

static const std::string kKinksName = "kink"
 
static const std::string kNodesName = "node"
 

Detailed Description

Definition at line 71 of file PMAlgTrackMaker_module.cc.

Member Typedef Documentation

Definition at line 17 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::detail::Producer::Table = Modifier::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 26 of file Producer.h.

Constructor & Destructor Documentation

trkf::PMAlgTrackMaker::PMAlgTrackMaker ( PMAlgTrackMaker::Parameters const &  config)
explicit

Definition at line 167 of file PMAlgTrackMaker_module.cc.

References fAdcInPassingPoints, fAdcInRejectedPoints, fCluModuleLabel, fEmModuleLabel, fGeom, fHitModuleLabel, fPmaConfig, fPmaStitchConfig, fPmaTaggingConfig, fPmaTrackerConfig, fPmaVtxConfig, fSaveOnlyBranchingVtx, fSavePmaNodes, fWireModuleLabel, kKinksName, kNodesName, geo::GeometryCore::MaxPlanes(), art::ProductRegistryHelper::produces(), and pma::PMAlgTracker::Config::Validation.

168  : EDProducer{config}
169  , fHitModuleLabel(config().HitModuleLabel())
170  , fWireModuleLabel(config().WireModuleLabel())
171  , fCluModuleLabel(config().ClusterModuleLabel())
172  , fEmModuleLabel(config().EmClusterModuleLabel())
173  , fPmaConfig(config().ProjectionMatchingAlg())
174  , fPmaTrackerConfig(config().PMAlgTracking())
175  , fPmaTaggingConfig(config().PMAlgCosmicTagging())
176  , fPmaVtxConfig(config().PMAlgVertexing())
177  , fPmaStitchConfig(config().PMAlgStitching())
178  , fSaveOnlyBranchingVtx(config().SaveOnlyBranchingVtx())
179  , fSavePmaNodes(config().SavePmaNodes())
181  {
182  produces<std::vector<recob::Track>>();
183  produces<std::vector<recob::SpacePoint>>();
184  produces<std::vector<recob::Vertex>>(); // no instance name for interaction vertices
185  produces<std::vector<recob::Vertex>>(kKinksName); // collection of kinks on tracks
186  produces<std::vector<recob::Vertex>>(kNodesName); // collection of pma nodes
187  produces<std::vector<anab::T0>>();
188  produces<std::vector<anab::CosmicTag>>(); // Cosmic ray tags
189 
191  recob::Hit>>(); // ****** REMEMBER to remove when FindMany improved ******
192  produces<art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta>>();
193 
194  produces<art::Assns<recob::Track, recob::SpacePoint>>();
195  produces<art::Assns<recob::SpacePoint, recob::Hit>>();
196  produces<
198  recob::Track>>(); // no instance name for assns of tracks to interaction vertices
199  produces<art::Assns<recob::Track, recob::Vertex>>(kKinksName); // assns of kinks to tracks
200  produces<art::Assns<recob::Track, anab::T0>>();
201  produces<art::Assns<recob::Track, anab::CosmicTag>>(); // Cosmic ray tags associated to tracks
202 
203  produces<std::vector<recob::PFParticle>>();
204  produces<art::Assns<recob::PFParticle, recob::Cluster>>();
205  produces<art::Assns<recob::PFParticle, recob::Vertex>>();
206  produces<art::Assns<recob::PFParticle, recob::Track>>();
207 
208  if (fPmaTrackerConfig.Validation() == "calib") // create histograms only in the calibration mode
209  {
211  for (size_t p = 0; p < fGeom->MaxPlanes(); ++p) {
212  std::ostringstream ss1;
213  ss1 << "adc_plane_" << p;
214  fAdcInPassingPoints.push_back(tfs->make<TH1F>(
215  (ss1.str() + "_passing").c_str(), "max adc around the point on track", 100., 0., 5.));
216  fAdcInRejectedPoints.push_back(tfs->make<TH1F>(
217  (ss1.str() + "_rejected").c_str(), "max adc around spurious point ", 100., 0., 5.));
218  }
219  }
220  }
static const std::string kKinksName
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
fhicl::Atom< std::string > Validation
geo::GeometryCore const * fGeom
pma::PMAlgStitching::Config fPmaStitchConfig
unsigned int MaxPlanes() const
Returns the largest number of planes among all TPCs in this detector.
pma::ProjectionMatchingAlg::Config fPmaConfig
pma::PMAlgVertexing::Config fPmaVtxConfig
pma::PMAlgCosmicTagger::Config fPmaTaggingConfig
std::vector< TH1F * > fAdcInRejectedPoints
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:992
pma::PMAlgTracker::Config fPmaTrackerConfig
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
std::vector< TH1F * > fAdcInPassingPoints
static const std::string kNodesName
trkf::PMAlgTrackMaker::PMAlgTrackMaker ( PMAlgTrackMaker const &  )
delete
trkf::PMAlgTrackMaker::PMAlgTrackMaker ( PMAlgTrackMaker &&  )
delete

Member Function Documentation

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::Producer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 22 of file Producer.cc.

References art::detail::Producer::beginJobWithFrame(), and art::detail::Producer::setupQueues().

23  {
24  setupQueues(resources);
25  ProcessingFrame const frame{ScheduleID{}};
26  beginJobWithFrame(frame);
27  }
virtual void setupQueues(SharedResources const &)=0
virtual void beginJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 65 of file Producer.cc.

References art::detail::Producer::beginRunWithFrame(), art::RangeSet::forRun(), art::RunPrincipal::makeRun(), r, art::RunPrincipal::runID(), and art::ModuleContext::scheduleID().

66  {
67  auto r = rp.makeRun(mc, RangeSet::forRun(rp.runID()));
68  ProcessingFrame const frame{mc.scheduleID()};
69  beginRunWithFrame(r, frame);
70  r.commitProducts();
71  return true;
72  }
TRandom r
Definition: spectrum.C:23
virtual void beginRunWithFrame(Run &, ProcessingFrame const &)=0
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
bool art::detail::Producer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 85 of file Producer.cc.

References art::detail::Producer::beginSubRunWithFrame(), art::RangeSet::forSubRun(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::SubRunPrincipal::subRunID().

86  {
87  auto sr = srp.makeSubRun(mc, RangeSet::forSubRun(srp.subRunID()));
88  ProcessingFrame const frame{mc.scheduleID()};
89  beginSubRunWithFrame(sr, frame);
90  sr.commitProducts();
91  return true;
92  }
virtual void beginSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
void art::detail::Producer::doEndJob ( )
inherited

Definition at line 30 of file Producer.cc.

References art::detail::Producer::endJobWithFrame().

31  {
32  ProcessingFrame const frame{ScheduleID{}};
33  endJobWithFrame(frame);
34  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 75 of file Producer.cc.

References art::detail::Producer::endRunWithFrame(), art::RunPrincipal::makeRun(), r, art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

76  {
77  auto r = rp.makeRun(mc, rp.seenRanges());
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(r, frame);
80  r.commitProducts();
81  return true;
82  }
TRandom r
Definition: spectrum.C:23
virtual void endRunWithFrame(Run &, ProcessingFrame const &)=0
bool art::detail::Producer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 95 of file Producer.cc.

References art::detail::Producer::endSubRunWithFrame(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::Principal::seenRanges().

96  {
97  auto sr = srp.makeSubRun(mc, srp.seenRanges());
98  ProcessingFrame const frame{mc.scheduleID()};
99  endSubRunWithFrame(sr, frame);
100  sr.commitProducts();
101  return true;
102  }
virtual void endSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
bool art::detail::Producer::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 105 of file Producer.cc.

References art::detail::Producer::checkPutProducts_, e, art::EventPrincipal::makeEvent(), art::detail::Producer::produceWithFrame(), and art::ModuleContext::scheduleID().

110  {
111  auto e = ep.makeEvent(mc);
112  ++counts_run;
113  ProcessingFrame const frame{mc.scheduleID()};
114  produceWithFrame(e, frame);
115  e.commitProducts(checkPutProducts_, &expectedProducts<InEvent>());
116  ++counts_passed;
117  return true;
118  }
bool const checkPutProducts_
Definition: Producer.h:70
Float_t e
Definition: plot.C:35
virtual void produceWithFrame(Event &, ProcessingFrame const &)=0
void art::detail::Producer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 44 of file Producer.cc.

References art::detail::Producer::respondToCloseInputFileWithFrame().

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

Definition at line 58 of file Producer.cc.

References art::detail::Producer::respondToCloseOutputFilesWithFrame().

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

Definition at line 37 of file Producer.cc.

References art::detail::Producer::respondToOpenInputFileWithFrame().

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

Definition at line 51 of file Producer.cc.

References art::detail::Producer::respondToOpenOutputFilesWithFrame().

52  {
53  ProcessingFrame const frame{ScheduleID{}};
55  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
void art::Modifier::fillProductDescriptions ( )
inherited

Definition at line 10 of file Modifier.cc.

References art::ProductRegistryHelper::fillDescriptions(), and art::ModuleBase::moduleDescription().

11  {
13  }
void fillDescriptions(ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
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
std::vector< anab::CosmicTagID_t > trkf::PMAlgTrackMaker::getCosmicTag ( const pma::Track3D::ETag  pmaTag) const
private

Definition at line 291 of file PMAlgTrackMaker_module.cc.

References pma::Track3D::kBeamIncompatible, anab::kFlash_BeamIncompatible, anab::kGeometry_XX, pma::Track3D::kGeometry_XX, anab::kGeometry_Y, pma::Track3D::kGeometry_Y, anab::kGeometry_YY, pma::Track3D::kGeometry_YY, anab::kGeometry_YZ, pma::Track3D::kGeometry_YZ, anab::kGeometry_ZZ, pma::Track3D::kGeometry_ZZ, anab::kOutsideDrift_Complete, pma::Track3D::kOutsideDrift_Complete, anab::kOutsideDrift_Partial, pma::Track3D::kOutsideDrift_Partial, and geo::kUnknown.

Referenced by produce().

293  {
294  std::vector<anab::CosmicTagID_t> anabTags;
295 
297  anabTags.push_back(anab::CosmicTagID_t::kOutsideDrift_Partial);
298  }
301  }
302  if (pmaTag & pma::Track3D::kBeamIncompatible) {
304  }
305  if (pmaTag & pma::Track3D::kGeometry_XX) {
306  anabTags.push_back(anab::CosmicTagID_t::kGeometry_XX);
307  }
308  if (pmaTag & pma::Track3D::kGeometry_YY) {
309  anabTags.push_back(anab::CosmicTagID_t::kGeometry_YY);
310  }
311  if (pmaTag & pma::Track3D::kGeometry_ZZ) {
312  anabTags.push_back(anab::CosmicTagID_t::kGeometry_ZZ);
313  }
314  if (pmaTag & pma::Track3D::kGeometry_YZ) {
315  anabTags.push_back(anab::CosmicTagID_t::kGeometry_YZ);
316  }
317  if (pmaTag & pma::Track3D::kGeometry_Y) {
318  anabTags.push_back(anab::CosmicTagID_t::kGeometry_Y);
319  }
320 
321  if (anabTags.empty()) { anabTags.push_back(anab::CosmicTagID_t::kUnknown); }
322 
323  return anabTags;
324  }
Unknown view.
Definition: geo_types.h:142
template<size_t N>
int trkf::PMAlgTrackMaker::getPdgFromCnnOnHits ( const art::Event evt,
const pma::Track3D trk 
) const
private

Definition at line 224 of file PMAlgTrackMaker_module.cc.

References anab::MVAReader< T, N >::create(), fCluModuleLabel, fPmaTrackerConfig, pma::Track3D::size(), and pma::PMAlgTracker::Config::TrackLikeThreshold.

225  {
226  int pdg = 0;
229  if (hitResults) {
230  int trkLikeIdx = hitResults->getIndex("track");
231  int emLikeIdx = hitResults->getIndex("em");
232  if ((trkLikeIdx < 0) || (emLikeIdx < 0)) {
233  throw cet::exception("PMAlgTrackMaker")
234  << "No em/track labeled columns in MVA data products." << std::endl;
235  }
236 
237  size_t nh[3] = {0, 0, 0};
238  for (size_t hidx = 0; hidx < trk.size(); ++hidx) {
239  ++nh[trk[hidx]->View2D()];
240  }
241 
242  size_t best_view = 2; // collection
243  if ((nh[0] >= nh[1]) && (nh[0] > 1.25 * nh[2])) best_view = 0; // ind1
244  if ((nh[1] >= nh[0]) && (nh[1] > 1.25 * nh[2])) best_view = 1; // ind2
245 
246  std::vector<art::Ptr<recob::Hit>> trkHitPtrList;
247  trkHitPtrList.reserve(nh[best_view]);
248  for (size_t hidx = 0; hidx < trk.size(); ++hidx) {
249  if (trk[hidx]->View2D() == best_view) {
250  trkHitPtrList.emplace_back(trk[hidx]->Hit2DPtr());
251  }
252  }
253  auto vout = hitResults->getOutput(trkHitPtrList);
254  double trk_like = -1, trk_or_em = vout[trkLikeIdx] + vout[emLikeIdx];
255  if (trk_or_em > 0) {
256  trk_like = vout[trkLikeIdx] / trk_or_em;
257  if (trk_like < fPmaTrackerConfig.TrackLikeThreshold()) pdg = 11; // tag if EM-like
258  // (don't set pdg for track-like, for the moment don't like the idea of using "13")
259  }
260  //std::cout << "trk:" << best_view << ":" << trk.size() << ":" << trkHitPtrList.size() << " p=" << trk_like << std::endl;
261  }
262  }
263  return pdg;
264  }
fhicl::Atom< float > TrackLikeThreshold
pma::PMAlgTracker::Config fPmaTrackerConfig
size_t size() const
Definition: PmaTrack3D.h:89
static std::unique_ptr< MVAReader > create(const art::Event &evt, const art::InputTag &tag)
Definition: MVAReader.h:108
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<size_t N>
bool trkf::PMAlgTrackMaker::init ( const art::Event evt,
pma::PMAlgTracker pmalgTracker 
) const
private

Definition at line 267 of file PMAlgTrackMaker_module.cc.

References anab::MVAReader< T, N >::create(), tca::evt, fCluModuleLabel, and pma::PMAlgTracker::init().

268  {
270  if (!cluResults) { return false; }
271 
272  int trkLikeIdx = cluResults->getIndex("track");
273  int emLikeIdx = cluResults->getIndex("em");
274  if ((trkLikeIdx < 0) || (emLikeIdx < 0)) { return false; }
275 
276  const art::FindManyP<recob::Hit> hitsFromClusters(
277  cluResults->dataHandle(), evt, cluResults->dataTag());
278  const auto& cnnOuts = cluResults->outputs();
279  std::vector<float> trackLike(cnnOuts.size());
280  for (size_t i = 0; i < cnnOuts.size(); ++i) {
281  double trkOrEm = cnnOuts[i][trkLikeIdx] + cnnOuts[i][emLikeIdx];
282  if (trkOrEm > 0) { trackLike[i] = cnnOuts[i][trkLikeIdx] / trkOrEm; }
283  else {
284  trackLike[i] = 0;
285  }
286  }
287  pmalgTracker.init(hitsFromClusters, trackLike);
288  return true;
289  }
void init(const art::FindManyP< recob::Hit > &hitsFromClusters)
TCEvent evt
Definition: DataStructs.cxx:8
static std::unique_ptr< MVAReader > create(const art::Event &evt, const art::InputTag &tag)
Definition: MVAReader.h:108
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
PMAlgTrackMaker& trkf::PMAlgTrackMaker::operator= ( PMAlgTrackMaker const &  )
delete
PMAlgTrackMaker& trkf::PMAlgTrackMaker::operator= ( PMAlgTrackMaker &&  )
delete
void trkf::PMAlgTrackMaker::produce ( art::Event e)
overrideprivatevirtual

Implements art::EDProducer.

Definition at line 326 of file PMAlgTrackMaker_module.cc.

References util::abs(), art::PtrVector< T >::clear(), pma::Track3D::CompleteMissingWires(), pma::convertFrom(), util::CreateAssn(), DEFINE_ART_MODULE, pma::Hit3D::Dx(), e, tca::evt, fAdcInPassingPoints, fAdcInRejectedPoints, fCluModuleLabel, fEmModuleLabel, fGeom, fHitModuleLabel, art::fill_ptr_vector(), fPmaConfig, fPmaStitchConfig, fPmaTaggingConfig, fPmaTrackerConfig, fPmaVtxConfig, pma::Track3D::FrontCryo(), pma::Track3D::FrontTPC(), fSaveOnlyBranchingVtx, fSavePmaNodes, fWireModuleLabel, getCosmicTag(), pma::Track3D::GetRawdEdxSequence(), pma::Track3D::GetT0(), pma::Track3D::GetTag(), art::ProductRetriever::getValidHandle(), pma::Track3D::HasT0(), pma::Track3D::HasTagFlag(), pma::Hit3D::Hit2DPtr(), pma::Hit3D::IsEnabled(), art::Ptr< T >::isNull(), pma::Track3D::kCosmic, kKinksName, kNodesName, recob::PFParticle::kPFParticlePrimary, geo::kU, geo::kV, geo::kX, geo::kY, geo::kZ, pma::Track3D::Nodes(), pma::Hit3D::Point3D(), art::PtrVector< T >::push_back(), art::Event::put(), pma::PMAlgTracker::Config::RunVertexing, pma::Track3D::SelectHits(), art::PtrVector< T >::size(), pma::Track3D::size(), geo::GeometryCore::TPC(), and pma::PMAlgTracker::Config::TrackLikeThreshold.

327  {
328  // ---------------- Create data products --------------------------
329  auto tracks = std::make_unique<std::vector<recob::Track>>();
330  auto allsp = std::make_unique<std::vector<recob::SpacePoint>>();
331  auto vtxs = std::make_unique<std::vector<recob::Vertex>>(); // interaction vertices
332  auto kinks = std::make_unique<
333  std::vector<recob::Vertex>>(); // kinks on tracks (no new particles start in kinks)
334  auto nodes = std::make_unique<std::vector<recob::Vertex>>(); // pma nodes
335  auto t0s = std::make_unique<std::vector<anab::T0>>();
336  auto cosmicTags = std::make_unique<std::vector<anab::CosmicTag>>();
337 
338  auto trk2hit_oldway = std::make_unique<
340  recob::Hit>>(); // ****** REMEMBER to remove when FindMany improved ******
341  auto trk2hit = std::make_unique<art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta>>();
342 
343  auto trk2sp = std::make_unique<art::Assns<recob::Track, recob::SpacePoint>>();
344  auto trk2t0 = std::make_unique<art::Assns<recob::Track, anab::T0>>();
345  auto trk2ct = std::make_unique<art::Assns<recob::Track, anab::CosmicTag>>();
346 
347  auto sp2hit = std::make_unique<art::Assns<recob::SpacePoint, recob::Hit>>();
348  auto vtx2trk = std::make_unique<
350  recob::Track>>(); // one or more tracks (particles) start in the vertex
351  auto trk2kink =
352  std::make_unique<art::Assns<recob::Track, recob::Vertex>>(); // one or more kinks on the track
353 
354  auto pfps = std::make_unique<std::vector<recob::PFParticle>>();
355 
356  auto pfp2clu = std::make_unique<art::Assns<recob::PFParticle, recob::Cluster>>();
357  auto pfp2vtx = std::make_unique<art::Assns<recob::PFParticle, recob::Vertex>>();
358  auto pfp2trk = std::make_unique<art::Assns<recob::PFParticle, recob::Track>>();
359 
360  // --------------------- Wires & Hits -----------------------------
361  auto wireHandle = evt.getValidHandle<std::vector<recob::Wire>>(fWireModuleLabel);
362  auto allHitListHandle = evt.getValidHandle<std::vector<recob::Hit>>(fHitModuleLabel);
363  std::vector<art::Ptr<recob::Hit>> allhitlist;
364  art::fill_ptr_vector(allhitlist, allHitListHandle);
365 
366  // -------------- PMA Tracker for this event ----------------------
367  auto pmalgTracker = pma::PMAlgTracker(allhitlist,
368  *wireHandle,
369  fPmaConfig,
376 
377  size_t mvaLength = 0;
378  if (fEmModuleLabel != "") // ----------- Exclude EM parts ---------
379  {
380  auto cluListHandle = evt.getValidHandle<std::vector<recob::Cluster>>(fCluModuleLabel);
381  auto splitCluHandle = evt.getValidHandle<std::vector<recob::Cluster>>(fEmModuleLabel);
382 
383  art::FindManyP<recob::Hit> hitsFromClusters(cluListHandle, evt, fCluModuleLabel);
384  art::FindManyP<recob::Hit> hitsFromEmParts(splitCluHandle, evt, fEmModuleLabel);
385  pmalgTracker.init(hitsFromClusters, hitsFromEmParts);
386  }
387  else if (fPmaTrackerConfig.TrackLikeThreshold() > 0) // --- CNN EM/trk separation ----
388  {
389  // try to dig out 4- or 3-output MVA data product
390  if (init<4>(evt, pmalgTracker)) { mvaLength = 4; } // e.g.: EM / track / Michel / none
391  else if (init<3>(evt, pmalgTracker)) {
392  mvaLength = 3;
393  } // e.g.: EM / track / none
394  else if (init<2>(evt, pmalgTracker)) {
395  mvaLength = 2;
396  } // just EM / track (LArIAT starts with this style)
397  else {
398  throw cet::exception("PMAlgTrackMaker") << "No EM/track MVA data products." << std::endl;
399  }
400  }
401  else // ------------------------ Use ALL clusters -----------------
402  {
403  auto cluListHandle = evt.getValidHandle<std::vector<recob::Cluster>>(fCluModuleLabel);
404  art::FindManyP<recob::Hit> hitsFromClusters(cluListHandle, evt, fCluModuleLabel);
405  pmalgTracker.init(hitsFromClusters);
406  }
407 
408  // ------------------ Do the job here: ----------------------------
409  auto const clockData = art::ServiceHandle<detinfo::DetectorClocksService const>()->DataFor(evt);
410  auto const detProp =
412  int retCode = pmalgTracker.build(clockData, detProp);
413  // ----------------------------------------------------------------
414  switch (retCode) {
415  case -2: mf::LogError("Summary") << "problem"; break;
416  case -1: mf::LogWarning("Summary") << "no input"; break;
417  case 0: mf::LogVerbatim("Summary") << "no tracks done"; break;
418  default:
419  if (retCode < 0)
420  mf::LogVerbatim("Summary") << "unknown result";
421  else if (retCode == 1)
422  mf::LogVerbatim("Summary") << retCode << " track ready";
423  else
424  mf::LogVerbatim("Summary") << retCode << " tracks ready";
425  break;
426  }
427 
428  // ---------- Translate output to data products: ------------------
429  auto const& result = pmalgTracker.result();
430  if (!result.empty()) // ok, there is something to save
431  {
432  size_t spStart = 0, spEnd = 0;
433  double sp_pos[3], sp_err[6];
434  for (size_t i = 0; i < 3; ++i)
435  sp_pos[i] = 0.0;
436  for (size_t i = 0; i < 6; ++i)
437  sp_err[i] = 1.0;
438 
439  auto const make_pfpptr = art::PtrMaker<recob::PFParticle>(evt);
440  auto const make_trkptr = art::PtrMaker<recob::Track>(evt); // PtrMaker Step #1
441  auto const make_vtxptr = art::PtrMaker<recob::Vertex>(evt);
442  auto const make_kinkptr = art::PtrMaker<recob::Vertex>(evt, kKinksName);
443  auto const make_t0ptr = art::PtrMaker<anab::T0>(evt);
444  auto const make_ctptr = art::PtrMaker<anab::CosmicTag>(evt);
445 
446  tracks->reserve(result.size());
447  for (size_t trkIndex = 0; trkIndex < result.size(); ++trkIndex) {
448  pma::Track3D* trk = result[trkIndex].Track();
449 
450  trk->SelectHits(); // just in case, set all to enabled
451  unsigned int itpc = trk->FrontTPC(), icryo = trk->FrontCryo();
452  pma::dedx_map dedx_tmp;
453  auto const& tpc = fGeom->TPC(geo::TPCID(icryo, itpc));
454  if (tpc.HasPlane(geo::kU)) {
455  trk->CompleteMissingWires(detProp, geo::kU);
456  trk->GetRawdEdxSequence(dedx_tmp, geo::kU, 1);
457  }
458  if (tpc.HasPlane(geo::kV)) {
459  trk->CompleteMissingWires(detProp, geo::kV);
460  trk->GetRawdEdxSequence(dedx_tmp, geo::kV, 1);
461  }
462  if (tpc.HasPlane(geo::kX)) {
463  trk->CompleteMissingWires(detProp, geo::kX);
464  trk->GetRawdEdxSequence(dedx_tmp, geo::kX, 1);
465  }
466  if (tpc.HasPlane(geo::kY)) {
467  trk->CompleteMissingWires(detProp, geo::kY);
468  trk->GetRawdEdxSequence(dedx_tmp, geo::kY, 1);
469  }
470  if (tpc.HasPlane(geo::kZ)) {
471  trk->CompleteMissingWires(detProp, geo::kZ);
472  trk->GetRawdEdxSequence(dedx_tmp, geo::kZ, 1);
473  }
474 
475  //gc: make sure no tracks are created with less than 2 points
476  if (trk->size() < 2) continue;
477 
478  int pdg = 0;
479  if (mvaLength == 4)
480  pdg = getPdgFromCnnOnHits<4>(evt, *(result[trkIndex].Track()));
481  else if (mvaLength == 3)
482  pdg = getPdgFromCnnOnHits<3>(evt, *(result[trkIndex].Track()));
483  else if (mvaLength == 2)
484  pdg = getPdgFromCnnOnHits<2>(evt, *(result[trkIndex].Track()));
485  //else mf::LogInfo("PMAlgTrackMaker") << "Not using PID from CNN.";
486 
487  tracks->push_back(pma::convertFrom(*trk, trkIndex, pdg));
488 
489  auto const trkPtr = make_trkptr(tracks->size() - 1); // PtrMaker Step #2
490 
491  if (trk->HasT0()) {
492  // TriggBits=3 means from 3d reco (0,1,2 mean something else)
493  t0s->push_back(anab::T0(trk->GetT0(), 0, 3, tracks->back().ID()));
494 
495  auto const t0Ptr = make_t0ptr(t0s->size() - 1); // PtrMaker Step #3
496  trk2t0->addSingle(trkPtr, t0Ptr);
497  }
498 
499  // Check if this is a cosmic ray and create an association if it is.
500  if (trk->HasTagFlag(pma::Track3D::kCosmic)) {
501  // Get the track end points
502  std::vector<float> trkEnd0;
503  std::vector<float> trkEnd1;
504  // Get the drift direction, but don't care about the sign
505  // Also need to subtract 1 due to the definition.
506  int driftDir = abs(tpc.DetectDriftDirection()) - 1;
507 
508  for (int i = 0; i < 3; ++i) {
509  // Get the drift direction and apply the opposite of the drift shift in order to
510  // give the CosmicTag the drift coordinate assuming T0 = T_beam as it requests.
511  double shift = 0.0;
512  if (i == driftDir) { shift = trk->Nodes()[0]->GetDriftShift(); }
513  trkEnd0.push_back(trk->Nodes()[0]->Point3D()[i] - shift);
514  trkEnd1.push_back(trk->Nodes()[trk->Nodes().size() - 1]->Point3D()[i] - shift);
515  }
516  // Make the tag object. For now, let's say this is very likely a cosmic (3rd argument = 1).
517  // Set the type of cosmic to the value saved in pma::Track.
518  auto tags = getCosmicTag(trk->GetTag());
519  for (const auto t : tags) {
520  cosmicTags->emplace_back(trkEnd0, trkEnd1, 1, t);
521  auto const cosmicPtr = make_ctptr(cosmicTags->size() - 1);
522  trk2ct->addSingle(trkPtr, cosmicPtr);
523  }
524  }
525 
526  //gc: save associated hits in the same order as trajectory points
527  for (size_t h = 0, cnt = 0; h < trk->size(); h++) {
528  pma::Hit3D* h3d = (*trk)[h];
529  if (!h3d->IsEnabled()) continue;
530 
531  recob::TrackHitMeta metadata(cnt++, h3d->Dx());
532  trk2hit->addSingle(trkPtr, h3d->Hit2DPtr(), metadata);
533  trk2hit_oldway->addSingle(
534  trkPtr, h3d->Hit2DPtr()); // ****** REMEMBER to remove when FindMany improved ******
535  }
536 
538  spStart = allsp->size();
539  //rs: so make also associations to space points in the order of trajectory points
540  for (size_t h = 0; h < trk->size(); ++h) {
541  pma::Hit3D* h3d = (*trk)[h];
542  if (!h3d->IsEnabled()) continue;
543 
544  double hx = h3d->Point3D().X();
545  double hy = h3d->Point3D().Y();
546  double hz = h3d->Point3D().Z();
547 
548  if ((h == 0) || (std::fabs(sp_pos[0] - hx) > 1.0e-5) ||
549  (std::fabs(sp_pos[1] - hy) > 1.0e-5) || (std::fabs(sp_pos[2] - hz) > 1.0e-5)) {
550  if (sp_hits.size()) // hits assigned to the previous sp
551  {
552  util::CreateAssn(evt, *allsp, sp_hits, *sp2hit);
553  sp_hits.clear();
554  }
555  sp_pos[0] = hx;
556  sp_pos[1] = hy;
557  sp_pos[2] = hz;
558  allsp->push_back(recob::SpacePoint(sp_pos, sp_err, 1.0));
559  }
560  sp_hits.push_back(h3d->Hit2DPtr());
561  }
562 
563  if (sp_hits.size()) // hits assigned to the last sp
564  {
565  util::CreateAssn(evt, *allsp, sp_hits, *sp2hit);
566  }
567  spEnd = allsp->size();
568 
569  if (spEnd > spStart) util::CreateAssn(evt, *tracks, *allsp, *trk2sp, spStart, spEnd);
570  }
571 
572  auto vsel = pmalgTracker.getVertices(
573  fSaveOnlyBranchingVtx); // vtx pos's with vector of connected track idxs
574  auto ksel = pmalgTracker.getKinks(); // pairs of kink position - associated track idx
575  std::map<size_t, art::Ptr<recob::Vertex>> frontVtxs; // front vertex ptr for each track index
576 
577  if (fPmaTrackerConfig.RunVertexing()) // save vertices and vtx-trk assns
578  {
579  double xyz[3];
580  for (auto const& v : vsel) {
581  xyz[0] = v.first.X();
582  xyz[1] = v.first.Y();
583  xyz[2] = v.first.Z();
584  mf::LogVerbatim("Summary") << " vtx:" << xyz[0] << ":" << xyz[1] << ":" << xyz[2]
585  << " (" << v.second.size() << " tracks)";
586 
587  size_t vidx = vtxs->size();
588  vtxs->push_back(recob::Vertex(xyz, vidx));
589 
590  auto const vptr = make_vtxptr(vidx);
591  if (!v.second.empty()) {
592  for (const auto& vEntry : v.second) {
593  size_t tidx = vEntry.first;
594  bool isFront = vEntry.second;
595 
596  if (isFront) frontVtxs[tidx] = vptr; // keep ptr of the front vtx
597 
598  auto const tptr = make_trkptr(tidx);
599  vtx2trk->addSingle(vptr, tptr);
600  }
601  }
602  else
603  mf::LogWarning("PMAlgTrackMaker") << "No tracks found at this vertex.";
604  }
605  mf::LogVerbatim("Summary") << vtxs->size() << " vertices ready";
606 
607  for (auto const& k : ksel) {
608  xyz[0] = k.first.X();
609  xyz[1] = k.first.Y();
610  xyz[2] = k.first.Z();
611  mf::LogVerbatim("Summary") << " kink:" << xyz[0] << ":" << xyz[1] << ":" << xyz[2];
612 
613  size_t kidx = kinks->size();
614  size_t tidx = k.second; // track idx on which this kink was found
615 
616  kinks->push_back(
617  recob::Vertex(xyz, tidx)); // save index of track (will have color of trk in evd)
618 
619  auto const tptr = make_trkptr(tidx);
620  auto const kptr = make_kinkptr(kidx);
621  trk2kink->addSingle(tptr, kptr);
622  }
623  mf::LogVerbatim("Summary") << ksel.size() << " kinks ready";
624  }
625 
626  if (fSavePmaNodes) {
627  double xyz[3];
628  for (size_t t = 0; t < result.size(); ++t) {
629  auto const& trk = *(result[t].Track());
630  for (auto const* node : trk.Nodes()) {
631  xyz[0] = node->Point3D().X();
632  xyz[1] = node->Point3D().Y();
633  xyz[2] = node->Point3D().Z();
634  nodes->push_back(recob::Vertex(xyz, t));
635  }
636  }
637  }
638 
639  for (size_t t = 0; t < result.size(); ++t) {
640  size_t parentIdx = recob::PFParticle::kPFParticlePrimary;
641  if (result[t].Parent() >= 0) parentIdx = (size_t)result[t].Parent();
642 
643  std::vector<size_t> daughterIdxs;
644  for (size_t idx : result[t].Daughters()) {
645  daughterIdxs.push_back(idx);
646  }
647 
648  size_t pfpidx = pfps->size();
649  pfps->emplace_back((*tracks)[t].ParticleId(), pfpidx, parentIdx, daughterIdxs);
650 
651  auto const pfpptr = make_pfpptr(pfpidx);
652  auto const tptr = make_trkptr(t);
653  pfp2trk->addSingle(pfpptr, tptr);
654 
655  // add assns to FRONT vertex of each particle
657  art::Ptr<recob::Vertex> vptr = frontVtxs[t];
658  if (!vptr.isNull())
659  pfp2vtx->addSingle(pfpptr, vptr);
660  else
661  mf::LogWarning("PMAlgTrackMaker") << "Front vertex for PFParticle is missing.";
662  }
663  }
664  mf::LogVerbatim("Summary") << pfps->size()
665  << " PFParticles created for reconstructed tracks.";
666  mf::LogVerbatim("Summary") << "Adding " << result.parents().size() << " primary PFParticles.";
667  for (size_t t = 0; t < result.parents().size(); ++t) {
668  std::vector<size_t> daughterIdxs;
669  for (size_t idx : result.parents()[t].Daughters()) {
670  daughterIdxs.push_back(idx);
671  }
672 
673  size_t pfpidx = pfps->size();
674  size_t parentIdx = recob::PFParticle::kPFParticlePrimary;
675  pfps->emplace_back(0, pfpidx, parentIdx, daughterIdxs);
676 
677  // add assns to END vertex of primary
678  if (fPmaTrackerConfig.RunVertexing() && !daughterIdxs.empty()) {
679  auto const pfpptr = make_pfpptr(pfpidx);
681  frontVtxs[daughterIdxs.front()]; // same vertex for all daughters
682  if (!vptr.isNull())
683  pfp2vtx->addSingle(pfpptr, vptr);
684  else
685  mf::LogWarning("PMAlgTrackMaker") << "Front vertex for PFParticle is missing.";
686  }
687  }
688  mf::LogVerbatim("Summary") << pfps->size() << " PFParticles created in total.";
689  }
690 
691  // for (const auto & ct : *cosmicTags) { std::cout << "Cosmic tag: " << ct << std::endl; }
692 
693  evt.put(std::move(tracks));
694  evt.put(std::move(allsp));
695  evt.put(std::move(vtxs));
696  evt.put(std::move(kinks), kKinksName);
697  evt.put(std::move(nodes), kNodesName);
698  evt.put(std::move(t0s));
699  evt.put(std::move(cosmicTags));
700 
701  evt.put(std::move(trk2hit_oldway)); // ****** REMEMBER to remove when FindMany improved ******
702  evt.put(std::move(trk2hit));
703  evt.put(std::move(trk2sp));
704  evt.put(std::move(trk2t0));
705  evt.put(std::move(trk2ct));
706 
707  evt.put(std::move(sp2hit));
708  evt.put(std::move(vtx2trk));
709  evt.put(std::move(trk2kink), kKinksName);
710 
711  evt.put(std::move(pfps));
712  evt.put(std::move(pfp2clu));
713  evt.put(std::move(pfp2vtx));
714  evt.put(std::move(pfp2trk));
715  }
bool SelectHits(float fraction=1.0F)
MaybeLogger_< ELseverityLevel::ELsev_info, true > LogVerbatim
static const std::string kKinksName
recob::Track convertFrom(const pma::Track3D &src, unsigned int tidx, int pdg=0)
static constexpr size_t kPFParticlePrimary
Define index to signify primary particle.
Definition: PFParticle.h:57
Planes which measure V.
Definition: geo_types.h:136
bool IsEnabled() const noexcept
Definition: PmaHit3D.h:86
Planes which measure X direction.
Definition: geo_types.h:140
constexpr auto abs(T v)
Returns the absolute value of the argument.
TVector3 const & Point3D() const
Definition: PmaHit3D.h:50
Planes which measure Z direction.
Definition: geo_types.h:138
Data related to recob::Hit associated with recob::Track.The purpose is to collect several variables t...
Definition: TrackHitMeta.h:43
fhicl::Atom< bool > RunVertexing
Definition: T0.h:16
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Planes which measure Y direction.
Definition: geo_types.h:139
std::vector< anab::CosmicTagID_t > getCosmicTag(const pma::Track3D::ETag pmaTag) const
geo::GeometryCore const * fGeom
TPCGeo const & TPC(TPCID const &tpcid=tpc_zero) const
Returns the specified TPC.
Definition: GeometryCore.h:722
Planes which measure U.
Definition: geo_types.h:135
double GetT0() const
Definition: PmaTrack3D.h:257
pma::PMAlgStitching::Config fPmaStitchConfig
pma::ProjectionMatchingAlg::Config fPmaConfig
void push_back(Ptr< U > const &p)
Definition: PtrVector.h:435
bool HasTagFlag(ETag value) const noexcept
Definition: PmaTrack3D.h:67
pma::PMAlgVertexing::Config fPmaVtxConfig
bool isNull() const noexcept
Definition: Ptr.h:211
unsigned int FrontTPC() const
Definition: PmaTrack3D.h:118
unsigned int FrontCryo() const
Definition: PmaTrack3D.h:119
The data type to uniquely identify a TPC.
Definition: geo_types.h:381
pma::PMAlgCosmicTagger::Config fPmaTaggingConfig
ETag GetTag() const noexcept
Definition: PmaTrack3D.h:66
size_type size() const
Definition: PtrVector.h:302
size_t CompleteMissingWires(detinfo::DetectorPropertiesData const &detProp, unsigned int view)
void push_back(pma::Hit3D *hit)
Definition: PmaTrack3D.h:77
bool CreateAssn(art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t index=UINT_MAX)
Creates a single one-to-one association.
std::map< size_t, std::vector< double > > dedx_map
Definition: Utilities.h:36
fhicl::Atom< float > TrackLikeThreshold
double GetRawdEdxSequence(std::map< size_t, std::vector< double >> &dedx, unsigned int view=geo::kZ, unsigned int skip=0, bool inclDisabled=false) const
double Dx() const noexcept
Definition: PmaHit3D.h:69
bool HasT0() const noexcept
Definition: PmaTrack3D.h:260
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
art::Ptr< recob::Hit > const & Hit2DPtr() const
Definition: PmaHit3D.h:48
std::vector< TH1F * > fAdcInRejectedPoints
boost::graph_traits< ModuleGraph >::vertex_descriptor Vertex
Definition: ModuleGraph.h:25
TrackCollectionProxyElement< TrackCollProxy > Track
Proxy to an element of a proxy collection of recob::Track objects.
Definition: Track.h:992
std::vector< pma::Node3D * > const & Nodes() const noexcept
Definition: PmaTrack3D.h:274
pma::PMAlgTracker::Config fPmaTrackerConfig
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:46
TCEvent evt
Definition: DataStructs.cxx:8
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:306
size_t size() const
Definition: PmaTrack3D.h:89
void clear()
Definition: PtrVector.h:533
Definition: fwd.h:26
std::vector< TH1F * > fAdcInPassingPoints
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
static const std::string kNodesName
void art::Modifier::registerProducts ( ProductDescriptions productsToRegister)
inherited

Definition at line 16 of file Modifier.cc.

References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().

17  {
18  ProductRegistryHelper::registerProducts(productsToRegister,
20  }
void registerProducts(ProductDescriptions &productsToRegister, ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
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)

Member Data Documentation

std::vector<TH1F*> trkf::PMAlgTrackMaker::fAdcInPassingPoints
private

Definition at line 160 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

std::vector<TH1F*> trkf::PMAlgTrackMaker::fAdcInRejectedPoints
private

Definition at line 160 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

art::InputTag trkf::PMAlgTrackMaker::fCluModuleLabel
private

Definition at line 140 of file PMAlgTrackMaker_module.cc.

Referenced by getPdgFromCnnOnHits(), init(), PMAlgTrackMaker(), and produce().

art::InputTag trkf::PMAlgTrackMaker::fEmModuleLabel
private

Definition at line 141 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

geo::GeometryCore const* trkf::PMAlgTrackMaker::fGeom
private

Definition at line 157 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

art::InputTag trkf::PMAlgTrackMaker::fHitModuleLabel
private

Definition at line 138 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

pma::ProjectionMatchingAlg::Config trkf::PMAlgTrackMaker::fPmaConfig
private

Definition at line 143 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

pma::PMAlgStitching::Config trkf::PMAlgTrackMaker::fPmaStitchConfig
private

Definition at line 147 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

pma::PMAlgCosmicTagger::Config trkf::PMAlgTrackMaker::fPmaTaggingConfig
private

Definition at line 145 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

pma::PMAlgTracker::Config trkf::PMAlgTrackMaker::fPmaTrackerConfig
private

Definition at line 144 of file PMAlgTrackMaker_module.cc.

Referenced by getPdgFromCnnOnHits(), PMAlgTrackMaker(), and produce().

pma::PMAlgVertexing::Config trkf::PMAlgTrackMaker::fPmaVtxConfig
private

Definition at line 146 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

bool trkf::PMAlgTrackMaker::fSaveOnlyBranchingVtx
private

Definition at line 149 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

bool trkf::PMAlgTrackMaker::fSavePmaNodes
private

Definition at line 150 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

art::InputTag trkf::PMAlgTrackMaker::fWireModuleLabel
private

Definition at line 139 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

const std::string trkf::PMAlgTrackMaker::kKinksName = "kink"
staticprivate

Definition at line 153 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

const std::string trkf::PMAlgTrackMaker::kNodesName = "node"
staticprivate

Definition at line 154 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().


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