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 58 of file PreMixingModule.cc.

Constructor & Destructor Documentation

◆ AdjustPileupDistribution()

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

Definition at line 60 of file PreMixingModule.cc.

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

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

Member Function Documentation

◆ firstRun()

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

Definition at line 72 of file PreMixingModule.cc.

72 { return firstRun_; }

References firstRun_.

◆ probability()

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

Definition at line 73 of file PreMixingModule.cc.

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

References newFWLiteAna::bin, firstBinPileup_, mixOne_premix_on_sim_cfi::pileup, and pileupProbabilities_.

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

Member Data Documentation

◆ firstBinPileup_

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

Definition at line 87 of file PreMixingModule.cc.

Referenced by probability().

◆ firstRun_

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

Definition at line 86 of file PreMixingModule.cc.

Referenced by AdjustPileupDistribution(), and firstRun().

◆ pileupProbabilities_

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

Definition at line 88 of file PreMixingModule.cc.

Referenced by AdjustPileupDistribution(), and probability().

AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
edm::PreMixingModule::AdjustPileupDistribution::pileupProbabilities_
std::vector< double > pileupProbabilities_
Definition: PreMixingModule.cc:88
mixOne_premix_on_sim_cfi.pileup
pileup
Definition: mixOne_premix_on_sim_cfi.py:42
edm::LogWarning
Definition: MessageLogger.h:141
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::PreMixingModule::AdjustPileupDistribution::firstRun_
edm::RunNumber_t firstRun_
Definition: PreMixingModule.cc:86
Exception
Definition: hltDiff.cc:246
edm::PreMixingModule::AdjustPileupDistribution::firstBinPileup_
unsigned int firstBinPileup_
Definition: PreMixingModule.cc:87