CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
RandomEngineAndDistribution Class Reference

#include <RandomEngineAndDistribution.h>

Public Member Functions

double flatShoot (double xmin=0.0, double xmax=1.0) const
 
double gaussShoot (double mean=0.0, double sigma=1.0) const
 
unsigned int poissonShoot (double mean) const
 
 RandomEngineAndDistribution (edm::StreamID const &)
 
 RandomEngineAndDistribution (edm::LuminosityBlockIndex const &)
 
CLHEP::HepRandomEngine & theEngine () const
 
 ~RandomEngineAndDistribution ()
 

Private Attributes

CLHEP::HepRandomEngine * engine_
 

Detailed Description

Definition at line 18 of file RandomEngineAndDistribution.h.

Constructor & Destructor Documentation

◆ RandomEngineAndDistribution() [1/2]

RandomEngineAndDistribution::RandomEngineAndDistribution ( edm::StreamID const &  streamID)

Definition at line 9 of file RandomEngineAndDistribution.cc.

References engine_, Exception, edm::RandomNumberGenerator::getEngine(), and edm::Service< T >::isAvailable().

9  : engine_(nullptr) {
11  if (!rng.isAvailable()) {
12  throw cms::Exception("Configuration") << "RandomNumberGenerator service is not available.\n"
13  "You must add the service in the configuration file\n"
14  "or remove the module that requires it.";
15  }
16  engine_ = &rng->getEngine(streamID);
17 }
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
bool isAvailable() const
Definition: Service.h:40

◆ RandomEngineAndDistribution() [2/2]

RandomEngineAndDistribution::RandomEngineAndDistribution ( edm::LuminosityBlockIndex const &  luminosityBlockIndex)

Definition at line 19 of file RandomEngineAndDistribution.cc.

References engine_, Exception, edm::RandomNumberGenerator::getEngine(), and edm::Service< T >::isAvailable().

20  : engine_(nullptr) {
22  if (!rng.isAvailable()) {
23  throw cms::Exception("Configuration") << "RandomNumberGenerator service is not available.\n"
24  "You must add the service in the configuration file\n"
25  "or remove the module that requires it.";
26  }
27  engine_ = &rng->getEngine(luminosityBlockIndex);
28 }
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
bool isAvailable() const
Definition: Service.h:40

◆ ~RandomEngineAndDistribution()

RandomEngineAndDistribution::~RandomEngineAndDistribution ( )

Definition at line 30 of file RandomEngineAndDistribution.cc.

30 {}

Member Function Documentation

◆ flatShoot()

double RandomEngineAndDistribution::flatShoot ( double  xmin = 0.0,
double  xmax = 1.0 
) const
inline

Definition at line 27 of file RandomEngineAndDistribution.h.

References engine_, TrackerOfflineValidation_Dqm_cff::xmax, and TrackerOfflineValidation_Dqm_cff::xmin.

Referenced by EcalHitMaker::addHit(), BremsstrahlungSimulator::brem(), fastsim::Bremsstrahlung::brem(), MuonBremsstrahlungSimulator::brem(), fastsim::MuonBremsstrahlung::brem(), MultipleScatteringSimulator::compute(), PairProductionSimulator::compute(), HFShower::compute(), HDShower::compute(), EMShower::compute(), NuclearInteractionFTFSimulator::compute(), NuclearInteractionSimulator::compute(), HDRShower::computeShower(), CalorimetryManager::EMShowerSimulation(), GammaFunctionGenerator::gammaFrac(), GammaFunctionGenerator::gammaInt(), PairProductionSimulator::gbteth(), BremsstrahlungSimulator::gbteth(), fastsim::PairProduction::gbteth(), MuonBremsstrahlungSimulator::gbteth(), fastsim::Bremsstrahlung::gbteth(), fastsim::MuonBremsstrahlung::gbteth(), SimpleHistogramGenerator::generate(), BaseNumericalRandomGenerator::generate(), BaseNumericalRandomGenerator::generateExp(), BaseNumericalRandomGenerator::generateLin(), HDRShower::getR(), HDShower::HDShower(), HFShower::HFShower(), ParticlePropagator::initProperDecayTime(), fastsim::PairProduction::interact(), fastsim::MultipleScattering::interact(), fastsim::NuclearInteraction::interact(), fastsim::NuclearInteractionFTF::interact(), HCALResponse::interHD(), HCALResponse::interMU(), HFShower::makeSteps(), HDShower::makeSteps(), fastsim::ParticleManager::nextParticle(), BremsstrahlungSimulator::poisson(), HDRShower::setHit(), DoubleCrystalBallGenerator::shoot(), GaussianTail::shoot(), PixelTemplateSmearerBase::smearHit(), PixelTemplateSmearerBase::smearMergeGroup(), and HDRShower::thetaFunction().

◆ gaussShoot()

double RandomEngineAndDistribution::gaussShoot ( double  mean = 0.0,
double  sigma = 1.0 
) const
inline

◆ poissonShoot()

unsigned int RandomEngineAndDistribution::poissonShoot ( double  mean) const
inline

◆ theEngine()

CLHEP::HepRandomEngine& RandomEngineAndDistribution::theEngine ( ) const
inline

Definition at line 25 of file RandomEngineAndDistribution.h.

References engine_.

Referenced by FastHFShowerLibrary::SetRandom(), and TrajectoryManager::updateWithDaughters().

25 { return *engine_; }

Member Data Documentation

◆ engine_

CLHEP::HepRandomEngine* RandomEngineAndDistribution::engine_
private