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::RandomEngineAndDistribution ( edm::StreamID const &  streamID)

Definition at line 10 of file RandomEngineAndDistribution.cc.

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

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

Definition at line 22 of file RandomEngineAndDistribution.cc.

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

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

Definition at line 34 of file RandomEngineAndDistribution.cc.

34  {
35 }

Member Function Documentation

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

Definition at line 29 of file RandomEngineAndDistribution.h.

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

Referenced by EcalHitMaker::addHit(), BremsstrahlungSimulator::brem(), fastsim::Bremsstrahlung::brem(), fastsim::MuonBremsstrahlung::brem(), MuonBremsstrahlungSimulator::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(), fastsim::Bremsstrahlung::gbteth(), MuonBremsstrahlungSimulator::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().

double RandomEngineAndDistribution::gaussShoot ( double  mean = 0.0,
double  sigma = 1.0 
) const
inline
unsigned int RandomEngineAndDistribution::poissonShoot ( double  mean) const
inline
CLHEP::HepRandomEngine& RandomEngineAndDistribution::theEngine ( ) const
inline

Member Data Documentation

CLHEP::HepRandomEngine* RandomEngineAndDistribution::engine_
private

Definition at line 43 of file RandomEngineAndDistribution.h.

Referenced by RandomEngineAndDistribution().