CMS 3D CMS Logo

HBHEDarkening.h
Go to the documentation of this file.
1 #ifndef CondFormats_HcalObjects_HBHEDarkening_h
2 #define CondFormats_HcalObjects_HBHEDarkening_h
3 
4 #include <vector>
5 #include <string>
6 #include <map>
7 
8 // Scintillator darkening model for HB and HE
9 // ingredients:
10 // 1) dose map (Mrad/fb-1), from Fluka
11 // 2) decay constant D as function of dose rate d (Mrad vs krad/hr): D(d) = A*d^B
12 // 3) inst lumi per year (fb-1/hr)
13 // 4) int lumi per year (fb-1)
14 // layer number for HB: (0,16) = (1,17) in HcalTestNumbering
15 // layer number for HE: (-1,17) = (1,19) in HcalTestNumbering
16 
18 public:
19  //helper classes
20  struct LumiYear {
21  //constructors
22  LumiYear() : year_(""), intlumi_(0.), lumirate_(0.), energy_(0), sumlumi_(0.) {}
23  LumiYear(std::string year, float intlumi, float lumirate, int energy)
24  : year_(year), intlumi_(intlumi), lumirate_(lumirate), energy_(energy), sumlumi_(0.) {}
25 
26  //sorting
27  bool operator<(const LumiYear& yr) const { return year_ < yr.year_; }
28 
29  //member variables
31  float intlumi_;
32  float lumirate_;
33  int energy_;
34  float sumlumi_;
35  };
36  struct LumiYearComp {
37  bool operator()(const LumiYear& yr, const float& lum) const { return yr.sumlumi_ < lum; }
38  };
39 
40  HBHEDarkening(int ieta_shift,
41  float drdA,
42  float drdB,
43  const std::map<int, std::vector<std::vector<float>>>& dosemaps,
44  const std::vector<LumiYear>& years);
46 
47  //public accessors
48  float degradation(float intlumi, int ieta, int lay) const;
49  int get_ieta_shift() const { return ieta_shift_; }
50 
51  //helper function
52  static std::vector<std::vector<float>> readDoseMap(const std::string& fullpath);
53 
54 private:
55  //helper functions
56  float dose(int ieta, int lay, int energy) const;
57  std::string getYearForLumi(float intlumi) const;
58  float degradationYear(const LumiYear& year, float intlumi, int ieta, int lay) const;
59 
60  //member variables
62  float drdA_, drdB_;
63  std::map<int, std::vector<std::vector<float>>> dosemaps_; //one map for each center of mass energy
64  std::vector<LumiYear> years_;
65 };
66 
67 #endif // HBHEDarkening_h
reco_skim_cfg_mod.fullpath
fullpath
Definition: reco_skim_cfg_mod.py:202
HBHEDarkening::dosemaps_
std::map< int, std::vector< std::vector< float > > > dosemaps_
Definition: HBHEDarkening.h:63
HBHEDarkening::drdA_
float drdA_
Definition: HBHEDarkening.h:62
HBHEDarkening::LumiYearComp::operator()
bool operator()(const LumiYear &yr, const float &lum) const
Definition: HBHEDarkening.h:37
HBHEDarkening::dose
float dose(int ieta, int lay, int energy) const
Definition: HBHEDarkening.cc:51
HBHEDarkening::LumiYear::intlumi_
float intlumi_
Definition: HBHEDarkening.h:31
HBHEDarkening::get_ieta_shift
int get_ieta_shift() const
Definition: HBHEDarkening.h:49
HBHEDarkening::readDoseMap
static std::vector< std::vector< float > > readDoseMap(const std::string &fullpath)
Definition: HBHEDarkening.cc:32
HBHEDarkening::LumiYear::sumlumi_
float sumlumi_
Definition: HBHEDarkening.h:34
HBHEDarkening::years_
std::vector< LumiYear > years_
Definition: HBHEDarkening.h:64
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
HBHEDarkening::LumiYearComp
Definition: HBHEDarkening.h:36
HBHEDarkening::LumiYear::year_
std::string year_
Definition: HBHEDarkening.h:30
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HBHEDarkening::drdB_
float drdB_
Definition: HBHEDarkening.h:62
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HBHEDarkening::LumiYear::operator<
bool operator<(const LumiYear &yr) const
Definition: HBHEDarkening.h:27
HBHEDarkening::LumiYear
Definition: HBHEDarkening.h:20
HBHEDarkening
Definition: HBHEDarkening.h:17
HBHEDarkening::degradationYear
float degradationYear(const LumiYear &year, float intlumi, int ieta, int lay) const
Definition: HBHEDarkening.cc:80
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
HBHEDarkening::LumiYear::lumirate_
float lumirate_
Definition: HBHEDarkening.h:32
HBHEDarkening::LumiYear::LumiYear
LumiYear()
Definition: HBHEDarkening.h:22
HBHEDarkening::ieta_shift_
int ieta_shift_
Definition: HBHEDarkening.h:61
HBHEDarkening::LumiYear::energy_
int energy_
Definition: HBHEDarkening.h:33
HBHEDarkening::degradation
float degradation(float intlumi, int ieta, int lay) const
Definition: HBHEDarkening.cc:98
HBHEDarkening::HBHEDarkening
HBHEDarkening(int ieta_shift, float drdA, float drdB, const std::map< int, std::vector< std::vector< float >>> &dosemaps, const std::vector< LumiYear > &years)
Definition: HBHEDarkening.cc:16
HBHEDarkening::LumiYear::LumiYear
LumiYear(std::string year, float intlumi, float lumirate, int energy)
Definition: HBHEDarkening.h:23
HBHEDarkening::~HBHEDarkening
~HBHEDarkening()
Definition: HBHEDarkening.h:45
genParticles_cff.map
map
Definition: genParticles_cff.py:11
HBHEDarkening::getYearForLumi
std::string getYearForLumi(float intlumi) const
Definition: HBHEDarkening.cc:70