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::InputTag &, double)
 
 GetLumi (const edm::InputTag &, double, edm::ConsumesCollector &iC)
 
 GetLumi (const edm::ParameterSet &)
 
 GetLumi (const edm::ParameterSet &, 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 constexpr double CM2_TO_NANOBARN = 1.0 / 1.e-33
 
static constexpr double FREQ_ORBIT = 11246.
 
static constexpr double INELASTIC_XSEC_13TeV = 71.3
 
static constexpr double INELASTIC_XSEC_7TeV = 68.0
 
static constexpr double INELASTIC_XSEC_8TeV = 69.3
 
static const unsigned int lastBunchCrossing = 3564
 
static const unsigned int NUM_BX = 3564
 
static constexpr double rXSEC_PIXEL_CLUSTER = 9.4e-24
 
static constexpr double rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24
 
static constexpr double SECONDS_PER_LS = double(0x40000) / double(FREQ_ORBIT)
 
static constexpr double XSEC_PIXEL_CLUSTER = 10.08e-24
 
static constexpr double XSEC_PIXEL_CLUSTER_UNC = 0.17e-24
 

Detailed Description

Definition at line 21 of file GetLumi.h.

Member Enumeration Documentation

◆ SQRT_S

Enumerator
SQRT_S_7TeV 
SQRT_S_8TeV 
SQRT_S_13TeV 

Definition at line 23 of file GetLumi.h.

Constructor & Destructor Documentation

◆ GetLumi() [1/4]

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")) {}

◆ GetLumi() [2/4]

GetLumi::GetLumi ( const edm::InputTag lumiInputTag,
double  lumiScale 
)

Definition at line 18 of file GetLumi.cc.

◆ GetLumi() [3/4]

GetLumi::GetLumi ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)

◆ GetLumi() [4/4]

GetLumi::GetLumi ( const edm::InputTag lumiInputTag,
double  lumiScale,
edm::ConsumesCollector iC 
)

◆ ~GetLumi()

GetLumi::~GetLumi ( )
virtual

Definition at line 32 of file GetLumi.cc.

32 {}

Member Function Documentation

◆ convert2PU() [1/2]

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

Definition at line 78 of file GetLumi.cc.

80 {
81  // from https://cmswbm.web.cern.ch/cmswbm/images/pileup.png
82  return instLumi * inelastic_xSec / FREQ_ORBIT;
83 }

References FREQ_ORBIT, and muonGEMDigis_cfi::instLumi.

Referenced by convert2PU().

◆ convert2PU() [2/2]

double GetLumi::convert2PU ( double  instLumi,
int  sqrt_s = GetLumi::SQRT_S_8TeV 
)

Definition at line 85 of file GetLumi.cc.

85  {
86  double inelastic_xSec = 0.;
87 
88  switch (sqrt_s) {
90  inelastic_xSec = GetLumi::INELASTIC_XSEC_7TeV;
91  break;
93  inelastic_xSec = GetLumi::INELASTIC_XSEC_8TeV;
94  break;
95  default:
96  break;
97  }
98 
99  return convert2PU(instLumi, inelastic_xSec);
100 }

References convert2PU(), INELASTIC_XSEC_7TeV, INELASTIC_XSEC_8TeV, muonGEMDigis_cfi::instLumi, SQRT_S_7TeV, and SQRT_S_8TeV.

◆ fillDescriptions()

static void GetLumi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

◆ getRawValue() [1/2]

double GetLumi::getRawValue ( const edm::Event iEvent)

Definition at line 34 of file GetLumi.cc.

34  {
35  // taken from
36  // DPGAnalysis/SiStripTools/src/DigiLumiCorrHistogramMaker.cc
37  // the scale factor 6.37 should follow the lumi prescriptions
39  iEvent.getLuminosityBlock().getByToken(lumiSummaryToken_, lumi);
40 
41  double bxlumi = -1.;
42  if (lumi->isValid()) {
43  bxlumi = lumi->lumiValue(LumiDetails::kOCC1, iEvent.bunchCrossing());
44  }
45 
46  return bxlumi;
47 }

References iEvent, LumiDetails::kOCC1, BXlumiParameters_cfi::lumi, and lumiSummaryToken_.

Referenced by getValue().

◆ getRawValue() [2/2]

double GetLumi::getRawValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 54 of file GetLumi.cc.

54  {
55  double lumi = -1.;
56  double intDelLumi = -1.;
57 
58  // size_t LS = lumiBlock.luminosityBlockAuxiliary().luminosityBlock();
59  // accumulate HF data at every LS as it is closed.
60  // note: lumi unit from DIPLumiSummary and Detail is microbarns
61  edm::Handle<LumiSummary> lumiSummary_;
62  lumiBlock.getByToken(lumiSummaryToken_, lumiSummary_);
63  if (lumiSummary_->isValid()) {
64  lumi = lumiSummary_->avgInsDelLumi();
65  intDelLumi = lumiSummary_->intgDelLumi();
66  std::cout << "Luminosity in this Lumi Section " << lumi << " --> " << intDelLumi << std::endl;
67  } else {
68  std::cout << "No valid data found!" << std::endl;
69  }
70 
71  return lumi;
72 }

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

◆ getValue() [1/2]

double GetLumi::getValue ( const edm::Event iEvent)

Definition at line 49 of file GetLumi.cc.

49  {
50  // bxlumi = lumi->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
51  return getRawValue(iEvent) * lumiScale_;
52 }

References getRawValue(), iEvent, and lumiScale_.

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

◆ getValue() [2/2]

double GetLumi::getValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 74 of file GetLumi.cc.

74  {
75  return getRawValue(lumiBlock, eSetup) * lumiScale_;
76 }

References getRawValue(), and lumiScale_.

Member Data Documentation

◆ CM2_TO_NANOBARN

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

Definition at line 42 of file GetLumi.h.

Referenced by LumiMonitor::dqmAnalyze(), and tadqm::TrackAnalyzer::setLumi().

◆ FREQ_ORBIT

constexpr double GetLumi::FREQ_ORBIT = 11246.
staticconstexpr

Definition at line 26 of file GetLumi.h.

Referenced by convert2PU(), and tadqm::TrackAnalyzer::TrackAnalyzer().

◆ INELASTIC_XSEC_13TeV

constexpr double GetLumi::INELASTIC_XSEC_13TeV = 71.3
staticconstexpr

Definition at line 32 of file GetLumi.h.

◆ INELASTIC_XSEC_7TeV

constexpr double GetLumi::INELASTIC_XSEC_7TeV = 68.0
staticconstexpr

Definition at line 29 of file GetLumi.h.

Referenced by convert2PU().

◆ INELASTIC_XSEC_8TeV

constexpr double GetLumi::INELASTIC_XSEC_8TeV = 69.3
staticconstexpr

Definition at line 30 of file GetLumi.h.

Referenced by convert2PU().

◆ lastBunchCrossing

const unsigned int GetLumi::lastBunchCrossing = 3564
static

◆ lumiDetailsToken_

edm::EDGetTokenT<LumiDetails> GetLumi::lumiDetailsToken_

Definition at line 65 of file GetLumi.h.

Referenced by GetLumi().

◆ lumiInputTag_

edm::InputTag GetLumi::lumiInputTag_

Definition at line 62 of file GetLumi.h.

Referenced by GetLumi().

◆ lumiScale_

double GetLumi::lumiScale_

Definition at line 63 of file GetLumi.h.

Referenced by getValue().

◆ lumiSummaryToken_

edm::EDGetTokenT<LumiSummary> GetLumi::lumiSummaryToken_

Definition at line 66 of file GetLumi.h.

Referenced by GetLumi(), and getRawValue().

◆ NUM_BX

const unsigned int GetLumi::NUM_BX = 3564
static

Definition at line 25 of file GetLumi.h.

◆ rXSEC_PIXEL_CLUSTER

constexpr double GetLumi::rXSEC_PIXEL_CLUSTER = 9.4e-24
staticconstexpr

Definition at line 40 of file GetLumi.h.

Referenced by tadqm::TrackAnalyzer::TrackAnalyzer().

◆ rXSEC_PIXEL_CLUSTER_UNC

constexpr double GetLumi::rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24
staticconstexpr

Definition at line 41 of file GetLumi.h.

◆ SECONDS_PER_LS

constexpr double GetLumi::SECONDS_PER_LS = double(0x40000) / double(FREQ_ORBIT)
staticconstexpr

Definition at line 27 of file GetLumi.h.

Referenced by tadqm::TrackAnalyzer::TrackAnalyzer().

◆ XSEC_PIXEL_CLUSTER

constexpr double GetLumi::XSEC_PIXEL_CLUSTER = 10.08e-24
staticconstexpr

Definition at line 36 of file GetLumi.h.

Referenced by tadqm::TrackAnalyzer::TrackAnalyzer().

◆ XSEC_PIXEL_CLUSTER_UNC

constexpr double GetLumi::XSEC_PIXEL_CLUSTER_UNC = 0.17e-24
staticconstexpr

Definition at line 37 of file GetLumi.h.

LumiSummary::intgDelLumi
float intgDelLumi() const
Definition: LumiSummary.cc:16
GetLumi::GetLumi
GetLumi(const edm::ParameterSet &)
Definition: GetLumi.cc:14
GetLumi::INELASTIC_XSEC_7TeV
static constexpr double INELASTIC_XSEC_7TeV
Definition: GetLumi.h:29
GetLumi::getRawValue
double getRawValue(const edm::Event &)
Definition: GetLumi.cc:34
gather_cfg.cout
cout
Definition: gather_cfg.py:144
LumiSummary::avgInsDelLumi
float avgInsDelLumi() const
Definition: LumiSummary.cc:8
LumiDetails
Definition: LumiDetails.h:20
LumiDetails::kOCC1
Definition: LumiDetails.h:26
edm::Handle
Definition: AssociativeIterator.h:50
GetLumi::convert2PU
double convert2PU(double, double)
Definition: GetLumi.cc:78
GetLumi::INELASTIC_XSEC_8TeV
static constexpr double INELASTIC_XSEC_8TeV
Definition: GetLumi.h:30
LumiSummary::isValid
bool isValid() const
Definition: LumiSummary.cc:50
BXlumiParameters_cfi.lumi
lumi
Definition: BXlumiParameters_cfi.py:6
LumiSummary
Definition: LumiSummary.h:20
BXlumiParameters_cfi.lumiScale
lumiScale
Definition: BXlumiParameters_cfi.py:11
GetLumi::FREQ_ORBIT
static constexpr double FREQ_ORBIT
Definition: GetLumi.h:26
GetLumi::lumiScale_
double lumiScale_
Definition: GetLumi.h:63
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:49
GetLumi::SQRT_S_8TeV
Definition: GetLumi.h:23
GetLumi::lumiInputTag_
edm::InputTag lumiInputTag_
Definition: GetLumi.h:62
edm::InLumi
Definition: BranchType.h:11
iEvent
int iEvent
Definition: GenABIO.cc:224
GetLumi::lumiDetailsToken_
edm::EDGetTokenT< LumiDetails > lumiDetailsToken_
Definition: GetLumi.h:65
GetLumi::SQRT_S_13TeV
Definition: GetLumi.h:23
muonGEMDigis_cfi.instLumi
instLumi
Definition: muonGEMDigis_cfi.py:10
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
GetLumi::SQRT_S_7TeV
Definition: GetLumi.h:23
GetLumi::lumiSummaryToken_
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:66
lumi
Definition: LumiSectionData.h:20
edm::InputTag
Definition: InputTag.h:15
EDMtoMEConverter_cfi.lumiInputTag
lumiInputTag
Definition: EDMtoMEConverter_cfi.py:13