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.

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

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  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307

Member Function Documentation

◆ firstRun()

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

Definition at line 72 of file PreMixingModule.cc.

References firstRun_.

◆ probability()

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

Definition at line 73 of file PreMixingModule.cc.

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

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

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  }
Log< level::Warning, false > LogWarning

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().