test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
lumi::fPoly Class Reference
Inheritance diagram for lumi::fPoly:
lumi::NormFunctor

Public Member Functions

 fPoly ()
 
virtual 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 ()
 
- Public Member Functions inherited from lumi::NormFunctor
void initialize (const std::map< std::string, float > &coeffmap, const std::map< unsigned int, float > &afterglowmap)
 
 NormFunctor ()
 
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

lumi::fPoly::fPoly ( )
inline

Definition at line 8 of file fPoly.cc.

8 {}
lumi::fPoly::~fPoly ( )
inline

Definition at line 9 of file fPoly.cc.

9 {}

Member Function Documentation

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

Implements lumi::NormFunctor.

Definition at line 23 of file fPoly.cc.

References alignmentValidation::c1, normFunctors::intglumi, normFunctors::nBXs, mps_fire::result, and edm::second().

23  {
24  float result=1.0;
25  float avglumi=0.;
26  float c1=0.;
27  std::map< std::string , float >::const_iterator coeffIt=m_coeffmap.find("C1");
28  if(coeffIt!=m_coeffmap.end()){
29  c1=coeffIt->second;
30  }
31  if(c1!=0. && nBXs>0){
32  avglumi=c1*luminonorm/nBXs;
33  }
34  float Afterglow=1.0;
35  if(!m_afterglowmap.empty()){
36  std::map< unsigned int, float >::const_iterator afterglowit=m_afterglowmap.lower_bound(nBXs+1);
37  if(afterglowit != m_afterglowmap.begin()){
38  Afterglow=(--afterglowit)->second;
39  }
40  }
41  float driftterm=1.0;
42  coeffIt=m_coeffmap.find("DRIFT");
43  if(coeffIt!=m_coeffmap.end()){
44  driftterm=1.0+coeffIt->second*intglumi;
45  }
46  float a0=1.0;
47  coeffIt=m_coeffmap.find("A0");
48  if(coeffIt!=m_coeffmap.end()){
49  a0=coeffIt->second;
50  }
51  float a1=0.;
52  coeffIt=m_coeffmap.find("A1");
53  if(coeffIt!=m_coeffmap.end()){
54  a1=coeffIt->second;
55  }
56  float a2=0.;
57  coeffIt=m_coeffmap.find("A2");
58  if(coeffIt!=m_coeffmap.end()){
59  a2=coeffIt->second;
60  }
61  result=a0*Afterglow/(1.+a1*avglumi+a2*avglumi*avglumi)*driftterm;
62  return result;
63 }
tuple result
Definition: mps_fire.py:83
U second(std::pair< T, U > const &p)
std::map< unsigned int, float > m_afterglowmap
Definition: NormFunctor.h:15
float intglumi
Definition: normFunctors.py:63
std::map< std::string, float > m_coeffmap
Definition: NormFunctor.h:14
float luminonorm
Definition: normFunctors.py:62
void lumi::fPoly::initialize ( const std::map< std::string, float > &  coeffmap,
const std::map< unsigned int, float > &  afterglowmap 
)

Definition at line 17 of file fPoly.cc.

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

18  {
19  m_coeffmap=coeffmap;
20  m_afterglowmap=afterglowmap;
21 }
std::map< unsigned int, float > m_afterglowmap
Definition: NormFunctor.h:15
std::map< std::string, float > m_coeffmap
Definition: NormFunctor.h:14