CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
17 
18 
20 public:
22 }
23 
24 void prefillMap(){
25 
26  for (int det = 1; det < 5; det++) {
27  for (int eta = -63; eta < 64; eta++) {
28  for (int phi = 0; phi < 128; phi++) {
29  for (int depth = 1; depth < 5; depth++) {
30 
31  try {
32  HcalDetId hcaldetid ((HcalSubdetector) det, eta, phi, depth);
33  if (topology.valid(hcaldetid))
34  // mapHcal_.setValue(hcaldetid.rawId(),1.0);
35  {
36  mapHcal_[hcaldetid.rawId()]=1.0;
37  // std::cout << "Valid cell found: " << det << " " << eta << " " << phi << " " << depth << std::endl;
38  }
39 
40  }
41  catch (...) {
42  }
43  }
44  }
45  }
46  }
47 }
48 
49 
50 virtual void addCell(const DetId &cell, float scaling_factor)
51 {
52  //mapHcal_.setValue(cell.rawId(),scaling_factor);
53  mapHcal_[cell.rawId()]=scaling_factor;
54 }
55 
56 void print()
57  {
58 
59  std::map<uint32_t,float>::const_iterator it;
60 
61  // for(it=mapHcal_.getMap().begin();it!=mapHcal_.getMap().end();it++){
62  // }
63  for(it=mapHcal_.begin();it!=mapHcal_.end();it++){
64  }
65 
66 }
67 
68 const std::map<uint32_t, float> & get(){
69 return mapHcal_;
70 }
71 
72 private:
73 
74  std::map<uint32_t, float> mapHcal_;
76  // EcalIntercalibConstants map_;
77  // const CaloSubdetectorGeometry *geometry;
78 };
79 
80 #endif
virtual bool valid(const HcalDetId &id) const
Definition: HcalTopology.cc:32
T eta() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
std::map< uint32_t, float > mapHcal_
HcalSubdetector
Definition: HcalAssistant.h:32
virtual void addCell(const DetId &cell, float scaling_factor)
Definition: DetId.h:20
Definition: DDAxes.h:10