CMS 3D CMS Logo

List of all members | Public Member Functions
lumi::fPoly Class Reference
Inheritance diagram for lumi::fPoly:
lumi::NormFunctor

Public Member Functions

 fPoly ()
 
float getCorrection (float luminonorm, float intglumi, unsigned int nBXs) const override
 
void initialize (const std::map< std::string, float > &coeffmap, const std::map< unsigned int, float > &afterglowmap)
 
 ~fPoly () override
 
- Public Member Functions inherited from lumi::NormFunctor
void initialize (const std::map< std::string, float > &coeffmap, const std::map< unsigned int, float > &afterglowmap)
 
 NormFunctor ()
 
 NormFunctor (const NormFunctor &)=delete
 
const NormFunctoroperator= (const NormFunctor &)=delete
 
virtual ~NormFunctor ()
 

Additional Inherited Members

- Protected Attributes inherited from lumi::NormFunctor
std::map< unsigned int, float > m_afterglowmap
 
std::map< std::string, float > m_coeffmap
 

Detailed Description

Definition at line 6 of file fPoly.cc.

Constructor & Destructor Documentation

◆ fPoly()

lumi::fPoly::fPoly ( )
inline

Definition at line 8 of file fPoly.cc.

8 {}

◆ ~fPoly()

lumi::fPoly::~fPoly ( )
inlineoverride

Definition at line 9 of file fPoly.cc.

9 {}

Member Function Documentation

◆ getCorrection()

float lumi::fPoly::getCorrection ( float  luminonorm,
float  intglumi,
unsigned int  nBXs 
) const
overridevirtual

Implements lumi::NormFunctor.

Definition at line 20 of file fPoly.cc.

20  {
21  float result = 1.0;
22  float avglumi = 0.;
23  float c1 = 0.;
24  std::map<std::string, float>::const_iterator coeffIt = m_coeffmap.find("C1");
25  if (coeffIt != m_coeffmap.end()) {
26  c1 = coeffIt->second;
27  }
28  if (c1 != 0. && nBXs > 0) {
29  avglumi = c1 * luminonorm / nBXs;
30  }
31  float Afterglow = 1.0;
32  if (!m_afterglowmap.empty()) {
33  std::map<unsigned int, float>::const_iterator afterglowit = m_afterglowmap.lower_bound(nBXs + 1);
34  if (afterglowit != m_afterglowmap.begin()) {
35  Afterglow = (--afterglowit)->second;
36  }
37  }
38  float driftterm = 1.0;
39  coeffIt = m_coeffmap.find("DRIFT");
40  if (coeffIt != m_coeffmap.end()) {
41  driftterm = 1.0 + coeffIt->second * intglumi;
42  }
43  float a0 = 1.0;
44  coeffIt = m_coeffmap.find("A0");
45  if (coeffIt != m_coeffmap.end()) {
46  a0 = coeffIt->second;
47  }
48  float a1 = 0.;
49  coeffIt = m_coeffmap.find("A1");
50  if (coeffIt != m_coeffmap.end()) {
51  a1 = coeffIt->second;
52  }
53  float a2 = 0.;
54  coeffIt = m_coeffmap.find("A2");
55  if (coeffIt != m_coeffmap.end()) {
56  a2 = coeffIt->second;
57  }
58  result = a0 * Afterglow / (1. + a1 * avglumi + a2 * avglumi * avglumi) * driftterm;
59  return result;
60 }

References a0, testProducerWithPsetDescEmpty_cfi::a2, alignmentValidation::c1, mps_fire::result, and edm::second().

◆ initialize()

void lumi::fPoly::initialize ( const std::map< std::string, float > &  coeffmap,
const std::map< unsigned int, float > &  afterglowmap 
)

Definition at line 15 of file fPoly.cc.

16  {
17  m_coeffmap = coeffmap;
18  m_afterglowmap = afterglowmap;
19 }

References lumi::NormFunctor::m_afterglowmap, and lumi::NormFunctor::m_coeffmap.

lumi::NormFunctor::m_coeffmap
std::map< std::string, float > m_coeffmap
Definition: NormFunctor.h:16
lumi::NormFunctor::m_afterglowmap
std::map< unsigned int, float > m_afterglowmap
Definition: NormFunctor.h:17
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
testProducerWithPsetDescEmpty_cfi.a2
a2
Definition: testProducerWithPsetDescEmpty_cfi.py:35
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
mps_fire.result
result
Definition: mps_fire.py:311
a0
static constexpr float a0
Definition: L1EGammaCrystalsEmulatorProducer.cc:82