CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
LumiCorrector Class Reference

#include <LumiCorrector.h>

Public Member Functions

float AfterglowFactor (int nBXs)
 
float getCoefficient (const std::string &name) const
 
float getNormForAlgo (const std::string &algo) const
 
 LumiCorrector ()
 
void setCoefficient (const std::string &name, float value)
 
void setNormForAlgo (const std::string &algo, float value)
 
float TotalNormET (float TotLumi_noNorm, int nBXs)
 
float TotalNormOcc1 (float TotLumi_noNorm, int nBXs)
 
float TotalNormOcc2 (float TotLumi_noNorm, int nBXs)
 
 ~LumiCorrector ()
 

Private Attributes

std::map< int, float > AfterglowMap_
 
float Alpha1_
 
float Alpha2_
 
float ETNorm_
 
float Occ1Norm_
 
float Occ2Norm_
 
float PUNorm_
 

Detailed Description

Definition at line 6 of file LumiCorrector.h.

Constructor & Destructor Documentation

◆ LumiCorrector()

LumiCorrector::LumiCorrector ( )

these are corrections including unit conversion /mb to /ub if unit is already /ub, use e-03

Definition at line 6 of file LumiCorrector.cc.

6  {
7  Occ1Norm_ = 6.36e3; // For 2.76TeV 1.34e3, for HI 2.214e6
8  Occ2Norm_ = 7.97e3;
9  ETNorm_ = 1.59e3;
10  PUNorm_ = 6.37e3;
11  Alpha1_ = 0.063;
12  Alpha2_ = -0.0037;
13  // map doesn't provide any initialization -> do brute force // For HI Afterglow=1.
14  AfterglowMap_[213] = 0.992;
15  AfterglowMap_[321] = 0.990;
16  AfterglowMap_[423] = 0.988;
17  AfterglowMap_[597] = 0.985;
18  AfterglowMap_[700] = 0.984;
19  AfterglowMap_[873] = 0.981;
20  AfterglowMap_[1041] = 0.979;
21  AfterglowMap_[1179] = 0.977;
22  AfterglowMap_[1317] = 0.975;
23 }

References AfterglowMap_, Alpha1_, Alpha2_, ETNorm_, Occ1Norm_, Occ2Norm_, and PUNorm_.

◆ ~LumiCorrector()

LumiCorrector::~LumiCorrector ( )
inline

Definition at line 9 of file LumiCorrector.h.

9 {}

Member Function Documentation

◆ AfterglowFactor()

float LumiCorrector::AfterglowFactor ( int  nBXs)

Definition at line 77 of file LumiCorrector.cc.

77  {
78  float Afterglow = 1.;
79  for (std::map<int, float>::iterator it = AfterglowMap_.begin(); it != AfterglowMap_.end(); ++it) {
80  if (nBXs >= it->first) {
81  Afterglow = it->second;
82  }
83  }
84  return Afterglow;
85 }

References AfterglowMap_.

Referenced by TotalNormOcc1().

◆ getCoefficient()

float LumiCorrector::getCoefficient ( const std::string &  name) const

Definition at line 68 of file LumiCorrector.cc.

68  {
69  if (name == "ALPHA1") {
70  return Alpha1_;
71  }
72  if (name == "ALPHA2") {
73  return Alpha2_;
74  }
75  return 0.0;
76 }

References Alpha1_, Alpha2_, and Skims_PA_cff::name.

◆ getNormForAlgo()

float LumiCorrector::getNormForAlgo ( const std::string &  algo) const

Definition at line 53 of file LumiCorrector.cc.

53  {
54  if (algo == "OCC1") {
55  return Occ1Norm_;
56  }
57  if (algo == "OCC2") {
58  return Occ2Norm_;
59  }
60  if (algo == "ET") {
61  return ETNorm_;
62  }
63  if (algo == "PU") {
64  return PUNorm_;
65  }
66  return 1.0;
67 }

References ETNorm_, Occ1Norm_, Occ2Norm_, and PUNorm_.

◆ setCoefficient()

void LumiCorrector::setCoefficient ( const std::string &  name,
float  value 
)

Definition at line 43 of file LumiCorrector.cc.

43  {
44  if (name == "ALPHA1") {
45  Alpha1_ = value;
46  return;
47  }
48  if (name == "ALPHA2") {
49  Alpha2_ = value;
50  return;
51  }
52 }

References Alpha1_, Alpha2_, Skims_PA_cff::name, and relativeConstraints::value.

◆ setNormForAlgo()

void LumiCorrector::setNormForAlgo ( const std::string &  algo,
float  value 
)

Definition at line 25 of file LumiCorrector.cc.

25  {
26  if (algo == "OCC1") {
27  Occ1Norm_ = value;
28  return;
29  }
30  if (algo == "OCC2") {
31  Occ2Norm_ = value;
32  return;
33  }
34  if (algo == "ET") {
35  ETNorm_ = value;
36  return;
37  }
38  if (algo == "PU") {
39  PUNorm_ = value;
40  return;
41  }
42 }

References ETNorm_, Occ1Norm_, Occ2Norm_, PUNorm_, and relativeConstraints::value.

◆ TotalNormET()

float LumiCorrector::TotalNormET ( float  TotLumi_noNorm,
int  nBXs 
)

Definition at line 92 of file LumiCorrector.cc.

92 { return ETNorm_; }

References ETNorm_.

◆ TotalNormOcc1()

float LumiCorrector::TotalNormOcc1 ( float  TotLumi_noNorm,
int  nBXs 
)

Definition at line 87 of file LumiCorrector.cc.

87  {
88  float AvgLumi = (nBXs > 0) ? PUNorm_ * TotLumi_noNorm / nBXs : 0.;
89  return Occ1Norm_ * AfterglowFactor(nBXs) / (1 + Alpha1_ * AvgLumi + Alpha2_ * AvgLumi * AvgLumi);
90 }

References AfterglowFactor(), Alpha1_, Alpha2_, Occ1Norm_, and PUNorm_.

◆ TotalNormOcc2()

float LumiCorrector::TotalNormOcc2 ( float  TotLumi_noNorm,
int  nBXs 
)

Definition at line 91 of file LumiCorrector.cc.

91 { return Occ2Norm_; }

References Occ2Norm_.

Member Data Documentation

◆ AfterglowMap_

std::map<int, float> LumiCorrector::AfterglowMap_
private

Definition at line 26 of file LumiCorrector.h.

Referenced by AfterglowFactor(), and LumiCorrector().

◆ Alpha1_

float LumiCorrector::Alpha1_
private

Definition at line 24 of file LumiCorrector.h.

Referenced by getCoefficient(), LumiCorrector(), setCoefficient(), and TotalNormOcc1().

◆ Alpha2_

float LumiCorrector::Alpha2_
private

Definition at line 25 of file LumiCorrector.h.

Referenced by getCoefficient(), LumiCorrector(), setCoefficient(), and TotalNormOcc1().

◆ ETNorm_

float LumiCorrector::ETNorm_
private

Definition at line 22 of file LumiCorrector.h.

Referenced by getNormForAlgo(), LumiCorrector(), setNormForAlgo(), and TotalNormET().

◆ Occ1Norm_

float LumiCorrector::Occ1Norm_
private

Definition at line 20 of file LumiCorrector.h.

Referenced by getNormForAlgo(), LumiCorrector(), setNormForAlgo(), and TotalNormOcc1().

◆ Occ2Norm_

float LumiCorrector::Occ2Norm_
private

Definition at line 21 of file LumiCorrector.h.

Referenced by getNormForAlgo(), LumiCorrector(), setNormForAlgo(), and TotalNormOcc2().

◆ PUNorm_

float LumiCorrector::PUNorm_
private

Definition at line 23 of file LumiCorrector.h.

Referenced by getNormForAlgo(), LumiCorrector(), setNormForAlgo(), and TotalNormOcc1().

cmsdt::algo
algo
Definition: constants.h:171
LumiCorrector::AfterglowFactor
float AfterglowFactor(int nBXs)
Definition: LumiCorrector.cc:77
LumiCorrector::AfterglowMap_
std::map< int, float > AfterglowMap_
Definition: LumiCorrector.h:26
LumiCorrector::Alpha2_
float Alpha2_
Definition: LumiCorrector.h:25
LumiCorrector::PUNorm_
float PUNorm_
Definition: LumiCorrector.h:23
LumiCorrector::Occ1Norm_
float Occ1Norm_
Definition: LumiCorrector.h:20
LumiCorrector::Occ2Norm_
float Occ2Norm_
Definition: LumiCorrector.h:21
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
LumiCorrector::Alpha1_
float Alpha1_
Definition: LumiCorrector.h:24
LumiCorrector::ETNorm_
float ETNorm_
Definition: LumiCorrector.h:22