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>
11 
26 public:
27 
28  HcalTopology(const HcalDDDRecConstants* hcons);
30 
31  HcalTopologyMode::Mode mode() const {return mode_;}
34  void exclude(const HcalDetId& id);
38  int exclude(HcalSubdetector subdet, int ieta1, int ieta2, int iphi1, int iphi2, int depth1=1, int depth2=4);
39 
40  static std::string producerTag() { return "HCAL" ; }
41 
43  virtual unsigned int detId2denseId(const DetId& id) const;
45  virtual DetId denseId2detId(unsigned int /*denseid*/) const;
47  virtual unsigned int ncells() const;
49  virtual int topoVersion() const;
50 
52  virtual bool valid(const DetId& id) const;
54  bool validHcal(const HcalDetId& id) const;
55  bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const;
56  bool validHT(const HcalTrigTowerDetId& id) const;
58  virtual std::vector<DetId> east(const DetId& id) const;
60  virtual std::vector<DetId> west(const DetId& id) const;
62  virtual std::vector<DetId> north(const DetId& id) const;
64  virtual std::vector<DetId> south(const DetId& id) const;
66  virtual std::vector<DetId> up(const DetId& id) const;
68  virtual std::vector<DetId> down(const DetId& id) const;
69 
71  int incIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
73  int decIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
75  bool incIPhi(const HcalDetId& id, HcalDetId &neighbor) const;
77  bool decIPhi(const HcalDetId& id, HcalDetId &neighbor) const;
79  bool incrementDepth(HcalDetId& id) const;
81  bool decrementDepth(HcalDetId& id) const;
82 
83  int firstHBRing() const {return firstHBRing_;}
84  int lastHBRing() const {return lastHBRing_;}
85  int firstHERing() const {return firstHERing_;}
86  int lastHERing() const {return lastHERing_;}
87  int firstHFRing() const {return firstHFRing_;}
88  int lastHFRing() const {return lastHFRing_;}
89  int firstHORing() const {return firstHORing_;}
90  int lastHORing() const {return lastHORing_;}
91 
93  int firstHEQuadPhiRing() const {return firstHEQuadPhiRing_;}
96  int singlePhiBins() const {return singlePhiBins_;}
97  int doublePhiBins() const {return doublePhiBins_;}
98 
101  int & nDepthBins, int & startingBin) const;
102 
104  int nPhiBins(int etaRing) const;
105  int nPhiBins(HcalSubdetector subdet, int etaRing) const;
106 
108  int etaRing(HcalSubdetector subdet, double eta) const;
109  int phiBin(HcalSubdetector subdet, int etaRing, double phi) const;
110 
113  void getDepthSegmentation(unsigned ring, std::vector<int> & readoutDepths) const;
114  void setDepthSegmentation(unsigned ring, const std::vector<int> & readoutDepths);
118  std::pair<int, int> segmentBoundaries(unsigned ring, unsigned depth) const;
119 
120 
121  unsigned int getHBSize() const {return HBSize_;}
122  unsigned int getHESize() const {return HESize_;}
123  unsigned int getHOSize() const {return HOSize_;}
124  unsigned int getHFSize() const {return HFSize_;}
125  unsigned int getHTSize() const {return HTSize_;}
126  unsigned int getCALIBSize() const {return CALIBSize_;}
127 
128  int maxDepthHB() const { return maxDepthHB_;}
129  int maxDepthHE() const { return maxDepthHE_;}
130  int maxDepth(HcalSubdetector subdet) const;
131  double etaMax(HcalSubdetector subdet) const;
132  std::pair<double,double> etaRange(HcalSubdetector subdet, int ieta) const;
133 
135  unsigned int detId2denseIdHB(const DetId& id) const;
137  unsigned int detId2denseIdHE(const DetId& id) const;
139  unsigned int detId2denseIdHO(const DetId& id) const;
141  unsigned int detId2denseIdHF(const DetId& id) const;
143  unsigned int detId2denseIdHT(const DetId& id) const;
145  unsigned int detId2denseIdCALIB(const DetId& id) const;
146 
147  unsigned int getNumberOfShapes() const { return numberOfShapes_; }
148 
149 private:
151  int incAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
153  int decAIEta(const HcalDetId& id, HcalDetId neighbors[2]) const;
154 
156  bool validDetIdPreLS1(const HcalDetId& id) const;
157  bool validRaw(const HcalDetId& id) const;
158  unsigned int detId2denseIdPreLS1 (const DetId& id) const;
159  bool isExcluded(const HcalDetId& id) const;
160 
162  std::vector<HcalDetId> exclusionList_;
164 
167 
172 
173  std::vector<HcalDDDRecConstants::HcalEtaBin> etaBinsHB_, etaBinsHE_;
175 
181  int maxEta_;
182 
183  unsigned int HBSize_;
184  unsigned int HESize_;
185  unsigned int HOSize_;
186  unsigned int HFSize_;
187  unsigned int HTSize_;
188  unsigned int CALIBSize_;
189  unsigned int numberOfShapes_;
190 
191  std::vector<double> etaTable, etaTableHF, dPhiTable, dPhiTableHF;
192  std::vector<double> phioff;
193  std::vector<int> unitPhi, unitPhiHF;
194 
196 
197  // index is ring;
198  typedef std::map<unsigned, std::vector<int> > SegmentationMap;
200 
201  enum { kHBhalf = 1296 ,
202  kHEhalf = 1296 ,
203  kHOhalf = 1080 ,
204  kHFhalf = 864 ,
205  kHThalf = 2088,
206  kZDChalf = 11,
207  kCASTORhalf = 224,
208  kCALIBhalf = 693,
211  enum { kHBSizePreLS1 = 2*kHBhalf } ;
212  enum { kHESizePreLS1 = 2*kHEhalf } ;
213  enum { kHOSizePreLS1 = 2*kHOhalf } ;
214  enum { kHFSizePreLS1 = 2*kHFhalf } ;
215  enum { kHTSizePreLS1 = 2*kHThalf } ;
216  enum { kHTSizePhase1 = (kHTSizePreLS1+(2*12*36)) } ;
218 };
219 
220 
221 #endif
int firstHFRing() const
Definition: HcalTopology.h:87
unsigned int getCALIBSize() const
Definition: HcalTopology.h:126
unsigned int getHFSize() const
Definition: HcalTopology.h:124
std::vector< int > unitPhiHF
Definition: HcalTopology.h:193
int decIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
unsigned int numberOfShapes_
Definition: HcalTopology.h:189
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:123
std::vector< double > dPhiTableHF
Definition: HcalTopology.h:191
void excludeSubdetector(HcalSubdetector subdet)
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHB_
Definition: HcalTopology.h:173
int phiBin(HcalSubdetector subdet, int etaRing, double phi) const
std::vector< int > unitPhi
Definition: HcalTopology.h:193
virtual std::vector< DetId > down(const DetId &id) const
int maxDepthHE() const
Definition: HcalTopology.h:129
bool validDetId(HcalSubdetector subdet, int ieta, int iphi, int depth) const
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)
HcalTopologyMode::TriggerMode triggerMode_
Definition: HcalTopology.h:166
int nPhiBins(int etaRing) const
how many phi segments in this ring
int firstHBRing() const
Definition: HcalTopology.h:83
int incIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
bool decrementDepth(HcalDetId &id) const
unsigned int HESize_
Definition: HcalTopology.h:184
int lastHBRing() const
Definition: HcalTopology.h:84
HcalTopology(const HcalDDDRecConstants *hcons)
Definition: HcalTopology.cc:17
unsigned int detId2denseIdHB(const DetId &id) const
return a linear packed id from HB
unsigned int HTSize_
Definition: HcalTopology.h:187
bool decIPhi(const HcalDetId &id, HcalDetId &neighbor) const
bool validHcal(const HcalDetId &id) const
bool neighbor(int endcap, int sector, int SectIndex, int id, int sub, int station)
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHE_
Definition: HcalTopology.h:173
HcalTopologyMode::TriggerMode triggerMode() const
Definition: HcalTopology.h:32
HcalTopologyMode::Mode mode() const
Definition: HcalTopology.h:31
virtual int topoVersion() const
return a version which identifies the given topology
int singlePhiBins() const
Definition: HcalTopology.h:96
bool isExcluded(const HcalDetId &id) const
unsigned int CALIBSize_
Definition: HcalTopology.h:188
unsigned int HFSize_
Definition: HcalTopology.h:186
bool incIPhi(const HcalDetId &id, HcalDetId &neighbor) const
bool validRaw(const HcalDetId &id) const
int decAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
unsigned int getNumberOfShapes() const
Definition: HcalTopology.h:147
int maxDepth(HcalSubdetector subdet) const
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:165
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
void setDepthSegmentation(unsigned ring, const std::vector< int > &readoutDepths)
int firstHETripleDepthRing() const
Definition: HcalTopology.h:95
static std::string producerTag()
Definition: HcalTopology.h:40
int lastHFRing() const
Definition: HcalTopology.h:88
unsigned int getHTSize() const
Definition: HcalTopology.h:125
HcalSubdetector
Definition: HcalAssistant.h:31
unsigned int HBSize_
Definition: HcalTopology.h:183
virtual std::vector< DetId > west(const DetId &id) const
int doublePhiBins() const
Definition: HcalTopology.h:97
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
int firstHORing() const
Definition: HcalTopology.h:89
virtual DetId denseId2detId(unsigned int) const
return a linear packed id
std::vector< double > etaTableHF
Definition: HcalTopology.h:191
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:92
SegmentationMap depthSegmentation_
Definition: HcalTopology.h:199
unsigned int HOSize_
Definition: HcalTopology.h:185
std::vector< double > etaTable
Definition: HcalTopology.h:191
bool validDetIdPreLS1(const HcalDetId &id) const
int firstHEQuadPhiRing_
Definition: HcalTopology.h:176
Definition: DetId.h:18
bool incrementDepth(HcalDetId &id) const
std::pair< int, int > segmentBoundaries(unsigned ring, unsigned depth) const
std::vector< double > phioff
Definition: HcalTopology.h:192
void getDepthSegmentation(unsigned ring, std::vector< int > &readoutDepths) const
virtual std::vector< DetId > north(const DetId &id) const
int firstHERing() const
Definition: HcalTopology.h:85
virtual bool valid(const DetId &id) const
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:94
unsigned int getHESize() const
Definition: HcalTopology.h:122
int maxDepthHB() const
Definition: HcalTopology.h:128
virtual std::vector< DetId > up(const DetId &id) const
std::vector< double > dPhiTable
Definition: HcalTopology.h:191
std::pair< double, double > etaRange(HcalSubdetector subdet, int ieta) const
int firstHETripleDepthRing_
Definition: HcalTopology.h:177
unsigned int detId2denseIdHO(const DetId &id) const
return a linear packed id from HO
std::vector< HcalDetId > exclusionList_
Definition: HcalTopology.h:162
unsigned int detId2denseIdHE(const DetId &id) const
return a linear packed id from HE
int firstHEQuadPhiRing() const
Definition: HcalTopology.h:93
virtual std::vector< DetId > east(const DetId &id) const
unsigned int getHBSize() const
Definition: HcalTopology.h:121
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:90
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
double etaMax(HcalSubdetector subdet) const
int lastHERing() const
Definition: HcalTopology.h:86
int firstHEDoublePhiRing_
Definition: HcalTopology.h:176
const HcalDDDRecConstants * hcons_
Definition: HcalTopology.h:161
std::map< unsigned, std::vector< int > > SegmentationMap
Definition: HcalTopology.h:198
int firstHFQuadPhiRing_
Definition: HcalTopology.h:176
bool validHT(const HcalTrigTowerDetId &id) const