Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:05

0001 #ifndef GetLumi_H
0002 #define GetLumi_H
0003 
0004 // system include files
0005 #include <memory>
0006 
0007 // user include files
0008 #include "FWCore/Utilities/interface/EDGetToken.h"
0009 #include "FWCore/Framework/interface/ConsumesCollector.h"
0010 #include "FWCore/Framework/interface/Frameworkfwd.h"
0011 #include "FWCore/Framework/interface/Event.h"
0012 #include "FWCore/Framework/interface/MakerMacros.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0014 
0015 class LumiDetails;
0016 class LumiSummary;
0017 
0018 class GetLumi {
0019 public:
0020   enum SQRT_S { SQRT_S_7TeV, SQRT_S_8TeV, SQRT_S_13TeV };
0021 
0022   static const unsigned int NUM_BX = 3564;
0023   static constexpr double FREQ_ORBIT = 11246.;  // Hz
0024   static constexpr double SECONDS_PER_LS = double(0x40000) / double(FREQ_ORBIT);
0025 
0026   static constexpr double INELASTIC_XSEC_7TeV = 68.0;  // mb
0027   static constexpr double INELASTIC_XSEC_8TeV = 69.3;  // mb
0028   // mb from http://inspirehep.net/record/1447965/files/FSQ-15-005-pas.pdf
0029   static constexpr double INELASTIC_XSEC_13TeV = 71.3;
0030 
0031   // from http://cmslxr.fnal.gov/source/DQM/PixelLumi/plugins/PixelLumiDQM.h
0032   // Using all pixel clusters:
0033   static constexpr double XSEC_PIXEL_CLUSTER = 10.08e-24;  //in cm^2
0034   static constexpr double XSEC_PIXEL_CLUSTER_UNC = 0.17e-24;
0035 
0036   // Excluding the inner barrel layer.
0037   static constexpr double rXSEC_PIXEL_CLUSTER = 9.4e-24;  //in cm^2
0038   static constexpr double rXSEC_PIXEL_CLUSTER_UNC = 0.119e-24;
0039   static constexpr double CM2_TO_NANOBARN = 1.0 / 1.e-33;
0040   static const unsigned int lastBunchCrossing = 3564;
0041 
0042   GetLumi(const edm::ParameterSet&);
0043   GetLumi(const edm::InputTag&, double);
0044   GetLumi(const edm::ParameterSet&, edm::ConsumesCollector& iC);
0045   GetLumi(const edm::InputTag&, double, edm::ConsumesCollector& iC);
0046   virtual ~GetLumi();
0047   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0048 
0049   double getRawValue(const edm::Event&);
0050   double getValue(const edm::Event&);
0051 
0052   double getRawValue(edm::LuminosityBlock const&, edm::EventSetup const&);
0053   double getValue(edm::LuminosityBlock const&, edm::EventSetup const&);
0054 
0055   double convert2PU(double, double);
0056   double convert2PU(double, int);
0057 
0058   // ----------member data ---------------------------
0059   edm::InputTag lumiInputTag_;
0060   double lumiScale_;
0061 
0062   edm::EDGetTokenT<LumiDetails> lumiDetailsToken_;
0063   edm::EDGetTokenT<LumiSummary> lumiSummaryToken_;
0064 };
0065 #endif