LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
trkf::PMAlgTrackMaker Class Reference
Inheritance diagram for trkf::PMAlgTrackMaker:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Classes

struct  Config
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 
using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::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 produce (art::Event &e) override
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

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

Private Member Functions

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 77 of file PMAlgTrackMaker_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

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

Definition at line 187 of file PMAlgTrackMaker_module.cc.

References fAdcInPassingPoints, fAdcInRejectedPoints, fGeom, fPmaTrackerConfig, kKinksName, kNodesName, art::TFileDirectory::make(), geo::GeometryCore::MaxPlanes(), and pma::PMAlgTracker::Config::Validation.

187  :
188  fHitModuleLabel(config().HitModuleLabel()),
189  fWireModuleLabel(config().WireModuleLabel()),
190  fCluModuleLabel(config().ClusterModuleLabel()),
191  fEmModuleLabel(config().EmClusterModuleLabel()),
192 
193  fPmaConfig(config().ProjectionMatchingAlg()),
194  fPmaTrackerConfig(config().PMAlgTracking()),
195  fPmaTaggingConfig(config().PMAlgCosmicTagging()),
196  fPmaVtxConfig(config().PMAlgVertexing()),
197  fPmaStitchConfig(config().PMAlgStitching()),
198 
199  fSaveOnlyBranchingVtx(config().SaveOnlyBranchingVtx()),
200  fSavePmaNodes(config().SavePmaNodes()),
201 
203 {
204  produces< std::vector<recob::Track> >();
205  produces< std::vector<recob::SpacePoint> >();
206  produces< std::vector<recob::Vertex> >(); // no instance name for interaction vertices
207  produces< std::vector<recob::Vertex> >(kKinksName); // collection of kinks on tracks
208  produces< std::vector<recob::Vertex> >(kNodesName); // collection of pma nodes
209  produces< std::vector<anab::T0> >();
210  produces< std::vector<anab::CosmicTag> >(); // Cosmic ray tags
211 
212  produces< art::Assns<recob::Track, recob::Hit> >(); // ****** REMEMBER to remove when FindMany improved ******
213  produces< art::Assns<recob::Track, recob::Hit, recob::TrackHitMeta> >();
214 
215  produces< art::Assns<recob::Track, recob::SpacePoint> >();
216  produces< art::Assns<recob::SpacePoint, recob::Hit> >();
217  produces< art::Assns<recob::Vertex, recob::Track> >(); // no instance name for assns of tracks to interaction vertices
218  produces< art::Assns<recob::Track, recob::Vertex> >(kKinksName); // assns of kinks to tracks
219  produces< art::Assns<recob::Track, anab::T0> >();
220  produces< art::Assns<recob::Track, anab::CosmicTag> >(); // Cosmic ray tags associated to tracks
221 
222  produces< std::vector<recob::PFParticle> >();
223  produces< art::Assns<recob::PFParticle, recob::Cluster> >();
224  produces< art::Assns<recob::PFParticle, recob::Vertex> >();
225  produces< art::Assns<recob::PFParticle, recob::Track> >();
226 
227  if (fPmaTrackerConfig.Validation() == "calib") // create histograms only in the calibration mode
228  {
230  for (size_t p = 0; p < fGeom->MaxPlanes(); ++p)
231  {
232  std::ostringstream ss1; ss1 << "adc_plane_" << p ;
233  fAdcInPassingPoints.push_back( tfs->make<TH1F>((ss1.str() + "_passing").c_str(), "max adc around the point on track", 100., 0., 5.) );
234  fAdcInRejectedPoints.push_back( tfs->make<TH1F>((ss1.str() + "_rejected").c_str(), "max adc around spurious point ", 100., 0., 5.) );
235  }
236  }
237 }
static const std::string kKinksName
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.
std::vector< TH1F * > fAdcInRejectedPoints
pma::ProjectionMatchingAlg::Config fPmaConfig
pma::PMAlgVertexing::Config fPmaVtxConfig
pma::PMAlgCosmicTagger::Config fPmaTaggingConfig
T * make(ARGS...args) const
std::vector< TH1F * > fAdcInPassingPoints
pma::PMAlgTracker::Config fPmaTrackerConfig
static const std::string kNodesName
trkf::PMAlgTrackMaker::PMAlgTrackMaker ( PMAlgTrackMaker const &  )
delete
trkf::PMAlgTrackMaker::PMAlgTrackMaker ( PMAlgTrackMaker &&  )
delete

Member Function Documentation

template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 147 of file Consumer.h.

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

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

Definition at line 162 of file Consumer.h.

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

Definition at line 172 of file Consumer.h.

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

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

Definition at line 32 of file EngineCreator.cc.

References art::EngineCreator::rng().

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

Definition at line 40 of file EngineCreator.cc.

References art::EngineCreator::rng().

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

Definition at line 120 of file EDProducer.cc.

References art::EDProducer::current_context_.

121  {
122  return current_context_.get();
123  }
CPC_exempt_ptr current_context_
Definition: EDProducer.h:116
EngineCreator::seed_t EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited

Definition at line 49 of file EngineCreator.cc.

References fhicl::ParameterSet::get().

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

52 {
53  auto const& explicit_seeds = pset.get<std::vector<int>>(key, {});
54  return explicit_seeds.empty() ? implicit_seed : explicit_seeds.front();
55 }
std::vector< anab::CosmicTagID_t > trkf::PMAlgTrackMaker::getCosmicTag ( const pma::Track3D::ETag  pmaTag) const
private

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

307 {
308  std::vector<anab::CosmicTagID_t> anabTags;
309 
313  if (pmaTag & pma::Track3D::kGeometry_XX) { anabTags.push_back(anab::CosmicTagID_t::kGeometry_XX); }
314  if (pmaTag & pma::Track3D::kGeometry_YY) { anabTags.push_back(anab::CosmicTagID_t::kGeometry_YY); }
315  if (pmaTag & pma::Track3D::kGeometry_ZZ) { anabTags.push_back(anab::CosmicTagID_t::kGeometry_ZZ); }
316  if (pmaTag & pma::Track3D::kGeometry_YZ) { anabTags.push_back(anab::CosmicTagID_t::kGeometry_YZ); }
317  if (pmaTag & pma::Track3D::kGeometry_Y) { anabTags.push_back(anab::CosmicTagID_t::kGeometry_Y); }
318 
319  if (anabTags.empty()) { anabTags.push_back(anab::CosmicTagID_t::kUnknown); }
320 
321  return anabTags;
322 }
Unknown view.
Definition: geo_types.h:83
template<size_t N>
int trkf::PMAlgTrackMaker::getPdgFromCnnOnHits ( const art::Event evt,
const pma::Track3D trk 
) const
private

Definition at line 241 of file PMAlgTrackMaker_module.cc.

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

242 {
243  int pdg = 0;
245  {
247  if (hitResults)
248  {
249  int trkLikeIdx = hitResults->getIndex("track");
250  int emLikeIdx = hitResults->getIndex("em");
251  if ((trkLikeIdx < 0) || (emLikeIdx < 0))
252  {
253  throw cet::exception("PMAlgTrackMaker") << "No em/track labeled columns in MVA data products." << std::endl;
254  }
255 
256  size_t nh[3] = { 0, 0, 0 };
257  for (size_t hidx = 0; hidx < trk.size(); ++hidx) { ++nh[trk[hidx]->View2D()]; }
258 
259  size_t best_view = 2; // collection
260  if ((nh[0] >= nh[1]) && (nh[0] > 1.25 * nh[2])) best_view = 0; // ind1
261  if ((nh[1] >= nh[0]) && (nh[1] > 1.25 * nh[2])) best_view = 1; // ind2
262 
263  std::vector< art::Ptr<recob::Hit> > trkHitPtrList;
264  trkHitPtrList.reserve(nh[best_view]);
265  for (size_t hidx = 0; hidx < trk.size(); ++hidx)
266  {
267  if (trk[hidx]->View2D() == best_view) { trkHitPtrList.emplace_back(trk[hidx]->Hit2DPtr()); }
268  }
269  auto vout = hitResults->getOutput(trkHitPtrList);
270  double trk_like = -1, trk_or_em = vout[trkLikeIdx] + vout[emLikeIdx];
271  if (trk_or_em > 0)
272  {
273  trk_like = vout[trkLikeIdx] / trk_or_em;
274  if (trk_like < fPmaTrackerConfig.TrackLikeThreshold()) pdg = 11; // tag if EM-like
275  // (don't set pdg for track-like, for the moment don't like the idea of using "13")
276  }
277  //std::cout << "trk:" << best_view << ":" << trk.size() << ":" << trkHitPtrList.size() << " p=" << trk_like << std::endl;
278  }
279  }
280  return pdg;
281 }
fhicl::Atom< float > TrackLikeThreshold
pma::PMAlgTracker::Config fPmaTrackerConfig
size_t size() const
Definition: PmaTrack3D.h:76
static std::unique_ptr< MVAReader > create(const art::Event &evt, const art::InputTag &tag)
Definition: MVAReader.h:110
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References B, and art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
Int_t B
Definition: plot.C:25
template<size_t N>
bool trkf::PMAlgTrackMaker::init ( const art::Event evt,
pma::PMAlgTracker pmalgTracker 
) const
private

Definition at line 284 of file PMAlgTrackMaker_module.cc.

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

285 {
287  if (!cluResults) { return false; }
288 
289  int trkLikeIdx = cluResults->getIndex("track");
290  int emLikeIdx = cluResults->getIndex("em");
291  if ((trkLikeIdx < 0) || (emLikeIdx < 0)) { return false; }
292 
293  const art::FindManyP< recob::Hit > hitsFromClusters(cluResults->dataHandle(), evt, cluResults->dataTag());
294  const auto & cnnOuts = cluResults->outputs();
295  std::vector< float > trackLike(cnnOuts.size());
296  for (size_t i = 0; i < cnnOuts.size(); ++i)
297  {
298  double trkOrEm = cnnOuts[i][trkLikeIdx] + cnnOuts[i][emLikeIdx];
299  if (trkOrEm > 0) { trackLike[i] = cnnOuts[i][trkLikeIdx] / trkOrEm; }
300  else { trackLike[i] = 0; }
301  }
302  pmalgTracker.init(hitsFromClusters, trackLike);
303  return true;
304 }
void init(const art::FindManyP< recob::Hit > &hitsFromClusters)
TCEvent evt
Definition: DataStructs.cxx:5
static std::unique_ptr< MVAReader > create(const art::Event &evt, const art::InputTag &tag)
Definition: MVAReader.h:110
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 190 of file Consumer.h.

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

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

Definition at line 205 of file Consumer.h.

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

Definition at line 215 of file Consumer.h.

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

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

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID().

41  {
42  return true;
43  }
PMAlgTrackMaker& trkf::PMAlgTrackMaker::operator= ( PMAlgTrackMaker const &  )
delete
PMAlgTrackMaker& trkf::PMAlgTrackMaker::operator= ( PMAlgTrackMaker &&  )
delete
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited

Definition at line 89 of file Consumer.cc.

References fhicl::ParameterSet::get_if_present().

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

90 {
91  if (!moduleContext_)
92  return;
93 
94  pset.get_if_present("errorOnMissingConsumes", requireConsumes_);
95  for (auto& consumablesPerBranch : consumables_) {
96  cet::sort_all(consumablesPerBranch);
97  }
98 }
bool requireConsumes_
Definition: Consumer.h:137
ConsumableProducts consumables_
Definition: Consumer.h:138
bool moduleContext_
Definition: Consumer.h:136
void trkf::PMAlgTrackMaker::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 324 of file PMAlgTrackMaker_module.cc.

References 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::DataViewImpl::getValidHandle(), geo::TPCGeo::HasPlane(), 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, nodes, 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::GeometryCore::TPC(), and pma::PMAlgTracker::Config::TrackLikeThreshold.

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

Definition at line 125 of file Consumer.cc.

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

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

Definition at line 101 of file Consumer.cc.

References art::errors::ProductRegistrationFailure.

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

Member Data Documentation

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

Definition at line 180 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 180 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 160 of file PMAlgTrackMaker_module.cc.

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

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

Definition at line 161 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

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

Definition at line 177 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 158 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

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

Definition at line 163 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

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

Definition at line 167 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

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

Definition at line 165 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

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

Definition at line 164 of file PMAlgTrackMaker_module.cc.

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

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

Definition at line 166 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

bool trkf::PMAlgTrackMaker::fSaveOnlyBranchingVtx
private

Definition at line 169 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

bool trkf::PMAlgTrackMaker::fSavePmaNodes
private

Definition at line 170 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

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

Definition at line 159 of file PMAlgTrackMaker_module.cc.

Referenced by produce().

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

Definition at line 173 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().

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

Definition at line 174 of file PMAlgTrackMaker_module.cc.

Referenced by PMAlgTrackMaker(), and produce().


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