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;
77  bool decrementDepth(HcalDetId& id) const;
78 
79  int firstHBRing() const {return firstHBRing_;}
80  int lastHBRing() const {return lastHBRing_;}
81  int firstHERing() const {return firstHERing_;}
82  int lastHERing() const {return lastHERing_;}
83  int firstHFRing() const {return firstHFRing_;}
84  int lastHFRing() const {return lastHFRing_;}
85  int firstHORing() const {return firstHORing_;}
86  int lastHORing() const {return lastHORing_;}
87 
89  int firstHFQuadPhiRing() const { return firstHFQuadPhiRing_; }
91  int singlePhiBins() const {return singlePhiBins_;}
92  int doublePhiBins() const {return doublePhiBins_;}
93 
95  void depthBinInformation(HcalSubdetector subdet, int etaRing,
96  int & nDepthBins, int & startingBin) const;
97 
99  int nPhiBins(int etaRing) const;
100 
103  void getDepthSegmentation(unsigned ring, std::vector<int> & readoutDepths) const;
104  void setDepthSegmentation(unsigned ring, const std::vector<int> & readoutDepths);
108  std::pair<int, int> segmentBoundaries(unsigned ring, unsigned depth) const;
109 
110 
111  unsigned int getHBSize() const {return HBSize_;}
112  unsigned int getHESize() const {return HESize_;}
113  unsigned int getHOSize() const {return HOSize_;}
114  unsigned int getHFSize() const {return HFSize_;}
115  unsigned int getHTSize() const {return HTSize_;}
116  unsigned int getCALIBSize() const {return CALIBSize_;}
117 
118  int maxDepthHB() const { return maxDepthHB_;}
119  int maxDepthHE() const { return maxDepthHE_;}
120 
122  unsigned int detId2denseIdHB(const DetId& id) const;
124  unsigned int detId2denseIdHE(const DetId& id) const;
126  unsigned int detId2denseIdHO(const DetId& id) const;
128  unsigned int detId2denseIdHF(const DetId& id) const;
130  unsigned int detId2denseIdHT(const DetId& id) const;
132  unsigned int detId2denseIdCALIB(const DetId& id) const;
133 
134  unsigned int getNumberOfShapes() const { return numberOfShapes_; }
135 
136 private:
138  int incAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
140  int decAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
141 
143  bool validDetIdPreLS1(const HcalDetId& id) const;
144  bool validRaw(const HcalDetId& id) const;
145  unsigned int detId2denseIdPreLS1 (const DetId& id) const;
146 
147  std::vector<HcalDetId> exclusionList_;
149 
152  bool isExcluded(const HcalDetId& id) const;
153 
154  const int firstHBRing_;
155  const int lastHBRing_;
156  const int firstHERing_;
157  const int lastHERing_;
158  const int firstHFRing_;
159  const int lastHFRing_;
160  const int firstHORing_;
161  const int lastHORing_;
162 
166  const int singlePhiBins_;
167  const int doublePhiBins_;
168  const int maxDepthHB_;
169  const int maxDepthHE_;
170 
171  unsigned int HBSize_;
172  unsigned int HESize_;
173  unsigned int HOSize_;
174  unsigned int HFSize_;
175  unsigned int HTSize_;
176  unsigned int CALIBSize_;
177  const unsigned int numberOfShapes_;
178 
180 
181  // index is ring;
182  typedef std::map<unsigned, std::vector<int> > SegmentationMap;
184 
185  enum { kHBhalf = 1296 ,
186  kHEhalf = 1296 ,
187  kHOhalf = 1080 ,
188  kHFhalf = 864 ,
189  kHThalf = 2088,
190  kZDChalf = 11,
191  kCASTORhalf = 224,
192  kCALIBhalf = 693,
195  enum { kHBSizePreLS1 = 2*kHBhalf } ;
196  enum { kHESizePreLS1 = 2*kHEhalf } ;
197  enum { kHOSizePreLS1 = 2*kHOhalf } ;
198  enum { kHFSizePreLS1 = 2*kHFhalf } ;
199  enum { kHTSizePreLS1 = 2*kHThalf };
201 };
202 
203 
204 #endif
int firstHFRing() const
Definition: HcalTopology.h:83
unsigned int getCALIBSize() const
Definition: HcalTopology.h:116
unsigned int getHFSize() const
Definition: HcalTopology.h:114
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:113
void excludeSubdetector(HcalSubdetector subdet)
Definition: HcalTopology.cc:97
const int lastHBRing_
Definition: HcalTopology.h:155
virtual std::vector< DetId > down(const DetId &id) const
int maxDepthHE() const
Definition: HcalTopology.h:119
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:151
int nPhiBins(int etaRing) const
how many phi segments in this ring
int firstHBRing() const
Definition: HcalTopology.h:79
int incIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
const int firstHETripleDepthRing_
Definition: HcalTopology.h:165
bool decrementDepth(HcalDetId &id) const
unsigned int HESize_
Definition: HcalTopology.h:172
int lastHBRing() const
Definition: HcalTopology.h:80
const int firstHFQuadPhiRing_
Definition: HcalTopology.h:164
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
unsigned int HTSize_
Definition: HcalTopology.h:175
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:157
int singlePhiBins() const
Definition: HcalTopology.h:91
bool isExcluded(const HcalDetId &id) const
Definition: HcalTopology.cc:72
unsigned int CALIBSize_
Definition: HcalTopology.h:176
unsigned int HFSize_
Definition: HcalTopology.h:174
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:134
const int lastHORing_
Definition: HcalTopology.h:161
const int firstHBRing_
Definition: HcalTopology.h:154
const int maxDepthHE_
Definition: HcalTopology.h:169
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:150
void setDepthSegmentation(unsigned ring, const std::vector< int > &readoutDepths)
int firstHETripleDepthRing() const
Definition: HcalTopology.h:90
int lastHFRing() const
Definition: HcalTopology.h:84
unsigned int getHTSize() const
Definition: HcalTopology.h:115
HcalSubdetector
Definition: HcalAssistant.h:31
unsigned int HBSize_
Definition: HcalTopology.h:171
const int firstHFRing_
Definition: HcalTopology.h:158
virtual std::vector< DetId > west(const DetId &id) const
int doublePhiBins() const
Definition: HcalTopology.h:92
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:163
int firstHORing() const
Definition: HcalTopology.h:85
virtual DetId denseId2detId(unsigned int) const
return a linear packed id
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:88
SegmentationMap depthSegmentation_
Definition: HcalTopology.h:183
unsigned int HOSize_
Definition: HcalTopology.h:173
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:81
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:89
const int firstHERing_
Definition: HcalTopology.h:156
unsigned int getHESize() const
Definition: HcalTopology.h:112
int maxDepthHB() const
Definition: HcalTopology.h:118
const unsigned int numberOfShapes_
Definition: HcalTopology.h:177
virtual std::vector< DetId > up(const DetId &id) const
const int firstHORing_
Definition: HcalTopology.h:160
const int lastHFRing_
Definition: HcalTopology.h:159
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
const int maxDepthHB_
Definition: HcalTopology.h:168
const int singlePhiBins_
Definition: HcalTopology.h:166
const int doublePhiBins_
Definition: HcalTopology.h:167
std::vector< HcalDetId > exclusionList_
Definition: HcalTopology.h:147
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:111
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:86
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
int lastHERing() const
Definition: HcalTopology.h:82
std::map< unsigned, std::vector< int > > SegmentationMap
Definition: HcalTopology.h:182