LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
artg4tk::CheckDRCalorimeterHits Class Reference
Inheritance diagram for artg4tk::CheckDRCalorimeterHits:
art::EDAnalyzer art::detail::Analyzer art::detail::LegacyModule art::Observer art::ModuleBase

Public Types

using ModuleType = EDAnalyzer
 

Public Member Functions

 CheckDRCalorimeterHits (fhicl::ParameterSet const &p)
 
void beginJob () override
 
void analyze (const art::Event &event) override
 
void doBeginJob (SharedResources const &resources)
 
void doEndJob ()
 
void doRespondToOpenInputFile (FileBlock const &fb)
 
void doRespondToCloseInputFile (FileBlock const &fb)
 
void doRespondToOpenOutputFiles (FileBlock const &fb)
 
void doRespondToCloseOutputFiles (FileBlock const &fb)
 
bool doBeginRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doEndRun (RunPrincipal &rp, ModuleContext const &mc)
 
bool doBeginSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEndSubRun (SubRunPrincipal &srp, ModuleContext const &mc)
 
bool doEvent (EventPrincipal &ep, ModuleContext const &mc, std::atomic< std::size_t > &counts_run, std::atomic< std::size_t > &counts_passed, std::atomic< std::size_t > &counts_failed)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

std::string const & processName () const
 
bool wantAllEvents () const noexcept
 
bool wantEvent (ScheduleID id, Event const &e) const
 
Handle< TriggerResults > getTriggerResults (Event const &e) const
 
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 Attributes

fhicl::ParameterSet pstl
 
std::map< std::string, TH1F * > mapofhistos
 
std::map< std::string, TH1F * > ncmapofhistos
 
std::vector< TH1F * > vecofhistosthin
 
std::vector< TH1F * > vecofhistosthick
 
std::vector< double > edepthin
 
std::vector< double > edepthick
 
TH1F * _hnDRHits
 
TH1F * _hDREdep
 
TH1F * _hNCeren
 
TH2F * _hEdepvsNCeren
 
TNtuple * _ntuple
 
TNtuple * _ntuple2
 

Detailed Description

Definition at line 45 of file CheckDRCalorimeterHits_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

Member Function Documentation

void artg4tk::CheckDRCalorimeterHits::analyze ( const art::Event event)
override

Definition at line 176 of file CheckDRCalorimeterHits_module.cc.

References _hDREdep, _hEdepvsNCeren, _hNCeren, _hnDRHits, _ntuple, _ntuple2, DEFINE_ART_MODULE, edepthick, edepthin, art::Event::event(), fhicl::ParameterSet::get_names(), mapofhistos, ncmapofhistos, art::Handle< T >::provenance(), vecofhistosthick, and vecofhistosthin.

177 {
178  typedef std::vector<art::Handle<DRCalorimeterHitCollection>> DRHandleVector;
179  // DRHandleVector allDRSims;
180  double sumDRE = 0;
181  double sumNCeren = 0.0;
182  unsigned int numz = 10;
183  std::vector<double> edepthin;
184  std::vector<double> edepthick;
185  std::vector<double> ncerenthin;
186  std::vector<double> ncerenthick;
187  for (unsigned int ijk = 0; ijk < numz; ijk++) {
188  edepthin.push_back(0.0);
189  edepthick.push_back(0.0);
190  ncerenthin.push_back(0.0);
191  ncerenthick.push_back(0.0);
192  }
193  // event.getManyByType(allDRSims);
194  auto allDRSims = event.getMany<DRCalorimeterHitCollection>();
195  for (DRHandleVector::const_iterator i = allDRSims.begin(); i != allDRSims.end(); ++i) {
197  auto const* prov = ih.provenance();
198  string iname = prov->productInstanceName();
199  string pname = prov->processName();
200  std::cout << "iname: " << iname << std::endl;
201  std::cout << "pname: " << pname << std::endl;
202  fhicl::ParameterSet ps = prov->parameterSet();
203  std::vector<std::string> names = ps.get_names();
204 
205  for (vector<string>::iterator t = names.begin(); t != names.end(); ++t) {
206  std::cout << *t << std::endl;
207  }
208  const DRCalorimeterHitCollection& DRsims(**i);
209  _hnDRHits->Fill(DRsims.size());
210  for (DRCalorimeterHitCollection::const_iterator j = DRsims.begin(); j != DRsims.end(); ++j) {
211  const DRCalorimeterHit& hit = *j;
212  unsigned int lay = (int)(hit.GetID() / (numz * numz));
213  // unsigned int jj = (int)(((hit.GetID()-kk*(numz*numz)))/numy);
214  // unsigned int ii = (int)(hit.GetID()-kk*(numz*numz)-jj*numy);
215  // cout << "ID: "<<hit.GetID()<<" Layer: "<< kk<<" Column: " << jj<< " row: "<<
216  // ii<<endl;
217  sumDRE = sumDRE + hit.GetEdep();
218  sumNCeren = sumNCeren + hit.GetNceren();
219  if (iname.find("thin") != std::string::npos) {
220  edepthin[lay] = edepthin[lay] + hit.GetEdep();
221  ncerenthin[lay] = ncerenthin[lay] + hit.GetNceren();
222  } else {
223  edepthick[lay] = edepthick[lay] + hit.GetEdep();
224  ncerenthick[lay] = ncerenthick[lay] + hit.GetNceren();
225  }
226  }
227  }
228  _hDREdep->Fill(sumDRE / CLHEP::GeV);
229  _hNCeren->Fill(sumNCeren);
230  _hEdepvsNCeren->Fill(sumDRE / CLHEP::GeV, sumNCeren);
231  for (unsigned int ijk = 0; ijk < numz; ijk++) {
232  vecofhistosthin[ijk]->Fill(edepthin[ijk] / CLHEP::GeV);
233  vecofhistosthick[ijk]->Fill(edepthick[ijk] / CLHEP::GeV);
234  }
235  _ntuple->Fill(event.event(),
236  edepthin[0],
237  edepthin[1],
238  edepthin[2],
239  edepthin[3],
240  edepthin[4],
241  edepthin[5],
242  edepthin[6],
243  edepthin[7],
244  edepthin[8],
245  edepthin[9]);
246  _ntuple2->Fill(event.event(),
247  ncerenthin.at(0),
248  ncerenthin.at(1),
249  ncerenthin.at(2),
250  ncerenthin.at(3),
251  ncerenthin.at(4),
252  ncerenthin.at(5),
253  ncerenthin.at(6),
254  ncerenthin.at(7),
255  ncerenthin.at(8),
256  ncerenthin.at(9));
257  typedef std::vector<art::Handle<ByParticle>> EdepHandleVector;
258  // EdepHandleVector allEdeps;
259  // event.getManyByType(allEdeps);
260  auto allEdeps = event.getMany<ByParticle>();
261  bool first = true;
262  ByParticle addup;
263  ByParticle addupnc;
264  double junkie = 0.0;
265  for (EdepHandleVector::const_iterator i = allEdeps.begin(); i != allEdeps.end(); ++i) {
266  art::Handle<ByParticle> ih = *i;
267  auto const* prov = ih.provenance();
268  string instancename = prov->productInstanceName();
269 
270  if (instancename.find("NCeren") != std::string::npos) {
271  const ByParticle& Edeps(**i);
272  if (first) {
273  addupnc = Edeps;
274  junkie = Edeps.at("NCerentot");
275  first = false;
276  } else {
277  junkie = junkie + Edeps.at("NCerentot");
278  for (std::map<std::string, double>::const_iterator it = Edeps.begin(); it != Edeps.end();
279  ++it) {
280  addupnc[it->first] = addupnc[it->first] + it->second;
281  }
282  }
283  } else if (instancename.find("Edep") != std::string::npos) {
284  const ByParticle& Edeps(**i);
285  if (first) {
286  addup = Edeps;
287  junkie = Edeps.at("Etot");
288  first = false;
289  } else {
290  junkie = junkie + Edeps.at("Etot");
291  for (std::map<std::string, double>::const_iterator it = Edeps.begin(); it != Edeps.end();
292  ++it) {
293  addup[it->first] = addup[it->first] + it->second;
294  }
295  }
296  /*
297  for (std::map<std::string, double>::const_iterator it = Edeps.begin(); it != Edeps.end();
298  ++it) {
299 
300  if (mapofhistos.find(it->first) != mapofhistos.end())
301  mapofhistos[it->first]->Fill((100.*it->second)/junkie);
302  }
303  */
304  }
305  }
306  for (std::map<std::string, double>::const_iterator it = addup.begin(); it != addup.end(); ++it) {
307  if (mapofhistos.find(it->first) != mapofhistos.end())
308  mapofhistos[it->first]->Fill((100. * it->second) / junkie);
309  }
310  for (std::map<std::string, double>::const_iterator it = addupnc.begin(); it != addupnc.end();
311  ++it) {
312  if (ncmapofhistos.find(it->first) != ncmapofhistos.end())
313  ncmapofhistos[it->first]->Fill((100. * it->second) / junkie);
314  }
315 } // end analyze
intermediate_table::iterator iterator
intermediate_table::const_iterator const_iterator
Provenance const * provenance() const
Definition: Handle.h:217
EventNumber_t event() const
Definition: Event.cc:41
std::map< std::string, TH1F * > ncmapofhistos
Detector simulation of raw signals on wires.
std::vector< std::string > get_names() const
std::map< std::string, TH1F * > mapofhistos
void artg4tk::CheckDRCalorimeterHits::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 79 of file CheckDRCalorimeterHits_module.cc.

References _hDREdep, _hEdepvsNCeren, _hNCeren, _hnDRHits, _ntuple, _ntuple2, fhicl::ParameterSet::get(), mapofhistos, ncmapofhistos, pstl, util::to_string(), vecofhistosthick, and vecofhistosthin.

80 {
82  _hnDRHits = tfs->make<TH1F>("hnDRHits", "Number of DRCaloArtHits", 100, 0., 20000.);
83  _hDREdep = tfs->make<TH1F>("hDREdep", "total Energy deposition in DRCaloArtHits", 100, 0., 11.);
84  _hNCeren = tfs->make<TH1F>(
85  "hNCeren", "total number of Cerenkov Photons in DRCaloArtHits", 100, 0., 10000.);
86  _hEdepvsNCeren = tfs->make<TH2F>("hEdepvsNCeren", "Edep vs. NCeren", 100, 0, 11, 100, 0, 10000.);
87  _ntuple = tfs->make<TNtuple>(
88  "ntuple", "Demo ntuple", "Event:Edep0:Edep1:Edep2:Edep3:Edep4:Edep5:Edep6:Edep7:Edep8:Edep9");
89  _ntuple2 = tfs->make<TNtuple>(
90  "ntuple2",
91  "Demo ntuple",
92  "Event:Nceren0:Nceren1:Nceren2:Nceren3:Nceren4:Nceren5:Nceren6:Nceren7:Nceren8:Nceren9");
93  mapofhistos["Fragment"] = tfs->make<TH1F>("hFragment", "Fragment percentage", 100, 0., 100.);
94  mapofhistos["He3"] = tfs->make<TH1F>("hHe3", "He3 percentage", 100, 0., 100.);
95  mapofhistos["alpha"] = tfs->make<TH1F>("halpha", "alpha percentage", 100, 0., 100.);
96  mapofhistos["deuteron"] = tfs->make<TH1F>("hdeuteron", "deuteron percentage", 100, 0., 100.);
97  mapofhistos["triton"] = tfs->make<TH1F>("htriton", "triton percentage", 100, 0., 100.);
98  mapofhistos["proton"] = tfs->make<TH1F>("hproton", "proton percentage", 100, 0., 100.);
99  mapofhistos["neutron"] = tfs->make<TH1F>("hneutron", "neutron percentage", 100, 0., 100.);
100  mapofhistos["e+"] = tfs->make<TH1F>("he+", "positron percentage", 100, 0., 100.);
101  mapofhistos["e-"] = tfs->make<TH1F>("he-", "electron percentage", 100, 0., 100.);
102  mapofhistos["pi+"] = tfs->make<TH1F>("hpiplus", "piplus percentage", 100, 0., 100.);
103  mapofhistos["pi-"] = tfs->make<TH1F>("hpiminus", "piminus percentage", 100, 0., 100.);
104  mapofhistos["gamma"] = tfs->make<TH1F>("hgamma", "gamma percentage", 100, 0., 100.);
105  mapofhistos["mu+"] = tfs->make<TH1F>("hmu+", "mu+ percentage", 100, 0., 100.);
106  mapofhistos["mu-"] = tfs->make<TH1F>("hmu-", "mu- percentage", 100, 0., 100.);
107  mapofhistos["sigma+"] = tfs->make<TH1F>("hsigma+", "sigma+ percentage", 100, 0., 100.);
108  mapofhistos["sigma-"] = tfs->make<TH1F>("hsigma-", "sigma- percentage", 100, 0., 100.);
109  mapofhistos["kaon+"] = tfs->make<TH1F>("hkaon+", "kaon+ percentage", 100, 0., 100.);
110  mapofhistos["kaon-"] = tfs->make<TH1F>("hkaon-", "kaon- percentage", 100, 0., 100.);
111  mapofhistos["kaon0L"] = tfs->make<TH1F>("hkaon0L", "kaon0 percentage", 100, 0., 100.);
112  mapofhistos["kaon0S"] = tfs->make<TH1F>("hkaon0S", "Kspercentage", 100, 0., 100.);
113  mapofhistos["lambda"] = tfs->make<TH1F>("hlambda", "lambda percentage", 100, 0., 100.);
114  mapofhistos["xi-"] = tfs->make<TH1F>("hximinus", "ximinu percentage", 100, 0., 100.);
115  mapofhistos["anti_neutron"] =
116  tfs->make<TH1F>("hneutronbar", "neutronbar percentage", 100, 0., 100.);
117  mapofhistos["anti_sigma-"] =
118  tfs->make<TH1F>("hsigmaminusbar", "anti_sigma- percentage", 100, 0., 100.);
119  mapofhistos["anti_proton"] = tfs->make<TH1F>("hpar", "pbar percentage", 100, 0., 100.);
120  mapofhistos["anti_xi-"] = tfs->make<TH1F>("hantiximinus", "anti_xi-percentage", 100, 0., 100.);
121  mapofhistos["anti_omega-"] =
122  tfs->make<TH1F>("hantiomegaminus", "anti_omega- percentage", 100, 0., 100.);
123  mapofhistos["anti_sigma+"] =
124  tfs->make<TH1F>("hantisigmaplus", "anti_sigma+percentage", 100, 0., 100.);
125  mapofhistos["anti_lambda"] =
126  tfs->make<TH1F>("hlambdabar", "anti_lambda percentage", 100, 0., 100.);
127  mapofhistos["anti_xi0"] = tfs->make<TH1F>("hxi0bar", "anti_xi0 percentage", 100, 0., 100.);
128  mapofhistos["other"] =
129  tfs->make<TH1F>("hother", "other percentage", 100, 0., 100.); // Just in case
130  //
131  ncmapofhistos["deuteron"] =
132  tfs->make<TH1F>("NCeren_deuteron", "deuteronp ercentage", 100, 0., 100.);
133  ncmapofhistos["triton"] = tfs->make<TH1F>("NCeren_triton", "triton percentage", 100, 0., 100.);
134  ncmapofhistos["He3"] = tfs->make<TH1F>("NCeren_He3", "He3 percentage", 100, 0., 100.);
135  ncmapofhistos["proton"] = tfs->make<TH1F>("NCeren_proton", "proton percentage", 100, 0., 100.);
136  ncmapofhistos["e+"] = tfs->make<TH1F>("NCeren_e+", "e+ percentage", 100, 0., 100.);
137  ncmapofhistos["e-"] = tfs->make<TH1F>("NCeren_e-", "e- percentage", 100, 0., 100.);
138  ncmapofhistos["mu+"] = tfs->make<TH1F>("NCeren_mu+", "mu+ percentage", 100, 0., 100.);
139  ncmapofhistos["mu-"] = tfs->make<TH1F>("NCeren_mu-", "mu- percentage", 100, 0., 100.);
140  ncmapofhistos["pi+"] = tfs->make<TH1F>("NCeren_pi+", "pi+ percentage", 100, 0., 100.);
141  ncmapofhistos["pi-"] = tfs->make<TH1F>("NCeren_pi-", "pi- percentage", 100, 0., 100.);
142  ncmapofhistos["kaon+"] = tfs->make<TH1F>("NCeren_kaon+", "kaon+ percentage", 100, 0., 100.);
143  ncmapofhistos["kaon-"] = tfs->make<TH1F>("NCeren_kaon-", "kaon- percentage", 100, 0., 100.);
144  ncmapofhistos["sigma+"] = tfs->make<TH1F>("NCeren_sigma+", "sigma+ percentage", 100, 0., 100.);
145  ncmapofhistos["sigma-"] = tfs->make<TH1F>("NCeren_sigma-", "sigma- percentage", 100, 0., 100.);
146  ncmapofhistos["xi-"] = tfs->make<TH1F>("NCeren_xi-", "xi- percentage", 100, 0., 100.);
147  ncmapofhistos["anti_sigma+"] =
148  tfs->make<TH1F>("NCeren_anti_sigma+", "anti_sigma+ percentage", 100, 0., 100.);
149  ncmapofhistos["anti_sigma-"] =
150  tfs->make<TH1F>("NCeren_anti_sigma-", "anti_sigma- percentage", 100, 0., 100.);
151  ncmapofhistos["anti_proton"] =
152  tfs->make<TH1F>("NCeren_anti_proton", "anti_proton percentage", 100, 0., 100.);
153  ncmapofhistos["anti_xi-"] =
154  tfs->make<TH1F>("NCeren_anti_xi-", "anti_xi- percentage", 100, 0., 100.);
155  ncmapofhistos["anti_omega-"] =
156  tfs->make<TH1F>("NCeren_anti_omega-", "anti_omega- percentage", 100, 0., 100.);
157  ncmapofhistos["other"] =
158  tfs->make<TH1F>("NCeren_other", "other percentage", 100, 0., 100.); // Just in case
159  const unsigned int numz = 10;
160  for (unsigned int jj = 0; jj < numz; jj++) {
161  std::string histonamethin = "Edep_thin_lay" + std::to_string(jj);
162  std::string histonamethick = "Edep_thick_lay" + std::to_string(jj);
163  cout << histonamethin << endl;
164  cout << histonamethin.c_str() << endl;
165  vecofhistosthin.push_back(
166  tfs->make<TH1F>(histonamethin.c_str(), histonamethin.c_str(), 100, 0., 2.));
167  vecofhistosthick.push_back(
168  tfs->make<TH1F>(histonamethick.c_str(), histonamethick.c_str(), 100, 0., 2.));
169  }
170  std::cout << " artg4tk::CheckDRCalorimeterHits: The name of the used reference physics list is: "
171  << pstl.get<std::string>("PhysicsListName") << std::endl;
172 
173 } // end beginJob
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
T get(std::string const &key) const
Definition: ParameterSet.h:314
std::map< std::string, TH1F * > ncmapofhistos
std::map< std::string, TH1F * > mapofhistos
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::Analyzer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 25 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

26  {
27  setupQueues(resources);
28  ProcessingFrame const frame{ScheduleID{}};
29  beginJobWithFrame(frame);
30  }
virtual void beginJobWithFrame(ProcessingFrame const &)=0
virtual void setupQueues(SharedResources const &)=0
bool art::detail::Analyzer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 68 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

69  {
70  ProcessingFrame const frame{mc.scheduleID()};
71  beginRunWithFrame(std::as_const(rp).makeRun(mc), frame);
72  return true;
73  }
virtual void beginRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 84 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

85  {
86  ProcessingFrame const frame{mc.scheduleID()};
87  beginSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
88  return true;
89  }
virtual void beginSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doEndJob ( )
inherited

Definition at line 33 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

34  {
35  ProcessingFrame const frame{ScheduleID{}};
36  endJobWithFrame(frame);
37  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 76 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

77  {
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(std::as_const(rp).makeRun(mc), frame);
80  return true;
81  }
virtual void endRunWithFrame(Run const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 92 of file Analyzer.cc.

References art::ModuleContext::scheduleID().

Referenced by art::detail::Analyzer::Analyzer().

93  {
94  ProcessingFrame const frame{mc.scheduleID()};
95  endSubRunWithFrame(std::as_const(srp).makeSubRun(mc), frame);
96  return true;
97  }
virtual void endSubRunWithFrame(SubRun const &, ProcessingFrame const &)=0
bool art::detail::Analyzer::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 100 of file Analyzer.cc.

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

Referenced by art::detail::Analyzer::Analyzer().

105  {
106  auto const e = std::as_const(ep).makeEvent(mc);
107  if (wantEvent(mc.scheduleID(), e)) {
108  ++counts_run;
109  ProcessingFrame const frame{mc.scheduleID()};
110  analyzeWithFrame(e, frame);
111  ++counts_passed;
112  }
113  return true;
114  }
bool wantEvent(ScheduleID id, Event const &e) const
Definition: Observer.cc:63
Float_t e
Definition: plot.C:35
virtual void analyzeWithFrame(Event const &, ProcessingFrame const &)=0
void art::detail::Analyzer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 47 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

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

Definition at line 61 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

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

Definition at line 40 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

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

Definition at line 54 of file Analyzer.cc.

Referenced by art::detail::Analyzer::Analyzer().

55  {
56  ProcessingFrame const frame{ScheduleID{}};
58  }
virtual void respondToOpenOutputFilesWithFrame(FileBlock const &, ProcessingFrame const &)=0
TFile fb("Li6.root")
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
Handle< TriggerResults > art::Observer::getTriggerResults ( Event const &  e) const
protectedinherited

Definition at line 75 of file Observer.cc.

References art::ProductRetriever::get(), and art::Observer::selectors_.

Referenced by art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

76  {
77  if (selectors_) {
78  return selectors_->getOneTriggerResults(e);
79  }
80 
81  // The following applies for cases where no SelectEvents entries
82  // exist.
83  Handle<TriggerResults> h;
84  if (e.get(empty_process_name, h)) {
85  return h;
86  }
87  return Handle<TriggerResults>{};
88  }
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79
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
string const & art::Observer::processName ( ) const
protectedinherited

Definition at line 57 of file Observer.cc.

References art::Observer::process_name_.

Referenced by art::FileDumperOutput::printPrincipal().

58  {
59  return process_name_;
60  }
std::string process_name_
Definition: Observer.h:76
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)
bool art::Observer::wantAllEvents ( ) const
inlineprotectednoexceptinherited

Definition at line 31 of file Observer.h.

References e, art::Observer::getTriggerResults(), art::Observer::wantAllEvents_, and art::Observer::wantEvent().

32  {
33  return wantAllEvents_;
34  }
bool wantAllEvents_
Definition: Observer.h:75
bool art::Observer::wantEvent ( ScheduleID  id,
Event const &  e 
) const
protectedinherited

Definition at line 63 of file Observer.cc.

References art::Observer::rejectors_, art::Observer::selectors_, and art::Observer::wantAllEvents_.

Referenced by art::OutputModule::doEvent(), art::OutputModule::doWriteEvent(), and art::Observer::wantAllEvents().

64  {
65  if (wantAllEvents_) {
66  return true;
67  }
68  bool const select_event = selectors_ ? selectors_->matchEvent(id, e) : true;
69  bool const reject_event =
70  rejectors_ ? rejectors_->matchEvent(id, e) : false;
71  return select_event and not reject_event;
72  }
bool wantAllEvents_
Definition: Observer.h:75
std::optional< detail::ProcessAndEventSelectors > rejectors_
Definition: Observer.h:80
Float_t e
Definition: plot.C:35
std::optional< detail::ProcessAndEventSelectors > selectors_
Definition: Observer.h:79

Member Data Documentation

TH1F* artg4tk::CheckDRCalorimeterHits::_hDREdep
private

Definition at line 60 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

TH2F* artg4tk::CheckDRCalorimeterHits::_hEdepvsNCeren
private

Definition at line 62 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckDRCalorimeterHits::_hNCeren
private

Definition at line 61 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckDRCalorimeterHits::_hnDRHits
private

Definition at line 59 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

TNtuple* artg4tk::CheckDRCalorimeterHits::_ntuple
private

Definition at line 63 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

TNtuple* artg4tk::CheckDRCalorimeterHits::_ntuple2
private

Definition at line 64 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

std::vector<double> artg4tk::CheckDRCalorimeterHits::edepthick
private

Definition at line 58 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze().

std::vector<double> artg4tk::CheckDRCalorimeterHits::edepthin
private

Definition at line 57 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze().

std::map<std::string, TH1F*> artg4tk::CheckDRCalorimeterHits::mapofhistos
private

Definition at line 53 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

std::map<std::string, TH1F*> artg4tk::CheckDRCalorimeterHits::ncmapofhistos
private

Definition at line 54 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

fhicl::ParameterSet artg4tk::CheckDRCalorimeterHits::pstl
private

Definition at line 52 of file CheckDRCalorimeterHits_module.cc.

Referenced by beginJob().

std::vector<TH1F*> artg4tk::CheckDRCalorimeterHits::vecofhistosthick
private

Definition at line 56 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().

std::vector<TH1F*> artg4tk::CheckDRCalorimeterHits::vecofhistosthin
private

Definition at line 55 of file CheckDRCalorimeterHits_module.cc.

Referenced by analyze(), and beginJob().


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