CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes
GetLumi Class Reference

#include <GetLumi.h>

Public Types

enum  SQRT_S { SQRT_S_7TeV, SQRT_S_8TeV, SQRT_S_13TeV }
 

Public Member Functions

double convert2PU (double, double)
 
double convert2PU (double, int)
 
 GetLumi (const edm::ParameterSet &)
 
 GetLumi (const edm::InputTag &, double)
 
 GetLumi (const edm::ParameterSet &, edm::ConsumesCollector &iC)
 
 GetLumi (const edm::InputTag &, double, edm::ConsumesCollector &iC)
 
double getRawValue (const edm::Event &)
 
double getRawValue (edm::LuminosityBlock const &, edm::EventSetup const &)
 
double getValue (const edm::Event &)
 
double getValue (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual ~GetLumi ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Public Attributes

edm::EDGetTokenT< LumiDetailslumiDetailsToken_
 
edm::InputTag lumiInputTag_
 
double lumiScale_
 
edm::EDGetTokenT< LumiSummarylumiSummaryToken_
 

Static Public Attributes

static double CM2_TO_NANOBARN = 1.0/1.e-33
 
static double FREQ_ORBIT = 11246.
 
static double INELASTIC_XSEC_13TeV = 71.3
 
static double INELASTIC_XSEC_7TeV = 68.0
 
static double INELASTIC_XSEC_8TeV = 69.3
 
static const unsigned int lastBunchCrossing = 3564
 
static const unsigned int NUM_BX = 3564
 
static double rXSEC_PIXEL_CLUSTER = 9.4e-24
 
static double rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24
 
static double SECONDS_PER_LS = double(0x40000)/double(FREQ_ORBIT)
 
static double XSEC_PIXEL_CLUSTER = 10.08e-24
 
static double XSEC_PIXEL_CLUSTER_UNC = 0.17e-24
 

Detailed Description

Definition at line 21 of file GetLumi.h.

Member Enumeration Documentation

Enumerator
SQRT_S_7TeV 
SQRT_S_8TeV 
SQRT_S_13TeV 

Definition at line 25 of file GetLumi.h.

Constructor & Destructor Documentation

GetLumi::GetLumi ( const edm::ParameterSet iConfig)

Definition at line 14 of file GetLumi.cc.

15  : lumiInputTag_ ( iConfig.getParameter<edm::InputTag>("lumi") )
16  , lumiScale_ ( iConfig.getParameter<double>("lumiScale") )
17 {
18 }
T getParameter(std::string const &) const
edm::InputTag lumiInputTag_
Definition: GetLumi.h:67
double lumiScale_
Definition: GetLumi.h:68
GetLumi::GetLumi ( const edm::InputTag lumiInputTag,
double  lumiScale 
)

Definition at line 20 of file GetLumi.cc.

21  : lumiInputTag_ ( lumiInputTag )
22  , lumiScale_ ( lumiScale )
23 {
24 }
edm::InputTag lumiInputTag_
Definition: GetLumi.h:67
double lumiScale_
Definition: GetLumi.h:68
GetLumi::GetLumi ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)

Definition at line 26 of file GetLumi.cc.

References edm::ConsumesCollector::consumes(), edm::InLumi, lumiDetailsToken_, lumiInputTag_, and lumiSummaryToken_.

26  : GetLumi(iConfig)
27 {
30 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< LumiDetails > lumiDetailsToken_
Definition: GetLumi.h:70
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:71
GetLumi(const edm::ParameterSet &)
Definition: GetLumi.cc:14
edm::InputTag lumiInputTag_
Definition: GetLumi.h:67
GetLumi::GetLumi ( const edm::InputTag lumiInputTag,
double  lumiScale,
edm::ConsumesCollector iC 
)

Definition at line 32 of file GetLumi.cc.

References edm::ConsumesCollector::consumes(), edm::InLumi, lumiDetailsToken_, lumiInputTag_, and lumiSummaryToken_.

32  : GetLumi(lumiInputTag,lumiScale)
33 {
36 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< LumiDetails > lumiDetailsToken_
Definition: GetLumi.h:70
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:71
GetLumi(const edm::ParameterSet &)
Definition: GetLumi.cc:14
edm::InputTag lumiInputTag_
Definition: GetLumi.h:67
GetLumi::~GetLumi ( )
virtual

Definition at line 38 of file GetLumi.cc.

39 {
40 }

Member Function Documentation

double GetLumi::convert2PU ( double  instLumi,
double  inelastic_xSec = GetLumi::INELASTIC_XSEC_8TeV 
)

Definition at line 106 of file GetLumi.cc.

References FREQ_ORBIT.

Referenced by convert2PU().

107 {
108 
109  // from https://cmswbm.web.cern.ch/cmswbm/images/pileup.png
110  return instLumi*inelastic_xSec/FREQ_ORBIT;
111 }
static double FREQ_ORBIT
Definition: GetLumi.h:32
double GetLumi::convert2PU ( double  instLumi,
int  sqrt_s = GetLumi::SQRT_S_8TeV 
)

Definition at line 114 of file GetLumi.cc.

References convert2PU(), INELASTIC_XSEC_7TeV, INELASTIC_XSEC_8TeV, SQRT_S_7TeV, and SQRT_S_8TeV.

115 {
116 
117  double inelastic_xSec = 0.;
118 
119  switch(sqrt_s) {
120  case GetLumi::SQRT_S_7TeV :
121  inelastic_xSec = GetLumi::INELASTIC_XSEC_7TeV;
122  break;
123  case GetLumi::SQRT_S_8TeV :
124  inelastic_xSec = GetLumi::INELASTIC_XSEC_8TeV;
125  break;
126  default :
127  break;
128  }
129 
130  return convert2PU(instLumi,inelastic_xSec);
131 
132 }
static double INELASTIC_XSEC_8TeV
Definition: GetLumi.h:36
static double INELASTIC_XSEC_7TeV
Definition: GetLumi.h:35
double convert2PU(double, double)
Definition: GetLumi.cc:106
static void GetLumi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static
double GetLumi::getRawValue ( const edm::Event iEvent)

Definition at line 43 of file GetLumi.cc.

References edm::EventBase::bunchCrossing(), edm::LuminosityBlock::getByToken(), edm::Event::getLuminosityBlock(), LumiDetails::isValid(), LumiDetails::kOCC1, csvLumiCalc::lumi, lumiSummaryToken_, and LumiDetails::lumiValue().

Referenced by getValue().

44 {
45 
46  // taken from
47  // DPGAnalysis/SiStripTools/src/DigiLumiCorrHistogramMaker.cc
48  // the scale factor 6.37 should follow the lumi prescriptions
51 
52 
53  double bxlumi = -1.;
54  if(lumi->isValid()) {
55  bxlumi = lumi->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing());
56  }
57 
58  return bxlumi;
59 
60 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool isValid() const
Definition: LumiDetails.cc:57
int bunchCrossing() const
Definition: EventBase.h:66
float lumiValue(AlgoType algo, unsigned int bx) const
Definition: LumiDetails.cc:92
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:71
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:86
double GetLumi::getRawValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 71 of file GetLumi.cc.

References LumiSummary::avgInsDelLumi(), gather_cfg::cout, edm::LuminosityBlock::getByToken(), LumiSummary::intgDelLumi(), LumiSummary::isValid(), csvLumiCalc::lumi, and lumiSummaryToken_.

73 {
74 
75  double lumi = -1.;
76  double intDelLumi = -1.;
77 
78  // size_t LS = lumiBlock.luminosityBlockAuxiliary().luminosityBlock();
79  // accumulate HF data at every LS as it is closed.
80  // note: lumi unit from DIPLumiSummary and Detail is microbarns
81  edm::Handle<LumiSummary> lumiSummary_;
82  lumiBlock.getByToken(lumiSummaryToken_, lumiSummary_);
83  if(lumiSummary_->isValid()){
84  lumi = lumiSummary_->avgInsDelLumi();
85  intDelLumi = lumiSummary_->intgDelLumi();
86  std::cout << "Luminosity in this Lumi Section " << lumi << " --> " << intDelLumi << std::endl;
87  } else {
88  std::cout << "No valid data found!" << std::endl;
89  }
90 
91 
92  return lumi;
93 
94 }
float intgDelLumi() const
Definition: LumiSummary.cc:17
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:71
float avgInsDelLumi() const
Definition: LumiSummary.cc:9
bool isValid() const
Definition: LumiSummary.cc:78
double GetLumi::getValue ( const edm::Event iEvent)

Definition at line 64 of file GetLumi.cc.

References getRawValue(), and lumiScale_.

Referenced by VertexMonitor::analyze(), LogMessageMonitor::analyze(), and TrackingMonitor::analyze().

65 {
66  // bxlumi = lumi->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
67  return getRawValue(iEvent)*lumiScale_;
68 }
double getRawValue(const edm::Event &)
Definition: GetLumi.cc:43
double lumiScale_
Definition: GetLumi.h:68
double GetLumi::getValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 98 of file GetLumi.cc.

References getRawValue(), and lumiScale_.

100 {
101  return getRawValue(lumiBlock,eSetup)*lumiScale_;
102 }
double getRawValue(const edm::Event &)
Definition: GetLumi.cc:43
double lumiScale_
Definition: GetLumi.h:68

Member Data Documentation

double GetLumi::CM2_TO_NANOBARN = 1.0/1.e-33
static

Definition at line 47 of file GetLumi.h.

Referenced by LumiMonitor::analyze(), and dqm::TrackAnalyzer::setLumi().

double GetLumi::FREQ_ORBIT = 11246.
static
double GetLumi::INELASTIC_XSEC_13TeV = 71.3
static

Definition at line 37 of file GetLumi.h.

double GetLumi::INELASTIC_XSEC_7TeV = 68.0
static

Definition at line 35 of file GetLumi.h.

Referenced by convert2PU().

double GetLumi::INELASTIC_XSEC_8TeV = 69.3
static

Definition at line 36 of file GetLumi.h.

Referenced by convert2PU().

const unsigned int GetLumi::lastBunchCrossing = 3564
static

Definition at line 48 of file GetLumi.h.

Referenced by dqm::TrackAnalyzer::bookHistosForEfficiencyFromHitPatter().

edm::EDGetTokenT<LumiDetails> GetLumi::lumiDetailsToken_

Definition at line 70 of file GetLumi.h.

Referenced by GetLumi().

edm::InputTag GetLumi::lumiInputTag_

Definition at line 67 of file GetLumi.h.

Referenced by GetLumi().

double GetLumi::lumiScale_

Definition at line 68 of file GetLumi.h.

Referenced by getValue().

edm::EDGetTokenT<LumiSummary> GetLumi::lumiSummaryToken_

Definition at line 71 of file GetLumi.h.

Referenced by GetLumi(), and getRawValue().

const unsigned int GetLumi::NUM_BX = 3564
static

Definition at line 31 of file GetLumi.h.

double GetLumi::rXSEC_PIXEL_CLUSTER = 9.4e-24
static

Definition at line 45 of file GetLumi.h.

Referenced by LumiMonitor::LumiMonitor(), and dqm::TrackAnalyzer::TrackAnalyzer().

double GetLumi::rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24
static

Definition at line 46 of file GetLumi.h.

double GetLumi::SECONDS_PER_LS = double(0x40000)/double(FREQ_ORBIT)
static

Definition at line 33 of file GetLumi.h.

Referenced by LumiMonitor::LumiMonitor(), and dqm::TrackAnalyzer::TrackAnalyzer().

double GetLumi::XSEC_PIXEL_CLUSTER = 10.08e-24
static

Definition at line 41 of file GetLumi.h.

Referenced by LumiMonitor::LumiMonitor(), and dqm::TrackAnalyzer::TrackAnalyzer().

double GetLumi::XSEC_PIXEL_CLUSTER_UNC = 0.17e-24
static

Definition at line 42 of file GetLumi.h.