CMS 3D CMS Logo

CaloMiscalibMapEcal.h
Go to the documentation of this file.
1 #ifndef CalibCalorimetry_CaloMiscalibTools_CaloMiscalibMapEcal_h
2 #define CalibCalorimetry_CaloMiscalibTools_CaloMiscalibMapEcal_h
10 #include <iostream>
11 #include <iomanip>
12 #include <map>
13 #include <vector>
14 
16 public:
18 
19  void prefillMap() {
20  for (int iEta = -EBDetId::MAX_IETA; iEta <= EBDetId::MAX_IETA; ++iEta) {
21  if (iEta == 0)
22  continue;
23  for (int iPhi = EBDetId::MIN_IPHI; iPhi <= EBDetId::MAX_IPHI; ++iPhi) {
24  EBDetId ebdetid(iEta, iPhi);
25  map_.setValue(ebdetid.rawId(), 1.0);
26  }
27  }
28 
29  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
30  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
31  EEDetId eedetidpos(iX, iY, 1);
32  map_.setValue(eedetidpos.rawId(), 1.0);
33  EEDetId eedetidneg(iX, iY, -1);
34  map_.setValue(eedetidneg.rawId(), 1.0);
35  }
36  }
37  }
38 
39  void addCell(const DetId &cell, float scaling_factor) override { map_.setValue(cell.rawId(), scaling_factor); }
40 
41  void print() {
42  int icount = 0;
43  for (int iEta = -EBDetId::MAX_IETA; iEta <= EBDetId::MAX_IETA; ++iEta) {
44  if (iEta == 0)
45  continue;
46  for (int iPhi = EBDetId::MIN_IPHI; iPhi <= EBDetId::MAX_IPHI; ++iPhi) {
47  if (EBDetId::validDetId(iEta, iPhi)) {
48  EBDetId ebdetid(iEta, iPhi);
50  EcalIntercalibConstant icalconst;
51  icalconst = (*icalit);
52 
53  icount++;
54  if (icount % 230 == 0) {
55  std::cout << "here is value for chan eta/phi " << iEta << "/" << iPhi << "=" << icalconst << std::endl;
56  }
57  }
58  }
59  }
60  for (int iX = EEDetId::IX_MIN; iX <= EEDetId::IX_MAX; ++iX) {
61  for (int iY = EEDetId::IY_MIN; iY <= EEDetId::IY_MAX; ++iY) {
62  if (EEDetId::validDetId(iX, iY, 1)) {
63  EEDetId eedetidpos(iX, iY, 1);
65  EcalIntercalibConstant icalconst;
66  icalconst = (*icalit);
67 
68  EEDetId eedetidneg(iX, iY, -1);
70  EcalIntercalibConstant icalconst2;
71  icalconst2 = (*icalit2);
72 
73  icount++;
74  if (icount % 230 == 0) {
75  std::cout << "here is value for chan x/y " << iX << "/" << iY << " pos side is =" << icalconst
76  << " and neg side is= " << icalconst2 << std::endl;
77  }
78  }
79  }
80  }
81  }
82 
83  const EcalIntercalibConstants &get() { return map_; }
84 
85 private:
88 };
89 
90 #endif
static const int MIN_IPHI
Definition: EBDetId.h:135
const CaloSubdetectorGeometry * geometry
void addCell(const DetId &cell, float scaling_factor) override
static const int IX_MIN
Definition: EEDetId.h:290
static const int IY_MIN
Definition: EEDetId.h:294
static bool validDetId(int i, int j)
check if a valid index combination
Definition: EBDetId.h:118
void setValue(const uint32_t id, const Item &item)
const_iterator find(uint32_t rawId) const
static const int IX_MAX
Definition: EEDetId.h:298
Definition: DetId.h:17
static const int MAX_IPHI
Definition: EBDetId.h:137
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
std::vector< Item >::const_iterator const_iterator
static const int MAX_IETA
Definition: EBDetId.h:136
EcalIntercalibConstants map_
static const int IY_MAX
Definition: EEDetId.h:302
float EcalIntercalibConstant