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 (edm::InputTag, double)
 
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::InputTag lumiInputTag_
 
double lumiScale_
 

Static Public Attributes

static double FREQ_ORBIT = 11246.
 
static double INELASTIC_XSEC_7TeV = 68.0
 
static double INELASTIC_XSEC_8TeV = 69.3
 
static const unsigned int NUM_BX = 3564
 
static double SECONDS_PER_LS = double(0x40000)/double(FREQ_ORBIT)
 

Detailed Description

Definition at line 16 of file GetLumi.h.

Member Enumeration Documentation

Enumerator
SQRT_S_7TeV 
SQRT_S_8TeV 

Definition at line 20 of file GetLumi.h.

Constructor & Destructor Documentation

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

Definition at line 15 of file GetLumi.cc.

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

Definition at line 21 of file GetLumi.cc.

22  : lumiInputTag_ ( lumiInputTag )
23  , lumiScale_ ( lumiScale )
24 {
25 }
edm::InputTag lumiInputTag_
Definition: GetLumi.h:47
double lumiScale_
Definition: GetLumi.h:48
GetLumi::~GetLumi ( )
virtual

Definition at line 27 of file GetLumi.cc.

28 {
29 }

Member Function Documentation

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

Definition at line 94 of file GetLumi.cc.

References FREQ_ORBIT.

Referenced by convert2PU().

95 {
96 
97  // from https://cmswbm.web.cern.ch/cmswbm/images/pileup.png
98  return instLumi*inelastic_xSec/FREQ_ORBIT;
99 }
static double FREQ_ORBIT
Definition: GetLumi.h:26
double GetLumi::convert2PU ( double  instLumi,
int  sqrt_s = GetLumi::SQRT_S_8TeV 
)

Definition at line 102 of file GetLumi.cc.

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

103 {
104 
105  double inelastic_xSec = 0.;
106 
107  switch(sqrt_s) {
108  case GetLumi::SQRT_S_7TeV :
109  inelastic_xSec = GetLumi::INELASTIC_XSEC_7TeV;
110  break;
111  case GetLumi::SQRT_S_8TeV :
112  inelastic_xSec = GetLumi::INELASTIC_XSEC_8TeV;
113  break;
114  default :
115  break;
116  }
117 
118  return convert2PU(instLumi,inelastic_xSec);
119 
120 }
static double INELASTIC_XSEC_8TeV
Definition: GetLumi.h:30
static double INELASTIC_XSEC_7TeV
Definition: GetLumi.h:29
double convert2PU(double, double)
Definition: GetLumi.cc:94
static void GetLumi::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static
double GetLumi::getRawValue ( const edm::Event iEvent)

Definition at line 32 of file GetLumi.cc.

References edm::EventBase::bunchCrossing(), edm::LuminosityBlock::getByLabel(), edm::Event::getLuminosityBlock(), edm::HandleBase::isValid(), LumiDetails::kOCC1, fjr2json::lumi, and lumiInputTag_.

Referenced by getValue().

33 {
34 
35  // taken from
36  // DPGAnalysis/SiStripTools/src/DigiLumiCorrHistogramMaker.cc
37  // the scale factor 6.37 should follow the lumi prescriptions
40 
41  double bxlumi = -1.;
42  if(lumi->isValid()) {
43  bxlumi = lumi->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing());
44  }
45 
46  return bxlumi;
47 
48 }
tuple lumi
Definition: fjr2json.py:35
int bunchCrossing() const
Definition: EventBase.h:62
bool getByLabel(std::string const &label, Handle< PROD > &result) const
LuminosityBlock const & getLuminosityBlock() const
Definition: Event.h:59
bool isValid() const
Definition: HandleBase.h:76
edm::InputTag lumiInputTag_
Definition: GetLumi.h:47
double GetLumi::getRawValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 59 of file GetLumi.cc.

References gather_cfg::cout, edm::LuminosityBlock::getByLabel(), edm::HandleBase::isValid(), fjr2json::lumi, and lumiInputTag_.

61 {
62 
63  double lumi = -1.;
64  double intDelLumi = -1.;
65 
66  // size_t LS = lumiBlock.luminosityBlockAuxiliary().luminosityBlock();
67  // accumulate HF data at every LS as it is closed.
68  // note: lumi unit from DIPLumiSummary and Detail is microbarns
69  edm::Handle<LumiSummary> lumiSummary_;
70  lumiBlock.getByLabel(lumiInputTag_, lumiSummary_);
71  if(lumiSummary_->isValid()){
72  lumi = lumiSummary_->avgInsDelLumi();
73  intDelLumi = lumiSummary_->intgDelLumi();
74  std::cout << "Luminosity in this Lumi Section " << lumi << " --> " << intDelLumi << std::endl;
75  } else {
76  std::cout << "No valid data found!" << std::endl;
77  }
78 
79 
80  return lumi;
81 
82 }
tuple lumi
Definition: fjr2json.py:35
bool isValid() const
Definition: HandleBase.h:76
tuple cout
Definition: gather_cfg.py:121
edm::InputTag lumiInputTag_
Definition: GetLumi.h:47
double GetLumi::getValue ( const edm::Event iEvent)

Definition at line 52 of file GetLumi.cc.

References getRawValue(), and lumiScale_.

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

53 {
54  // bxlumi = lumi->lumiValue(LumiDetails::kOCC1,iEvent.bunchCrossing())*6.37;
55  return getRawValue(iEvent)*lumiScale_;
56 }
double getRawValue(const edm::Event &)
Definition: GetLumi.cc:32
double lumiScale_
Definition: GetLumi.h:48
double GetLumi::getValue ( edm::LuminosityBlock const &  lumiBlock,
edm::EventSetup const &  eSetup 
)

Definition at line 86 of file GetLumi.cc.

References getRawValue(), and lumiScale_.

88 {
89  return getRawValue(lumiBlock,eSetup)*lumiScale_;
90 }
double getRawValue(const edm::Event &)
Definition: GetLumi.cc:32
double lumiScale_
Definition: GetLumi.h:48

Member Data Documentation

double GetLumi::FREQ_ORBIT = 11246.
static

Definition at line 26 of file GetLumi.h.

Referenced by convert2PU().

double GetLumi::INELASTIC_XSEC_7TeV = 68.0
static

Definition at line 29 of file GetLumi.h.

Referenced by convert2PU().

double GetLumi::INELASTIC_XSEC_8TeV = 69.3
static

Definition at line 30 of file GetLumi.h.

Referenced by convert2PU().

edm::InputTag GetLumi::lumiInputTag_

Definition at line 47 of file GetLumi.h.

Referenced by getRawValue().

double GetLumi::lumiScale_

Definition at line 48 of file GetLumi.h.

Referenced by getValue().

const unsigned int GetLumi::NUM_BX = 3564
static

Definition at line 25 of file GetLumi.h.

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

Definition at line 27 of file GetLumi.h.