CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalTopology.h
Go to the documentation of this file.
1 #ifndef GEOMETRY_CALOTOPOLOGY_HCALTOPOLOGY_H
2 #define GEOMETRY_CALOTOPOLOGY_HCALTOPOLOGY_H 1
3 
4 #include <vector>
5 #include <map>
9 
26 public:
27 
29 
30  HcalTopologyMode::Mode mode() const {return mode_;}
33  void exclude(const HcalDetId& id);
37  int exclude(HcalSubdetector subdet, int ieta1, int ieta2, int iphi1, int iphi2, int depth1=1, int depth2=4);
38 
39 
41  virtual unsigned int detId2denseId(const DetId& id) const;
43  virtual DetId denseId2detId(unsigned int /*denseid*/) const;
45  virtual unsigned int ncells() const;
47  virtual int topoVersion() const;
48 
50  virtual bool valid(const DetId& id) const;
52  bool validHcal(const HcalDetId& id) const;
54  virtual std::vector<DetId> east(const DetId& id) const;
56  virtual std::vector<DetId> west(const DetId& id) const;
58  virtual std::vector<DetId> north(const DetId& id) const;
60  virtual std::vector<DetId> south(const DetId& id) const;
62  virtual std::vector<DetId> up(const DetId& id) const;
64  virtual std::vector<DetId> down(const DetId& id) const;
65 
67  int incIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
69  int decIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
71  bool incIPhi(const HcalDetId& id, HcalDetId &neighbor) const;
73  bool decIPhi(const HcalDetId& id, HcalDetId &neighbor) const;
75  bool incrementDepth(HcalDetId& id) const;
76 
77  int firstHBRing() const {return firstHBRing_;}
78  int lastHBRing() const {return lastHBRing_;}
79  int firstHERing() const {return firstHERing_;}
80  int lastHERing() const {return lastHERing_;}
81  int firstHFRing() const {return firstHFRing_;}
82  int lastHFRing() const {return lastHFRing_;}
83  int firstHORing() const {return firstHORing_;}
84  int lastHORing() const {return lastHORing_;}
85 
87  int firstHFQuadPhiRing() const { return firstHFQuadPhiRing_; }
89  int singlePhiBins() const {return singlePhiBins_;}
90  int doublePhiBins() const {return doublePhiBins_;}
91 
93  void depthBinInformation(HcalSubdetector subdet, int etaRing,
94  int & nDepthBins, int & startingBin) const;
95 
97  int nPhiBins(int etaRing) const;
98 
101  void getDepthSegmentation(unsigned ring, std::vector<int> & readoutDepths) const;
102  void setDepthSegmentation(unsigned ring, const std::vector<int> & readoutDepths);
106  std::pair<int, int> segmentBoundaries(unsigned ring, unsigned depth) const;
107 
108 
109  unsigned int getHBSize() const {return HBSize_;}
110  unsigned int getHESize() const {return HESize_;}
111  unsigned int getHOSize() const {return HOSize_;}
112  unsigned int getHFSize() const {return HFSize_;}
113  unsigned int getHTSize() const {return HTSize_;}
114  unsigned int getCALIBSize() const {return CALIBSize_;}
115 
116  int maxDepthHB() const { return maxDepthHB_;}
117  int maxDepthHE() const { return maxDepthHE_;}
118 
120  unsigned int detId2denseIdHB(const DetId& id) const;
122  unsigned int detId2denseIdHE(const DetId& id) const;
124  unsigned int detId2denseIdHO(const DetId& id) const;
126  unsigned int detId2denseIdHF(const DetId& id) const;
128  unsigned int detId2denseIdHT(const DetId& id) const;
130  unsigned int detId2denseIdCALIB(const DetId& id) const;
131 
132  unsigned int getNumberOfShapes() const { return numberOfShapes_; }
133 
134 private:
136  int incAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
138  int decAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
139 
141  bool validDetIdPreLS1(const HcalDetId& id) const;
142  bool validRaw(const HcalDetId& id) const;
143  unsigned int detId2denseIdPreLS1 (const DetId& id) const;
144 
145  std::vector<HcalDetId> exclusionList_;
147 
150  bool isExcluded(const HcalDetId& id) const;
151 
152  const int firstHBRing_;
153  const int lastHBRing_;
154  const int firstHERing_;
155  const int lastHERing_;
156  const int firstHFRing_;
157  const int lastHFRing_;
158  const int firstHORing_;
159  const int lastHORing_;
160 
164  const int singlePhiBins_;
165  const int doublePhiBins_;
166  const int maxDepthHB_;
167  const int maxDepthHE_;
168 
169  unsigned int HBSize_;
170  unsigned int HESize_;
171  unsigned int HOSize_;
172  unsigned int HFSize_;
173  unsigned int HTSize_;
174  unsigned int CALIBSize_;
175  const unsigned int numberOfShapes_;
176 
178 
179  // index is ring;
180  typedef std::map<unsigned, std::vector<int> > SegmentationMap;
182 
183  enum { kHBhalf = 1296 ,
184  kHEhalf = 1296 ,
185  kHOhalf = 1080 ,
186  kHFhalf = 864 ,
187  kHThalf = 2088,
188  kZDChalf = 11,
189  kCASTORhalf = 224,
190  kCALIBhalf = 693,
193  enum { kHBSizePreLS1 = 2*kHBhalf } ;
194  enum { kHESizePreLS1 = 2*kHEhalf } ;
195  enum { kHOSizePreLS1 = 2*kHOhalf } ;
196  enum { kHFSizePreLS1 = 2*kHFhalf } ;
197  enum { kHTSizePreLS1 = 2*kHThalf };
199 };
200 
201 
202 #endif
int firstHFRing() const
Definition: HcalTopology.h:81
unsigned int getCALIBSize() const
Definition: HcalTopology.h:114
unsigned int getHFSize() const
Definition: HcalTopology.h:112
int decIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
unsigned int detId2denseIdPreLS1(const DetId &id) const
virtual unsigned int detId2denseId(const DetId &id) const
return a linear packed id
unsigned int getHOSize() const
Definition: HcalTopology.h:111
void excludeSubdetector(HcalSubdetector subdet)
Definition: HcalTopology.cc:97
const int lastHBRing_
Definition: HcalTopology.h:153
virtual std::vector< DetId > down(const DetId &id) const
int maxDepthHE() const
Definition: HcalTopology.h:117
virtual std::vector< DetId > south(const DetId &id) const
unsigned int detId2denseIdHT(const DetId &id) const
return a linear packed id from HT
unsigned int detId2denseIdHF(const DetId &id) const
return a linear packed id from HF
void exclude(const HcalDetId &id)
Definition: HcalTopology.cc:90
HcalTopologyMode::TriggerMode triggerMode_
Definition: HcalTopology.h:149
int nPhiBins(int etaRing) const
how many phi segments in this ring
int firstHBRing() const
Definition: HcalTopology.h:77
int incIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
const int firstHETripleDepthRing_
Definition: HcalTopology.h:163
unsigned int HESize_
Definition: HcalTopology.h:170
int lastHBRing() const
Definition: HcalTopology.h:78
const int firstHFQuadPhiRing_
Definition: HcalTopology.h:162
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
unsigned int HTSize_
Definition: HcalTopology.h:173
bool decIPhi(const HcalDetId &id, HcalDetId &neighbor) const
bool validHcal(const HcalDetId &id) const
Definition: HcalTopology.cc:63
HcalTopologyMode::TriggerMode triggerMode() const
Definition: HcalTopology.h:31
HcalTopologyMode::Mode mode() const
Definition: HcalTopology.h:30
virtual int topoVersion() const
return a version which identifies the given topology
const int lastHERing_
Definition: HcalTopology.h:155
int singlePhiBins() const
Definition: HcalTopology.h:89
bool isExcluded(const HcalDetId &id) const
Definition: HcalTopology.cc:72
unsigned int CALIBSize_
Definition: HcalTopology.h:174
unsigned int HFSize_
Definition: HcalTopology.h:172
bool incIPhi(const HcalDetId &id, HcalDetId &neighbor) const
HcalTopology(HcalTopologyMode::Mode mode, int maxDepthHB, int maxDepthHE, HcalTopologyMode::TriggerMode tmode=HcalTopologyMode::tm_LHC_PreLS1)
Definition: HcalTopology.cc:13
bool validRaw(const HcalDetId &id) const
int decAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
unsigned int getNumberOfShapes() const
Definition: HcalTopology.h:132
const int lastHORing_
Definition: HcalTopology.h:159
const int firstHBRing_
Definition: HcalTopology.h:152
const int maxDepthHE_
Definition: HcalTopology.h:167
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:148
void setDepthSegmentation(unsigned ring, const std::vector< int > &readoutDepths)
int firstHETripleDepthRing() const
Definition: HcalTopology.h:88
int lastHFRing() const
Definition: HcalTopology.h:82
unsigned int getHTSize() const
Definition: HcalTopology.h:113
HcalSubdetector
Definition: HcalAssistant.h:31
unsigned int HBSize_
Definition: HcalTopology.h:169
const int firstHFRing_
Definition: HcalTopology.h:156
virtual std::vector< DetId > west(const DetId &id) const
int doublePhiBins() const
Definition: HcalTopology.h:90
void depthBinInformation(HcalSubdetector subdet, int etaRing, int &nDepthBins, int &startingBin) const
finds the number of depth bins and which is the number to start with
const int firstHEDoublePhiRing_
Definition: HcalTopology.h:161
int firstHORing() const
Definition: HcalTopology.h:83
virtual DetId denseId2detId(unsigned int) const
return a linear packed id
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:86
SegmentationMap depthSegmentation_
Definition: HcalTopology.h:181
unsigned int HOSize_
Definition: HcalTopology.h:171
bool validDetIdPreLS1(const HcalDetId &id) const
Definition: DetId.h:18
bool incrementDepth(HcalDetId &id) const
std::pair< int, int > segmentBoundaries(unsigned ring, unsigned depth) const
void getDepthSegmentation(unsigned ring, std::vector< int > &readoutDepths) const
virtual std::vector< DetId > north(const DetId &id) const
int firstHERing() const
Definition: HcalTopology.h:79
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:87
const int firstHERing_
Definition: HcalTopology.h:154
unsigned int getHESize() const
Definition: HcalTopology.h:110
int maxDepthHB() const
Definition: HcalTopology.h:116
const unsigned int numberOfShapes_
Definition: HcalTopology.h:175
virtual std::vector< DetId > up(const DetId &id) const
const int firstHORing_
Definition: HcalTopology.h:158
const int lastHFRing_
Definition: HcalTopology.h:157
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
const int maxDepthHB_
Definition: HcalTopology.h:166
const int singlePhiBins_
Definition: HcalTopology.h:164
const int doublePhiBins_
Definition: HcalTopology.h:165
std::vector< HcalDetId > exclusionList_
Definition: HcalTopology.h:145
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
virtual std::vector< DetId > east(const DetId &id) const
unsigned int getHBSize() const
Definition: HcalTopology.h:109
int incAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
unsigned int detId2denseIdCALIB(const DetId &id) const
return a linear packed id from CALIB
int lastHORing() const
Definition: HcalTopology.h:84
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
int lastHERing() const
Definition: HcalTopology.h:80
std::map< unsigned, std::vector< int > > SegmentationMap
Definition: HcalTopology.h:180