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

Public Types

using ModuleType = EDAnalyzer
 

Public Member Functions

 CheckProtonProduction (fhicl::ParameterSet const &p)
 
void beginJob () override
 
void beginRun (const art::Run &Run) override
 
void endJob () 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

int fNThetaBinsFW
 
double fThetaMinFW
 
double fDeltaThetaFW
 
int fNThetaBinsLA
 
double fThetaMinLA
 
double fDeltaThetaLA
 
TH1F * _fHistoNSec
 
TH1F * _fHistoSecPMom
 
TH1F * _fHistoSecPkinE54
 
TH1F * _fHistoSecPkinE68
 
TH1F * _fHistoSecPkinE90
 
TH1F * _fHistoSecPkinE121
 
TH1F * _fHistoSecPkinE164
 
TH1F * _fHistoSecPkinE
 
TH1F * _fHistoSecPTheta
 
TH1F * _fHistoSecDMom
 
TH1F * _fHistoSecDkinE54
 
TH1F * _fHistoSecDkinE68
 
TH1F * _fHistoSecDkinE90
 
TH1F * _fHistoSecDkinE121
 
TH1F * _fHistoSecDkinE164
 
TH1F * _fHistoSecDkinE
 
TH1F * _fHistoSecDTheta
 
TH1F * _fHistoSecTMom
 
TH1F * _fHistoSecTkinE54
 
TH1F * _fHistoSecTkinE68
 
TH1F * _fHistoSecTkinE90
 
TH1F * _fHistoSecTkinE121
 
TH1F * _fHistoSecTkinE164
 
TH1F * _fHistoSecTkinE
 
TH1F * _fHistoSecTTheta
 
std::vector< TH1D * > fHistoSecProtonFW
 

Detailed Description

Definition at line 45 of file CheckProtonProduction_module.cc.

Member Typedef Documentation

Definition at line 22 of file EDAnalyzer.h.

Constructor & Destructor Documentation

artg4tk::CheckProtonProduction::CheckProtonProduction ( fhicl::ParameterSet const &  p)
explicit

Definition at line 92 of file CheckProtonProduction_module.cc.

93  : art::EDAnalyzer(p)
94  , fNThetaBinsFW(p.get<int>("ThetaBinsFW", 4))
95  , fThetaMinFW(p.get<double>("ThetaMinFW", 0.05))
96  , fDeltaThetaFW(p.get<double>("DeltaThetaFW", 0.05))
97  , fNThetaBinsLA(p.get<int>("ThetaBinsLA", 9))
98  , fThetaMinLA(p.get<double>("ThetaMinLA", 0.35))
99  , fDeltaThetaLA(p.get<double>("DeltaThetaLA", 0.2))
100  , _fHistoNSec(0)
101  , _fHistoSecPMom(0)
102  , _fHistoSecPkinE54(0)
103  , _fHistoSecPkinE68(0)
104  , _fHistoSecPkinE90(0)
105  , _fHistoSecPkinE121(0)
106  , _fHistoSecPkinE164(0)
107  , _fHistoSecPkinE(0)
108  , _fHistoSecPTheta(0)
109  , _fHistoSecDMom(0)
110  , _fHistoSecDkinE54(0)
111  , _fHistoSecDkinE68(0)
112  , _fHistoSecDkinE90(0)
113  , _fHistoSecDkinE121(0)
114  , _fHistoSecDkinE164(0)
115  , _fHistoSecDkinE(0)
116  , _fHistoSecDTheta(0)
117  , _fHistoSecTMom(0)
118  , _fHistoSecTkinE54(0)
119  , _fHistoSecTkinE68(0)
120  , _fHistoSecTkinE90(0)
121  , _fHistoSecTkinE121(0)
122  , _fHistoSecTkinE164(0)
123  , _fHistoSecTkinE(0)
124  , _fHistoSecTTheta(0)
125 {}

Member Function Documentation

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

Definition at line 227 of file CheckProtonProduction_module.cc.

References _fHistoNSec, _fHistoSecDkinE, _fHistoSecDkinE121, _fHistoSecDkinE164, _fHistoSecDkinE54, _fHistoSecDkinE68, _fHistoSecDkinE90, _fHistoSecDMom, _fHistoSecDTheta, _fHistoSecPkinE, _fHistoSecPkinE121, _fHistoSecPkinE164, _fHistoSecPkinE54, _fHistoSecPkinE68, _fHistoSecPkinE90, _fHistoSecPMom, _fHistoSecPTheta, _fHistoSecTkinE, _fHistoSecTkinE121, _fHistoSecTkinE164, _fHistoSecTkinE54, _fHistoSecTkinE68, _fHistoSecTkinE90, _fHistoSecTMom, and _fHistoSecTTheta.

228 {
229  typedef std::vector<art::Handle<myInteractionArtHitDataCollection>> HandleVector;
230  auto allSims = event.getMany<myInteractionArtHitDataCollection>();
231 
232  for (HandleVector::const_iterator i = allSims.begin(); i != allSims.end(); ++i) {
233  const myInteractionArtHitDataCollection& sims(**i);
234  if (sims.size() > 0) {
235  _fHistoNSec->Fill(sims.size());
236  }
237  for (myInteractionArtHitDataCollection::const_iterator j = sims.begin(); j != sims.end(); ++j) {
238  const myInteractionArtHitData& hit = *j;
239  if (hit.pname == "proton") {
240  _fHistoSecPMom->Fill(hit.pmom);
241  double angle = hit.theta * 57.29577951;
242  if (fabs(angle - 54.) < 2.)
243  _fHistoSecPkinE54->Fill(hit.Ekin);
244  if (fabs(angle - 68.) < 2.)
245  _fHistoSecPkinE68->Fill(hit.Ekin);
246  if (fabs(angle - 90.) < 2.)
247  _fHistoSecPkinE90->Fill(hit.Ekin);
248  if (fabs(angle - 121.) < 2.)
249  _fHistoSecPkinE121->Fill(hit.Ekin);
250  if (fabs(angle - 164.) < 2.)
251  _fHistoSecPkinE164->Fill(hit.Ekin);
252  _fHistoSecPkinE->Fill(hit.Ekin);
253  _fHistoSecPTheta->Fill(hit.theta);
254  } else if (hit.pname == "deuteron") {
255  _fHistoSecDMom->Fill(hit.pmom);
256  double angle = hit.theta * 57.29577951;
257  if (fabs(angle - 54.) < 2.)
258  _fHistoSecDkinE54->Fill(hit.Ekin);
259  if (fabs(angle - 68.) < 2.)
260  _fHistoSecDkinE68->Fill(hit.Ekin);
261  if (fabs(angle - 90.) < 2.)
262  _fHistoSecDkinE90->Fill(hit.Ekin);
263  if (fabs(angle - 121.) < 2.)
264  _fHistoSecDkinE121->Fill(hit.Ekin);
265  if (fabs(angle - 164.) < 2.)
266  _fHistoSecDkinE164->Fill(hit.Ekin);
267  _fHistoSecDkinE->Fill(hit.Ekin);
268  _fHistoSecDTheta->Fill(hit.theta);
269  } else if (hit.pname == "triton") {
270  _fHistoSecTMom->Fill(hit.pmom);
271  double angle = hit.theta * 57.29577951;
272  if (fabs(angle - 54.) < 2.)
273  _fHistoSecTkinE54->Fill(hit.Ekin);
274  if (fabs(angle - 68.) < 2.)
275  _fHistoSecTkinE68->Fill(hit.Ekin);
276  if (fabs(angle - 90.) < 2.)
277  _fHistoSecTkinE90->Fill(hit.Ekin);
278  if (fabs(angle - 121.) < 2.)
279  _fHistoSecTkinE121->Fill(hit.Ekin);
280  if (fabs(angle - 164.) < 2.)
281  _fHistoSecTkinE164->Fill(hit.Ekin);
282  _fHistoSecTkinE->Fill(hit.Ekin);
283  _fHistoSecTTheta->Fill(hit.theta);
284  }
285  }
286  }
287 
288 } // end analyze
intermediate_table::const_iterator const_iterator
Detector simulation of raw signals on wires.
void artg4tk::CheckProtonProduction::beginJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 134 of file CheckProtonProduction_module.cc.

References _fHistoNSec, _fHistoSecDkinE, _fHistoSecDkinE121, _fHistoSecDkinE164, _fHistoSecDkinE54, _fHistoSecDkinE68, _fHistoSecDkinE90, _fHistoSecDMom, _fHistoSecDTheta, _fHistoSecPkinE, _fHistoSecPkinE121, _fHistoSecPkinE164, _fHistoSecPkinE54, _fHistoSecPkinE68, _fHistoSecPkinE90, _fHistoSecPMom, _fHistoSecPTheta, _fHistoSecTkinE, _fHistoSecTkinE121, _fHistoSecTkinE164, _fHistoSecTkinE54, _fHistoSecTkinE68, _fHistoSecTkinE90, _fHistoSecTMom, _fHistoSecTTheta, fDeltaThetaFW, fHistoSecProtonFW, fNThetaBinsFW, and fThetaMinFW.

135 {
137  _fHistoNSec = tfs->make<TH1F>("NSec", "neutron + Cu", 100, 0., 100.);
138  //
140  tfs->make<TH1F>("pmomentum", "neutron + Cu momentum of secondary protons", 100, 0., 600);
141  _fHistoSecPkinE54 = tfs->make<TH1F>(
142  "pkinE54", "neutron + Cu kinetic Energy of secondary protons (54)", 100, 0., 400.);
143  _fHistoSecPkinE68 = tfs->make<TH1F>(
144  "pkinE68", "neutron + Cu kinetis Energy of secondary protons (68)", 100, 0., 400.);
145  _fHistoSecPkinE90 = tfs->make<TH1F>(
146  "pkinE90", "neutron + Cu kinetic Energy of secondary protons (90)", 100, 0., 400.);
147  _fHistoSecPkinE121 = tfs->make<TH1F>(
148  "pkinE121", "neutron + Cu kinetic Energy of secondary protons (121)", 100, 0., 400);
149  _fHistoSecPkinE164 = tfs->make<TH1F>(
150  "pkinE164", "neutron + Cu kinetic Energy of secondary protons (168)", 100, 0., 400.);
152  tfs->make<TH1F>("pkinE", "neutron + Cu kinetic Energy of secondary protons", 100, 0., 400.);
154  tfs->make<TH1F>("ptheta", "neutron + Cu kin. theta of secondary protons", 100, 0., 3.2);
155  //
157  tfs->make<TH1F>("dmomentum", "neutron + Cu momentum of secondary deuterons", 100, 0., 600);
158  _fHistoSecDkinE54 = tfs->make<TH1F>(
159  "dkinE54", "neutron + Cu kinetic Energy of secondary deuterons (54)", 100, 0., 400.);
160  _fHistoSecDkinE68 = tfs->make<TH1F>(
161  "dkinE68", "neutron + Cu kinetis Energy of secondary deuterons (68)", 100, 0., 400.);
162  _fHistoSecDkinE90 = tfs->make<TH1F>(
163  "dkinE90", "neutron + Cu kinetic Energy of secondary deuterons (90)", 100, 0., 400.);
164  _fHistoSecDkinE121 = tfs->make<TH1F>(
165  "dkinE121", "neutron + Cu kinetic Energy of secondary deuterons (121)", 100, 0., 400);
166  _fHistoSecDkinE164 = tfs->make<TH1F>(
167  "dkinE164", "neutron + Cu kinetic Energy of secondary deuterons (168)", 100, 0., 400.);
169  tfs->make<TH1F>("dkinE", "neutron + Cu kinetic Energy of secondary deuterons", 100, 0., 400.);
171  tfs->make<TH1F>("dtheta", "neutron + Cu kin. theta of secondary deuterons", 100, 0., 3.2);
172  //
174  tfs->make<TH1F>("tmomentum", "neutron + Cu momentum of secondary tritons", 100, 0., 600);
175  _fHistoSecTkinE54 = tfs->make<TH1F>(
176  "tkinE54", "neutron + Cu kinetic Energy of secondary tritons (54)", 100, 0., 400.);
177  _fHistoSecTkinE68 = tfs->make<TH1F>(
178  "tkinE68", "neutron + Cu kinetis Energy of secondary tritons (68)", 100, 0., 400.);
179  _fHistoSecTkinE90 = tfs->make<TH1F>(
180  "tkinE90", "neutron + Cu kinetic Energy of secondary tritons (90)", 100, 0., 400.);
181  _fHistoSecTkinE121 = tfs->make<TH1F>(
182  "tkinE121", "neutron + Cu kinetic Energy of secondary tritons (121)", 100, 0., 400);
183  _fHistoSecTkinE164 = tfs->make<TH1F>(
184  "tkinE164", "neutron + Cu kinetic Energy of secondary tritons (168)", 100, 0., 400.);
186  tfs->make<TH1F>("tkinE", "neutron + Cu kinetic Energy of secondary tritons", 100, 0., 400.);
188  tfs->make<TH1F>("ttheta", "neutron + Cu kin. theta of secondary tritons", 100, 0., 3.2);
189  //
190  string htitle;
191  string hname;
192  string ht = "neutron + Cu";
193 
194  double thetaMin = 0.;
195  double thetaMax = 0.;
196  std::string theta_bin_fw;
197  std::string theta_bin_la;
198 
199  for (int i = 0; i < fNThetaBinsFW; i++) {
200  thetaMin = fThetaMinFW + fDeltaThetaFW * i;
201  thetaMax = thetaMin + fDeltaThetaFW;
202 
203  std::ostringstream osTitle1;
204  std::ostringstream osTitle2;
205  std::ostringstream osTitle3;
206 
207  osTitle1.clear();
208  osTitle1 << thetaMin;
209  theta_bin_fw = osTitle1.str() + " < theta < ";
210  osTitle2.clear();
211  osTitle2 << thetaMax;
212  theta_bin_fw += osTitle2.str();
213  theta_bin_fw += "(rad)";
214 
215  osTitle3.clear();
216  osTitle3 << i;
217 
218  htitle = ht + " -> X + proton, " + theta_bin_fw;
219  hname = "proton_fw_" + osTitle3.str();
220  TH1D* histo = tfs->make<TH1D>(hname.c_str(), htitle.c_str(), 80, 0., 8.0);
221  fHistoSecProtonFW.push_back(histo);
222  }
223 
224 } // end beginJob
void artg4tk::CheckProtonProduction::beginRun ( const art::Run Run)
override

Definition at line 128 of file CheckProtonProduction_module.cc.

References art::Run::beginTime().

129 {
130  thisRun.beginTime();
131 }
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")
void artg4tk::CheckProtonProduction::endJob ( )
overridevirtual

Reimplemented from art::EDAnalyzer.

Definition at line 291 of file CheckProtonProduction_module.cc.

References _fHistoNSec, DEFINE_ART_MODULE, norm, and scale.

292 {
293  cout << " ********************************CheckProtonProduction: now normalizing the histos "
294  << endl;
295  double norm = _fHistoNSec->Integral();
296  double xbin = _fHistoNSec->GetBinWidth(1);
297  double scale = 1. / (xbin * norm);
298  _fHistoNSec->Scale(scale);
299 } // end endJob
Double_t scale
Definition: plot.C:24
Float_t norm
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::CheckProtonProduction::_fHistoNSec
private

Definition at line 61 of file CheckProtonProduction_module.cc.

Referenced by analyze(), beginJob(), and endJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecDkinE
private

Definition at line 78 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecDkinE121
private

Definition at line 76 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecDkinE164
private

Definition at line 77 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecDkinE54
private

Definition at line 73 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecDkinE68
private

Definition at line 74 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecDkinE90
private

Definition at line 75 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecDMom
private

Definition at line 72 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecDTheta
private

Definition at line 79 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecPkinE
private

Definition at line 69 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecPkinE121
private

Definition at line 67 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecPkinE164
private

Definition at line 68 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecPkinE54
private

Definition at line 64 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecPkinE68
private

Definition at line 65 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecPkinE90
private

Definition at line 66 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecPMom
private

Definition at line 63 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecPTheta
private

Definition at line 70 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecTkinE
private

Definition at line 87 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecTkinE121
private

Definition at line 85 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecTkinE164
private

Definition at line 86 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecTkinE54
private

Definition at line 82 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecTkinE68
private

Definition at line 83 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecTkinE90
private

Definition at line 84 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecTMom
private

Definition at line 81 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

TH1F* artg4tk::CheckProtonProduction::_fHistoSecTTheta
private

Definition at line 88 of file CheckProtonProduction_module.cc.

Referenced by analyze(), and beginJob().

double artg4tk::CheckProtonProduction::fDeltaThetaFW
private

Definition at line 56 of file CheckProtonProduction_module.cc.

Referenced by beginJob().

double artg4tk::CheckProtonProduction::fDeltaThetaLA
private

Definition at line 59 of file CheckProtonProduction_module.cc.

std::vector<TH1D*> artg4tk::CheckProtonProduction::fHistoSecProtonFW
private

Definition at line 89 of file CheckProtonProduction_module.cc.

Referenced by beginJob().

int artg4tk::CheckProtonProduction::fNThetaBinsFW
private

Definition at line 54 of file CheckProtonProduction_module.cc.

Referenced by beginJob().

int artg4tk::CheckProtonProduction::fNThetaBinsLA
private

Definition at line 57 of file CheckProtonProduction_module.cc.

double artg4tk::CheckProtonProduction::fThetaMinFW
private

Definition at line 55 of file CheckProtonProduction_module.cc.

Referenced by beginJob().

double artg4tk::CheckProtonProduction::fThetaMinLA
private

Definition at line 58 of file CheckProtonProduction_module.cc.


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