LArSoft  v10_04_05
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 72 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 168 of file PMAlgTrackMaker_module.cc.

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

169  : EDProducer{config}
170  , fHitModuleLabel(config().HitModuleLabel())
171  , fWireModuleLabel(config().WireModuleLabel())
172  , fCluModuleLabel(config().ClusterModuleLabel())
173  , fEmModuleLabel(config().EmClusterModuleLabel())
174  , fPmaConfig(config().ProjectionMatchingAlg())
175  , fPmaTrackerConfig(config().PMAlgTracking())
176  , fPmaTaggingConfig(config().PMAlgCosmicTagging())
177  , fPmaVtxConfig(config().PMAlgVertexing())
178  , fPmaStitchConfig(config().PMAlgStitching())
179  , fSaveOnlyBranchingVtx(config().SaveOnlyBranchingVtx())
180  , fSavePmaNodes(config().SavePmaNodes())
182  {
183  produces<std::vector<recob::Track>>();
184  produces<std::vector<recob::SpacePoint>>();
185  produces<std::vector<recob::Vertex>>(); // no instance name for interaction vertices
186  produces<std::vector<recob::Vertex>>(kKinksName); // collection of kinks on tracks
187  produces<std::vector<recob::Vertex>>(kNodesName); // collection of pma nodes
188  produces<std::vector<anab::T0>>();
189  produces<std::vector<anab::CosmicTag>>(); // Cosmic ray tags
190 
192  recob::Hit>>(); // ****** REMEMBER to remove when FindMany improved ******
193  produces<art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta>>();
194 
195  produces<art::Assns<recob::Track, recob::SpacePoint>>();
196  produces<art::Assns<recob::SpacePoint, recob::Hit>>();
197  produces<
199  recob::Track>>(); // no instance name for assns of tracks to interaction vertices
200  produces<art::Assns<recob::Track, recob::Vertex>>(kKinksName); // assns of kinks to tracks
201  produces<art::Assns<recob::Track, anab::T0>>();
202  produces<art::Assns<recob::Track, anab::CosmicTag>>(); // Cosmic ray tags associated to tracks
203 
204  produces<std::vector<recob::PFParticle>>();
205  produces<art::Assns<recob::PFParticle, recob::Cluster>>();
206  produces<art::Assns<recob::PFParticle, recob::Vertex>>();
207  produces<art::Assns<recob::PFParticle, recob::Track>>();
208 
209  if (fPmaTrackerConfig.Validation() == "calib") // create histograms only in the calibration mode
210  {
212  auto const& wireReadoutGeom = art::ServiceHandle<geo::WireReadout>()->Get();
213  for (size_t p = 0; p < wireReadoutGeom.MaxPlanes(); ++p) {
214  std::ostringstream ss1;
215  ss1 << "adc_plane_" << p;
216  fAdcInPassingPoints.push_back(tfs->make<TH1F>(
217  (ss1.str() + "_passing").c_str(), "max adc around the point on track", 100., 0., 5.));
218  fAdcInRejectedPoints.push_back(tfs->make<TH1F>(
219  (ss1.str() + "_rejected").c_str(), "max adc around spurious point ", 100., 0., 5.));
220  }
221  }
222  }
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
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
Definition: AddMC.C:8
geo::GeometryCore const * fGeom
pma::PMAlgStitching::Config fPmaStitchConfig
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 293 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().

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

Definition at line 226 of file PMAlgTrackMaker_module.cc.

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

227  {
228  int pdg = 0;
231  if (hitResults) {
232  int trkLikeIdx = hitResults->getIndex("track");
233  int emLikeIdx = hitResults->getIndex("em");
234  if ((trkLikeIdx < 0) || (emLikeIdx < 0)) {
235  throw cet::exception("PMAlgTrackMaker")
236  << "No em/track labeled columns in MVA data products." << std::endl;
237  }
238 
239  size_t nh[3] = {0, 0, 0};
240  for (size_t hidx = 0; hidx < trk.size(); ++hidx) {
241  ++nh[trk[hidx]->View2D()];
242  }
243 
244  size_t best_view = 2; // collection
245  if ((nh[0] >= nh[1]) && (nh[0] > 1.25 * nh[2])) best_view = 0; // ind1
246  if ((nh[1] >= nh[0]) && (nh[1] > 1.25 * nh[2])) best_view = 1; // ind2
247 
248  std::vector<art::Ptr<recob::Hit>> trkHitPtrList;
249  trkHitPtrList.reserve(nh[best_view]);
250  for (size_t hidx = 0; hidx < trk.size(); ++hidx) {
251  if (trk[hidx]->View2D() == best_view) {
252  trkHitPtrList.emplace_back(trk[hidx]->Hit2DPtr());
253  }
254  }
255  auto vout = hitResults->getOutput(trkHitPtrList);
256  double trk_like = -1, trk_or_em = vout[trkLikeIdx] + vout[emLikeIdx];
257  if (trk_or_em > 0) {
258  trk_like = vout[trkLikeIdx] / trk_or_em;
259  if (trk_like < fPmaTrackerConfig.TrackLikeThreshold()) pdg = 11; // tag if EM-like
260  // (don't set pdg for track-like, for the moment don't like the idea of using "13")
261  }
262  //std::cout << "trk:" << best_view << ":" << trk.size() << ":" << trkHitPtrList.size() << " p=" << trk_like << std::endl;
263  }
264  }
265  return pdg;
266  }
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 269 of file PMAlgTrackMaker_module.cc.

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

270  {
272  if (!cluResults) { return false; }
273 
274  int trkLikeIdx = cluResults->getIndex("track");
275  int emLikeIdx = cluResults->getIndex("em");
276  if ((trkLikeIdx < 0) || (emLikeIdx < 0)) { return false; }
277 
278  const art::FindManyP<recob::Hit> hitsFromClusters(
279  cluResults->dataHandle(), evt, cluResults->dataTag());
280  const auto& cnnOuts = cluResults->outputs();
281  std::vector<float> trackLike(cnnOuts.size());
282  for (size_t i = 0; i < cnnOuts.size(); ++i) {
283  double trkOrEm = cnnOuts[i][trkLikeIdx] + cnnOuts[i][emLikeIdx];
284  if (trkOrEm > 0) { trackLike[i] = cnnOuts[i][trkLikeIdx] / trkOrEm; }
285  else {
286  trackLike[i] = 0;
287  }
288  }
289  pmalgTracker.init(hitsFromClusters, trackLike);
290  return true;
291  }
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 328 of file PMAlgTrackMaker_module.cc.

References art::PtrVector< T >::clear(), pma::Track3D::CompleteMissingWires(), pma::convertFrom(), util::CreateAssn(), DEFINE_ART_MODULE, geo::TPCGeo::DriftAxisWithSign(), pma::Hit3D::Dx(), e, tca::evt, fAdcInPassingPoints, fAdcInRejectedPoints, fCluModuleLabel, fEmModuleLabel, fHitModuleLabel, art::fill_ptr_vector(), fPmaConfig, fPmaStitchConfig, fPmaTaggingConfig, fPmaTrackerConfig, fPmaVtxConfig, pma::Track3D::FrontCryo(), pma::Track3D::FrontTPC(), fSaveOnlyBranchingVtx, fSavePmaNodes, fWireModuleLabel, Get, getCosmicTag(), pma::Track3D::GetRawdEdxSequence(), pma::Track3D::GetT0(), pma::Track3D::GetTag(), art::ProductRetriever::getValidHandle(), pma::Track3D::HasT0(), pma::Track3D::HasTagFlag(), pma::Hit3D::Hit2DPtr(), geo::TPCGeo::ID(), 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(), pma::Track3D::size(), art::PtrVector< T >::size(), geo::to_int(), geo::GeometryCore::TPC(), and pma::PMAlgTracker::Config::TrackLikeThreshold.

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

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 161 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 141 of file PMAlgTrackMaker_module.cc.

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

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

Definition at line 142 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 158 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker().

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

Definition at line 139 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 144 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 148 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 146 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 145 of file PMAlgTrackMaker_module.cc.

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

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

Definition at line 147 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

bool trkf::PMAlgTrackMaker::fSaveOnlyBranchingVtx
private

Definition at line 150 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

bool trkf::PMAlgTrackMaker::fSavePmaNodes
private

Definition at line 151 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 140 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 154 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 155 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().


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