CMS 3D CMS Logo

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

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 FREQ_ORBIT = 11246.
 
static constexpr double INELASTIC_XSEC_7TeV = 68.0
 
static constexpr double INELASTIC_XSEC_8TeV = 69.3
 
static const unsigned int NUM_BX = 3564
 
static constexpr double SECONDS_PER_LS = double(0x40000)/double(FREQ_ORBIT)
 

Detailed Description

Definition at line 21 of file GetLumi.h.

Member Enumeration Documentation

Enumerator
SQRT_S_7TeV 
SQRT_S_8TeV 

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:54
double lumiScale_
Definition: GetLumi.h:55
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:54
double lumiScale_
Definition: GetLumi.h:55
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:57
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:58
GetLumi(const edm::ParameterSet &)
Definition: GetLumi.cc:14
edm::InputTag lumiInputTag_
Definition: GetLumi.h:54
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:57
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:58
GetLumi(const edm::ParameterSet &)
Definition: GetLumi.cc:14
edm::InputTag lumiInputTag_
Definition: GetLumi.h:54
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 constexpr double FREQ_ORBIT
Definition: GetLumi.h:31
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 constexpr double INELASTIC_XSEC_7TeV
Definition: GetLumi.h:34
static constexpr double INELASTIC_XSEC_8TeV
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(), edm::HandleBase::isValid(), LumiDetails::kOCC1, fjr2json::lumi, and lumiSummaryToken_.

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
tuple lumi
Definition: fjr2json.py:35
int bunchCrossing() const
Definition: EventBase.h:62
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:58
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:80
bool isValid() const
Definition: HandleBase.h:76
double GetLumi::getRawValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 71 of file GetLumi.cc.

References gather_cfg::cout, edm::LuminosityBlock::getByToken(), edm::HandleBase::isValid(), fjr2json::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 }
tuple lumi
Definition: fjr2json.py:35
edm::EDGetTokenT< LumiSummary > lumiSummaryToken_
Definition: GetLumi.h:58
bool isValid() const
Definition: HandleBase.h:76
tuple cout
Definition: gather_cfg.py:121
double GetLumi::getValue ( const edm::Event iEvent)

Definition at line 64 of file GetLumi.cc.

References getRawValue(), and lumiScale_.

Referenced by VertexMonitor::analyze(), TrackingMonitor::analyze(), and LogMessageMonitor::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:55
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:55

Member Data Documentation

constexpr double GetLumi::FREQ_ORBIT = 11246.
static

Definition at line 31 of file GetLumi.h.

Referenced by convert2PU().

constexpr double GetLumi::INELASTIC_XSEC_7TeV = 68.0
static

Definition at line 34 of file GetLumi.h.

Referenced by convert2PU().

constexpr double GetLumi::INELASTIC_XSEC_8TeV = 69.3
static

Definition at line 35 of file GetLumi.h.

Referenced by convert2PU().

edm::EDGetTokenT<LumiDetails> GetLumi::lumiDetailsToken_

Definition at line 57 of file GetLumi.h.

Referenced by GetLumi().

edm::InputTag GetLumi::lumiInputTag_

Definition at line 54 of file GetLumi.h.

Referenced by GetLumi().

double GetLumi::lumiScale_

Definition at line 55 of file GetLumi.h.

Referenced by getValue().

edm::EDGetTokenT<LumiSummary> GetLumi::lumiSummaryToken_

Definition at line 58 of file GetLumi.h.

Referenced by GetLumi(), and getRawValue().

const unsigned int GetLumi::NUM_BX = 3564
static

Definition at line 30 of file GetLumi.h.

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

Definition at line 32 of file GetLumi.h.