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

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 ShowerReco3D (fhicl::ParameterSet const &p)
 
 ShowerReco3D (ShowerReco3D const &)=delete
 
 ShowerReco3D (ShowerReco3D &&)=delete
 
ShowerReco3Doperator= (ShowerReco3D const &)=delete
 
ShowerReco3Doperator= (ShowerReco3D &&)=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 Attributes

bool fUsePFParticle
 
std::string fInputProducer
 
::showerreco::ShowerRecoManager fManager
 
::showerreco::ShowerRecoAlgfShowerAlgo
 
::calo::CalorimetryAlgfCaloAlgo
 
::cmtool::CPAlgoArrayfCPAlgoArray
 
::cmtool::CPAlgoNHitsfCPAlgoNHits
 
::cmtool::CPAlgoIgnoreTracksfCPAlgoIgnoreTracks
 
::cmtool::CFAlgoTimeOverlapfCFAlgoTimeOverlap
 

Detailed Description

Definition at line 43 of file ShowerReco3D_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

ShowerReco3D::ShowerReco3D ( fhicl::ParameterSet const &  p)
explicit

Definition at line 73 of file ShowerReco3D_module.cc.

References cmtool::CPAlgoArray::AddAlgo(), cmtool::CMatchManager::AddMatchAlgo(), cmtool::CMManagerBase::AddPriorityAlgo(), showerreco::ShowerRecoManager::Algo(), showerreco::ShowerRecoAlgBase::CaloAlgo(), fCaloAlgo, fCFAlgoTimeOverlap, fCPAlgoArray, fCPAlgoIgnoreTracks, fCPAlgoNHits, fInputProducer, fManager, fShowerAlgo, fUsePFParticle, fhicl::ParameterSet::get(), showerreco::ShowerRecoManager::MatchManager(), showerreco::ShowerRecoAlg::setEcorrection(), cmtool::CPAlgoNHits::SetMinHits(), showerreco::ShowerRecoAlg::SetUseArea(), and showerreco::ShowerRecoAlgBase::Verbose().

74 {
75  fInputProducer = p.get<std::string>("InputProducer");
76  fUsePFParticle = p.get<bool>("UsePFParticle");
77  produces< std::vector<recob::Shower> >();
78  produces< art::Assns<recob::Shower,recob::Cluster> >();
79  produces< art::Assns<recob::Shower,recob::Hit> >();
80  if(fUsePFParticle)
81  produces< art::Assns<recob::PFParticle,recob::Shower> >();
82 
83  // Instantiate algorithms
84  fCaloAlgo = new ::calo::CalorimetryAlg(p.get< fhicl::ParameterSet >("CalorimetryAlg"));
85  fShowerAlgo = new ::showerreco::ShowerRecoAlg;
86  fCPAlgoArray = new ::cmtool::CPAlgoArray;
87  fCPAlgoNHits = new ::cmtool::CPAlgoNHits;
88  fCPAlgoIgnoreTracks = new ::cmtool::CPAlgoIgnoreTracks;
89  fCFAlgoTimeOverlap = new ::cmtool::CFAlgoTimeOverlap;
90 
91  // Configure
92  fCPAlgoNHits->SetMinHits(p.get<int>("MinHits"));
93 
96 
99 
100  fShowerAlgo->Verbose(p.get<bool>("Verbosity"));
101  fShowerAlgo->SetUseArea(p.get<bool>("UseArea"));
102  fShowerAlgo->setEcorrection(p.get<bool>("ApplyMCEnergyCorrection"));
103  fShowerAlgo->CaloAlgo(fCaloAlgo);
104 
106 
107 }
void Algo(ShowerRecoAlgBase *alg)
::calo::CalorimetryAlg * fCaloAlgo
::cmtool::CPAlgoArray * fCPAlgoArray
::showerreco::ShowerRecoManager fManager
void AddAlgo(CPriorityAlgoBase *algo)
Setter to add a new algorithm.
Definition: CPAlgoArray.h:63
void SetMinHits(size_t n)
Setter for minimum # hits.
Definition: CPAlgoNHits.h:42
::cmtool::CFAlgoTimeOverlap * fCFAlgoTimeOverlap
void AddMatchAlgo(CFloatAlgoBase *algo)
A simple method to add an algorithm for merging.
Definition: CMatchManager.h:48
void CaloAlgo(::calo::CalorimetryAlg *alg)
Calorimetry algorithm setter.
std::string fInputProducer
void setEcorrection(bool on)
Function to decide if to use ModBox (True) or Birks (False) for calorimetry.
Definition: ShowerRecoAlg.h:48
virtual void Verbose(bool on=true)
Verbosity switch.
void SetUseArea(bool on)
Function to decide if to use Area or Pulse Amplitude for calculations.
Definition: ShowerRecoAlg.h:42
::cmtool::CMatchManager & MatchManager()
::cmtool::CPAlgoIgnoreTracks * fCPAlgoIgnoreTracks
::showerreco::ShowerRecoAlg * fShowerAlgo
::cmtool::CPAlgoNHits * fCPAlgoNHits
void AddPriorityAlgo(CPriorityAlgoBase *algo)
Setter to add an algorithm for priority determination.
Definition: CMManagerBase.h:63
ShowerReco3D::ShowerReco3D ( ShowerReco3D const &  )
delete
ShowerReco3D::ShowerReco3D ( ShowerReco3D &&  )
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 }
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<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  }
ShowerReco3D& ShowerReco3D::operator= ( ShowerReco3D const &  )
delete
ShowerReco3D& ShowerReco3D::operator= ( ShowerReco3D &&  )
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 ShowerReco3D::produce ( art::Event e)
overridevirtual

Implements art::EDProducer.

Definition at line 109 of file ShowerReco3D_module.cc.

References util::CreateAssn(), DEFINE_ART_MODULE, fInputProducer, fManager, fUsePFParticle, util::PxHitConverter::GeneratePxHit(), art::DataViewImpl::getByLabel(), hits(), art::Handle< T >::isValid(), recob::PFParticle::PdgCode(), art::Event::put(), showerreco::ShowerRecoManager::Reconstruct(), and showerreco::ShowerRecoManager::Reset().

110 {
111  //
112  // Create output data product containers
113  //
114  std::unique_ptr<std::vector<recob::Shower> > out_shower_v(new std::vector<recob::Shower>);
115  std::unique_ptr<art::Assns<recob::Shower, recob::Cluster> > sc_assn(new art::Assns<recob::Shower, recob::Cluster>);
116  std::unique_ptr<art::Assns<recob::Shower, recob::Hit> > sh_assn(new art::Assns<recob::Shower, recob::Hit>);
117  std::unique_ptr<art::Assns<recob::PFParticle, recob::Shower> > sp_assn(new art::Assns<recob::PFParticle, recob::Shower>);
118 
119  //
120  // Preparation
121  //
122 
123  // Reset ShowerRecoManager
124  fManager.Reset();
125 
126  // Retrieve input clusters
128  e.getByLabel(fInputProducer,cHandle);
129 
130  if(!cHandle.isValid())
131  throw cet::exception(__FUNCTION__) << "Invalid input cluster label!" << std::endl;
132 
133  // Cluster type conversion: recob::Hit => util::PxHit
134  std::vector<std::vector< ::util::PxHit> > local_clusters;
135  art::FindManyP<recob::Hit> hit_m(cHandle, e, fInputProducer);
137  for(size_t i=0; i<cHandle->size(); ++i) {
138 
139  local_clusters.push_back(std::vector< ::util::PxHit>());
140 
141  const std::vector<art::Ptr<recob::Hit> >& hits = hit_m.at(i);
142 
143  conv.GeneratePxHit(hits, local_clusters.back());
144  }
145 
146  //
147  // Run shower reconstruction
148  //
149  // shower pfparticle index (later used to make an association)
150  std::vector<size_t> shower_pfpart_index;
151  // cluster combination in terms of cluster index (for ShowerRecoManager::Reconstruct)
152  std::vector<std::vector<unsigned int> > matched_pairs;
153  // shower vector container to receive from ShowerRecoManager::Reconstruct
154  std::vector<recob::Shower> shower_v;
155 
156  if(!fUsePFParticle) matched_pairs = fManager.Reconstruct(local_clusters, shower_v);
157 
158  else {
159 
160  // Retrieve PFParticle
162  e.getByLabel(fInputProducer,pfHandle);
163  if(!pfHandle.isValid())
164  throw cet::exception(__FUNCTION__) << "Invalid input PFParticle label!" << std::endl;
165 
166  // Make a cluster ptr => index map to fill matched_pairs
167  std::map<art::Ptr<recob::Cluster>,size_t> cmap;
168  for(size_t i=0; i<cHandle->size(); ++i) {
169 
170  const art::Ptr<recob::Cluster> cptr(cHandle,i);
171 
172  cmap[cptr] = i;
173 
174  }
175  // Now to fill matched_pairs retrieve association of pfpart => cluster(s)
176  art::FindManyP<recob::Cluster> cluster_m(pfHandle, e, fInputProducer);
177 
178  for(size_t i=0; i<pfHandle->size(); ++i) {
179 
180  const art::Ptr<recob::PFParticle> pf(pfHandle,i);
181 
182  if(pf->PdgCode()!=11) continue;
183 
184  const std::vector<art::Ptr<recob::Cluster> >& clusters = cluster_m.at(i);
185 
186  std::vector<unsigned int> one_pair;
187  one_pair.reserve(clusters.size());
188 
189  for(auto const& cptr : clusters) {
190 
191  auto iter = cmap.find(cptr);
192  if(iter == cmap.end())
193  throw cet::exception(__FUNCTION__) << "PFParticle=>Cluster association not valid!" << std::endl;
194 
195  one_pair.push_back((*iter).second);
196  }
197  matched_pairs.push_back(one_pair);
198  shower_pfpart_index.push_back(i);
199  }
200  // Run reconstruction
201  fManager.Reconstruct(local_clusters, matched_pairs, shower_v);
202  }
203 
204  // Make sure output shower vector size is same as expected length
205  if(shower_v.size() != matched_pairs.size())
206  throw cet::exception(__FUNCTION__) << "Logic error: # of matched pairs != # of reco-ed showers!" << std::endl;
207 
208  // Fill output shower vector data container
209  out_shower_v->reserve(shower_v.size());
210 
211  for(size_t i=0; i<shower_v.size(); ++i) {
212 
213  // Set output shower ID
214  shower_v[i].set_id(i);
215 
216  out_shower_v->push_back(shower_v[i]);
217 
218  // Create shower=>cluster association
219  std::vector<art::Ptr<recob::Cluster> > ass_clusters;
220  // Create shower=>hit association
221  std::vector<art::Ptr<recob::Hit> > ass_hits;
222  for(auto const& cindex : matched_pairs[i]) {
223 
224  ass_clusters.push_back( art::Ptr<recob::Cluster>(cHandle,cindex) );
225 
226  const std::vector<art::Ptr<recob::Hit> >& hits = hit_m.at(cindex);
227 
228  for(auto const& ptr : hits) ass_hits.push_back(ptr);
229  }
230  // Shower=>Cluster
231  util::CreateAssn(*this,
232  e,
233  *(out_shower_v.get()),
234  ass_clusters,
235  *(sc_assn.get())
236  );
237  // Shower=>Hits
238  util::CreateAssn(*this,
239  e,
240  *(out_shower_v.get()),
241  ass_hits,
242  *(sh_assn.get())
243  );
244 
245  if(fUsePFParticle) {
246 
248  e.getByLabel(fInputProducer,pfHandle);
249 
250  art::Ptr<recob::PFParticle> pf_ptr(pfHandle,shower_pfpart_index[i]);
251 
252  util::CreateAssn(*this,
253  e,
254  *(out_shower_v.get()),
255  pf_ptr,
256  *(sp_assn.get())
257  );
258  }
259  }
260 
261  // Store in an event record
262  e.put(std::move(out_shower_v));
263  e.put(std::move(sh_assn));
264  e.put(std::move(sc_assn));
265  if(fUsePFParticle)
266  e.put(std::move(sp_assn));
267 
268 }
::showerreco::ShowerRecoManager fManager
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool isValid() const
Definition: Handle.h:190
void hits()
Definition: readHits.C:15
std::string fInputProducer
void GeneratePxHit(const std::vector< unsigned int > &hit_index, const std::vector< art::Ptr< recob::Hit >> hits, std::vector< util::PxHit > &pxhits) const
Generate: from 1 set of hits => 1 set of PxHits using indexes (association)
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.
ClusterAss_t Reconstruct(const std::vector< std::vector< util::PxHit > > &clusters, std::vector< ::recob::Shower > &showers)
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
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

::calo::CalorimetryAlg* ShowerReco3D::fCaloAlgo
private

Definition at line 65 of file ShowerReco3D_module.cc.

Referenced by ShowerReco3D().

::cmtool::CFAlgoTimeOverlap* ShowerReco3D::fCFAlgoTimeOverlap
private

Definition at line 69 of file ShowerReco3D_module.cc.

Referenced by ShowerReco3D().

::cmtool::CPAlgoArray* ShowerReco3D::fCPAlgoArray
private

Definition at line 66 of file ShowerReco3D_module.cc.

Referenced by ShowerReco3D().

::cmtool::CPAlgoIgnoreTracks* ShowerReco3D::fCPAlgoIgnoreTracks
private

Definition at line 68 of file ShowerReco3D_module.cc.

Referenced by ShowerReco3D().

::cmtool::CPAlgoNHits* ShowerReco3D::fCPAlgoNHits
private

Definition at line 67 of file ShowerReco3D_module.cc.

Referenced by ShowerReco3D().

std::string ShowerReco3D::fInputProducer
private

Definition at line 62 of file ShowerReco3D_module.cc.

Referenced by produce(), and ShowerReco3D().

::showerreco::ShowerRecoManager ShowerReco3D::fManager
private

Definition at line 63 of file ShowerReco3D_module.cc.

Referenced by produce(), and ShowerReco3D().

::showerreco::ShowerRecoAlg* ShowerReco3D::fShowerAlgo
private

Definition at line 64 of file ShowerReco3D_module.cc.

Referenced by ShowerReco3D().

bool ShowerReco3D::fUsePFParticle
private

Definition at line 61 of file ShowerReco3D_module.cc.

Referenced by produce(), and ShowerReco3D().


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