CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 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

Enumerator
SQRT_S_7TeV 
SQRT_S_8TeV 
SQRT_S_13TeV 

Definition at line 23 of file GetLumi.h.

Constructor & Destructor Documentation

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

Definition at line 13 of file GetLumi.cc.

14  : lumiInputTag_(iConfig.getParameter<edm::InputTag>("lumi")),
15  lumiScale_(iConfig.getParameter<double>("lumiScale")) {}
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag lumiInputTag_
Definition: GetLumi.h:62
double lumiScale_
Definition: GetLumi.h:63
GetLumi::GetLumi ( const edm::InputTag lumiInputTag,
double  lumiScale 
)

Definition at line 17 of file GetLumi.cc.

18  : lumiInputTag_(lumiInputTag), lumiScale_(lumiScale) {}
edm::InputTag lumiInputTag_
Definition: GetLumi.h:62
double lumiScale_
Definition: GetLumi.h:63
GetLumi::GetLumi ( const edm::ParameterSet iConfig,
edm::ConsumesCollector iC 
)

Definition at line 20 of file GetLumi.cc.

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

20  : GetLumi(iConfig) {
23 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< LumiDetails > lumiDetailsToken_
Definition: GetLumi.h:65
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:66
GetLumi(const edm::ParameterSet &)
Definition: GetLumi.cc:13
edm::InputTag lumiInputTag_
Definition: GetLumi.h:62
GetLumi::GetLumi ( const edm::InputTag lumiInputTag,
double  lumiScale,
edm::ConsumesCollector iC 
)

Definition at line 25 of file GetLumi.cc.

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

26  : GetLumi(lumiInputTag, lumiScale) {
29 }
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< LumiDetails > lumiDetailsToken_
Definition: GetLumi.h:65
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:66
GetLumi(const edm::ParameterSet &)
Definition: GetLumi.cc:13
edm::InputTag lumiInputTag_
Definition: GetLumi.h:62
GetLumi::~GetLumi ( )
virtual

Definition at line 31 of file GetLumi.cc.

31 {}

Member Function Documentation

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

Definition at line 77 of file GetLumi.cc.

References FREQ_ORBIT.

Referenced by convert2PU().

79 {
80  // from https://cmswbm.web.cern.ch/cmswbm/images/pileup.png
81  return instLumi * inelastic_xSec / FREQ_ORBIT;
82 }
static constexpr double FREQ_ORBIT
Definition: GetLumi.h:26
double GetLumi::convert2PU ( double  instLumi,
int  sqrt_s = GetLumi::SQRT_S_8TeV 
)

Definition at line 84 of file GetLumi.cc.

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

84  {
85  double inelastic_xSec = 0.;
86 
87  switch (sqrt_s) {
89  inelastic_xSec = GetLumi::INELASTIC_XSEC_7TeV;
90  break;
92  inelastic_xSec = GetLumi::INELASTIC_XSEC_8TeV;
93  break;
94  default:
95  break;
96  }
97 
98  return convert2PU(instLumi, inelastic_xSec);
99 }
static constexpr double INELASTIC_XSEC_7TeV
Definition: GetLumi.h:29
static constexpr double INELASTIC_XSEC_8TeV
Definition: GetLumi.h:30
double convert2PU(double, double)
Definition: GetLumi.cc:77
static void GetLumi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static
double GetLumi::getRawValue ( const edm::Event iEvent)

Definition at line 33 of file GetLumi.cc.

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

Referenced by getValue().

33  {
34  // taken from
35  // DPGAnalysis/SiStripTools/src/DigiLumiCorrHistogramMaker.cc
36  // the scale factor 6.37 should follow the lumi prescriptions
39 
40  double bxlumi = -1.;
41  if (lumi->isValid()) {
42  bxlumi = lumi->lumiValue(LumiDetails::kOCC1, iEvent.bunchCrossing());
43  }
44 
45  return bxlumi;
46 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
int bunchCrossing() const
Definition: EventBase.h:64
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:66
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:100
bool isValid() const
Definition: HandleBase.h:70
list lumi
Definition: dqmdumpme.py:53
double GetLumi::getRawValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 53 of file GetLumi.cc.

References edm::LuminosityBlock::getByToken(), edm::HandleBase::isValid(), dqmdumpme::lumi, and lumiSummaryToken_.

53  {
54  double lumi = -1.;
55  double intDelLumi = -1.;
56 
57  // size_t LS = lumiBlock.luminosityBlockAuxiliary().luminosityBlock();
58  // accumulate HF data at every LS as it is closed.
59  // note: lumi unit from DIPLumiSummary and Detail is microbarns
60  edm::Handle<LumiSummary> lumiSummary_;
61  lumiBlock.getByToken(lumiSummaryToken_, lumiSummary_);
62  if (lumiSummary_->isValid()) {
63  lumi = lumiSummary_->avgInsDelLumi();
64  intDelLumi = lumiSummary_->intgDelLumi();
65  edm::LogInfo("GetLumi") << "Luminosity in this Lumi Section " << lumi << " --> " << intDelLumi << std::endl;
66  } else {
67  edm::LogWarning("GetLumi") << "No valid data found!" << std::endl;
68  }
69 
70  return lumi;
71 }
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:66
bool isValid() const
Definition: HandleBase.h:70
list lumi
Definition: dqmdumpme.py:53
Log< level::Info, false > LogInfo
Log< level::Warning, false > LogWarning
double GetLumi::getValue ( const edm::Event iEvent)

Definition at line 48 of file GetLumi.cc.

References getRawValue(), and lumiScale_.

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

48  {
49  // bxlumi = lumi->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
50  return getRawValue(iEvent) * lumiScale_;
51 }
double getRawValue(const edm::Event &)
Definition: GetLumi.cc:33
double lumiScale_
Definition: GetLumi.h:63
double GetLumi::getValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 73 of file GetLumi.cc.

References getRawValue(), and lumiScale_.

73  {
74  return getRawValue(lumiBlock, eSetup) * lumiScale_;
75 }
double getRawValue(const edm::Event &)
Definition: GetLumi.cc:33
double lumiScale_
Definition: GetLumi.h:63

Member Data Documentation

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

Definition at line 42 of file GetLumi.h.

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

constexpr double GetLumi::FREQ_ORBIT = 11246.
static

Definition at line 26 of file GetLumi.h.

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

constexpr double GetLumi::INELASTIC_XSEC_13TeV = 71.3
static

Definition at line 32 of file GetLumi.h.

constexpr double GetLumi::INELASTIC_XSEC_7TeV = 68.0
static

Definition at line 29 of file GetLumi.h.

Referenced by convert2PU().

constexpr double GetLumi::INELASTIC_XSEC_8TeV = 69.3
static

Definition at line 30 of file GetLumi.h.

Referenced by convert2PU().

const unsigned int GetLumi::lastBunchCrossing = 3564
static
edm::EDGetTokenT<LumiDetails> GetLumi::lumiDetailsToken_

Definition at line 65 of file GetLumi.h.

Referenced by GetLumi().

edm::InputTag GetLumi::lumiInputTag_

Definition at line 62 of file GetLumi.h.

Referenced by GetLumi().

double GetLumi::lumiScale_

Definition at line 63 of file GetLumi.h.

Referenced by getValue().

edm::EDGetTokenT<LumiSummary> GetLumi::lumiSummaryToken_

Definition at line 66 of file GetLumi.h.

Referenced by GetLumi(), and getRawValue().

const unsigned int GetLumi::NUM_BX = 3564
static

Definition at line 25 of file GetLumi.h.

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

Definition at line 40 of file GetLumi.h.

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

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

Definition at line 41 of file GetLumi.h.

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

Definition at line 27 of file GetLumi.h.

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

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

Definition at line 36 of file GetLumi.h.

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

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

Definition at line 37 of file GetLumi.h.