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::LuminosityBlockIndex const &)
 
 RandomEngineAndDistribution (edm::StreamID 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 10 of file RandomEngineAndDistribution.cc.

10  : engine_(nullptr) {
12  if (!rng.isAvailable()) {
13  throw cms::Exception("Configuration") << "RandomNumberGenerator service is not available.\n"
14  "You must add the service in the configuration file\n"
15  "or remove the module that requires it.";
16  }
17  engine_ = &rng->getEngine(streamID);
18 }

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

◆ RandomEngineAndDistribution() [2/2]

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

Definition at line 20 of file RandomEngineAndDistribution.cc.

21  : engine_(nullptr) {
23  if (!rng.isAvailable()) {
24  throw cms::Exception("Configuration") << "RandomNumberGenerator service is not available.\n"
25  "You must add the service in the configuration file\n"
26  "or remove the module that requires it.";
27  }
28  engine_ = &rng->getEngine(luminosityBlockIndex);
29 }

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

◆ ~RandomEngineAndDistribution()

RandomEngineAndDistribution::~RandomEngineAndDistribution ( )

Definition at line 31 of file RandomEngineAndDistribution.cc.

31 {}

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.

27 { return xmin + (xmax - xmin) * engine_->flat(); }

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.

25 { return *engine_; }

References engine_.

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

Member Data Documentation

◆ engine_

CLHEP::HepRandomEngine* RandomEngineAndDistribution::engine_
private
edm::RandomNumberGenerator::getEngine
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
SiStripPI::mean
Definition: SiStripPayloadInspectorHelper.h:169
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
RandomEngineAndDistribution::engine_
CLHEP::HepRandomEngine * engine_
Definition: RandomEngineAndDistribution.h:36
edm::Service< edm::RandomNumberGenerator >
TrackerOfflineValidation_Dqm_cff.xmax
xmax
Definition: TrackerOfflineValidation_Dqm_cff.py:11
Exception
Definition: hltDiff.cc:246
TrackerOfflineValidation_Dqm_cff.xmin
xmin
Definition: TrackerOfflineValidation_Dqm_cff.py:10