LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
simfilter::FilterGenInTime Class Reference
Inheritance diagram for simfilter::FilterGenInTime:
art::EDFilter art::detail::Filter art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Public Types

using ModuleType = EDFilter
 
template<typename UserConfig >
using Table = Modifier::Table< UserConfig >
 

Public Member Functions

 FilterGenInTime (fhicl::ParameterSet const &pset)
 
bool filter (art::Event &)
 
virtual void beginJob ()
 
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 &)
 
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)
 

Static Public Attributes

static constexpr bool Pass {true}
 
static constexpr bool Fail {false}
 

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

bool KeepParticle (simb::MCParticle const &part) const
 

Private Attributes

std::vector< std::array< double, 6 > > fCryostatBoundaries
 boundaries of each cryostat More...
 
double fMinKE
 
bool fKeepOnlyMuons
 
double fMinT
 
double fMaxT
 
bool fSortParticles
 
bool fAlwaysPass
 

Detailed Description

Definition at line 38 of file FilterGenInTime_module.cc.

Member Typedef Documentation

Definition at line 18 of file EDFilter.h.

template<typename UserConfig >
using art::detail::Filter::Table = Modifier::Table<UserConfig>
inherited

Definition at line 32 of file Filter.h.

Constructor & Destructor Documentation

simfilter::FilterGenInTime::FilterGenInTime ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 61 of file FilterGenInTime_module.cc.

References fAlwaysPass, fKeepOnlyMuons, fMaxT, fMinKE, fMinT, and fSortParticles.

62  : EDFilter{pset}
63  , fMinKE(pset.get<double>("MinEnergy", 0.0))
64  , fKeepOnlyMuons(pset.get<bool>("KeepOnlyMuons", false))
65  , fMinT(pset.get<double>("MinT", 0.0))
66  , fMaxT(pset.get<double>("MaxT"))
67  , fSortParticles(pset.get<bool>("SortParticles", false))
68  , fAlwaysPass(pset.get<bool>("AlwaysPass", false))
69  {
70  if (fSortParticles) {
71  produces<std::vector<simb::MCTruth>>("intime");
72  produces<std::vector<simb::MCTruth>>("outtime");
73  }
74  std::cout << "New Filter!\n";
75  }
EDFilter(fhicl::ParameterSet const &pset)
Definition: EDFilter.cc:6

Member Function Documentation

void simfilter::FilterGenInTime::beginJob ( )
virtual

Reimplemented from art::EDFilter.

Definition at line 77 of file FilterGenInTime_module.cc.

References fCryostatBoundaries.

78  {
79  auto const& geom = *art::ServiceHandle<geo::Geometry const>();
80  for (auto const& cryo : geom.Iterate<geo::CryostatGeo>()) {
81  std::array<double, 6> this_cryo_boundaries{};
82  cryo.Boundaries(&this_cryo_boundaries[0]);
83  fCryostatBoundaries.push_back(this_cryo_boundaries);
84  }
85  }
std::vector< std::array< double, 6 > > fCryostatBoundaries
boundaries of each cryostat
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
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::Filter::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 29 of file Filter.cc.

30  {
31  setupQueues(resources);
32  ProcessingFrame const frame{ScheduleID{}};
33  beginJobWithFrame(frame);
34  }
virtual void setupQueues(SharedResources const &)=0
virtual void beginJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Filter::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 72 of file Filter.cc.

References art::RunPrincipal::makeRun(), r, art::RunPrincipal::runID(), and art::ModuleContext::scheduleID().

73  {
74  auto r = rp.makeRun(mc, RangeSet::forRun(rp.runID()));
75  ProcessingFrame const frame{mc.scheduleID()};
76  bool const rc = beginRunWithFrame(r, frame);
77  r.commitProducts();
78  return rc;
79  }
TRandom r
Definition: spectrum.C:23
virtual bool beginRunWithFrame(Run &, ProcessingFrame const &)=0
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
bool art::detail::Filter::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Filter.cc.

References art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::SubRunPrincipal::subRunID().

93  {
94  auto sr = srp.makeSubRun(mc, RangeSet::forSubRun(srp.subRunID()));
95  ProcessingFrame const frame{mc.scheduleID()};
96  bool const rc = beginSubRunWithFrame(sr, frame);
97  sr.commitProducts();
98  return rc;
99  }
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
virtual bool beginSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
void art::detail::Filter::doEndJob ( )
inherited

Definition at line 37 of file Filter.cc.

38  {
39  ProcessingFrame const frame{ScheduleID{}};
40  endJobWithFrame(frame);
41  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Filter::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 82 of file Filter.cc.

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

83  {
84  auto r = rp.makeRun(mc, rp.seenRanges());
85  ProcessingFrame const frame{mc.scheduleID()};
86  bool const rc = endRunWithFrame(r, frame);
87  r.commitProducts();
88  return rc;
89  }
TRandom r
Definition: spectrum.C:23
virtual bool endRunWithFrame(Run &, ProcessingFrame const &)=0
bool art::detail::Filter::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 102 of file Filter.cc.

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

103  {
104  auto sr = srp.makeSubRun(mc, srp.seenRanges());
105  ProcessingFrame const frame{mc.scheduleID()};
106  bool const rc = endSubRunWithFrame(sr, frame);
107  sr.commitProducts();
108  return rc;
109  }
virtual bool endSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
bool art::detail::Filter::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 112 of file Filter.cc.

References e, art::EventPrincipal::makeEvent(), and art::ModuleContext::scheduleID().

117  {
118  auto e = ep.makeEvent(mc);
119  ++counts_run;
120  ProcessingFrame const frame{mc.scheduleID()};
121  bool const rc = filterWithFrame(e, frame);
122  e.commitProducts(checkPutProducts_, &expectedProducts<InEvent>());
123  if (rc) {
124  ++counts_passed;
125  } else {
126  ++counts_failed;
127  }
128  return rc;
129  }
virtual bool filterWithFrame(Event &, ProcessingFrame const &)=0
bool const checkPutProducts_
Definition: Filter.h:75
Float_t e
Definition: plot.C:35
void art::detail::Filter::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 51 of file Filter.cc.

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

Definition at line 65 of file Filter.cc.

66  {
67  ProcessingFrame const frame{ScheduleID{}};
69  }
TFile fb("Li6.root")
virtual void respondToCloseOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
void art::detail::Filter::doRespondToOpenInputFile ( FileBlock const &  fb)
inherited

Definition at line 44 of file Filter.cc.

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

Definition at line 58 of file Filter.cc.

59  {
60  ProcessingFrame const frame{ScheduleID{}};
62  }
TFile fb("Li6.root")
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
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
bool simfilter::FilterGenInTime::filter ( art::Event evt)
virtual

Implements art::EDFilter.

Definition at line 208 of file FilterGenInTime_module.cc.

References util::abs(), simb::MCTruth::Add(), DEFINE_ART_MODULE, simb::MCParticle::E(), fAlwaysPass, fKeepOnlyMuons, fMinKE, fSortParticles, art::ProductRetriever::getMany(), simb::MCTruth::GetParticle(), ipart, KeepParticle(), simb::MCParticle::Mass(), simb::MCTruth::NParticles(), simb::MCParticle::PdgCode(), and art::Event::put().

209  {
210 
211  std::unique_ptr<std::vector<simb::MCTruth>> truthInTimePtr(new std::vector<simb::MCTruth>(1));
212  std::unique_ptr<std::vector<simb::MCTruth>> truthOutOfTimePtr(
213  new std::vector<simb::MCTruth>(1));
214 
215  simb::MCTruth& truthInTime = truthInTimePtr->at(0);
216  simb::MCTruth& truthOutOfTime = truthOutOfTimePtr->at(0);
217 
218  //get the list of particles from this event
220 
221  //std::vector< art::Handle< std::vector<simb::MCTruth> > > allmclists;
222  //evt.getManyByType(allmclists);
223  auto allmclists = evt.getMany<std::vector<simb::MCTruth>>();
224  bool keepEvent = false;
225  for (size_t mcl = 0; mcl < allmclists.size(); ++mcl) {
226  art::Handle<std::vector<simb::MCTruth>> mclistHandle = allmclists[mcl];
227  for (size_t m = 0; m < mclistHandle->size(); ++m) {
228  art::Ptr<simb::MCTruth> mct(mclistHandle, m);
229 
230  for (int ipart = 0; ipart < mct->NParticles(); ipart++) {
231  bool kp = KeepParticle(mct->GetParticle(ipart));
232 
233  if (kp && (!fKeepOnlyMuons || abs(mct->GetParticle(ipart).PdgCode()) == 13) &&
234  mct->GetParticle(ipart).E() - mct->GetParticle(ipart).Mass() > fMinKE) {
235  keepEvent = true;
236  if (!fSortParticles) break;
237  }
238 
239  if (fSortParticles) {
240  simb::MCParticle particle = mct->GetParticle(ipart);
241  if (kp) truthInTime.Add(particle);
242  if (!kp) truthOutOfTime.Add(particle);
243  }
244 
245  } //end loop over particles
246 
247  if (!fSortParticles && keepEvent) break;
248 
249  } //end loop over mctruth col
250 
251  if (!fSortParticles && keepEvent) break;
252 
253  } //end loop over all mctruth lists
254 
255  if (fSortParticles) {
256  evt.put(std::move(truthInTimePtr), "intime");
257  evt.put(std::move(truthOutOfTimePtr), "outtime");
258  }
259 
260  return (keepEvent || fAlwaysPass);
261  }
Int_t ipart
Definition: Style.C:10
constexpr auto abs(T v)
Returns the absolute value of the argument.
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
void Add(simb::MCParticle const &part)
Definition: MCTruth.h:80
bool KeepParticle(simb::MCParticle const &part) const
Event generator information.
Definition: MCTruth.h:32
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const
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
bool simfilter::FilterGenInTime::KeepParticle ( simb::MCParticle const &  part) const
private

Definition at line 87 of file FilterGenInTime_module.cc.

References util::abs(), geo::vect::coord(), e, simb::MCParticle::E(), fCryostatBoundaries, fMaxT, fMinT, simb::MCParticle::Mass(), simb::MCParticle::Momentum(), simb::MCParticle::Position(), and simb::MCParticle::T().

Referenced by filter().

88  {
89  const TLorentzVector& v4 = part.Position();
90  const TLorentzVector& p4 = part.Momentum();
91  // origin of particle
92  double x0[3] = {v4.X(), v4.Y(), v4.Z()};
93  // normalized direction of particle
94  double dx[3] = {
95  p4.Px() / p4.Vect().Mag(), p4.Py() / p4.Vect().Mag(), p4.Pz() / p4.Vect().Mag()};
96 
97  // tolernace for treating number as "zero"
98  double eps = 1e-5;
99 
100  //check to see if particle crosses boundary of any cryostat within appropriate time window
101  std::vector<bool> intersects_cryo(fCryostatBoundaries.size(), false);
102  std::vector<bool> inside_cryo(fCryostatBoundaries.size(), false);
103  std::vector<double> distance_to_cryo(fCryostatBoundaries.size(), 0.);
104 
105  // Check to see if particle intersects any cryostat
106  //
107  // Algorithmically, this is looking for ray-box intersection. This is a common problem in
108  // computer graphics. The algorithm below is taken from "Graphics Gems", Academic Press, 1990
109  for (size_t i_cryo = 0; i_cryo < fCryostatBoundaries.size(); i_cryo++) {
110  auto const& bound = fCryostatBoundaries[i_cryo];
111  std::array<int, 3> quadrant{}; // 0 == RIGHT, 1 == LEFT, 2 == MIDDLE
112  std::array<double, 3> candidatePlane{};
113  std::array<double, 3> coord{};
114 
115  std::array<double, 3> bound_lo = {{bound[0], bound[2], bound[4]}};
116  std::array<double, 3> bound_hi = {{bound[1], bound[3], bound[5]}};
117 
118  // First check if origin is inside box
119  // Also check which of the two planes in each dimmension is the
120  // "candidate" for the ray to hit
121  bool inside = true;
122  for (int i = 0; i < 3; i++) {
123  if (x0[i] < bound_lo[i]) {
124  quadrant[i] = 1; // LEFT
125  candidatePlane[i] = bound_lo[i];
126  inside = false;
127  }
128  else if (x0[i] > bound_hi[i]) {
129  quadrant[i] = 0; // RIGHT
130  candidatePlane[i] = bound_hi[i];
131  inside = false;
132  }
133  else {
134  quadrant[i] = 2; // MIDDLE
135  }
136  }
137 
138  if (inside) {
139  inside_cryo[i_cryo] = true;
140  // if we're inside the cryostat, then we do intersect it
141  intersects_cryo[i_cryo] = true;
142  continue;
143  }
144 
145  // ray origin is outside the box -- calculate the distance to the cryostat and see if it intersects
146 
147  // calculate distances to candidate planes
148  std::array<double, 3> maxT{};
149  for (int i = 0; i < 3; i++) {
150  if (quadrant[i] != 2 /* MIDDLE */ && abs(dx[i]) > eps) {
151  maxT[i] = (candidatePlane[i] - x0[i]) / dx[i];
152  }
153  // if a ray origin is between two the two planes in a dimmension, it would never hit that plane first
154  else {
155  maxT[i] = -1;
156  }
157  }
158 
159  // The plane on the box that the ray hits is the one with the largest distance
160  int whichPlane = 0;
161  for (int i = 1; i < 3; i++) {
162  if (maxT[whichPlane] < maxT[i]) whichPlane = i;
163  }
164 
165  // check if the candidate intersection point is inside the box
166 
167  // no intersection
168  if (maxT[whichPlane] < 0.) {
169  intersects_cryo[i_cryo] = false;
170  continue;
171  }
172 
173  for (int i = 0; i < 3; i++) {
174  if (whichPlane != i) { coord[i] = x0[i] + maxT[whichPlane] * dx[i]; }
175  else {
176  coord[i] = candidatePlane[i];
177  }
178  }
179 
180  // check if intersection is in box
181  intersects_cryo[i_cryo] = true;
182  for (int i = 0; i < 3; i++) {
183  if (coord[i] < bound_lo[i] || coord[i] > bound_hi[i]) { intersects_cryo[i_cryo] = false; }
184  }
185 
186  if (intersects_cryo[i_cryo]) { distance_to_cryo[i_cryo] = maxT[whichPlane]; }
187  }
188 
189  // check if any cryostats are intersected in-time
190  for (size_t i_cryo = 0; i_cryo < fCryostatBoundaries.size(); i_cryo++) {
191 
192  // If the particle originates inside the cryostat, then
193  // we can't really say when it will leave. Thus, accept
194  // the particle
195  if (inside_cryo[i_cryo]) { return true; }
196  // otherwise check arrival time at boundary of cryostat
197  if (intersects_cryo[i_cryo]) {
198  double ptime = (distance_to_cryo[i_cryo] * 1e-2 /* cm -> m */) /
199  (TMath::C() * sqrt(1 - pow(part.Mass() / part.E(), 2))) /* velocity */;
200  double totT = part.T() + ptime * 1e9 /* s -> ns */;
201  if (totT > fMinT && totT < fMaxT) { return true; }
202  }
203  }
204 
205  return false;
206  }
auto coord(Vector &v, unsigned int n) noexcept
Returns an object to manage the coordinate n of a vector.
std::vector< std::array< double, 6 > > fCryostatBoundaries
boundaries of each cryostat
constexpr auto abs(T v)
Returns the absolute value of the argument.
TString part[npart]
Definition: Style.C:32
Float_t e
Definition: plot.C:35
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
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

constexpr bool art::detail::Filter::Fail {false}
staticinherited

Definition at line 29 of file Filter.h.

bool simfilter::FilterGenInTime::fAlwaysPass
private

Definition at line 54 of file FilterGenInTime_module.cc.

Referenced by filter(), and FilterGenInTime().

std::vector<std::array<double, 6> > simfilter::FilterGenInTime::fCryostatBoundaries
private

boundaries of each cryostat

Definition at line 49 of file FilterGenInTime_module.cc.

Referenced by beginJob(), and KeepParticle().

bool simfilter::FilterGenInTime::fKeepOnlyMuons
private

Definition at line 51 of file FilterGenInTime_module.cc.

Referenced by filter(), and FilterGenInTime().

double simfilter::FilterGenInTime::fMaxT
private

Definition at line 52 of file FilterGenInTime_module.cc.

Referenced by FilterGenInTime(), and KeepParticle().

double simfilter::FilterGenInTime::fMinKE
private

Definition at line 50 of file FilterGenInTime_module.cc.

Referenced by filter(), and FilterGenInTime().

double simfilter::FilterGenInTime::fMinT
private

Definition at line 52 of file FilterGenInTime_module.cc.

Referenced by FilterGenInTime(), and KeepParticle().

bool simfilter::FilterGenInTime::fSortParticles
private

Definition at line 53 of file FilterGenInTime_module.cc.

Referenced by filter(), and FilterGenInTime().

constexpr bool art::detail::Filter::Pass {true}
staticinherited

Definition at line 28 of file Filter.h.


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