LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
evgen::SingleGen Class Reference

module to produce single or multiple specified particles in the detector More...

Inheritance diagram for evgen::SingleGen:
art::EDProducer art::detail::Producer art::detail::LegacyModule art::Modifier art::ModuleBase art::ProductRegistryHelper

Classes

struct  Config
 

Public Types

using Parameters = art::EDProducer::Table< Config >
 
using ModuleType = EDProducer
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = Modifier::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 SingleGen (Parameters const &config)
 
void produce (art::Event &evt) 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)
 
void fillProductDescriptions ()
 
void registerProducts (ProductDescriptions &productsToRegister)
 
ModuleDescription const & moduleDescription () const
 
void setModuleDescription (ModuleDescription const &)
 
std::array< std::vector< ProductInfo >, NumBranchTypes > const & getConsumables () const
 
void sortConsumables (std::string const &current_process_name)
 
std::unique_ptr< Worker > makeWorker (WorkerParams const &wp)
 
template<typename T , BranchType BT>
ViewToken< T > consumesView (InputTag const &tag)
 
template<typename T , BranchType BT>
ViewToken< T > mayConsumeView (InputTag const &tag)
 

Protected Member Functions

ConsumesCollector & consumesCollector ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > consumes (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename T , BranchType = InEvent>
ProductToken< T > mayConsume (InputTag const &)
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 

Private Member Functions

void SampleOne (unsigned int i, simb::MCTruth &mct)
 
void SampleMany (simb::MCTruth &mct)
 
void Sample (simb::MCTruth &mct)
 
void printVecs (std::vector< std::string > const &list)
 
bool PadVector (std::vector< double > &vec)
 
double SelectFromHist (const TH1 &h)
 
void SelectFromHist (const TH2 &h, double &x, double &y)
 
void beginRun (art::Run &run) override
 Act on begin of run: write "RunData" information (sumdata::RunData). More...
 
void setup ()
 Performs checks and initialization based on the current configuration. More...
 

Static Private Member Functions

static std::map< int, std::string > makeParticleSelectionModeNames ()
 Returns a vector with the name of particle selection mode keywords. More...
 
static std::map< int, std::string > makeDistributionNames ()
 Returns a vector with the name of distribution keywords. More...
 
template<typename OptionList >
static auto selectOption (std::string Option, OptionList const &allowedOptions) -> decltype(auto)
 Parses an option string and returns the corresponding option number. More...
 
template<typename OptionList >
static std::string presentOptions (OptionList const &allowedOptions, bool printKey, std::initializer_list< typename OptionList::value_type::first_type > exclude)
 Returns a string describing all options in the list. More...
 
template<typename OptionList >
static std::string presentOptions (OptionList const &allowedOptions, bool printKey=true)
 
template<typename OptionList >
static std::string optionName (typename OptionList::value_type::first_type optionKey, OptionList const &allowedOptions, std::string defName="<unknown>")
 Returns the name of the specified option key, or defName if not known. More...
 

Private Attributes

int fMode
 
bool fPadOutVectors
 
std::vector< int > fPDG
 PDG code of particles to generate. More...
 
std::vector< double > fP0
 Central momentum (GeV/c) to generate. More...
 
std::vector< double > fSigmaP
 Variation in momenta (GeV/c) More...
 
int fPDist
 How to distribute momenta (gaus or uniform) More...
 
std::vector< double > fX0
 Central x position (cm) in world coordinates. More...
 
std::vector< double > fY0
 Central y position (cm) in world coordinates. More...
 
std::vector< double > fZ0
 Central z position (cm) in world coordinates. More...
 
std::vector< double > fT0
 Central t position (s) in world coordinates. More...
 
std::vector< double > fSigmaX
 Variation in x position (cm) More...
 
std::vector< double > fSigmaY
 Variation in y position (cm) More...
 
std::vector< double > fSigmaZ
 Variation in z position (cm) More...
 
std::vector< double > fSigmaT
 Variation in t position (s) More...
 
int fPosDist
 How to distribute xyz (gaus, or uniform) More...
 
int fTDist
 How to distribute t (gaus, or uniform) More...
 
bool fSingleVertex
 if true - all particles produced at the same location More...
 
std::vector< double > fTheta0XZ
 Angle in XZ plane (degrees) More...
 
std::vector< double > fTheta0YZ
 Angle in YZ plane (degrees) More...
 
std::vector< double > fSigmaThetaXZ
 Variation in angle in XZ plane. More...
 
std::vector< double > fSigmaThetaYZ
 Variation in angle in YZ plane. More...
 
int fAngleDist
 How to distribute angles (gaus, uniform) More...
 
std::string fHistFileName
 Filename containing histogram of momenta. More...
 
std::vector< std::string > fPHist
 name of histogram of momenta More...
 
std::vector< std::string > fThetaXzYzHist
 name of histogram for thetaxz/thetayz distribution More...
 
std::vector< std::unique_ptr< TH1 > > hPHist
 
std::vector< std::unique_ptr< TH2 > > hThetaXzYzHist
 actual TH1 for momentum distributions More...
 
CLHEP::HepRandomEngine & fEngine
 actual TH2 for angle distributions - Xz on x axis . More...
 

Static Private Attributes

static const std::map< int, std::string > ParticleSelectionModeNames
 Names of all particle selection modes. More...
 
static const std::map< int, std::string > DistributionNames
 Names of all distribution modes. More...
 
Constants for particle type extraction mode (`ParticleSelectionMode` parameter).
static constexpr int kSelectAllParts = 0
 One particle per entry is generated. More...
 
static constexpr int kSelectOneRandPart
 
Constants for kinematic distribution options.
static constexpr int kUNIF = 0
 Uniform distribution. More...
 
static constexpr int kGAUS = 1
 Gaussian distribution. More...
 
static constexpr int kHIST = 2
 

Detailed Description

module to produce single or multiple specified particles in the detector

Definition at line 61 of file SingleGen_module.cc.

Member Typedef Documentation

Definition at line 17 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::detail::Producer::Table = Modifier::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 26 of file Producer.h.

Constructor & Destructor Documentation

evgen::SingleGen::SingleGen ( Parameters const &  config)
explicit

Definition at line 423 of file SingleGen_module.cc.

References art::detail::EngineCreator::createEngine(), DistributionNames, fAngleDist, fEngine, fHistFileName, fMode, fP0, fPadOutVectors, fPDG, fPDist, fPHist, fPosDist, fSigmaP, fSigmaT, fSigmaThetaXZ, fSigmaThetaYZ, fSigmaX, fSigmaY, fSigmaZ, fSingleVertex, fT0, fTDist, fTheta0XZ, fTheta0YZ, fThetaXzYzHist, fX0, fY0, fZ0, ParticleSelectionModeNames, seed, selectOption(), and setup().

424  : EDProducer{config}
425  , fMode(selectOption(config().ParticleSelectionMode(), ParticleSelectionModeNames))
426  , fPadOutVectors(config().PadOutVectors())
427  , fPDG(config().PDG())
428  , fP0(config().P0())
429  , fSigmaP(config().SigmaP())
430  , fPDist(selectOption(config().PDist(), DistributionNames))
431  , fX0(config().X0())
432  , fY0(config().Y0())
433  , fZ0(config().Z0())
434  , fT0(config().T0())
435  , fSigmaX(config().SigmaX())
436  , fSigmaY(config().SigmaY())
437  , fSigmaZ(config().SigmaZ())
438  , fSigmaT(config().SigmaT())
439  , fPosDist(selectOption(config().PosDist(), DistributionNames))
440  , fTDist(selectOption(config().TDist(), DistributionNames))
441  , fSingleVertex(config().SingleVertex())
442  , fTheta0XZ(config().Theta0XZ())
443  , fTheta0YZ(config().Theta0YZ())
444  , fSigmaThetaXZ(config().SigmaThetaXZ())
445  , fSigmaThetaYZ(config().SigmaThetaYZ())
446  , fAngleDist(selectOption(config().AngleDist(), DistributionNames))
447  , fHistFileName(config().HistogramFile())
448  , fPHist(config().PHist())
449  , fThetaXzYzHist(config().ThetaXzYzHist())
450  , fEngine(createEngine(0))
451  {
452  setup();
454  if (config().Seed(seed)) { fEngine.setSeed(seed, 0 /* dummy? */); }
455 
456  produces<std::vector<simb::MCTruth>>();
457  produces<sumdata::RunData, art::InRun>();
458  }
int fPDist
How to distribute momenta (gaus or uniform)
static const std::map< int, std::string > DistributionNames
Names of all distribution modes.
base_engine_t & createEngine(seed_t seed)
int fTDist
How to distribute t (gaus, or uniform)
std::vector< double > fSigmaT
Variation in t position (s)
EDProducer(fhicl::ParameterSet const &pset)
Definition: EDProducer.cc:6
std::vector< std::string > fThetaXzYzHist
name of histogram for thetaxz/thetayz distribution
bool fSingleVertex
if true - all particles produced at the same location
int fPosDist
How to distribute xyz (gaus, or uniform)
std::vector< double > fSigmaZ
Variation in z position (cm)
std::vector< double > fT0
Central t position (s) in world coordinates.
long seed
Definition: chem4.cc:67
std::vector< double > fP0
Central momentum (GeV/c) to generate.
std::vector< double > fTheta0YZ
Angle in YZ plane (degrees)
static auto selectOption(std::string Option, OptionList const &allowedOptions) -> decltype(auto)
Parses an option string and returns the corresponding option number.
std::vector< double > fY0
Central y position (cm) in world coordinates.
std::vector< int > fPDG
PDG code of particles to generate.
std::vector< double > fSigmaThetaYZ
Variation in angle in YZ plane.
std::vector< double > fSigmaP
Variation in momenta (GeV/c)
std::vector< double > fZ0
Central z position (cm) in world coordinates.
std::vector< std::string > fPHist
name of histogram of momenta
std::vector< double > fSigmaX
Variation in x position (cm)
std::vector< double > fX0
Central x position (cm) in world coordinates.
static const std::map< int, std::string > ParticleSelectionModeNames
Names of all particle selection modes.
std::string fHistFileName
Filename containing histogram of momenta.
int fAngleDist
How to distribute angles (gaus, uniform)
std::vector< double > fTheta0XZ
Angle in XZ plane (degrees)
void setup()
Performs checks and initialization based on the current configuration.
std::vector< double > fSigmaThetaXZ
Variation in angle in XZ plane.
CLHEP::HepRandomEngine & fEngine
actual TH2 for angle distributions - Xz on x axis .
art::detail::EngineCreator::seed_t seed_t
std::vector< double > fSigmaY
Variation in y position (cm)

Member Function Documentation

void evgen::SingleGen::beginRun ( art::Run run)
overrideprivatevirtual

Act on begin of run: write "RunData" information (sumdata::RunData).

Reimplemented from art::EDProducer.

Definition at line 461 of file SingleGen_module.cc.

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

462  {
463  geo::GeometryCore const& geom = *(lar::providerFrom<geo::Geometry>());
464  run.put(std::make_unique<sumdata::RunData>(geom.DetectorName()), art::fullRun());
465  }
constexpr auto fullRun()
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Run.h:121
Description of geometry of one entire detector.
Definition: GeometryCore.h:119
std::string const & DetectorName() const
Returns a string with the name of the detector, as configured.
Definition: GeometryCore.h:203
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::Producer::doBeginJob ( SharedResources const &  resources)
inherited

Definition at line 22 of file Producer.cc.

References art::detail::Producer::beginJobWithFrame(), and art::detail::Producer::setupQueues().

23  {
24  setupQueues(resources);
25  ProcessingFrame const frame{ScheduleID{}};
26  beginJobWithFrame(frame);
27  }
virtual void setupQueues(SharedResources const &)=0
virtual void beginJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doBeginRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 65 of file Producer.cc.

References art::detail::Producer::beginRunWithFrame(), art::RangeSet::forRun(), art::RunPrincipal::makeRun(), r, art::RunPrincipal::runID(), and art::ModuleContext::scheduleID().

66  {
67  auto r = rp.makeRun(mc, RangeSet::forRun(rp.runID()));
68  ProcessingFrame const frame{mc.scheduleID()};
69  beginRunWithFrame(r, frame);
70  r.commitProducts();
71  return true;
72  }
TRandom r
Definition: spectrum.C:23
virtual void beginRunWithFrame(Run &, ProcessingFrame const &)=0
static RangeSet forRun(RunID)
Definition: RangeSet.cc:51
bool art::detail::Producer::doBeginSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 85 of file Producer.cc.

References art::detail::Producer::beginSubRunWithFrame(), art::RangeSet::forSubRun(), art::SubRunPrincipal::makeSubRun(), art::ModuleContext::scheduleID(), and art::SubRunPrincipal::subRunID().

86  {
87  auto sr = srp.makeSubRun(mc, RangeSet::forSubRun(srp.subRunID()));
88  ProcessingFrame const frame{mc.scheduleID()};
89  beginSubRunWithFrame(sr, frame);
90  sr.commitProducts();
91  return true;
92  }
virtual void beginSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
static RangeSet forSubRun(SubRunID)
Definition: RangeSet.cc:57
void art::detail::Producer::doEndJob ( )
inherited

Definition at line 30 of file Producer.cc.

References art::detail::Producer::endJobWithFrame().

31  {
32  ProcessingFrame const frame{ScheduleID{}};
33  endJobWithFrame(frame);
34  }
virtual void endJobWithFrame(ProcessingFrame const &)=0
bool art::detail::Producer::doEndRun ( RunPrincipal rp,
ModuleContext const &  mc 
)
inherited

Definition at line 75 of file Producer.cc.

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

76  {
77  auto r = rp.makeRun(mc, rp.seenRanges());
78  ProcessingFrame const frame{mc.scheduleID()};
79  endRunWithFrame(r, frame);
80  r.commitProducts();
81  return true;
82  }
TRandom r
Definition: spectrum.C:23
virtual void endRunWithFrame(Run &, ProcessingFrame const &)=0
bool art::detail::Producer::doEndSubRun ( SubRunPrincipal srp,
ModuleContext const &  mc 
)
inherited

Definition at line 95 of file Producer.cc.

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

96  {
97  auto sr = srp.makeSubRun(mc, srp.seenRanges());
98  ProcessingFrame const frame{mc.scheduleID()};
99  endSubRunWithFrame(sr, frame);
100  sr.commitProducts();
101  return true;
102  }
virtual void endSubRunWithFrame(SubRun &, ProcessingFrame const &)=0
bool art::detail::Producer::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 105 of file Producer.cc.

References art::detail::Producer::checkPutProducts_, e, art::EventPrincipal::makeEvent(), art::detail::Producer::produceWithFrame(), and art::ModuleContext::scheduleID().

110  {
111  auto e = ep.makeEvent(mc);
112  ++counts_run;
113  ProcessingFrame const frame{mc.scheduleID()};
114  produceWithFrame(e, frame);
115  e.commitProducts(checkPutProducts_, &expectedProducts<InEvent>());
116  ++counts_passed;
117  return true;
118  }
bool const checkPutProducts_
Definition: Producer.h:70
Float_t e
Definition: plot.C:35
virtual void produceWithFrame(Event &, ProcessingFrame const &)=0
void art::detail::Producer::doRespondToCloseInputFile ( FileBlock const &  fb)
inherited

Definition at line 44 of file Producer.cc.

References art::detail::Producer::respondToCloseInputFileWithFrame().

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

Definition at line 58 of file Producer.cc.

References art::detail::Producer::respondToCloseOutputFilesWithFrame().

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

Definition at line 37 of file Producer.cc.

References art::detail::Producer::respondToOpenInputFileWithFrame().

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

Definition at line 51 of file Producer.cc.

References art::detail::Producer::respondToOpenOutputFilesWithFrame().

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

Definition at line 10 of file Modifier.cc.

References art::ProductRegistryHelper::fillDescriptions(), and art::ModuleBase::moduleDescription().

11  {
13  }
void fillDescriptions(ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
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
std::map< int, std::string > evgen::SingleGen::makeDistributionNames ( )
staticprivate

Returns a vector with the name of distribution keywords.

Definition at line 346 of file SingleGen_module.cc.

References DistributionNames, kGAUS, kHIST, kUNIF, makeParticleSelectionModeNames(), and ParticleSelectionModeNames.

347  {
348  std::map<int, std::string> names;
349  names[int(kUNIF)] = "uniform";
350  names[int(kGAUS)] = "Gaussian";
351  names[int(kHIST)] = "histograms";
352  return names;
353  } // SingleGen::makeDistributionNames()
static constexpr int kGAUS
Gaussian distribution.
static constexpr int kUNIF
Uniform distribution.
static constexpr int kHIST
std::map< int, std::string > evgen::SingleGen::makeParticleSelectionModeNames ( )
staticprivate

Returns a vector with the name of particle selection mode keywords.

Definition at line 338 of file SingleGen_module.cc.

References kSelectAllParts, and kSelectOneRandPart.

Referenced by makeDistributionNames().

339  {
340  std::map<int, std::string> names;
341  names[int(kSelectAllParts)] = "all";
342  names[int(kSelectOneRandPart)] = "singleRandom";
343  return names;
344  } // SingleGen::makeParticleSelectionModeNames()
static constexpr int kSelectOneRandPart
static constexpr int kSelectAllParts
One particle per entry is generated.
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
template<typename OptionList >
std::string evgen::SingleGen::optionName ( typename OptionList::value_type::first_type  optionKey,
OptionList const &  allowedOptions,
std::string  defName = "<unknown>" 
)
staticprivate

Returns the name of the specified option key, or defName if not known.

Definition at line 407 of file SingleGen_module.cc.

Referenced by presentOptions(), and setup().

411  {
412  auto iOption = allowedOptions.find(optionKey);
413  return (iOption != allowedOptions.end()) ? iOption->second : defName;
414  } // SingleGen::optionName()
bool evgen::SingleGen::PadVector ( std::vector< double > &  vec)
private

Definition at line 657 of file SingleGen_module.cc.

References fPadOutVectors, and fPDG.

Referenced by setup().

658  {
659  // check if the vec has the same size as fPDG
660  if (vec.size() != fPDG.size()) {
661  // if not padding out the vectors always cause an
662  // exception to be thrown if the vector in question
663  // is not the same size as the fPDG vector
664  // the exception is thrown in the reconfigure method
665  // that calls this one
666  if (!fPadOutVectors)
667  return false;
668  else if (fPadOutVectors) {
669  // if padding of vectors is desired but the vector in
670  // question has more than one entry it isn't clear
671  // what the padded values should be so cause
672  // an exception
673  if (vec.size() != 1) return false;
674 
675  // pad it out
676  vec.resize(fPDG.size(), vec[0]);
677 
678  } // end if padding out vectors
679  } // end if the vector size is not the same as fPDG
680 
681  return true;
682  }
std::vector< int > fPDG
PDG code of particles to generate.
template<typename OptionList >
std::string evgen::SingleGen::presentOptions ( OptionList const &  allowedOptions,
bool  printKey,
std::initializer_list< typename OptionList::value_type::first_type >  exclude 
)
staticprivate

Returns a string describing all options in the list.

Template Parameters
OptionListtype of list of options (e.g. std::map<int, std::string>)
Parameters
allowedOptionsthe list of allowed options
printKeywhether to print the key of the option beside its name
excludeKeyslist of keys to be ignored (none by default)
Returns
a string with all options in a line

The result string is a list of option names, separated by commas, like in `"'apple', 'orange', 'banana'". IfprintKeyistrue`, the key of each option is also written in parentheses, like in `"'apple' (1), 'orange' (7), 'banana' (2)"`.

Definition at line 387 of file SingleGen_module.cc.

References n, and util::to_string().

Referenced by presentOptions().

392  {
393  std::string msg;
394 
395  unsigned int n = 0;
396  for (auto const& option : allowedOptions) {
397  auto const& key = option.first;
398  if (std::find(exclude.begin(), exclude.end(), key) != exclude.end()) continue;
399  if (n++ > 0) msg += ", ";
400  msg += '\"' + std::string(option.second) + '\"';
401  if (printKey) msg += " (" + std::to_string(key) + ")";
402  } // for
403  return msg;
404  } // SingleGen::presentOptions()
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
Char_t n[5]
template<typename OptionList >
static std::string evgen::SingleGen::presentOptions ( OptionList const &  allowedOptions,
bool  printKey = true 
)
inlinestaticprivate

Definition at line 322 of file SingleGen_module.cc.

References optionName(), and presentOptions().

323  {
324  return presentOptions(allowedOptions, printKey, {});
325  }
static std::string presentOptions(OptionList const &allowedOptions, bool printKey, std::initializer_list< typename OptionList::value_type::first_type > exclude)
Returns a string describing all options in the list.
void evgen::SingleGen::printVecs ( std::vector< std::string > const &  list)
private

Definition at line 964 of file SingleGen_module.cc.

References e, fP0, fPDG, fSigmaP, fSigmaT, fSigmaThetaXZ, fSigmaThetaYZ, fSigmaX, fSigmaY, fSigmaZ, fT0, fTheta0XZ, fTheta0YZ, fX0, fY0, fZ0, and util::values().

Referenced by setup().

965  {
966 
967  mf::LogInfo("SingleGen") << " You are using vector values for SingleGen configuration.\n "
968  << " Some of the configuration vectors may have been padded out ,"
969  << " because they (weren't) as long as the pdg vector"
970  << " in your configuration. \n"
971  << " The new input particle configuration is:\n";
972 
973  std::string values;
974  for (size_t i = 0; i <= 1; ++i) { // list.size(); ++i){
975 
976  values.append(list[i]);
977  values.append(": [ ");
978 
979  for (size_t e = 0; e < fPDG.size(); ++e) {
980  std::stringstream buf;
981  buf.width(10);
982  if (i == 0) buf << fPDG[e] << ", ";
983  buf.precision(5);
984  if (i == 1) buf << fP0[e] << ", ";
985  if (i == 2) buf << fSigmaP[e] << ", ";
986  if (i == 3) buf << fX0[e] << ", ";
987  if (i == 4) buf << fY0[e] << ", ";
988  if (i == 5) buf << fZ0[e] << ", ";
989  if (i == 6) buf << fSigmaX[e] << ", ";
990  if (i == 7) buf << fSigmaY[e] << ", ";
991  if (i == 8) buf << fSigmaZ[e] << ", ";
992  if (i == 9) buf << fTheta0XZ[e] << ", ";
993  if (i == 10) buf << fTheta0YZ[e] << ", ";
994  if (i == 11) buf << fSigmaThetaXZ[e] << ", ";
995  if (i == 12) buf << fSigmaThetaYZ[e] << ", ";
996  if (i == 13) buf << fT0[e] << ", ";
997  if (i == 14) buf << fSigmaT[e] << ", ";
998  values.append(buf.str());
999  }
1000 
1001  values.erase(values.find_last_of(","));
1002  values.append(" ] \n");
1003 
1004  } // end loop over vector names in list
1005 
1006  mf::LogInfo("SingleGen") << values;
1007 
1008  return;
1009  }
std::vector< double > fSigmaT
Variation in t position (s)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
std::vector< double > fSigmaZ
Variation in z position (cm)
std::vector< double > fT0
Central t position (s) in world coordinates.
std::vector< double > fP0
Central momentum (GeV/c) to generate.
std::vector< double > fTheta0YZ
Angle in YZ plane (degrees)
decltype(auto) values(Coll &&coll)
Range-for loop helper iterating across the values of the specified collection.
std::vector< double > fY0
Central y position (cm) in world coordinates.
std::vector< int > fPDG
PDG code of particles to generate.
std::vector< double > fSigmaThetaYZ
Variation in angle in YZ plane.
std::vector< double > fSigmaP
Variation in momenta (GeV/c)
std::vector< double > fZ0
Central z position (cm) in world coordinates.
std::vector< double > fSigmaX
Variation in x position (cm)
std::vector< double > fX0
Central x position (cm) in world coordinates.
std::vector< double > fTheta0XZ
Angle in XZ plane (degrees)
Float_t e
Definition: plot.C:35
std::vector< double > fSigmaThetaXZ
Variation in angle in XZ plane.
std::vector< double > fSigmaY
Variation in y position (cm)
void evgen::SingleGen::produce ( art::Event evt)
overridevirtual

unique_ptr allows ownership to be transferred to the art::Event after the put statement

Implements art::EDProducer.

Definition at line 685 of file SingleGen_module.cc.

References simb::kSingleParticle, MF_LOG_DEBUG, art::Event::put(), Sample(), and simb::MCTruth::SetOrigin().

686  {
687 
689  std::unique_ptr<std::vector<simb::MCTruth>> truthcol(new std::vector<simb::MCTruth>);
690 
691  simb::MCTruth truth;
693  Sample(truth);
694 
695  MF_LOG_DEBUG("SingleGen") << truth;
696 
697  truthcol->push_back(truth);
698 
699  evt.put(std::move(truthcol));
700 
701  return;
702  }
void SetOrigin(simb::Origin_t origin)
Definition: MCTruth.h:82
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition: Event.h:77
single particles thrown at the detector
Definition: MCTruth.h:26
void Sample(simb::MCTruth &mct)
#define MF_LOG_DEBUG(id)
Event generator information.
Definition: MCTruth.h:32
void art::Modifier::registerProducts ( ProductDescriptions productsToRegister)
inherited

Definition at line 16 of file Modifier.cc.

References art::ModuleBase::moduleDescription(), and art::ProductRegistryHelper::registerProducts().

17  {
18  ProductRegistryHelper::registerProducts(productsToRegister,
20  }
void registerProducts(ProductDescriptions &productsToRegister, ModuleDescription const &md)
ModuleDescription const & moduleDescription() const
Definition: ModuleBase.cc:13
void evgen::SingleGen::Sample ( simb::MCTruth mct)
private

Definition at line 933 of file SingleGen_module.cc.

References fEngine, fMode, fPDG, fSingleVertex, SampleMany(), and SampleOne().

Referenced by produce().

934  {
935 
936  switch (fMode) {
937  case 0: // List generation mode: every event will have one of each
938  // particle species in the fPDG array
939  if (fSingleVertex) { SampleMany(mct); }
940  else {
941  for (unsigned int i = 0; i < fPDG.size(); ++i) {
942  SampleOne(i, mct);
943  } //end loop over particles
944  }
945  break;
946  case 1: // Random selection mode: every event will exactly one particle
947  // selected randomly from the fPDG array
948  {
949  CLHEP::RandFlat flat(fEngine);
950 
951  unsigned int i = flat.fireInt(fPDG.size());
952  SampleOne(i, mct);
953  } break;
954  default:
955  mf::LogWarning("UnrecognizeOption")
956  << "SingleGen does not recognize ParticleSelectionMode " << fMode;
957  break;
958  } // switch on fMode
959 
960  return;
961  }
void SampleOne(unsigned int i, simb::MCTruth &mct)
bool fSingleVertex
if true - all particles produced at the same location
std::vector< int > fPDG
PDG code of particles to generate.
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
void SampleMany(simb::MCTruth &mct)
CLHEP::HepRandomEngine & fEngine
actual TH2 for angle distributions - Xz on x axis .
void evgen::SingleGen::SampleMany ( simb::MCTruth mct)
private

Definition at line 821 of file SingleGen_module.cc.

References simb::MCTruth::Add(), simb::MCParticle::AddTrajectoryPoint(), fAngleDist, fEngine, fP0, fPDG, fPDist, fPosDist, fSigmaP, fSigmaT, fSigmaThetaXZ, fSigmaThetaYZ, fSigmaX, fSigmaY, fSigmaZ, fT0, fTDist, fTheta0XZ, fTheta0YZ, fX0, fY0, fZ0, hPHist, hThetaXzYzHist, kGAUS, kHIST, part, SelectFromHist(), and x.

Referenced by Sample().

822  {
823 
824  CLHEP::RandFlat flat(fEngine);
825  CLHEP::RandGaussQ gauss(fEngine);
826 
827  // Choose position
828  TVector3 x;
829  if (fPosDist == kGAUS) {
830  x[0] = gauss.fire(fX0[0], fSigmaX[0]);
831  ;
832  x[1] = gauss.fire(fY0[0], fSigmaY[0]);
833  x[2] = gauss.fire(fZ0[0], fSigmaZ[0]);
834  }
835  else {
836  x[0] = fX0[0] + fSigmaX[0] * (2.0 * flat.fire() - 1.0);
837  x[1] = fY0[0] + fSigmaY[0] * (2.0 * flat.fire() - 1.0);
838  x[2] = fZ0[0] + fSigmaZ[0] * (2.0 * flat.fire() - 1.0);
839  }
840 
841  double t = 0.;
842  if (fTDist == kGAUS) { t = gauss.fire(fT0[0], fSigmaT[0]); }
843  else {
844  t = fT0[0] + fSigmaT[0] * (2.0 * flat.fire() - 1.0);
845  }
846 
847  TLorentzVector pos(x[0], x[1], x[2], t);
848 
849  // loop through particles and select momenta and angles
850  for (unsigned int i(0); i < fPDG.size(); ++i) {
851  // Choose momentum
852  double p = 0.0;
853  double m = 0.0;
854  if (fPDist == kGAUS) { p = gauss.fire(fP0[i], fSigmaP[i]); }
855  else if (fPDist == kHIST) {
856  p = SelectFromHist(*(hPHist[i]));
857  }
858  else {
859  p = fP0[i] + fSigmaP[i] * (2.0 * flat.fire() - 1.0);
860  }
861 
862  static TDatabasePDG pdgt;
863  TParticlePDG* pdgp = pdgt.GetParticle(fPDG[i]);
864  if (pdgp) m = pdgp->Mass();
865 
866  // Choose angles
867  double thxz = 0;
868  double thyz = 0;
869 
870  double thyzrads = 0;
871  double thyzradsplussigma = 0;
872  double thyzradsminussigma = 0;
873 
874  if (fAngleDist == kGAUS) {
875  thxz = gauss.fire(fTheta0XZ[i], fSigmaThetaXZ[i]);
876  thyz = gauss.fire(fTheta0YZ[i], fSigmaThetaYZ[i]);
877  }
878  else if (fAngleDist == kHIST) {
879  double thetaxz = 0;
880  double thetayz = 0;
881  SelectFromHist(*(hThetaXzYzHist[i]), thetaxz, thetayz);
882  thxz = (180. / M_PI) * thetaxz;
883  thyz = (180. / M_PI) * thetayz;
884  }
885  else {
886 
887  // Choose angles flat in phase space, which is flat in theta_xz
888  // and flat in sin(theta_yz).
889 
890  thxz = fTheta0XZ[i] + fSigmaThetaXZ[i] * (2.0 * flat.fire() - 1.0);
891 
892  thyzrads = std::asin(std::sin(
893  (M_PI / 180.) *
894  (fTheta0YZ
895  [i]))); //Taking asin of sin gives value between -Pi/2 and Pi/2 regardless of user input
896  thyzradsplussigma =
897  TMath::Min((thyzrads + ((M_PI / 180.) * fabs(fSigmaThetaYZ[i]))), M_PI / 2.);
898  thyzradsminussigma =
899  TMath::Max((thyzrads - ((M_PI / 180.) * fabs(fSigmaThetaYZ[i]))), -M_PI / 2.);
900 
901  //uncomment line to print angular variation info
902  //std::cout << "Central angle: " << (180./M_PI)*thyzrads << " Max angle: " << (180./M_PI)*thyzradsplussigma << " Min angle: " << (180./M_PI)*thyzradsminussigma << std::endl;
903 
904  double sinthyzmin = std::sin(thyzradsminussigma);
905  double sinthyzmax = std::sin(thyzradsplussigma);
906  double sinthyz = sinthyzmin + flat.fire() * (sinthyzmax - sinthyzmin);
907  thyz = (180. / M_PI) * std::asin(sinthyz);
908  }
909 
910  double thxzrad = thxz * M_PI / 180.0;
911  double thyzrad = thyz * M_PI / 180.0;
912 
913  TLorentzVector pvec(p * std::cos(thyzrad) * std::sin(thxzrad),
914  p * std::sin(thyzrad),
915  p * std::cos(thxzrad) * std::cos(thyzrad),
916  std::sqrt(p * p + m * m));
917 
918  // set track id to -i as these are all primary particles and have id <= 0
919  int trackid = -1 * (i + 1);
920  std::string primary("primary");
921 
922  simb::MCParticle part(trackid, fPDG[i], primary);
923  part.AddTrajectoryPoint(pos, pvec);
924 
925  //std::cout << "Px: " << pvec.Px() << " Py: " << pvec.Py() << " Pz: " << pvec.Pz() << std::endl;
926  //std::cout << "x: " << pos.X() << " y: " << pos.Y() << " z: " << pos.Z() << " time: " << pos.T() << std::endl;
927  //std::cout << "YZ Angle: " << (thyzrad * (180./M_PI)) << " XZ Angle: " << (thxzrad * (180./M_PI)) << std::endl;
928  mct.Add(part);
929  }
930  }
Float_t x
Definition: compare.C:6
int fPDist
How to distribute momenta (gaus or uniform)
int fTDist
How to distribute t (gaus, or uniform)
std::vector< std::unique_ptr< TH2 > > hThetaXzYzHist
actual TH1 for momentum distributions
std::vector< double > fSigmaT
Variation in t position (s)
std::vector< std::unique_ptr< TH1 > > hPHist
int fPosDist
How to distribute xyz (gaus, or uniform)
std::vector< double > fSigmaZ
Variation in z position (cm)
std::vector< double > fT0
Central t position (s) in world coordinates.
TString part[npart]
Definition: Style.C:32
std::vector< double > fP0
Central momentum (GeV/c) to generate.
std::vector< double > fTheta0YZ
Angle in YZ plane (degrees)
double SelectFromHist(const TH1 &h)
std::vector< double > fY0
Central y position (cm) in world coordinates.
std::vector< int > fPDG
PDG code of particles to generate.
std::vector< double > fSigmaThetaYZ
Variation in angle in YZ plane.
std::vector< double > fSigmaP
Variation in momenta (GeV/c)
void Add(simb::MCParticle const &part)
Definition: MCTruth.h:80
std::vector< double > fZ0
Central z position (cm) in world coordinates.
std::vector< double > fSigmaX
Variation in x position (cm)
static constexpr int kGAUS
Gaussian distribution.
std::vector< double > fX0
Central x position (cm) in world coordinates.
int fAngleDist
How to distribute angles (gaus, uniform)
std::vector< double > fTheta0XZ
Angle in XZ plane (degrees)
static constexpr int kHIST
std::vector< double > fSigmaThetaXZ
Variation in angle in XZ plane.
CLHEP::HepRandomEngine & fEngine
actual TH2 for angle distributions - Xz on x axis .
std::vector< double > fSigmaY
Variation in y position (cm)
void evgen::SingleGen::SampleOne ( unsigned int  i,
simb::MCTruth mct 
)
private

Definition at line 707 of file SingleGen_module.cc.

References simb::MCTruth::Add(), simb::MCParticle::AddTrajectoryPoint(), fAngleDist, fEngine, fP0, fPDG, fPDist, fPosDist, fSigmaP, fSigmaT, fSigmaThetaXZ, fSigmaThetaYZ, fSigmaX, fSigmaY, fSigmaZ, fT0, fTDist, fTheta0XZ, fTheta0YZ, fX0, fY0, fZ0, hPHist, hThetaXzYzHist, kGAUS, kHIST, part, SelectFromHist(), and x.

Referenced by Sample().

708  {
709 
710  CLHEP::RandFlat flat(fEngine);
711  CLHEP::RandGaussQ gauss(fEngine);
712 
713  // Choose momentum
714  double p = 0.0;
715  double m = 0.0;
716  if (fPDist == kGAUS) { p = gauss.fire(fP0[i], fSigmaP[i]); }
717  else if (fPDist == kHIST) {
718  p = SelectFromHist(*(hPHist[i]));
719  }
720  else { // if (fPDist == kUNIF) {
721  p = fP0[i] + fSigmaP[i] * (2.0 * flat.fire() - 1.0);
722  }
723  // else {std::cout << "do not understand the value of PDist!";}
724 
725  static TDatabasePDG pdgt;
726  TParticlePDG* pdgp = pdgt.GetParticle(fPDG[i]);
727  if (pdgp) m = pdgp->Mass();
728 
729  // Choose position
730  TVector3 x;
731  if (fPosDist == kGAUS) {
732  x[0] = gauss.fire(fX0[i], fSigmaX[i]);
733  ;
734  x[1] = gauss.fire(fY0[i], fSigmaY[i]);
735  x[2] = gauss.fire(fZ0[i], fSigmaZ[i]);
736  }
737  else {
738  x[0] = fX0[i] + fSigmaX[i] * (2.0 * flat.fire() - 1.0);
739  x[1] = fY0[i] + fSigmaY[i] * (2.0 * flat.fire() - 1.0);
740  x[2] = fZ0[i] + fSigmaZ[i] * (2.0 * flat.fire() - 1.0);
741  }
742 
743  double t = 0.;
744  if (fTDist == kGAUS) { t = gauss.fire(fT0[i], fSigmaT[i]); }
745  else {
746  t = fT0[i] + fSigmaT[i] * (2.0 * flat.fire() - 1.0);
747  }
748 
749  TLorentzVector pos(x[0], x[1], x[2], t);
750 
751  // Choose angles
752  double thxz = 0;
753  double thyz = 0;
754 
755  double thyzrads = 0;
756  double thyzradsplussigma = 0;
757  double thyzradsminussigma = 0;
758 
759  if (fAngleDist == kGAUS) {
760  thxz = gauss.fire(fTheta0XZ[i], fSigmaThetaXZ[i]);
761  thyz = gauss.fire(fTheta0YZ[i], fSigmaThetaYZ[i]);
762  }
763  else if (fAngleDist == kHIST) { // Select thetaxz and thetayz from histogram
764  double thetaxz = 0;
765  double thetayz = 0;
766  SelectFromHist(*(hThetaXzYzHist[i]), thetaxz, thetayz);
767  thxz = (180. / M_PI) * thetaxz;
768  thyz = (180. / M_PI) * thetayz;
769  }
770  else {
771 
772  // Choose angles flat in phase space, which is flat in theta_xz
773  // and flat in sin(theta_yz).
774 
775  thxz = fTheta0XZ[i] + fSigmaThetaXZ[i] * (2.0 * flat.fire() - 1.0);
776 
777  thyzrads = std::asin(std::sin(
778  (M_PI / 180.) *
779  (fTheta0YZ
780  [i]))); //Taking asin of sin gives value between -Pi/2 and Pi/2 regardless of user input
781  thyzradsplussigma =
782  TMath::Min((thyzrads + ((M_PI / 180.) * fabs(fSigmaThetaYZ[i]))), M_PI / 2.);
783  thyzradsminussigma =
784  TMath::Max((thyzrads - ((M_PI / 180.) * fabs(fSigmaThetaYZ[i]))), -M_PI / 2.);
785 
786  //uncomment line to print angular variation info
787  //std::cout << "Central angle: " << (180./M_PI)*thyzrads << " Max angle: " << (180./M_PI)*thyzradsplussigma << " Min angle: " << (180./M_PI)*thyzradsminussigma << std::endl;
788 
789  double sinthyzmin = std::sin(thyzradsminussigma);
790  double sinthyzmax = std::sin(thyzradsplussigma);
791  double sinthyz = sinthyzmin + flat.fire() * (sinthyzmax - sinthyzmin);
792  thyz = (180. / M_PI) * std::asin(sinthyz);
793  }
794 
795  double thxzrad = thxz * M_PI / 180.0;
796  double thyzrad = thyz * M_PI / 180.0;
797 
798  TLorentzVector pvec(p * std::cos(thyzrad) * std::sin(thxzrad),
799  p * std::sin(thyzrad),
800  p * std::cos(thxzrad) * std::cos(thyzrad),
801  std::sqrt(p * p + m * m));
802 
803  // set track id to -i as these are all primary particles and have id <= 0
804  int trackid = -1 * (i + 1);
805  std::string primary("primary");
806 
807  simb::MCParticle part(trackid, fPDG[i], primary);
808  part.AddTrajectoryPoint(pos, pvec);
809 
810  //std::cout << "Px: " << pvec.Px() << " Py: " << pvec.Py() << " Pz: " << pvec.Pz() << std::endl;
811  //std::cout << "x: " << pos.X() << " y: " << pos.Y() << " z: " << pos.Z() << " time: " << pos.T() << std::endl;
812  //std::cout << "YZ Angle: " << (thyzrad * (180./M_PI)) << " XZ Angle: " << (thxzrad * (180./M_PI)) << std::endl;
813 
814  mct.Add(part);
815  }
Float_t x
Definition: compare.C:6
int fPDist
How to distribute momenta (gaus or uniform)
int fTDist
How to distribute t (gaus, or uniform)
std::vector< std::unique_ptr< TH2 > > hThetaXzYzHist
actual TH1 for momentum distributions
std::vector< double > fSigmaT
Variation in t position (s)
std::vector< std::unique_ptr< TH1 > > hPHist
int fPosDist
How to distribute xyz (gaus, or uniform)
std::vector< double > fSigmaZ
Variation in z position (cm)
std::vector< double > fT0
Central t position (s) in world coordinates.
TString part[npart]
Definition: Style.C:32
std::vector< double > fP0
Central momentum (GeV/c) to generate.
std::vector< double > fTheta0YZ
Angle in YZ plane (degrees)
double SelectFromHist(const TH1 &h)
std::vector< double > fY0
Central y position (cm) in world coordinates.
std::vector< int > fPDG
PDG code of particles to generate.
std::vector< double > fSigmaThetaYZ
Variation in angle in YZ plane.
std::vector< double > fSigmaP
Variation in momenta (GeV/c)
void Add(simb::MCParticle const &part)
Definition: MCTruth.h:80
std::vector< double > fZ0
Central z position (cm) in world coordinates.
std::vector< double > fSigmaX
Variation in x position (cm)
static constexpr int kGAUS
Gaussian distribution.
std::vector< double > fX0
Central x position (cm) in world coordinates.
int fAngleDist
How to distribute angles (gaus, uniform)
std::vector< double > fTheta0XZ
Angle in XZ plane (degrees)
static constexpr int kHIST
std::vector< double > fSigmaThetaXZ
Variation in angle in XZ plane.
CLHEP::HepRandomEngine & fEngine
actual TH2 for angle distributions - Xz on x axis .
std::vector< double > fSigmaY
Variation in y position (cm)
double evgen::SingleGen::SelectFromHist ( const TH1 &  h)
private

Definition at line 1012 of file SingleGen_module.cc.

References fEngine.

Referenced by SampleMany(), and SampleOne().

1013  {
1014  CLHEP::RandFlat flat(fEngine);
1015 
1016  double throw_value = h.Integral() * flat.fire();
1017  double cum_value(0);
1018  for (int i(0); i < h.GetNbinsX() + 1; ++i) {
1019  cum_value += h.GetBinContent(i);
1020  if (throw_value < cum_value) { return flat.fire() * h.GetBinWidth(i) + h.GetBinLowEdge(i); }
1021  }
1022  return throw_value; // for some reason we've gone through all bins and failed?
1023  }
CLHEP::HepRandomEngine & fEngine
actual TH2 for angle distributions - Xz on x axis .
void evgen::SingleGen::SelectFromHist ( const TH2 &  h,
double &  x,
double &  y 
)
private

Definition at line 1025 of file SingleGen_module.cc.

References DEFINE_ART_MODULE, and fEngine.

1026  {
1027  CLHEP::RandFlat flat(fEngine);
1028 
1029  double throw_value = h.Integral() * flat.fire();
1030  double cum_value(0);
1031  for (int i(0); i < h.GetNbinsX() + 1; ++i) {
1032  for (int j(0); j < h.GetNbinsY() + 1; ++j) {
1033  cum_value += h.GetBinContent(i, j);
1034  if (throw_value < cum_value) {
1035  x = flat.fire() * h.GetXaxis()->GetBinWidth(i) + h.GetXaxis()->GetBinLowEdge(i);
1036  y = flat.fire() * h.GetYaxis()->GetBinWidth(j) + h.GetYaxis()->GetBinLowEdge(j);
1037  return;
1038  }
1039  }
1040  }
1041  return; // for some reason we've gone through all bins and failed?
1042  }
Float_t x
Definition: compare.C:6
Float_t y
Definition: compare.C:6
CLHEP::HepRandomEngine & fEngine
actual TH2 for angle distributions - Xz on x axis .
template<typename OptionList >
auto evgen::SingleGen::selectOption ( std::string  Option,
OptionList const &  allowedOptions 
) -> decltype(auto)
staticprivate

Parses an option string and returns the corresponding option number.

Template Parameters
OptionListtype of list of options (e.g. std::map<int, std::string>)
Parameters
Optionthe string of the option to be parsed
allowedOptionslist of valid options, as key/name pairs
Returns
the key of the Option string from allowedOptions
Exceptions
std::runtime_errorif Option is not in the option list

The option string Option represent a single one among the supported options as defined in allowedOptions. The option string can be either one of the option names (the matching is not case-sensitive) or the number of the option itself.

OptionList requirements

OptionList must behave like a sequence with forward iterators. Each element must behave as a pair, whose first element is the option key and the second element is the option name, equivalent to a string in that it must be forward-iterable and its elements can be converted by std::tolower(). The key type has no requirements beside being copiable.

Definition at line 361 of file SingleGen_module.cc.

References util::end().

Referenced by evgen::SingleGen::Config::fromHistogram(), and SingleGen().

363  {
364  using key_type = typename OptionList::value_type::first_type;
365  using tolower_type = int (*)(int);
366  auto toLower = [](auto const& S) {
367  std::string s;
368  s.reserve(S.size());
369  std::transform(S.cbegin(), S.cend(), std::back_inserter(s), (tolower_type)&std::tolower);
370  return s;
371  };
372  auto option = toLower(Option);
373  for (auto const& candidate : allowedOptions) {
374  if (toLower(candidate.second) == option) return candidate.first;
375  }
376  try {
377  std::size_t end;
378  key_type num = std::stoi(Option, &end);
379  if (allowedOptions.count(num) && (end == Option.length())) return num;
380  }
381  catch (std::invalid_argument const&) {
382  }
383  throw std::runtime_error("Option '" + Option + "' not supported.");
384  } // SingleGen::selectOption()
decltype(auto) constexpr end(T &&obj)
ADL-aware version of std::end.
Definition: StdUtils.h:77
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 evgen::SingleGen::setup ( )
private

Performs checks and initialization based on the current configuration.

Definition at line 468 of file SingleGen_module.cc.

References art::errors::Configuration, DistributionNames, fAngleDist, fHistFileName, fP0, fPadOutVectors, fPDG, fPDist, fPHist, fPosDist, fSigmaP, fSigmaT, fSigmaThetaXZ, fSigmaThetaYZ, fSigmaX, fSigmaY, fSigmaZ, fT0, fTDist, fTheta0XZ, fTheta0YZ, fThetaXzYzHist, fX0, fY0, fZ0, hPHist, hThetaXzYzHist, kGAUS, kHIST, kUNIF, art::errors::NotFound, optionName(), PadVector(), printVecs(), and util::to_string().

Referenced by SingleGen().

469  {
470  // do not put seed in reconfigure because we don't want to reset
471  // the seed midstream
472  std::vector<std::string> vlist(15);
473  vlist[0] = "PDG";
474  vlist[1] = "P0";
475  vlist[2] = "SigmaP";
476  vlist[3] = "X0";
477  vlist[4] = "Y0";
478  vlist[5] = "Z0";
479  vlist[6] = "SigmaX";
480  vlist[7] = "SigmaY";
481  vlist[8] = "SigmaZ";
482  vlist[9] = "Theta0XZ";
483  vlist[10] = "Theta0YZ";
484  vlist[11] = "SigmaThetaXZ";
485  vlist[12] = "SigmaThetaYZ";
486  vlist[13] = "T0";
487  vlist[14] = "SigmaT";
488 
489  // vlist[15] = "PHist";
490  // vlist[16] = "ThetaHist";
491  // vlist[17] = "PhiHist";
492 
493  // begin tests for multiple particle error possibilities
494  std::string list;
495  if (fPDist != kHIST) {
496  if (!this->PadVector(fP0)) { list.append(vlist[1].append(", \n")); }
497  if (!this->PadVector(fSigmaP)) { list.append(vlist[2].append(", \n")); }
498  }
499  if (!this->PadVector(fX0)) { list.append(vlist[3].append(", \n")); }
500  if (!this->PadVector(fY0)) { list.append(vlist[4].append(", \n")); }
501  if (!this->PadVector(fZ0)) { list.append(vlist[5].append(", \n")); }
502  if (!this->PadVector(fSigmaX)) { list.append(vlist[6].append(", \n")); }
503  if (!this->PadVector(fSigmaY)) { list.append(vlist[7].append(", \n")); }
504  if (!this->PadVector(fSigmaZ)) { list.append(vlist[8].append(", \n")); }
505  if (!this->PadVector(fTheta0XZ)) { list.append(vlist[9].append(", \n")); }
506  if (!this->PadVector(fTheta0YZ)) { list.append(vlist[10].append(", \n")); }
507  if (!this->PadVector(fSigmaThetaXZ)) { list.append(vlist[11].append(", \n")); }
508  if (!this->PadVector(fSigmaThetaYZ)) { list.append(vlist[12].append(" \n")); }
509  if (!this->PadVector(fT0)) { list.append(vlist[13].append(", \n")); }
510  if (!this->PadVector(fSigmaT)) { list.append(vlist[14].append(", \n")); }
511 
512  if (list.size() > 0)
513  throw cet::exception("SingleGen")
514  << "The " << list << "\n vector(s) defined in the fhicl files has/have "
515  << "a different size than the PDG vector "
516  << "\n and it has (they have) more than one value, "
517  << "\n disallowing sensible padding "
518  << " and/or you have set fPadOutVectors to false. \n";
519 
520  if (fPDG.size() > 1 && fPadOutVectors) this->printVecs(vlist);
521 
522  // If needed, get histograms for momentum and angle distributions
523  TFile* histFile = nullptr;
524  if (!fHistFileName.empty()) {
525  if (fHistFileName[0] == '/') {
526  // We have an absolute path, use given name exactly.
527  if (cet::file_exists(fHistFileName)) {
528  histFile = new TFile(fHistFileName.c_str());
529  if (!histFile || histFile->IsZombie() || !histFile->IsOpen()) {
530  delete histFile;
531  histFile = nullptr;
533  << "Cannot open ROOT file specified in parameter HistogramFile: \"" << fHistFileName
534  << "\"";
535  }
536  }
537  else {
539  << "ROOT file specified in parameter HistogramFile: \"" << fHistFileName
540  << "\" does not exist!";
541  }
542  }
543  else {
544  // We have a relative path, search starting from current directory.
545  std::string relative_filename{"./"};
546  relative_filename += fHistFileName;
547  if (cet::file_exists(relative_filename)) {
548  histFile = new TFile(relative_filename.c_str());
549  if (!histFile || histFile->IsZombie() || !histFile->IsOpen()) {
550  delete histFile;
551  histFile = nullptr;
553  << "Cannot open ROOT file found using relative path and originally specified in "
554  "parameter HistogramFile: \""
555  << relative_filename << '"';
556  }
557  }
558  else {
559  cet::search_path sp{"FW_SEARCH_PATH"};
560  std::string found_filename;
561  auto found = sp.find_file(fHistFileName, found_filename);
562  if (!found) {
564  << "Cannot find ROOT file in current directory nor on FW_SEARCH_PATH specified in "
565  "parameter HistogramFile: \""
566  << fHistFileName << '"';
567  }
568  histFile = new TFile(found_filename.c_str());
569  if (!histFile || histFile->IsZombie() || !histFile->IsOpen()) {
570  delete histFile;
571  histFile = nullptr;
573  << "Cannot open ROOT file found on FW_SEARCH_PATH and originally specified in "
574  "parameter HistogramFile: \""
575  << found_filename << '"';
576  }
577  }
578  }
579  }
580 
581  //
582  // deal with position distribution
583  //
584  switch (fPosDist) {
585  case kGAUS:
586  case kUNIF: break; // supported, no further action needed
587  default:
589  << "Position distribution of type '" << optionName(fPosDist, DistributionNames) << "' ("
590  << std::to_string(fPosDist) << ") is not supported.";
591  } // switch(fPosDist)
592 
593  //
594  // deal with time distribution
595  //
596  switch (fTDist) {
597  case kGAUS:
598  case kUNIF: break; // supported, no further action needed
599  default:
601  << "Time distribution of type '" << optionName(fTDist, DistributionNames) << "' ("
602  << std::to_string(fTDist) << ") is not supported.";
603  } // switch(fTDist)
604 
605  //
606  // deal with momentum distribution
607  //
608  switch (fPDist) {
609  case kHIST:
610  if (fPHist.size() != fPDG.size()) {
612  << fPHist.size() << " momentum histograms to describe " << fPDG.size()
613  << " particle types...";
614  }
615  hPHist.reserve(fPHist.size());
616  for (auto const& histName : fPHist) {
617  TH1* pHist = dynamic_cast<TH1*>(histFile->Get(histName.c_str()));
618  if (!pHist) {
620  << "Failed to read momentum histogram '" << histName << "' from '"
621  << histFile->GetPath() << "\'";
622  }
623  pHist->SetDirectory(nullptr); // make it independent of the input file
624  hPHist.emplace_back(pHist);
625  } // for
626  break;
627  default: // supported, no further action needed
628  break;
629  } // switch(fPDist)
630 
631  switch (fAngleDist) {
632  case kHIST:
633  if (fThetaXzYzHist.size() != fPDG.size()) {
635  << fThetaXzYzHist.size() << " direction histograms to describe " << fPDG.size()
636  << " particle types...";
637  }
638  hThetaXzYzHist.reserve(fThetaXzYzHist.size());
639  for (auto const& histName : fThetaXzYzHist) {
640  TH2* pHist = dynamic_cast<TH2*>(histFile->Get(histName.c_str()));
641  if (!pHist) {
643  << "Failed to read direction histogram '" << histName << "' from '"
644  << histFile->GetPath() << "\'";
645  }
646  pHist->SetDirectory(nullptr); // make it independent of the input file
647  hThetaXzYzHist.emplace_back(pHist);
648  } // for
649  default: // supported, no further action needed
650  break;
651  } // switch(fAngleDist)
652 
653  delete histFile;
654  }
int fPDist
How to distribute momenta (gaus or uniform)
static const std::map< int, std::string > DistributionNames
Names of all distribution modes.
int fTDist
How to distribute t (gaus, or uniform)
bool PadVector(std::vector< double > &vec)
std::vector< std::unique_ptr< TH2 > > hThetaXzYzHist
actual TH1 for momentum distributions
std::vector< double > fSigmaT
Variation in t position (s)
std::vector< std::unique_ptr< TH1 > > hPHist
std::vector< std::string > fThetaXzYzHist
name of histogram for thetaxz/thetayz distribution
int fPosDist
How to distribute xyz (gaus, or uniform)
void printVecs(std::vector< std::string > const &list)
std::vector< double > fSigmaZ
Variation in z position (cm)
std::vector< double > fT0
Central t position (s) in world coordinates.
decltype(auto) constexpr to_string(T &&obj)
ADL-aware version of std::to_string.
std::vector< double > fP0
Central momentum (GeV/c) to generate.
std::vector< double > fTheta0YZ
Angle in YZ plane (degrees)
std::vector< double > fY0
Central y position (cm) in world coordinates.
std::vector< int > fPDG
PDG code of particles to generate.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
std::vector< double > fSigmaThetaYZ
Variation in angle in YZ plane.
std::vector< double > fSigmaP
Variation in momenta (GeV/c)
std::vector< double > fZ0
Central z position (cm) in world coordinates.
std::vector< std::string > fPHist
name of histogram of momenta
std::vector< double > fSigmaX
Variation in x position (cm)
static constexpr int kGAUS
Gaussian distribution.
std::vector< double > fX0
Central x position (cm) in world coordinates.
static std::string optionName(typename OptionList::value_type::first_type optionKey, OptionList const &allowedOptions, std::string defName="<unknown>")
Returns the name of the specified option key, or defName if not known.
std::string fHistFileName
Filename containing histogram of momenta.
int fAngleDist
How to distribute angles (gaus, uniform)
static constexpr int kUNIF
Uniform distribution.
std::vector< double > fTheta0XZ
Angle in XZ plane (degrees)
static constexpr int kHIST
std::vector< double > fSigmaThetaXZ
Variation in angle in XZ plane.
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
std::vector< double > fSigmaY
Variation in y position (cm)
void art::ModuleBase::sortConsumables ( std::string const &  current_process_name)
inherited

Definition at line 49 of file ModuleBase.cc.

References art::ModuleBase::collector_, and art::ConsumesCollector::sortConsumables().

50  {
51  // Now that we know we have seen all the consumes declarations,
52  // sort the results for fast lookup later.
53  collector_.sortConsumables(current_process_name);
54  }
ConsumesCollector collector_
Definition: ModuleBase.h:56
void sortConsumables(std::string const &current_process_name)

Member Data Documentation

const std::map< int, std::string > evgen::SingleGen::DistributionNames
staticprivate
Initial value:

Names of all distribution modes.

Definition at line 198 of file SingleGen_module.cc.

Referenced by evgen::SingleGen::Config::fromHistogram(), makeDistributionNames(), setup(), and SingleGen().

int evgen::SingleGen::fAngleDist
private

How to distribute angles (gaus, uniform)

Definition at line 250 of file SingleGen_module.cc.

Referenced by SampleMany(), SampleOne(), setup(), and SingleGen().

CLHEP::HepRandomEngine& evgen::SingleGen::fEngine
private

actual TH2 for angle distributions - Xz on x axis .

art-managed random-number engine

Definition at line 262 of file SingleGen_module.cc.

Referenced by Sample(), SampleMany(), SampleOne(), SelectFromHist(), and SingleGen().

std::string evgen::SingleGen::fHistFileName
private

Filename containing histogram of momenta.

Definition at line 251 of file SingleGen_module.cc.

Referenced by setup(), and SingleGen().

int evgen::SingleGen::fMode
private

Particle Selection Mode 0–generate a list of all particles, 1–generate a single particle selected randomly from the list

Definition at line 224 of file SingleGen_module.cc.

Referenced by Sample(), and SingleGen().

std::vector<double> evgen::SingleGen::fP0
private

Central momentum (GeV/c) to generate.

Definition at line 232 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

bool evgen::SingleGen::fPadOutVectors
private

Select to pad out configuration vectors if they are not of of the same length as PDG false: don't pad out - all values need to specified true: pad out - default values assumed and printed out

Definition at line 227 of file SingleGen_module.cc.

Referenced by PadVector(), setup(), and SingleGen().

std::vector<int> evgen::SingleGen::fPDG
private

PDG code of particles to generate.

Definition at line 231 of file SingleGen_module.cc.

Referenced by PadVector(), printVecs(), Sample(), SampleMany(), SampleOne(), setup(), and SingleGen().

int evgen::SingleGen::fPDist
private

How to distribute momenta (gaus or uniform)

Definition at line 234 of file SingleGen_module.cc.

Referenced by SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<std::string> evgen::SingleGen::fPHist
private

name of histogram of momenta

Definition at line 252 of file SingleGen_module.cc.

Referenced by setup(), and SingleGen().

int evgen::SingleGen::fPosDist
private

How to distribute xyz (gaus, or uniform)

Definition at line 243 of file SingleGen_module.cc.

Referenced by SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fSigmaP
private

Variation in momenta (GeV/c)

Definition at line 233 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fSigmaT
private

Variation in t position (s)

Definition at line 242 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fSigmaThetaXZ
private

Variation in angle in XZ plane.

Definition at line 248 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fSigmaThetaYZ
private

Variation in angle in YZ plane.

Definition at line 249 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fSigmaX
private

Variation in x position (cm)

Definition at line 239 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fSigmaY
private

Variation in y position (cm)

Definition at line 240 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fSigmaZ
private

Variation in z position (cm)

Definition at line 241 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

bool evgen::SingleGen::fSingleVertex
private

if true - all particles produced at the same location

Definition at line 245 of file SingleGen_module.cc.

Referenced by Sample(), and SingleGen().

std::vector<double> evgen::SingleGen::fT0
private

Central t position (s) in world coordinates.

Definition at line 238 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

int evgen::SingleGen::fTDist
private

How to distribute t (gaus, or uniform)

Definition at line 244 of file SingleGen_module.cc.

Referenced by SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fTheta0XZ
private

Angle in XZ plane (degrees)

Definition at line 246 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fTheta0YZ
private

Angle in YZ plane (degrees)

Definition at line 247 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<std::string> evgen::SingleGen::fThetaXzYzHist
private

name of histogram for thetaxz/thetayz distribution

Definition at line 253 of file SingleGen_module.cc.

Referenced by setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fX0
private

Central x position (cm) in world coordinates.

Definition at line 235 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fY0
private

Central y position (cm) in world coordinates.

Definition at line 236 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<double> evgen::SingleGen::fZ0
private

Central z position (cm) in world coordinates.

Definition at line 237 of file SingleGen_module.cc.

Referenced by printVecs(), SampleMany(), SampleOne(), setup(), and SingleGen().

std::vector<std::unique_ptr<TH1> > evgen::SingleGen::hPHist
private

Definition at line 255 of file SingleGen_module.cc.

Referenced by SampleMany(), SampleOne(), and setup().

std::vector<std::unique_ptr<TH2> > evgen::SingleGen::hThetaXzYzHist
private

actual TH1 for momentum distributions

Definition at line 257 of file SingleGen_module.cc.

Referenced by SampleMany(), SampleOne(), and setup().

constexpr int evgen::SingleGen::kGAUS = 1
staticprivate

Gaussian distribution.

Definition at line 220 of file SingleGen_module.cc.

Referenced by makeDistributionNames(), SampleMany(), SampleOne(), and setup().

constexpr int evgen::SingleGen::kHIST = 2
staticprivate

Distribution from histograms.

Definition at line 221 of file SingleGen_module.cc.

Referenced by evgen::SingleGen::Config::fromHistogram(), makeDistributionNames(), SampleMany(), SampleOne(), and setup().

constexpr int evgen::SingleGen::kSelectAllParts = 0
staticprivate

One particle per entry is generated.

Definition at line 211 of file SingleGen_module.cc.

Referenced by makeParticleSelectionModeNames().

constexpr int evgen::SingleGen::kSelectOneRandPart
staticprivate
Initial value:
=
1

One particle is generated, extracted from the provided options.

Definition at line 212 of file SingleGen_module.cc.

Referenced by makeParticleSelectionModeNames().

constexpr int evgen::SingleGen::kUNIF = 0
staticprivate

Uniform distribution.

Definition at line 219 of file SingleGen_module.cc.

Referenced by makeDistributionNames(), and setup().

const std::map< int, std::string > evgen::SingleGen::ParticleSelectionModeNames
staticprivate
Initial value:

Names of all particle selection modes.

Definition at line 196 of file SingleGen_module.cc.

Referenced by makeDistributionNames(), and SingleGen().


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