CMS 3D CMS Logo

CaloMiscalibMapHcal.h
Go to the documentation of this file.
1 #ifndef _CALO_MISCALIB_MAP_HCAL
2 #define _CALO_MISCALIB_MAP_HCAL
10 
11 #include <iostream>
12 #include <iomanip>
13 #include <map>
14 #include <vector>
15 
17 public:
19 
21  for (int det = 1; det <= HcalForward; det++) {
23  for (unsigned int phi = 1; phi <= HcalDetId::kHcalPhiMask2; phi++) {
24  for (unsigned int depth = 1; depth <= HcalDetId::kHcalDepthMask2; depth++) {
25  try {
26  HcalDetId hcaldetid((HcalSubdetector)det, eta, phi, depth);
27  if (topology.valid(hcaldetid)) {
28  mapHcal_[hcaldetid.rawId()] = 1.0;
29  // std::cout << "Valid cell found: " << det << " " << eta << " " << phi << " " << depth << std::endl;
30  }
31 
32  } catch (...) {
33  }
34  }
35  }
36  }
37  }
38  }
39 
40  void addCell(const DetId &cell, float scaling_factor) override {
41  //mapHcal_.setValue(cell.rawId(),scaling_factor);
42  mapHcal_[cell.rawId()] = scaling_factor;
43  }
44 
45  void print() {
46  std::map<uint32_t, float>::const_iterator it;
47 
48  // for(it=mapHcal_.getMap().begin();it!=mapHcal_.getMap().end();it++){
49  // }
50  for (it = mapHcal_.begin(); it != mapHcal_.end(); it++) {
51  }
52  }
53 
54  const std::map<uint32_t, float> &get() { return mapHcal_; }
55 
56 private:
57  std::map<uint32_t, float> mapHcal_;
58  // EcalIntercalibConstants map_;
59  // const CaloSubdetectorGeometry *geometry;
60 };
61 
62 #endif
static constexpr uint32_t kHcalPhiMask2
Definition: HcalDetId.h:15
std::map< uint32_t, float > mapHcal_
HcalSubdetector
Definition: HcalAssistant.h:31
static constexpr uint32_t kHcalEtaMask2
Definition: HcalDetId.h:19
Definition: DetId.h:17
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
void prefillMap(const HcalTopology &topology)
void addCell(const DetId &cell, float scaling_factor) override
static constexpr uint32_t kHcalDepthMask2
Definition: HcalDetId.h:25