LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
evgen::GENIEGen Class Reference

A module to check the results from the Monte Carlo generator. More...

Inheritance diagram for evgen::GENIEGen:
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

 GENIEGen (fhicl::ParameterSet const &pset)
 
virtual ~GENIEGen ()
 
void produce (art::Event &evt)
 
void beginJob ()
 
void beginRun (art::Run &run)
 
void beginSubRun (art::SubRun &sr)
 
void endSubRun (art::SubRun &sr)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > consumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > consumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< T > mayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< T > mayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

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

Private Member Functions

std::string ParticleStatus (int StatusCode)
 
std::string ReactionChannel (int ccnc, int mode)
 
void FillHistograms (simb::MCTruth mc)
 

Private Attributes

evgb::GENIEHelperfGENIEHelp
 GENIEHelper object. More...
 
bool fDefinedVtxHistRange
 
std::vector< double > fVtxPosHistRange
 use defined hist range; it is useful to have for asymmetric ranges like in DP FD. More...
 
int fPassEmptySpills
 whether or not to kill evnets with no interactions More...
 
TStopwatch fStopwatch
 
double fGlobalTimeOffset
 keep track of how long it takes to run the job More...
 
double fRandomTimeOffset
 The start of a simulated "beam gate". More...
 
::sim::BeamType_t fBeamType
 The width of a simulated "beam gate". More...
 
double fPrevTotPOT
 The type of beam. More...
 
double fPrevTotGoodPOT
 Total good POT from subruns previous to current subrun. More...
 
TH1F * fGenerated [6]
 Spectra as generated. More...
 
TH1F * fVertexX
 vertex location of generated events in x More...
 
TH1F * fVertexY
 vertex location of generated events in y More...
 
TH1F * fVertexZ
 vertex location of generated events in z More...
 
TH2F * fVertexXY
 vertex location in xy More...
 
TH2F * fVertexXZ
 vertex location in xz More...
 
TH2F * fVertexYZ
 vertex location in yz More...
 
TH1F * fDCosX
 direction cosine in x More...
 
TH1F * fDCosY
 direction cosine in y More...
 
TH1F * fDCosZ
 direction cosine in z More...
 
TH1F * fMuMomentum
 momentum of outgoing muons More...
 
TH1F * fMuDCosX
 direction cosine of outgoing mu in x More...
 
TH1F * fMuDCosY
 direction cosine of outgoing mu in y More...
 
TH1F * fMuDCosZ
 direction cosine of outgoing mu in z More...
 
TH1F * fEMomentum
 momentum of outgoing electrons More...
 
TH1F * fEDCosX
 direction cosine of outgoing e in x More...
 
TH1F * fEDCosY
 direction cosine of outgoing e in y More...
 
TH1F * fEDCosZ
 direction cosine of outgoing e in z More...
 
TH1F * fCCMode
 CC interaction mode. More...
 
TH1F * fNCMode
 CC interaction mode. More...
 
TH1F * fDeltaE
 difference in neutrino energy from MCTruth::Enu() vs TParticle More...
 
TH1F * fECons
 histogram to determine if energy is conserved in the event More...
 

Detailed Description

A module to check the results from the Monte Carlo generator.

Note on random number generator

GENIE uses a TRandom generator for its purposes. Since art's RandomNumberGenerator service only provides CLHEP::HepRandomEngine, the standard LArSoft/art mechanism for handling the random stream can't be used. GENIEHelper, interface to GENIE provided by nutools, creates a TRandom that GENIE can use. It initializes it with a random seed read from RandomSeed configuration parameter. This and all the other parameters are inherited from the art module (that is, GENIEGen) configuration. LArSoft meddles with this mechanism to provide support for the standard "Seed" parameter and NuRandomService service.

Configuration parameters

  • RandomSeed (integer, optional): if specified, this value is used as seed for GENIE random number generator engine
  • Seed (unsigned integer, optional): if specified, this value is used as seed for GENIE random number generator engine; if RandomSeed is also specified, this value is ignored (but in the future this could turn into a configuration error)

As custom, if the random seed is not provided by the configuration, one is fetched from NuRandomService (if available), with the behaviour in lar::util::FetchRandomSeed().

Definition at line 90 of file GENIEGen_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

evgen::GENIEGen::GENIEGen ( fhicl::ParameterSet const &  pset)
explicit

Definition at line 158 of file GENIEGen_module.cc.

References fBeamType, fGENIEHelp, fStopwatch, fhicl::ParameterSet::get(), fhicl::ParameterSet::get_if_present(), sim::kBNB, sim::kNuMI, geo::kUnknown, fhicl::ParameterSet::put(), geo::GeometryCore::ROOTFile(), geo::GeometryCore::ROOTGeoManager(), seed, and geo::GeometryCore::TotalMass().

159  : fGENIEHelp(0)
160  , fDefinedVtxHistRange (pset.get< bool >("DefinedVtxHistRange"))
161  , fVtxPosHistRange (pset.get< std::vector<double> >("VtxPosHistRange"))
162  , fPassEmptySpills (pset.get< bool >("PassEmptySpills"))
163  , fGlobalTimeOffset(pset.get< double >("GlobalTimeOffset",0))
164  , fRandomTimeOffset(pset.get< double >("RandomTimeOffset",1600.)) // BNB default value
165  , fBeamType(::sim::kBNB)
166  {
167  fStopwatch.Start();
168 
169  produces< std::vector<simb::MCTruth> >();
170  produces< std::vector<simb::MCFlux> >();
171  produces< std::vector<simb::GTruth> >();
172  produces< sumdata::RunData, art::InRun >();
173  produces< sumdata::POTSummary, art::InSubRun >();
174  produces< art::Assns<simb::MCTruth, simb::MCFlux> >();
175  produces< art::Assns<simb::MCTruth, simb::GTruth> >();
176  produces< std::vector<sim::BeamGateInfo> >();
177 
178  std::string beam_type_name = pset.get<std::string>("BeamName");
179 
180  if(beam_type_name == "numi")
181 
183 
184  else if(beam_type_name == "booster")
185 
187 
188  else
189 
191 
193 
194  signed int temp_seed; // the seed read by GENIEHelper is a signed integer...
195  fhicl::ParameterSet GENIEconfig(pset);
196  if (!GENIEconfig.get_if_present("RandomSeed", temp_seed)) { // TODO use has_key() when it becomes available
197  // no RandomSeed specified; check for the LArSoft-style "Seed" instead:
198  // obtain the random seed from a service,
199  // unless overridden in configuration with key "Seed"
200  unsigned int seed;
201  if (!GENIEconfig.get_if_present("Seed", seed))
202  seed = art::ServiceHandle<rndm::NuRandomService>()->getSeed();
203 
204  // The seed is not passed to RandomNumberGenerator,
205  // since GENIE uses a TRandom generator that is owned by the GENIEHelper.
206  // Instead, we explicitly configure the random seed for GENIEHelper:
207  GENIEconfig.put("RandomSeed", seed);
208  } // if no RandomSeed present
209 
210  fGENIEHelp = new evgb::GENIEHelper(GENIEconfig,
211  geo->ROOTGeoManager(),
212  geo->ROOTFile(),
213  geo->TotalMass(pset.get< std::string>("TopVolume").c_str()));
214 
215  }
Unknown view.
Definition: geo_types.h:83
TGeoManager * ROOTGeoManager() const
Access to the ROOT geometry description manager.
std::string ROOTFile() const
Returns the full directory path to the geometry file source.
::sim::BeamType_t fBeamType
The width of a simulated "beam gate".
NuMI.
Definition: BeamTypes.h:12
double TotalMass() const
Returns the total mass [kg] of the specified volume (default: world).
long seed
Definition: chem4.cc:68
int fPassEmptySpills
whether or not to kill evnets with no interactions
evgb::GENIEHelper * fGENIEHelp
GENIEHelper object.
double fGlobalTimeOffset
keep track of how long it takes to run the job
BNB.
Definition: BeamTypes.h:11
TStopwatch fStopwatch
Namespace collecting geometry-related classes utilities.
std::vector< double > fVtxPosHistRange
use defined hist range; it is useful to have for asymmetric ranges like in DP FD. ...
double fRandomTimeOffset
The start of a simulated "beam gate".
evgen::GENIEGen::~GENIEGen ( )
virtual

Definition at line 218 of file GENIEGen_module.cc.

References fGENIEHelp, and fStopwatch.

219  {
220  if(fGENIEHelp) delete fGENIEHelp;
221  fStopwatch.Stop();
222  mf::LogInfo("GENIEProductionTime") << "real time to produce file: " << fStopwatch.RealTime();
223  }
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
evgb::GENIEHelper * fGENIEHelp
GENIEHelper object.
TStopwatch fStopwatch

Member Function Documentation

void evgen::GENIEGen::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 226 of file GENIEGen_module.cc.

References geo::GeometryCore::DetHalfHeight(), geo::GeometryCore::DetHalfWidth(), geo::GeometryCore::DetLength(), fCCMode, fDCosX, fDCosY, fDCosZ, fDefinedVtxHistRange, fDeltaE, fECons, fEDCosX, fEDCosY, fEDCosZ, fEMomentum, fGenerated, fGENIEHelp, fMuDCosX, fMuDCosY, fMuDCosZ, fMuMomentum, fNCMode, fPrevTotGoodPOT, fPrevTotPOT, fVertexX, fVertexXY, fVertexXZ, fVertexY, fVertexYZ, fVertexZ, fVtxPosHistRange, evgb::GENIEHelper::Initialize(), art::TFileDirectory::make(), x, y, and z.

226  {
228 
229  fPrevTotPOT = 0.;
230  fPrevTotGoodPOT = 0.;
231 
232  // Get access to the TFile service.
234 
235  fGenerated[0] = tfs->make<TH1F>("fGenerated_necc","", 100, 0.0, 20.0);
236  fGenerated[1] = tfs->make<TH1F>("fGenerated_nebcc","", 100, 0.0, 20.0);
237  fGenerated[2] = tfs->make<TH1F>("fGenerated_nmcc","", 100, 0.0, 20.0);
238  fGenerated[3] = tfs->make<TH1F>("fGenerated_nmbcc","", 100, 0.0, 20.0);
239  fGenerated[4] = tfs->make<TH1F>("fGenerated_nnc","", 100, 0.0, 20.0);
240  fGenerated[5] = tfs->make<TH1F>("fGenerated_nbnc","", 100, 0.0, 20.0);
241 
242  fDCosX = tfs->make<TH1F>("fDCosX", ";dx/ds", 200, -1., 1.);
243  fDCosY = tfs->make<TH1F>("fDCosY", ";dy/ds", 200, -1., 1.);
244  fDCosZ = tfs->make<TH1F>("fDCosZ", ";dz/ds", 200, -1., 1.);
245 
246  fMuMomentum = tfs->make<TH1F>("fMuMomentum", ";p_{#mu} (GeV/c)", 500, 0., 50.);
247  fMuDCosX = tfs->make<TH1F>("fMuDCosX", ";dx/ds;", 200, -1., 1.);
248  fMuDCosY = tfs->make<TH1F>("fMuDCosY", ";dy/ds;", 200, -1., 1.);
249  fMuDCosZ = tfs->make<TH1F>("fMuDCosZ", ";dz/ds;", 200, -1., 1.);
250 
251  fEMomentum = tfs->make<TH1F>("fEMomentum", ";p_{e} (GeV/c)", 500, 0., 50.);
252  fEDCosX = tfs->make<TH1F>("fEDCosX", ";dx/ds;", 200, -1., 1.);
253  fEDCosY = tfs->make<TH1F>("fEDCosY", ";dy/ds;", 200, -1., 1.);
254  fEDCosZ = tfs->make<TH1F>("fEDCosZ", ";dz/ds;", 200, -1., 1.);
255 
256  fCCMode = tfs->make<TH1F>("fCCMode", ";CC Interaction Mode;", 4, 0., 4.);
257  fCCMode->GetXaxis()->SetBinLabel(1, "QE");
258  fCCMode->GetXaxis()->SetBinLabel(2, "Res");
259  fCCMode->GetXaxis()->SetBinLabel(3, "DIS");
260  fCCMode->GetXaxis()->SetBinLabel(4, "Coh");
261  fCCMode->GetXaxis()->CenterLabels();
262 
263  fNCMode = tfs->make<TH1F>("fNCMode", ";NC Interaction Mode;", 4, 0., 4.);
264  fNCMode->GetXaxis()->SetBinLabel(1, "QE");
265  fNCMode->GetXaxis()->SetBinLabel(2, "Res");
266  fNCMode->GetXaxis()->SetBinLabel(3, "DIS");
267  fNCMode->GetXaxis()->SetBinLabel(4, "Coh");
268  fNCMode->GetXaxis()->CenterLabels();
269 
270  fDeltaE = tfs->make<TH1F>("fDeltaE", ";#Delta E_{#nu} (GeV);", 200, -1., 1.);
271  fECons = tfs->make<TH1F>("fECons", ";#Delta E(#nu,lepton);", 500, -5., 5.);
272 
274  double x = 2.1*geo->DetHalfWidth();
275  double y = 2.1*geo->DetHalfHeight();
276  double z = 2.*geo->DetLength();
277  int xdiv = TMath::Nint(2*x/5.);
278  int ydiv = TMath::Nint(2*y/5.);
279  int zdiv = TMath::Nint(2*z/5.);
280 
281  if (fDefinedVtxHistRange == false)
282  {
283  fVertexX = tfs->make<TH1F>("fVertexX", ";x (cm)", xdiv, -0.1*x, x);
284  fVertexY = tfs->make<TH1F>("fVertexY", ";y (cm)", ydiv, -y, y);
285  fVertexZ = tfs->make<TH1F>("fVertexZ", ";z (cm)", zdiv, -0.1*z, z);
286 
287  fVertexXY = tfs->make<TH2F>("fVertexXY", ";x (cm);y (cm)", xdiv, -0.1*x, x, ydiv, -y, y);
288  fVertexXZ = tfs->make<TH2F>("fVertexXZ", ";z (cm);x (cm)", zdiv, -0.2*z, z, xdiv, -0.1*x, x);
289  fVertexYZ = tfs->make<TH2F>("fVertexYZ", ";z (cm);y (cm)", zdiv, -0.2*z, z, ydiv, -y, y);
290  }
291  else
292  {
293  fVertexX = tfs->make<TH1F>("fVertexX", ";x (cm)", xdiv, fVtxPosHistRange[0], fVtxPosHistRange[1]);
294  fVertexY = tfs->make<TH1F>("fVertexY", ";y (cm)", ydiv, fVtxPosHistRange[2], fVtxPosHistRange[3]);
295  fVertexZ = tfs->make<TH1F>("fVertexZ", ";z (cm)", zdiv, fVtxPosHistRange[4], fVtxPosHistRange[5]);
296 
297  fVertexXY = tfs->make<TH2F>("fVertexXY", ";x (cm);y (cm)", xdiv, fVtxPosHistRange[0], fVtxPosHistRange[1], ydiv, fVtxPosHistRange[2], fVtxPosHistRange[3]);
298  fVertexXZ = tfs->make<TH2F>("fVertexXZ", ";z (cm);x (cm)", zdiv, fVtxPosHistRange[4], fVtxPosHistRange[5], xdiv, fVtxPosHistRange[0], fVtxPosHistRange[1]);
299  fVertexYZ = tfs->make<TH2F>("fVertexYZ", ";z (cm);y (cm)", zdiv, fVtxPosHistRange[4], fVtxPosHistRange[5], ydiv, fVtxPosHistRange[2], fVtxPosHistRange[3]);
300  }
301 
302  }
TH1F * fVertexX
vertex location of generated events in x
Float_t x
Definition: compare.C:6
TH1F * fMuDCosZ
direction cosine of outgoing mu in z
TH2F * fVertexXZ
vertex location in xz
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
TH1F * fDeltaE
difference in neutrino energy from MCTruth::Enu() vs TParticle
TH2F * fVertexXY
vertex location in xy
TH1F * fMuDCosY
direction cosine of outgoing mu in y
Float_t y
Definition: compare.C:6
Double_t z
Definition: plot.C:279
TH1F * fNCMode
CC interaction mode.
TH1F * fDCosZ
direction cosine in z
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
TH1F * fEDCosY
direction cosine of outgoing e in y
TH1F * fCCMode
CC interaction mode.
double fPrevTotGoodPOT
Total good POT from subruns previous to current subrun.
evgb::GENIEHelper * fGENIEHelp
GENIEHelper object.
TH1F * fEDCosX
direction cosine of outgoing e in x
TH1F * fMuDCosX
direction cosine of outgoing mu in x
TH1F * fGenerated[6]
Spectra as generated.
geo::Length_t DetLength(geo::TPCID const &tpcid) const
Returns the length of the active volume of the specified TPC.
double fPrevTotPOT
The type of beam.
TH1F * fDCosY
direction cosine in y
TH1F * fEMomentum
momentum of outgoing electrons
T * make(ARGS...args) const
TH2F * fVertexYZ
vertex location in yz
TH1F * fECons
histogram to determine if energy is conserved in the event
TH1F * fEDCosZ
direction cosine of outgoing e in z
TH1F * fDCosX
direction cosine in x
Namespace collecting geometry-related classes utilities.
TH1F * fMuMomentum
momentum of outgoing muons
TH1F * fVertexY
vertex location of generated events in y
std::vector< double > fVtxPosHistRange
use defined hist range; it is useful to have for asymmetric ranges like in DP FD. ...
TH1F * fVertexZ
vertex location of generated events in z
void evgen::GENIEGen::beginRun ( art::Run run)
virtual

Reimplemented from art::EDProducer.

Definition at line 305 of file GENIEGen_module.cc.

References geo::GeometryCore::DetectorName(), and art::Run::put().

306  {
307 
308  // grab the geometry object to see what geometry we are using
310  std::unique_ptr<sumdata::RunData> runcol(new sumdata::RunData(geo->DetectorName()));
311 
312  run.put(std::move(runcol));
313 
314  return;
315  }
art::ProductID put(std::unique_ptr< PROD > &&)
Definition: Run.h:148
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
Namespace collecting geometry-related classes utilities.
void evgen::GENIEGen::beginSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDProducer.

Definition at line 318 of file GENIEGen_module.cc.

References fGENIEHelp, fPrevTotGoodPOT, fPrevTotPOT, and evgb::GENIEHelper::TotalExposure().

319  {
320 
323 
324  return;
325  }
double fPrevTotGoodPOT
Total good POT from subruns previous to current subrun.
evgb::GENIEHelper * fGENIEHelp
GENIEHelper object.
double fPrevTotPOT
The type of beam.
double TotalExposure() const
Definition: GENIEHelper.h:66
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
void evgen::GENIEGen::endSubRun ( art::SubRun sr)
virtual

Reimplemented from art::EDProducer.

Definition at line 328 of file GENIEGen_module.cc.

References fGENIEHelp, fPrevTotGoodPOT, fPrevTotPOT, art::SubRun::put(), evgb::GENIEHelper::TotalExposure(), sumdata::POTSummary::totgoodpot, and sumdata::POTSummary::totpot.

329  {
330 
331  std::unique_ptr<sumdata::POTSummary> p(new sumdata::POTSummary());
332 
333  p->totpot = fGENIEHelp->TotalExposure() - fPrevTotPOT;
334  p->totgoodpot = fGENIEHelp->TotalExposure() - fPrevTotGoodPOT;
335 
336  sr.put(std::move(p));
337 
338  return;
339  }
double fPrevTotGoodPOT
Total good POT from subruns previous to current subrun.
evgb::GENIEHelper * fGENIEHelp
GENIEHelper object.
double fPrevTotPOT
The type of beam.
double TotalExposure() const
Definition: GENIEHelper.h:66
ProductID put(std::unique_ptr< PROD > &&)
void evgen::GENIEGen::FillHistograms ( simb::MCTruth  mc)
private

< fill the vertex histograms from the neutrino - that is always particle 0 in the list

look for the outgoing lepton in the particle stack just interested in the first one

Definition at line 491 of file GENIEGen_module.cc.

References simb::MCNeutrino::CCNC(), DEFINE_ART_MODULE, simb::MCParticle::E(), energy, fCCMode, fDCosX, fDCosY, fDCosZ, fECons, fEDCosX, fEDCosY, fEDCosZ, fEMomentum, fGenerated, fMuDCosX, fMuDCosY, fMuDCosZ, fMuMomentum, fNCMode, fVertexX, fVertexXY, fVertexXZ, fVertexY, fVertexYZ, fVertexZ, simb::MCTruth::GetNeutrino(), simb::MCTruth::GetParticle(), simb::kCC, art::left(), LOG_DEBUG, simb::MCNeutrino::Mode(), simb::MCTruth::NParticles(), simb::MCNeutrino::Nu(), simb::MCParticle::P(), part, ParticleStatus(), simb::MCParticle::PdgCode(), simb::MCParticle::Px(), simb::MCParticle::Py(), simb::MCParticle::Pz(), ReactionChannel(), simb::MCParticle::Vx(), simb::MCParticle::Vy(), and simb::MCParticle::Vz().

Referenced by produce().

492  {
493  // Decide which histograms to put the spectrum in
494  int id = -1;
495  if (mc.GetNeutrino().CCNC()==simb::kCC) {
496  fCCMode->Fill(mc.GetNeutrino().Mode());
497  if (mc.GetNeutrino().Nu().PdgCode() == 12) id = 0;
498  else if (mc.GetNeutrino().Nu().PdgCode() == -12) id = 1;
499  else if (mc.GetNeutrino().Nu().PdgCode() == 14) id = 2;
500  else if (mc.GetNeutrino().Nu().PdgCode() == -14) id = 3;
501  else return;
502  }
503  else {
504  fNCMode->Fill(mc.GetNeutrino().Mode());
505  if (mc.GetNeutrino().Nu().PdgCode() > 0) id = 4;
506  else id = 5;
507  }
508  if (id==-1) abort();
509 
510  // Fill the specta histograms
511  fGenerated[id]->Fill(mc.GetNeutrino().Nu().E() );
512 
515  simb::MCNeutrino mcnu = mc.GetNeutrino();
516  const simb::MCParticle nu = mcnu.Nu();
517 
518  fVertexX->Fill(nu.Vx());
519  fVertexY->Fill(nu.Vy());
520  fVertexZ->Fill(nu.Vz());
521 
522  fVertexXY->Fill(nu.Vx(), nu.Vy());
523  fVertexXZ->Fill(nu.Vz(), nu.Vx());
524  fVertexYZ->Fill(nu.Vz(), nu.Vy());
525 
526  double mom = nu.P();
527  if(std::abs(mom) > 0.){
528  fDCosX->Fill(nu.Px()/mom);
529  fDCosY->Fill(nu.Py()/mom);
530  fDCosZ->Fill(nu.Pz()/mom);
531  }
532 
533 
534  LOG_DEBUG("GENIEInteractionInformation")
535  << std::endl
536  << "REACTION: " << ReactionChannel(mc.GetNeutrino().CCNC(),mc.GetNeutrino().Mode())
537  << std::endl
538  << "-----------> Particles in the Stack = " << mc.NParticles() << std::endl
539  << std::setiosflags(std::ios::left)
540  << std::setw(20) << "PARTICLE"
541  << std::setiosflags(std::ios::left)
542  << std::setw(32) << "STATUS"
543  << std::setw(18) << "E (GeV)"
544  << std::setw(18) << "m (GeV/c2)"
545  << std::setw(18) << "Ek (GeV)"
546  << std::endl << std::endl;
547 
548  const TDatabasePDG* databasePDG = TDatabasePDG::Instance();
549 
550  // Loop over the particle stack for this event
551  for(int i = 0; i < mc.NParticles(); ++i){
553  std::string name = databasePDG->GetParticle(part.PdgCode())->GetName();
554  int code = part.StatusCode();
555  std::string status = ParticleStatus(code);
556  double mass = part.Mass();
557  double energy = part.E();
558  double Ek = (energy-mass); // Kinetic Energy (GeV)
559  if(status=="kIStStableFinalState"||status=="kIStHadronInTheNucleus")
560  LOG_DEBUG("GENIEFinalState")
561  << std::setiosflags(std::ios::left) << std::setw(20) << name
562  << std::setiosflags(std::ios::left) << std::setw(32) <<status
563  << std::setw(18)<< energy
564  << std::setw(18)<< mass
565  << std::setw(18)<< Ek <<std::endl;
566  else
567  LOG_DEBUG("GENIEFinalState")
568  << std::setiosflags(std::ios::left) << std::setw(20) << name
569  << std::setiosflags(std::ios::left) << std::setw(32) << status
570  << std::setw(18) << energy
571  << std::setw(18) << mass <<std::endl;
572  }
573 
574 
575  if(mc.GetNeutrino().CCNC() == simb::kCC){
576 
579  for(int i = 0; i < mc.NParticles(); ++i){
581  if(abs(part.PdgCode()) == 11){
582  fEMomentum->Fill(part.P());
583  fEDCosX->Fill(part.Px()/part.P());
584  fEDCosY->Fill(part.Py()/part.P());
585  fEDCosZ->Fill(part.Pz()/part.P());
586  fECons->Fill(nu.E() - part.E());
587  break;
588  }
589  else if(abs(part.PdgCode()) == 13){
590  fMuMomentum->Fill(part.P());
591  fMuDCosX->Fill(part.Px()/part.P());
592  fMuDCosY->Fill(part.Py()/part.P());
593  fMuDCosZ->Fill(part.Pz()/part.P());
594  fECons->Fill(nu.E() - part.E());
595  break;
596  }
597  }// end loop over particles
598  }//end if CC interaction
599 
600  return;
601  }
TH1F * fVertexX
vertex location of generated events in x
std::string ParticleStatus(int StatusCode)
double E(const int i=0) const
Definition: MCParticle.h:237
TH1F * fMuDCosZ
direction cosine of outgoing mu in z
TH2F * fVertexXZ
vertex location in xz
int PdgCode() const
Definition: MCParticle.h:216
int CCNC() const
Definition: MCNeutrino.h:152
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:74
double Py(const int i=0) const
Definition: MCParticle.h:235
TH2F * fVertexXY
vertex location in xy
std::string ReactionChannel(int ccnc, int mode)
TH1F * fMuDCosY
direction cosine of outgoing mu in y
const simb::MCParticle & Nu() const
Definition: MCNeutrino.h:150
double Px(const int i=0) const
Definition: MCParticle.h:234
int NParticles() const
Definition: MCTruth.h:72
TH1F * fNCMode
CC interaction mode.
TH1F * fDCosZ
direction cosine in z
TH1F * fEDCosY
direction cosine of outgoing e in y
TH1F * fCCMode
CC interaction mode.
double P(const int i=0) const
Definition: MCParticle.h:238
TString part[npart]
Definition: Style.C:32
TH1F * fEDCosX
direction cosine of outgoing e in x
double energy
Definition: plottest35.C:25
TH1F * fMuDCosX
direction cosine of outgoing mu in x
TH1F * fGenerated[6]
Spectra as generated.
TH1F * fDCosY
direction cosine in y
const simb::MCParticle & GetParticle(int i) const
Definition: MCTruth.h:73
double Vx(const int i=0) const
Definition: MCParticle.h:225
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:104
TH1F * fEMomentum
momentum of outgoing electrons
TH2F * fVertexYZ
vertex location in yz
TH1F * fECons
histogram to determine if energy is conserved in the event
double Pz(const int i=0) const
Definition: MCParticle.h:236
double Vz(const int i=0) const
Definition: MCParticle.h:227
#define LOG_DEBUG(id)
TH1F * fEDCosZ
direction cosine of outgoing e in z
TH1F * fDCosX
direction cosine in x
Event generator information.
Definition: MCNeutrino.h:18
TH1F * fMuMomentum
momentum of outgoing muons
int Mode() const
Definition: MCNeutrino.h:153
TH1F * fVertexY
vertex location of generated events in y
TH1F * fVertexZ
vertex location of generated events in z
double Vy(const int i=0) const
Definition: MCParticle.h:226
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  }
std::string evgen::GENIEGen::ParticleStatus ( int  StatusCode)
private

Definition at line 420 of file GENIEGen_module.cc.

References sim::ParticleStatusName().

Referenced by FillHistograms().

421  {
422  int code = StatusCode;
423  std::string ParticleStatusName;
424 
425  switch(code)
426  {
427  case -1:
428  ParticleStatusName = "kIStUndefined";
429  break;
430  case 0:
431  ParticleStatusName = "kIStInitialState";
432  break;
433  case 1:
434  ParticleStatusName = "kIStStableFinalState";
435  break;
436  case 2:
437  ParticleStatusName = "kIStIntermediateState";
438  break;
439  case 3:
440  ParticleStatusName = "kIStDecayedState";
441  break;
442  case 11:
443  ParticleStatusName = "kIStNucleonTarget";
444  break;
445  case 12:
446  ParticleStatusName = "kIStDISPreFragmHadronicState";
447  break;
448  case 13:
449  ParticleStatusName = "kIStPreDecayResonantState";
450  break;
451  case 14:
452  ParticleStatusName = "kIStHadronInTheNucleus";
453  break;
454  case 15:
455  ParticleStatusName = "kIStFinalStateNuclearRemnant";
456  break;
457  case 16:
458  ParticleStatusName = "kIStNucleonClusterTarget";
459  break;
460  default:
461  ParticleStatusName = "Status Unknown";
462  }
463  return ParticleStatusName;
464  }
std::string ParticleStatusName(int code)
Describes the status of a particle (simb::MCParticle::StatusCode()).
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 evgen::GENIEGen::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 342 of file GENIEGen_module.cc.

References util::CreateAssn(), sim::dump::DumpGTruth(), sim::dump::DumpMCTruth(), fBeamType, fGENIEHelp, fGlobalTimeOffset, FillHistograms(), fPassEmptySpills, fRandomTimeOffset, simb::MCTruth::GetNeutrino(), simb::MCNeutrino::InteractionType(), simb::kNuanceOffset, LOG_DEBUG, simb::MCTruth::NeutrinoSet(), art::Event::put(), evgb::GENIEHelper::Sample(), and evgb::GENIEHelper::Stop().

343  {
344  std::unique_ptr< std::vector<simb::MCTruth> > truthcol (new std::vector<simb::MCTruth>);
345  std::unique_ptr< std::vector<simb::MCFlux> > fluxcol (new std::vector<simb::MCFlux >);
346  std::unique_ptr< std::vector<simb::GTruth> > gtruthcol (new std::vector<simb::GTruth >);
347  std::unique_ptr< art::Assns<simb::MCTruth, simb::MCFlux> > tfassn(new art::Assns<simb::MCTruth, simb::MCFlux>);
348  std::unique_ptr< art::Assns<simb::MCTruth, simb::GTruth> > tgtassn(new art::Assns<simb::MCTruth, simb::GTruth>);
349  std::unique_ptr< std::vector<sim::BeamGateInfo> > gateCollection(new std::vector<sim::BeamGateInfo>);
350 
351  while(truthcol->size() < 1){
352  while(!fGENIEHelp->Stop()){
353 
354  simb::MCTruth truth;
355  simb::MCFlux flux;
356  simb::GTruth gTruth;
357 
358  // GENIEHelper returns a false in the sample method if
359  // either no neutrino was generated, or the interaction
360  // occurred beyond the detector's z extent - ie something we
361  // would never see anyway.
362  if(fGENIEHelp->Sample(truth, flux, gTruth)){
363 
364  truthcol ->push_back(truth);
365  fluxcol ->push_back(flux);
366  gtruthcol->push_back(gTruth);
367  util::CreateAssn(*this, evt, *truthcol, *fluxcol, *tfassn, fluxcol->size()-1, fluxcol->size());
368  util::CreateAssn(*this, evt, *truthcol, *gtruthcol, *tgtassn, gtruthcol->size()-1, gtruthcol->size());
369 
370  FillHistograms(truth);
371 
372  // check that the process code is not unsupported by GENIE
373  // (see issue #18025 for reference);
374  // if it is, print all the information we can about this truth record
375  if (truth.NeutrinoSet() && (truth.GetNeutrino().InteractionType() == simb::kNuanceOffset)) {
376  mf::LogWarning log("GENIEmissingProcessMapping");
377  log << "Found an interaction that is not represented by the interaction type code in GENIE:"
378  "\nMCTruth record:"
379  "\n"
380  ;
381  sim::dump::DumpMCTruth(log, truth, 2U); // 2 trajectory points per line
382  log <<
383  "\nGENIE truth record:"
384  "\n"
385  ;
386  sim::dump::DumpGTruth(log, gTruth);
387  } // if
388 
389  }// end if genie was able to make an event
390 
391  }// end event generation loop
392 
393  // check to see if we are to pass empty spills
394  if(truthcol->size() < 1 && fPassEmptySpills){
395  LOG_DEBUG("GENIEGen") << "no events made for this spill but "
396  << "passing it on and ending the event anyway";
397  break;
398  }
399 
400  }// end loop while no interactions are made
401 
402  // Create a simulated "beam gate" for these neutrino events.
403  // We're creating a vector of these because, in a
404  // distant-but-possible future, we may be generating more than one
405  // beam gate within a simulated time window.
406  gateCollection->push_back(sim::BeamGateInfo( fGlobalTimeOffset, fRandomTimeOffset, fBeamType ));
407 
408  // put the collections in the event
409  evt.put(std::move(truthcol));
410  evt.put(std::move(fluxcol));
411  evt.put(std::move(gtruthcol));
412  evt.put(std::move(tfassn));
413  evt.put(std::move(tgtassn));
414  evt.put(std::move(gateCollection));
415 
416  return;
417  }
const simb::MCNeutrino & GetNeutrino() const
Definition: MCTruth.h:74
void DumpGTruth(Stream &&out, simb::GTruth const &truth, std::string indent, std::string firstIndent)
Dumps the content of the GENIE truth in the output stream.
Definition: MCDumpers.h:379
bool Sample(simb::MCTruth &truth, simb::MCFlux &flux, simb::GTruth &gtruth)
offset to account for adding in Nuance codes to this enum
Definition: MCNeutrino.h:99
::sim::BeamType_t fBeamType
The width of a simulated "beam gate".
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
int InteractionType() const
Definition: MCNeutrino.h:154
int fPassEmptySpills
whether or not to kill evnets with no interactions
evgb::GENIEHelper * fGENIEHelp
GENIEHelper object.
double fGlobalTimeOffset
keep track of how long it takes to run the job
void DumpMCTruth(Stream &&out, simb::MCTruth const &truth, unsigned int pointsPerLine, std::string indent, std::string firstIndent)
Dumps the content of the specified MC truth in the output stream.
Definition: MCDumpers.h:346
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.
#define LOG_DEBUG(id)
bool NeutrinoSet() const
Definition: MCTruth.h:75
Event generator information.
Definition: MCTruth.h:30
void FillHistograms(simb::MCTruth mc)
size_t size() const
Definition: DataViewImpl.cc:34
double fRandomTimeOffset
The start of a simulated "beam gate".
std::string evgen::GENIEGen::ReactionChannel ( int  ccnc,
int  mode 
)
private

Definition at line 467 of file GENIEGen_module.cc.

Referenced by FillHistograms().

468  {
469  std::string ReactionChannelName=" ";
470 
471  if(ccnc==0)
472  ReactionChannelName = "kCC";
473  else if(ccnc==1)
474  ReactionChannelName = "kNC";
475  else std::cout<<"Current mode unknown!! "<<std::endl;
476 
477  if(mode==0)
478  ReactionChannelName += "_kQE";
479  else if(mode==1)
480  ReactionChannelName += "_kRes";
481  else if(mode==2)
482  ReactionChannelName += "_kDIS";
483  else if(mode==3)
484  ReactionChannelName += "_kCoh";
485  else std::cout<<"interaction mode unknown!! "<<std::endl;
486 
487  return ReactionChannelName;
488  }
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

::sim::BeamType_t evgen::GENIEGen::fBeamType
private

The width of a simulated "beam gate".

Definition at line 117 of file GENIEGen_module.cc.

Referenced by GENIEGen(), and produce().

TH1F* evgen::GENIEGen::fCCMode
private

CC interaction mode.

Definition at line 146 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fDCosX
private

direction cosine in x

Definition at line 132 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fDCosY
private

direction cosine in y

Definition at line 133 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fDCosZ
private

direction cosine in z

Definition at line 134 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

bool evgen::GENIEGen::fDefinedVtxHistRange
private

Definition at line 109 of file GENIEGen_module.cc.

Referenced by beginJob().

TH1F* evgen::GENIEGen::fDeltaE
private

difference in neutrino energy from MCTruth::Enu() vs TParticle

Definition at line 149 of file GENIEGen_module.cc.

Referenced by beginJob().

TH1F* evgen::GENIEGen::fECons
private

histogram to determine if energy is conserved in the event

Definition at line 150 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fEDCosX
private

direction cosine of outgoing e in x

Definition at line 142 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fEDCosY
private

direction cosine of outgoing e in y

Definition at line 143 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fEDCosZ
private

direction cosine of outgoing e in z

Definition at line 144 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fEMomentum
private

momentum of outgoing electrons

Definition at line 141 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fGenerated[6]
private

Spectra as generated.

Definition at line 122 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

evgb::GENIEHelper* evgen::GENIEGen::fGENIEHelp
private

GENIEHelper object.

Definition at line 108 of file GENIEGen_module.cc.

Referenced by beginJob(), beginSubRun(), endSubRun(), GENIEGen(), produce(), and ~GENIEGen().

double evgen::GENIEGen::fGlobalTimeOffset
private

keep track of how long it takes to run the job

Definition at line 115 of file GENIEGen_module.cc.

Referenced by produce().

TH1F* evgen::GENIEGen::fMuDCosX
private

direction cosine of outgoing mu in x

Definition at line 137 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fMuDCosY
private

direction cosine of outgoing mu in y

Definition at line 138 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fMuDCosZ
private

direction cosine of outgoing mu in z

Definition at line 139 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fMuMomentum
private

momentum of outgoing muons

Definition at line 136 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fNCMode
private

CC interaction mode.

Definition at line 147 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

int evgen::GENIEGen::fPassEmptySpills
private

whether or not to kill evnets with no interactions

Definition at line 112 of file GENIEGen_module.cc.

Referenced by produce().

double evgen::GENIEGen::fPrevTotGoodPOT
private

Total good POT from subruns previous to current subrun.

Definition at line 120 of file GENIEGen_module.cc.

Referenced by beginJob(), beginSubRun(), and endSubRun().

double evgen::GENIEGen::fPrevTotPOT
private

The type of beam.

Total POT from subruns previous to current subrun

Definition at line 119 of file GENIEGen_module.cc.

Referenced by beginJob(), beginSubRun(), and endSubRun().

double evgen::GENIEGen::fRandomTimeOffset
private

The start of a simulated "beam gate".

Definition at line 116 of file GENIEGen_module.cc.

Referenced by produce().

TStopwatch evgen::GENIEGen::fStopwatch
private

Definition at line 113 of file GENIEGen_module.cc.

Referenced by GENIEGen(), and ~GENIEGen().

TH1F* evgen::GENIEGen::fVertexX
private

vertex location of generated events in x

Definition at line 124 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH2F* evgen::GENIEGen::fVertexXY
private

vertex location in xy

Definition at line 128 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH2F* evgen::GENIEGen::fVertexXZ
private

vertex location in xz

Definition at line 129 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fVertexY
private

vertex location of generated events in y

Definition at line 125 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH2F* evgen::GENIEGen::fVertexYZ
private

vertex location in yz

Definition at line 130 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

TH1F* evgen::GENIEGen::fVertexZ
private

vertex location of generated events in z

Definition at line 126 of file GENIEGen_module.cc.

Referenced by beginJob(), and FillHistograms().

std::vector< double > evgen::GENIEGen::fVtxPosHistRange
private

use defined hist range; it is useful to have for asymmetric ranges like in DP FD.

Definition at line 110 of file GENIEGen_module.cc.

Referenced by beginJob().


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