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, and query::result.

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.size()!=0){
36  std::map< unsigned int, float >::const_iterator afterglowit=--m_afterglowmap.end();
37  if(nBXs>=afterglowit->first){
38  Afterglow=afterglowit->second;
39  }else{
40  afterglowit=m_afterglowmap.upper_bound(nBXs);
41  --afterglowit;
42  Afterglow=afterglowit->second;
43  }
44  }
45  float driftterm=1.0;
46  coeffIt=m_coeffmap.find("DRIFT");
47  if(coeffIt!=m_coeffmap.end()){
48  driftterm=1.0+coeffIt->second*intglumi;
49  }
50  float a0=1.0;
51  coeffIt=m_coeffmap.find("A0");
52  if(coeffIt!=m_coeffmap.end()){
53  a0=coeffIt->second;
54  }
55  float a1=0.;
56  coeffIt=m_coeffmap.find("A1");
57  if(coeffIt!=m_coeffmap.end()){
58  a1=coeffIt->second;
59  }
60  float a2=0.;
61  coeffIt=m_coeffmap.find("A2");
62  if(coeffIt!=m_coeffmap.end()){
63  a2=coeffIt->second;
64  }
65  result=a0*Afterglow/(1.+a1*avglumi+a2*avglumi*avglumi)*driftterm;
66  return result;
67 }
std::map< unsigned int, float > m_afterglowmap
Definition: NormFunctor.h:15
tuple result
Definition: query.py:137
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