CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edm::PreMixingModule::AdjustPileupDistribution Class Reference

Public Member Functions

 AdjustPileupDistribution (const edm::ParameterSet &ps)
 
edm::RunNumber_t firstRun () const
 
double probability (float pileup) const
 

Private Attributes

unsigned int firstBinPileup_
 
edm::RunNumber_t firstRun_
 
std::vector< double > pileupProbabilities_
 

Detailed Description

Definition at line 59 of file PreMixingModule.cc.

Constructor & Destructor Documentation

edm::PreMixingModule::AdjustPileupDistribution::AdjustPileupDistribution ( const edm::ParameterSet ps)
inline

Definition at line 61 of file PreMixingModule.cc.

References Exception, firstRun_, AlCaHLTBitMon_ParallelJobs::p, and pileupProbabilities_.

61  :
62  firstRun_(ps.getParameter<unsigned int>("firstRun")),
63  firstBinPileup_(ps.getParameter<unsigned int>("firstBinPileup")),
64  pileupProbabilities_(ps.getParameter<std::vector<double>>("pileupProbabilities"))
65  {
66  for(double p: pileupProbabilities_) {
67  if(p < 0. or p > 1.) {
68  throw cms::Exception("Configuration") << "Invalid probability value " << p << " for firstRun " << firstRun_ << ". The probability must be >= 0. and <= 1.";
69  }
70  }
71  }
T getParameter(std::string const &) const

Member Function Documentation

edm::RunNumber_t edm::PreMixingModule::AdjustPileupDistribution::firstRun ( ) const
inline

Definition at line 73 of file PreMixingModule.cc.

References firstRun_.

double edm::PreMixingModule::AdjustPileupDistribution::probability ( float  pileup) const
inline

Definition at line 74 of file PreMixingModule.cc.

References stringResolutionProvider_cfi::bin, firstBinPileup_, estimatePileup_makeJSON::pileup, and pileupProbabilities_.

Referenced by edm::PreMixingModule::pileWorker().

74  {
75  unsigned int bin = static_cast<unsigned int>(pileup);
76  if(bin < firstBinPileup_ or bin >= firstBinPileup_+pileupProbabilities_.size()) {
77  edm::LogWarning("PreMixingModule") << "Got pileup event with true pileup " << pileup << " that is outside of the configured pileup adjustment bounds [" << firstBinPileup_ << ", " << firstBinPileup_+pileupProbabilities_.size()-1 << "]. Using probability 0.";
78  return 0.;
79  }
81  }
bin
set the eta bin as selection string.

Member Data Documentation

unsigned int edm::PreMixingModule::AdjustPileupDistribution::firstBinPileup_
private

Definition at line 85 of file PreMixingModule.cc.

Referenced by probability().

edm::RunNumber_t edm::PreMixingModule::AdjustPileupDistribution::firstRun_
private

Definition at line 84 of file PreMixingModule.cc.

Referenced by AdjustPileupDistribution(), and firstRun().

std::vector<double> edm::PreMixingModule::AdjustPileupDistribution::pileupProbabilities_
private

Definition at line 86 of file PreMixingModule.cc.

Referenced by AdjustPileupDistribution(), and probability().