CMS 3D CMS Logo

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