CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

LumiCorrector Class Reference

#include <LumiCorrector.h>

List of all members.

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

Public Attributes

tuple lcorr = 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 ( )

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.

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

                            {
  Occ1Norm_=7.13e3; // For 2.76TeV 1.34e3, for HI 2.214e6
  Occ2Norm_=7.97e3;
  ETNorm_=1.59e3;
  PUNorm_=6.37e3;
  Alpha1_=0.063;
  Alpha2_=-0.0037;
  // map doesn't provide any initialization -> do brute force // For HI Afterglow=1.
  AfterglowMap_[213]=0.992; 
  AfterglowMap_[321]=0.990; 
  AfterglowMap_[423]=0.988; 
  AfterglowMap_[597]=0.985; 
  AfterglowMap_[700]=0.984; 
  AfterglowMap_[873]=0.981; 
  AfterglowMap_[1041]=0.979; 
  AfterglowMap_[1179]=0.977; 
  AfterglowMap_[1317]=0.975;
}
LumiCorrector::~LumiCorrector ( ) [inline]

Definition at line 10 of file LumiCorrector.h.

{}

Member Function Documentation

float LumiCorrector::AfterglowFactor ( int  nBXs)

Definition at line 52 of file LumiCorrector.cc.

References AfterglowMap_.

Referenced by TotalNormOcc1().

                                      {
  float Afterglow = 1.;
  for(std::map<int,float>::iterator it = AfterglowMap_.begin(); it != AfterglowMap_.end(); ++it){
    if (nBXs >= it->first){
      Afterglow = it->second;
    }
  }  
  return Afterglow;
}
float LumiCorrector::getCoefficient ( const std::string &  name) const

Definition at line 46 of file LumiCorrector.cc.

References Alpha1_, and Alpha2_.

                                                       {
  if( name=="ALPHA1" ){ return Alpha1_;}
  if( name=="ALPHA2" ){ return Alpha2_;}
  return 0.0;
}
float LumiCorrector::getNormForAlgo ( const std::string &  algo) const

Definition at line 38 of file LumiCorrector.cc.

References ETNorm_, Occ1Norm_, Occ2Norm_, and PUNorm_.

                                                       {
  if( algo=="OCC1" ){return Occ1Norm_;}
  if( algo=="OCC2" ){return Occ2Norm_;}
  if( algo=="ET" ){return ETNorm_;}
  if( algo=="PU" ){return PUNorm_;}
  return 1.0;
}
void LumiCorrector::setCoefficient ( const std::string &  name,
float  value 
)

Definition at line 33 of file LumiCorrector.cc.

References Alpha1_, Alpha2_, and relativeConstraints::value.

                                                              {
  if( name=="ALPHA1" ){Alpha1_=value;return;}
  if( name=="ALPHA2" ){Alpha2_=value;return;}
}
void LumiCorrector::setNormForAlgo ( const std::string &  algo,
float  value 
)

Definition at line 26 of file LumiCorrector.cc.

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

                                                              {
  if( algo=="OCC1" ){Occ1Norm_=value;return;}
  if( algo=="OCC2" ){Occ2Norm_=value;return;}
  if( algo=="ET" ){ETNorm_=value;return;}
  if( algo=="PU" ){PUNorm_=value;return;}
}
float LumiCorrector::TotalNormET ( float  TotLumi_noNorm,
int  nBXs 
)

Definition at line 72 of file LumiCorrector.cc.

References ETNorm_.

                                                        {
  return ETNorm_;
}
float LumiCorrector::TotalNormOcc1 ( float  TotLumi_noNorm,
int  nBXs 
)

Definition at line 63 of file LumiCorrector.cc.

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

                                                          {
  float AvgLumi = (nBXs>0) ? PUNorm_*TotLumi_noNorm/nBXs : 0.;
  return Occ1Norm_*AfterglowFactor(nBXs)/(1 + Alpha1_*AvgLumi + Alpha2_*AvgLumi*AvgLumi);
}
float LumiCorrector::TotalNormOcc2 ( float  TotLumi_noNorm,
int  nBXs 
)

Definition at line 68 of file LumiCorrector.cc.

References Occ2Norm_.

                                                          {
  return Occ2Norm_;
}

Member Data Documentation

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

Definition at line 26 of file LumiCorrector.h.

Referenced by AfterglowFactor(), and LumiCorrector().

float LumiCorrector::Alpha1_ [private]

Definition at line 24 of file LumiCorrector.h.

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

float LumiCorrector::Alpha2_ [private]

Definition at line 25 of file LumiCorrector.h.

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

float LumiCorrector::ETNorm_ [private]

Definition at line 22 of file LumiCorrector.h.

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

Definition at line 94 of file LumiCorrector.py.

float LumiCorrector::Occ1Norm_ [private]

Definition at line 20 of file LumiCorrector.h.

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

float LumiCorrector::Occ2Norm_ [private]

Definition at line 21 of file LumiCorrector.h.

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

float LumiCorrector::PUNorm_ [private]

Definition at line 23 of file LumiCorrector.h.

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