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
11 
12 #include <iostream>
13 #include <iomanip>
14 #include <map>
15 #include <vector>
16 
18 public:
20  }
21 
23 
24  for (int det = 1; det <= HcalForward; det++) {
26  for (unsigned int phi = 1; phi <= HcalDetId::kHcalPhiMask2; phi++) {
27  for (unsigned int depth = 1; depth <= HcalDetId::kHcalDepthMask2; depth++) {
28 
29  try {
30  HcalDetId hcaldetid ((HcalSubdetector) det, eta, phi, depth);
31  if (topology.valid(hcaldetid)) {
32  mapHcal_[hcaldetid.rawId()]=1.0;
33  // std::cout << "Valid cell found: " << det << " " << eta << " " << phi << " " << depth << std::endl;
34  }
35 
36  }
37  catch (...) {
38  }
39  }
40  }
41  }
42  }
43 }
44 
45 
46 void addCell(const DetId &cell, float scaling_factor) override
47 {
48  //mapHcal_.setValue(cell.rawId(),scaling_factor);
49  mapHcal_[cell.rawId()]=scaling_factor;
50 }
51 
52 void print()
53  {
54 
55  std::map<uint32_t,float>::const_iterator it;
56 
57  // for(it=mapHcal_.getMap().begin();it!=mapHcal_.getMap().end();it++){
58  // }
59  for(it=mapHcal_.begin();it!=mapHcal_.end();it++){
60  }
61 
62 }
63 
64 const std::map<uint32_t, float> & get(){
65 return mapHcal_;
66 }
67 
68 private:
69 
70  std::map<uint32_t, float> mapHcal_;
71  // EcalIntercalibConstants map_;
72  // const CaloSubdetectorGeometry *geometry;
73 };
74 
75 #endif
bool valid(const DetId &id) const override
static uint32_t kHcalEtaMask2
Definition: HcalDetId.h:21
CaloTopology const * topology(0)
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
std::map< uint32_t, float > mapHcal_
static uint32_t kHcalDepthMask2
Definition: HcalDetId.h:27
HcalSubdetector
Definition: HcalAssistant.h:31
Definition: DetId.h:18
static uint32_t kHcalPhiMask2
Definition: HcalDetId.h:17
void prefillMap(const HcalTopology &topology)
void addCell(const DetId &cell, float scaling_factor) override