CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
HcalTopology Class Reference

#include <HcalTopology.h>

Inheritance diagram for HcalTopology:
CaloSubdetectorTopology

Public Member Functions

int decIEta (const HcalDetId &id, HcalDetId neighbors[2]) const
 
bool decIPhi (const HcalDetId &id, HcalDetId &neighbor) const
 
virtual DetId denseId2detId (unsigned int) const
 return a linear packed id More...
 
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 More...
 
virtual unsigned int detId2denseId (const DetId &id) const
 return a linear packed id More...
 
unsigned int detId2denseIdCALIB (const DetId &id) const
 return a linear packed id from CALIB More...
 
unsigned int detId2denseIdHB (const DetId &id) const
 return a linear packed id from HB More...
 
unsigned int detId2denseIdHE (const DetId &id) const
 return a linear packed id from HE More...
 
unsigned int detId2denseIdHF (const DetId &id) const
 return a linear packed id from HF More...
 
unsigned int detId2denseIdHO (const DetId &id) const
 return a linear packed id from HO More...
 
unsigned int detId2denseIdHT (const DetId &id) const
 return a linear packed id from HT More...
 
int doublePhiBins () const
 
virtual std::vector< DetIddown (const DetId &id) const
 
virtual std::vector< DetIdeast (const DetId &id) const
 
void exclude (const HcalDetId &id)
 
int exclude (HcalSubdetector subdet, int ieta1, int ieta2, int iphi1, int iphi2, int depth1=1, int depth2=4)
 
void excludeSubdetector (HcalSubdetector subdet)
 
int firstHBRing () const
 
int firstHEDoublePhiRing () const
 
int firstHERing () const
 
int firstHETripleDepthRing () const
 
int firstHFQuadPhiRing () const
 
int firstHFRing () const
 
int firstHORing () const
 
unsigned int getCALIBSize () const
 
void getDepthSegmentation (unsigned ring, std::vector< int > &readoutDepths) const
 
unsigned int getHBSize () const
 
unsigned int getHESize () const
 
unsigned int getHFSize () const
 
unsigned int getHOSize () const
 
unsigned int getHTSize () const
 
unsigned int getNumberOfShapes () const
 
 HcalTopology (HcalTopologyMode::Mode mode, int maxDepthHB, int maxDepthHE, HcalTopologyMode::TriggerMode tmode=HcalTopologyMode::tm_LHC_PreLS1)
 
int incIEta (const HcalDetId &id, HcalDetId neighbors[2]) const
 
bool incIPhi (const HcalDetId &id, HcalDetId &neighbor) const
 
bool incrementDepth (HcalDetId &id) const
 
int lastHBRing () const
 
int lastHERing () const
 
int lastHFRing () const
 
int lastHORing () const
 
int maxDepthHB () const
 
int maxDepthHE () const
 
HcalTopologyMode::Mode mode () const
 
virtual unsigned int ncells () const
 return a count of valid cells (for dense indexing use) More...
 
virtual std::vector< DetIdnorth (const DetId &id) const
 
int nPhiBins (int etaRing) const
 how many phi segments in this ring More...
 
std::pair< int, int > segmentBoundaries (unsigned ring, unsigned depth) const
 
void setDepthSegmentation (unsigned ring, const std::vector< int > &readoutDepths)
 
int singlePhiBins () const
 
virtual std::vector< DetIdsouth (const DetId &id) const
 
virtual int topoVersion () const
 return a version which identifies the given topology More...
 
HcalTopologyMode::TriggerMode triggerMode () const
 
virtual std::vector< DetIdup (const DetId &id) const
 
virtual bool valid (const DetId &id) const
 
bool validHcal (const HcalDetId &id) const
 
virtual std::vector< DetIdwest (const DetId &id) const
 
- Public Member Functions inherited from CaloSubdetectorTopology
 CaloSubdetectorTopology ()
 standard constructor More...
 
virtual bool denseIdConsistent (int topoVer) const
 return whether this topology is consistent with the numbering in the given topology More...
 
virtual std::vector< DetIdgetAllNeighbours (const DetId &id) const
 
virtual std::vector< DetIdgetNeighbours (const DetId &id, const CaloDirection &dir) const
 
virtual std::vector< DetIdgetWindow (const DetId &id, const int &northSouthSize, const int &eastWestSize) const
 
virtual DetId goDown (const DetId &id) const
 
virtual DetId goEast (const DetId &id) const
 
virtual DetId goNorth (const DetId &id) const
 
virtual DetId goSouth (const DetId &id) const
 
virtual DetId goUp (const DetId &id) const
 
virtual DetId goWest (const DetId &id) const
 
virtual ~CaloSubdetectorTopology ()
 virtual destructor More...
 

Private Types

enum  {
  kHBhalf = 1296, kHEhalf = 1296, kHOhalf = 1080, kHFhalf = 864,
  kHThalf = 2088, kZDChalf = 11, kCASTORhalf = 224, kCALIBhalf = 693,
  kHcalhalf = kHBhalf + kHEhalf + kHOhalf + kHFhalf
}
 
enum  { kSizeForDenseIndexingPreLS1 = 2*kHcalhalf }
 
enum  { kHBSizePreLS1 = 2*kHBhalf }
 
enum  { kHESizePreLS1 = 2*kHEhalf }
 
enum  { kHOSizePreLS1 = 2*kHOhalf }
 
enum  { kHFSizePreLS1 = 2*kHFhalf }
 
enum  { kHTSizePreLS1 = 2*kHThalf }
 
enum  { kCALIBSizePreLS1 = 2*kCALIBhalf }
 
typedef std::map< unsigned,
std::vector< int > > 
SegmentationMap
 

Private Member Functions

int decAIEta (const HcalDetId &id, HcalDetId neighbors[2]) const
 
unsigned int detId2denseIdPreLS1 (const DetId &id) const
 
int incAIEta (const HcalDetId &id, HcalDetId neighbors[2]) const
 
bool isExcluded (const HcalDetId &id) const
 
bool validDetIdPreLS1 (const HcalDetId &id) const
 
bool validRaw (const HcalDetId &id) const
 

Private Attributes

unsigned int CALIBSize_
 
SegmentationMap depthSegmentation_
 
const int doublePhiBins_
 
bool excludeHB_
 
bool excludeHE_
 
bool excludeHF_
 
bool excludeHO_
 
std::vector< HcalDetIdexclusionList_
 
const int firstHBRing_
 
const int firstHEDoublePhiRing_
 
const int firstHERing_
 
const int firstHETripleDepthRing_
 
const int firstHFQuadPhiRing_
 
const int firstHFRing_
 
const int firstHORing_
 
unsigned int HBSize_
 
unsigned int HESize_
 
unsigned int HFSize_
 
unsigned int HOSize_
 
unsigned int HTSize_
 
const int lastHBRing_
 
const int lastHERing_
 
const int lastHFRing_
 
const int lastHORing_
 
const int maxDepthHB_
 
const int maxDepthHE_
 
HcalTopologyMode::Mode mode_
 
const unsigned int numberOfShapes_
 
const int singlePhiBins_
 
int topoVersion_
 
HcalTopologyMode::TriggerMode triggerMode_
 

Additional Inherited Members

- Protected Types inherited from CaloSubdetectorTopology
typedef std::pair< int, int > Coordinate
 
- Protected Member Functions inherited from CaloSubdetectorTopology
Coordinate getNeighbourIndex (const Coordinate &coord, const CaloDirection &dir) const
 

Detailed Description

The HcalTopology class contains a set of constants which represent the topology (tower relationship) of the CMS HCAL as built. These constants can be used to determine neighbor relationships and existence of cells.

For use with limited setups (testbeam, cosmic stands, etc), the topology can be limited by creating a rejection list – a list of cells which would normally exist in the full CMS HCAL, but are not present for the specified topology.

Revision:
1.17
Author
J. Mans - Minnesota

Definition at line 25 of file HcalTopology.h.

Member Typedef Documentation

typedef std::map<unsigned, std::vector<int> > HcalTopology::SegmentationMap
private

Definition at line 180 of file HcalTopology.h.

Member Enumeration Documentation

anonymous enum
private
Enumerator
kHBhalf 
kHEhalf 
kHOhalf 
kHFhalf 
kHThalf 
kZDChalf 
kCASTORhalf 
kCALIBhalf 
kHcalhalf 

Definition at line 183 of file HcalTopology.h.

anonymous enum
private
Enumerator
kSizeForDenseIndexingPreLS1 

Definition at line 192 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHBSizePreLS1 

Definition at line 193 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHESizePreLS1 

Definition at line 194 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHOSizePreLS1 

Definition at line 195 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHFSizePreLS1 

Definition at line 196 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHTSizePreLS1 

Definition at line 197 of file HcalTopology.h.

anonymous enum
private
Enumerator
kCALIBSizePreLS1 

Definition at line 198 of file HcalTopology.h.

Constructor & Destructor Documentation

HcalTopology::HcalTopology ( HcalTopologyMode::Mode  mode,
int  maxDepthHB,
int  maxDepthHE,
HcalTopologyMode::TriggerMode  tmode = HcalTopologyMode::tm_LHC_PreLS1 
)

Definition at line 13 of file HcalTopology.cc.

References HBSize_, HESize_, HFSize_, HOSize_, kHBSizePreLS1, kHESizePreLS1, kHFSizePreLS1, kHOSizePreLS1, HcalTopologyMode::LHC, mode_, HcalTopologyMode::SLHC, and topoVersion_.

Referenced by HcalTopologyIdealEP::produce().

13  :
14  excludeHB_(false),
15  excludeHE_(false),
16  excludeHO_(false),
17  excludeHF_(false),
18  mode_(mode),
19  triggerMode_(tmode),
20  firstHBRing_(1),
21  lastHBRing_(16),
22  firstHERing_(16),
23  lastHERing_(29),
24  firstHFRing_(29),
25  lastHFRing_(41),
26  firstHORing_(1),
27  lastHORing_(15),
31  singlePhiBins_(72),
32  doublePhiBins_(36),
39  numberOfShapes_(( mode==HcalTopologyMode::SLHC ) ? 500 : 87 ) {
40 
42  topoVersion_=0; //DL
43  HBSize_= kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal
44  HESize_= kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal
45  HOSize_= kHOSizePreLS1; // ieta * iphi * 2
46  HFSize_= kHFSizePreLS1; // phi * eta * depth * pm
47  } else if (mode_==HcalTopologyMode::SLHC) { // need to know more eventually
48  HBSize_= maxDepthHB*16*72*2;
49  HESize_= maxDepthHE*(29-16+1)*72*2;
50  HOSize_= 15*72*2; // ieta * iphi * 2
51  HFSize_= 72*13*2*2; // phi * eta * depth * pm
52 
53  topoVersion_=10;
54  }
55 
56 }
const int lastHBRing_
Definition: HcalTopology.h:153
int maxDepthHE() const
Definition: HcalTopology.h:117
HcalTopologyMode::TriggerMode triggerMode_
Definition: HcalTopology.h:149
const int firstHETripleDepthRing_
Definition: HcalTopology.h:163
unsigned int HESize_
Definition: HcalTopology.h:170
const int firstHFQuadPhiRing_
Definition: HcalTopology.h:162
HcalTopologyMode::Mode mode() const
Definition: HcalTopology.h:30
const int lastHERing_
Definition: HcalTopology.h:155
unsigned int HFSize_
Definition: HcalTopology.h:172
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
unsigned int HBSize_
Definition: HcalTopology.h:169
const int firstHFRing_
Definition: HcalTopology.h:156
const int firstHEDoublePhiRing_
Definition: HcalTopology.h:161
unsigned int HOSize_
Definition: HcalTopology.h:171
const int firstHERing_
Definition: HcalTopology.h:154
int maxDepthHB() const
Definition: HcalTopology.h:116
const unsigned int numberOfShapes_
Definition: HcalTopology.h:175
const int firstHORing_
Definition: HcalTopology.h:158
const int lastHFRing_
Definition: HcalTopology.h:157
const int maxDepthHB_
Definition: HcalTopology.h:166
const int singlePhiBins_
Definition: HcalTopology.h:164
const int doublePhiBins_
Definition: HcalTopology.h:165

Member Function Documentation

int HcalTopology::decAIEta ( const HcalDetId id,
HcalDetId  neighbors[2] 
) const
private

Get the neighbors of the given cell with lower absolute ieta

Decreasing in |ieta|, there are be two neighbors of 40 and 21

Definition at line 398 of file HcalTopology.cc.

References firstHEDoublePhiRing(), firstHFQuadPhiRing(), HcalBarrel, HcalEndcap, IPHI_MAX, lastHBRing(), lastHERing(), n, and valid().

Referenced by decIEta(), and incIEta().

398  {
399  int n=1;
400  int aieta=id.ietaAbs();
401 
402  if (aieta==firstHEDoublePhiRing()) {
403  n=2;
404  neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth());
405  neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi()+1,id.depth());
406  } else if (aieta==firstHFQuadPhiRing()) {
407  n=2;
408  neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth());
409  if (id.iphi()==IPHI_MAX-1) neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),1,id.depth());
410  else neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi()+2,id.depth());
411  } else if (aieta==1) {
412  neighbors[0]=HcalDetId(id.subdet(),-aieta*id.zside(),id.iphi(),id.depth());
413  } else if (aieta==lastHBRing()+1) {
414  neighbors[0]=HcalDetId(HcalBarrel,(aieta-1)*id.zside(),id.iphi(),id.depth());
415  } else if (aieta==lastHERing()+1) {
416  neighbors[0]=HcalDetId(HcalEndcap,(aieta-1)*id.zside(),id.iphi(),id.depth());
417  } else
418  neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth());
419 
420  if (!valid(neighbors[0]) && n==2) {
421  if (!valid(neighbors[1])) n=0;
422  else {
423  n=1;
424  neighbors[0]=neighbors[1];
425  }
426  }
427  if (n==2 && !valid(neighbors[1])) n=1;
428  if (n==1 && !valid(neighbors[0])) n=0;
429 
430  return n;
431 }
int lastHBRing() const
Definition: HcalTopology.h:78
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:86
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:87
int lastHERing() const
Definition: HcalTopology.h:80
static const int IPHI_MAX
Definition: HcalTopology.cc:11
int HcalTopology::decIEta ( const HcalDetId id,
HcalDetId  neighbors[2] 
) const

Get the neighbors of the given cell with lower (signed) ieta

Definition at line 372 of file HcalTopology.cc.

References decAIEta(), and incAIEta().

Referenced by east().

372  {
373  if (id.zside()==1) return decAIEta(id,neighbors);
374  else return incAIEta(id,neighbors);
375 }
int decAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
int incAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
bool HcalTopology::decIPhi ( const HcalDetId id,
HcalDetId neighbor 
) const

Get the neighbor (if present) of the given cell with lower iphi

Definition at line 334 of file HcalTopology.cc.

References firstHEDoublePhiRing(), firstHFQuadPhiRing(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, IPHI_MAX, convertSQLiteXML::ok, and valid().

Referenced by south().

334  {
335  bool ok=valid(id);
336  if (ok) {
337  switch (id.subdet()) {
338  case (HcalBarrel):
339  case (HcalOuter):
340  if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX,id.depth());
341  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-1,id.depth());
342  break;
343  case (HcalEndcap):
344  if (id.ietaAbs()>=firstHEDoublePhiRing()) {
345  if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth());
346  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-2,id.depth());
347  } else {
348  if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX,id.depth());
349  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-1,id.depth());
350  }
351  break;
352  case (HcalForward):
353  if (id.ietaAbs()>=firstHFQuadPhiRing()) {
354  if (id.iphi()==3) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth());
355  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-4,id.depth());
356  } else {
357  if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth());
358  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-2,id.depth());
359  }
360  break;
361  default: ok=false;
362  }
363  }
364  return ok;
365 }
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:86
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:87
static const int IPHI_MAX
Definition: HcalTopology.cc:11
DetId HcalTopology::denseId2detId ( unsigned int  denseid) const
virtual

return a linear packed id

Reimplemented from CaloSubdetectorTopology.

Definition at line 771 of file HcalTopology.cc.

References reco::dp, HBSize_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HESize_, HOSize_, recoMuon::in, kHBhalf, kHEhalf, kHFhalf, kHOhalf, kSizeForDenseIndexingPreLS1, maxDepthHB_, maxDepthHE_, ncells(), sd, and topoVersion_.

Referenced by HcalGeometry::localCorners().

771  {
772 
774  int ie ( 0 ) ;
775  int ip ( 0 ) ;
776  int dp ( 0 ) ;
777  int in ( denseid ) ;
778  int iz ( 1 ) ;
779  if (topoVersion_==0) { //DL// pre-LS1
780  if (denseid < kSizeForDenseIndexingPreLS1) {
781  if ( in > 2*( kHBhalf + kHEhalf + kHOhalf ) - 1 ) { // HF
782  sd = HcalForward ;
783  in -= 2*( kHBhalf + kHEhalf + kHOhalf ) ;
784  iz = ( in<kHFhalf ? 1 : -1 ) ;
785  in %= kHFhalf ;
786  ip = 4*( in/48 ) ;
787  in %= 48 ;
788  ip += 1 + ( in>21 ? 2 : 0 ) ;
789  if( 3 == ip%4 ) in -= 22 ;
790  ie = 29 + in/2 ;
791  dp = 1 + in%2 ;
792  } else if ( in > 2*( kHBhalf + kHEhalf ) - 1 ) { // HO
793  sd = HcalOuter ;
794  in -= 2*( kHBhalf + kHEhalf ) ;
795  iz = ( in<kHOhalf ? 1 : -1 ) ;
796  in %= kHOhalf ;
797  dp = 4 ;
798  ip = 1 + in/15 ;
799  ie = 1 + ( in - 15*( ip - 1 ) ) ;
800  } else if ( in > 2*kHBhalf - 1 ) { // Endcap
801  sd = HcalEndcap ;
802  in -= 2*kHBhalf ;
803  iz = ( in<kHEhalf ? 1 : -1 ) ;
804  in %= kHEhalf ;
805  ip = 2*( in/36 ) ;
806  in %= 36 ;
807  ip += 1 + in/28 ;
808  if( 0 == ip%2 ) in %= 28 ;
809  ie = 15 + ( in<2 ? 1 + in : 2 +
810  ( in<20 ? 1 + ( in - 2 )/2 : 9 +
811  ( in<26 ? 1 + ( in - 20 )/3 : 3 ) ) ) ;
812  dp = ( in<1 ? 3 :
813  ( in<2 ? 1 :
814  ( in<20 ? 1 + ( in - 2 )%2 :
815  ( in<26 ? 1 + ( in - 20 )%3 :
816  ( 1 + ( in - 26 )%2 ) ) ) ) ) ;
817  } else { // barrel
818  iz = ( in<kHBhalf ? 1 : -1 ) ;
819  in %= kHBhalf ;
820  ip = in/18 + 1 ;
821  in %= 18 ;
822  if ( in < 14 ) {
823  dp = 1 ;
824  ie = in + 1 ;
825  } else {
826  in %= 14 ;
827  dp = 1 + in%2 ;
828  ie = 15 + in/2 ;
829  }
830  }
831  }
832  } else if (topoVersion_==10) {
833  if (denseid < ncells()) {
834  if (denseid >= (HBSize_+HESize_+HOSize_)) {
835  sd = HcalForward ;
836  in -= (HBSize_+HESize_+HOSize_);
837  dp = (in%2) + 1;
838  ip = (in - dp + 1)%144;
839  ip = (ip/2) + 1;
840  ie = (in - dp + 1 - 2*(ip -1))/144;
841  if (ie > 12) {ie = 54 -ie; iz = -1;}
842  else {ie += 29; iz = 1;}
843  } else if (denseid >= (HBSize_+HESize_)) {
844  sd = HcalOuter ;
845  in -= (HBSize_+HESize_);
846  dp = 4;
847  ip = (in%72) + 1;
848  ie = (in - ip + 1)/72;
849  if (ie > 14) {ie = 30 -ie; iz = -1;}
850  else {ie += 1; iz = 1;}
851  } else if (denseid >= (HBSize_)) {
852  sd = HcalEndcap ;
853  in -= (HBSize_);
854  dp = (in%maxDepthHE_)+1;
855  ip = (in - dp + 1)%(maxDepthHE_*72);
856  ip = (ip/maxDepthHE_) + 1;
857  ie = (in - dp + 1 - maxDepthHE_*(ip-1))/(72*maxDepthHE_);
858  if (ie > 13) {ie = 43 - ie; iz = -1;}
859  else {ie += 16; iz = 1;}
860  } else {
861  sd = HcalBarrel ;
862  dp = (in%maxDepthHB_)+1;
863  ip = (in - dp + 1)%(maxDepthHB_*72);
864  ip = (ip/maxDepthHB_) + 1;
865  ie = (in - dp + 1 - maxDepthHB_*(ip-1))/(72*maxDepthHB_);
866  if (ie > 15) {ie = 32 - ie; iz = -1;}
867  else {ie += 1; iz = 1;}
868  }
869  }
870  }
871  return HcalDetId( sd, iz*int(ie), ip, dp );
872 }
unsigned int HESize_
Definition: HcalTopology.h:170
const int maxDepthHE_
Definition: HcalTopology.h:167
HcalSubdetector
Definition: HcalAssistant.h:31
unsigned int HBSize_
Definition: HcalTopology.h:169
unsigned int HOSize_
Definition: HcalTopology.h:171
auto dp
Definition: deltaR.h:24
double sd
const int maxDepthHB_
Definition: HcalTopology.h:166
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
void HcalTopology::depthBinInformation ( HcalSubdetector  subdet,
int  etaRing,
int &  nDepthBins,
int &  startingBin 
) const

finds the number of depth bins and which is the number to start with

Definition at line 434 of file HcalTopology.cc.

References dtNoiseDBValidation_cfg::cerr, firstHERing(), firstHETripleDepthRing(), HcalTopologyMode::H2HE, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, lastHBRing(), lastHERing(), maxDepthHB_, maxDepthHE_, mode_, and HcalTopologyMode::SLHC.

Referenced by CaloTowerConstituentsMap::constituentsOf(), HcalTrigTowerGeometry::detIds(), HcalHardcodeGeometryLoader::fill(), incrementDepth(), and HcalHardcodeGeometryLoader::makeCell().

435  {
436 
437  if(subdet == HcalBarrel) {
439  startingBin = 1;
440  if (etaRing==lastHBRing()) {
441  nDepthBins = 2;
442  } else {
443  nDepthBins = maxDepthHB_;
444  }
445  } else {
446  if (etaRing<=14) {
447  nDepthBins = 1;
448  startingBin = 1;
449  } else {
450  nDepthBins = 2;
451  startingBin = 1;
452  }
453  }
454  } else if(subdet == HcalEndcap) {
456  if (etaRing==firstHERing()) {
457  nDepthBins = maxDepthHE_ - 2;
458  startingBin = 3;
459  } else {
460  nDepthBins = maxDepthHE_;
461  startingBin = 1;
462  }
463  } else {
464  if (etaRing==firstHERing()) {
465  nDepthBins = 1;
466  startingBin = 3;
467  } else if (etaRing==17) {
468  nDepthBins = 1;
469  startingBin = 1;
470  } else if (etaRing==lastHERing()) {
471  nDepthBins = 2;
472  startingBin = 1;
473  } else {
474  nDepthBins = (etaRing >= firstHETripleDepthRing()) ? 3 : 2;
475  startingBin = 1;
476  }
477  }
478  } else if(subdet == HcalForward) {
479  nDepthBins = 2;
480  startingBin = 1;
481  } else if(subdet == HcalOuter) {
482  nDepthBins = 1;
483  startingBin = 4;
484  } else {
485  std::cerr << "Bad HCAL subdetector " << subdet << std::endl;
486  }
487 }
int lastHBRing() const
Definition: HcalTopology.h:78
const int maxDepthHE_
Definition: HcalTopology.h:167
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:148
int firstHETripleDepthRing() const
Definition: HcalTopology.h:88
int firstHERing() const
Definition: HcalTopology.h:79
const int maxDepthHB_
Definition: HcalTopology.h:166
int lastHERing() const
Definition: HcalTopology.h:80
unsigned int HcalTopology::detId2denseId ( const DetId id) const
virtual

return a linear packed id

Reimplemented from CaloSubdetectorTopology.

Definition at line 734 of file HcalTopology.cc.

References HcalDetId::depth(), detId2denseIdPreLS1(), HBSize_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HESize_, HOSize_, HcalDetId::ieta(), HcalDetId::iphi(), maxDepthHB_, maxDepthHE_, HcalDetId::subdet(), and topoVersion_.

Referenced by HcalRecHitsMaker::createVectorOfSubdetectorCells(), HcalGeometry::getGeometry(), HcalGeometry::indexFor(), HcalRecHitsMaker::loadPCaloHits(), HcalDDDGeometry::newCell(), and HcalGeometry::newCell().

734  {
735  unsigned int retval(0);
736  if (topoVersion_==0) { // pre-LS1
737  retval = detId2denseIdPreLS1(id);
738  } else if (topoVersion_==10) {
739  HcalDetId hid(id);
740  if (hid.subdet()==HcalBarrel) {
741  retval=(hid.depth()-1)+maxDepthHB_*(hid.iphi()-1);
742  if (hid.ieta()>0) {
743  retval+=maxDepthHB_*72*(hid.ieta()-1);
744  } else {
745  retval+=maxDepthHB_*72*(32+hid.ieta());
746  }
747  } else if (hid.subdet()==HcalEndcap) {
748  retval=HBSize_;
749  retval+=(hid.depth()-1)+maxDepthHE_*(hid.iphi()-1);
750  if (hid.ieta()>0) {
751  retval+=maxDepthHE_*72*(hid.ieta()-16);
752  } else {
753  retval+=maxDepthHE_*72*((14+29)+hid.ieta());
754  }
755  } else if (hid.subdet()==HcalOuter) {
756  retval=HBSize_+HESize_;
757  if (hid.ieta()>0) retval+=(hid.iphi()-1)+72*(hid.ieta()-1);
758  else retval+=(hid.iphi()-1)+72*(30+hid.ieta());
759  } else if (hid.subdet()==HcalForward) {
760  retval=HBSize_+HESize_+HOSize_;
761  retval+=hid.depth()-1+2*(hid.iphi()-1);
762  if (hid.ieta()>0) retval+=2*72*(hid.ieta()-29);
763  else retval+=2*72*((41+13)+hid.ieta());
764  } else {
765  return 0xFFFFFFFu;
766  }
767  }
768  return retval;
769 }
unsigned int detId2denseIdPreLS1(const DetId &id) const
unsigned int HESize_
Definition: HcalTopology.h:170
const int maxDepthHE_
Definition: HcalTopology.h:167
unsigned int HBSize_
Definition: HcalTopology.h:169
unsigned int HOSize_
Definition: HcalTopology.h:171
const int maxDepthHB_
Definition: HcalTopology.h:166
unsigned int HcalTopology::detId2denseIdCALIB ( const DetId id) const

return a linear packed id from CALIB

Definition at line 675 of file HcalTopology.cc.

References funct::abs(), HcalCalibDetId::calibFlavor(), HcalCalibDetId::CalibrationBox, HcalCalibDetId::cboxChannel(), gather_cfg::cout, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalCalibDetId::hcalSubdet(), HcalCalibDetId::HOCrosstalk, HcalCalibDetId::ieta(), getHLTprescales::index, HcalCalibDetId::iphi(), and HcalCalibDetId::zside().

Referenced by HcalLogicalMapGenerator::buildCALIBMap(), HcalLogicalMapGenerator::buildHOXMap(), HcalLogicalMap::checkHashIds(), HcalLogicalMap::getHcalFrontEndId(), and HcalCondObjectContainerBase::indexFor().

675  {
676  HcalCalibDetId tid(id);
677  int channel = tid.cboxChannel();
678  int ieta = tid.ieta();
679  int iphi = tid.iphi();
680  int zside = tid.zside();
681  unsigned int index=0xFFFFFFFFu;
682 
683  if (tid.calibFlavor()==HcalCalibDetId::CalibrationBox) {
684 
685  HcalSubdetector subDet = tid.hcalSubdet();
686 
687  if (subDet==HcalBarrel) {
688  //std::cout<<"CALIB_HB: ";
689  //dphi = 4 (18 phi values), 3 channel types (0,1,2), eta = -1 or 1
690  //total of 18*3*2=108 channels
691  index = ((iphi+1)/4-1) + 18*channel + 27*(ieta+1);
692  } else if (subDet==HcalEndcap) {
693  //std::cout<<"CALIB_HE: ";
694  //dphi = 4 (18 phi values), 6 channel types (0,1,3,4,5,6), eta = -1 or 1
695  //total of 18*6*2=216 channels
696  if (channel>2) channel-=1;
697  index = ((iphi+1)/4-1) + 18*channel + 54*(ieta+1) + 108;
698  } else if (subDet==HcalForward) {
699  //std::cout<<"CALIB_HF: ";
700  //dphi = 18 (4 phi values), 3 channel types (0,1,8), eta = -1 or 1
701  if (channel==8) channel = 2;
702  //total channels 4*3*2=24
703  index = (iphi-1)/18 + 4*channel + 6*(ieta+1) + 324;
704  } else if (subDet==HcalOuter) {
705  //std::cout<<"CALIB_HO: ";
706  //there are 5 special calib crosstalk channels, one in each ring
707  if (channel==7) {
708  channel = 2;
709  index = (ieta+2) + 420;
710  //for HOM/HOP dphi = 6 (12 phi values), 2 channel types (0,1), eta = -2,-1 or 1,2
711  //for HO0/YB0 dphi = 12 (6 phi values), 2 channel types (0,1), eta = 0
712  } else{
713  if (ieta<0) index = ((iphi+1)/12-1) + 36*channel + 6*(ieta+2) + 348;
714  else if (ieta>0) index = ((iphi+1)/12-1) + 36*channel + 6*(ieta+2) + 6 + 348;
715  else index = ((iphi+1)/6-1) + 36*channel + 6*(ieta+2) + 348;
716  }
717  } else {
718  std::cout << "HCAL Det Id not valid!" << std::endl;
719  index = 0;
720  }
721 
722  } else if (tid.calibFlavor()==HcalCalibDetId::HOCrosstalk) {
723  //std::cout<<"HX: ";
724  //for YB0/HO0 phi is grouped in 6 groups of 6 with dphi=2 but the transitions are 1 or 3
725  // in such a way that the %36 operation yeilds unique values for every iphi
726  if (abs(ieta)==4) index = ((iphi-1)%36) + (((zside+1)*36)/2) + 72 + 425; //ieta = 1 YB0/HO0;
727  else index = (iphi-1) + (36*(zside+1)*2) + 425; //ieta = 0 for HO2M/HO1M ieta=2 for HO1P/HO2P;
728  }
729  //std::cout << " " << ieta << " " << zside << " " << iphi << " " << depth << " " << index << std::endl;
730  return index;
731 }
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tuple cout
Definition: gather_cfg.py:121
unsigned int HcalTopology::detId2denseIdHB ( const DetId id) const

return a linear packed id from HB

Definition at line 592 of file HcalTopology.cc.

References HcalDetId::depth(), reco::dp, HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), kHBhalf, maxDepthHB_, topoVersion_, and HcalDetId::zside().

Referenced by HcalLogicalMapGenerator::buildHBEFTMap(), HcalLogicalMap::checkHashIds(), HcalLogicalMap::getHcalFrontEndId(), and HcalCondObjectContainerBase::indexFor().

592  {
593  HcalDetId hid(id);
594  const int ip (hid.iphi() ) ;
595  const int ie (hid.ietaAbs() ) ;
596  const int dp (hid.depth() ) ;
597  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
598  unsigned int retval = 0xFFFFFFFFu;
599  if (topoVersion_==0) {
600  retval=( ip - 1 )*18 + dp - 1 + ie - ( ie<16 ? 1 : 0 ) + zn*kHBhalf;
601  } else if (topoVersion_==10) {
602  retval=dp-1 + maxDepthHB_*(ip-1)+maxDepthHB_*72*(hid.ieta()-1+33*zn);
603  }
604  return retval;
605 }
auto dp
Definition: deltaR.h:24
const int maxDepthHB_
Definition: HcalTopology.h:166
unsigned int HcalTopology::detId2denseIdHE ( const DetId id) const

return a linear packed id from HE

Definition at line 607 of file HcalTopology.cc.

References HcalDetId::depth(), reco::dp, HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), kHEhalf, maxDepthHE_, topoVersion_, and HcalDetId::zside().

Referenced by HcalLogicalMapGenerator::buildHBEFTMap(), HcalLogicalMap::checkHashIds(), HcalLogicalMap::getHcalFrontEndId(), and HcalCondObjectContainerBase::indexFor().

607  {
608  HcalDetId hid(id);
609  const int ip (hid.iphi() ) ;
610  const int ie (hid.ietaAbs() ) ;
611  const int dp (hid.depth() ) ;
612  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
613  unsigned int retval = 0xFFFFFFFFu;
614  if (topoVersion_==0) {
615  retval=( ip - 1 )*8 + ( ip/2 )*20 +
616  ( ( ie==16 || ie==17 ) ? ie - 16 :
617  ( ( ie>=18 && ie<=20 ) ? 2 + 2*( ie - 18 ) + dp - 1 :
618  ( ( ie>=21 && ie<=26 ) ? 8 + 2*( ie - 21 ) + dp - 1 :
619  ( ( ie>=27 && ie<=28 ) ? 20 + 3*( ie - 27 ) + dp - 1 :
620  26 + 2*( ie - 29 ) + dp - 1 ) ) ) ) + zn*kHEhalf;
621  } else if (topoVersion_==10) {
622  retval=(dp-1)+maxDepthHE_*(ip-1)+maxDepthHE_*72*(hid.ieta()-16+zn*(14+29+16));
623  }
624  return retval;
625 }
const int maxDepthHE_
Definition: HcalTopology.h:167
auto dp
Definition: deltaR.h:24
unsigned int HcalTopology::detId2denseIdHF ( const DetId id) const

return a linear packed id from HF

Definition at line 642 of file HcalTopology.cc.

References HcalDetId::depth(), reco::dp, HcalDetId::ietaAbs(), HcalDetId::iphi(), kHFhalf, topoVersion_, and HcalDetId::zside().

Referenced by HcalLogicalMapGenerator::buildHBEFTMap(), HcalLogicalMap::checkHashIds(), HcalLogicalMap::getHcalFrontEndId(), and HcalCondObjectContainerBase::indexFor().

642  {
643  HcalDetId hid(id);
644  const int ip (hid.iphi() ) ;
645  const int ie (hid.ietaAbs() ) ;
646  const int dp (hid.depth() ) ;
647  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
648 
649  unsigned int retval = 0xFFFFFFFFu;
650  if (topoVersion_==0) {
651  retval = ( ( ip - 1 )/4 )*4 + ( ( ip - 1 )/2 )*22 +
652  2*( ie - 29 ) + ( dp - 1 ) + zn*kHFhalf;
653  } else if (topoVersion_==10) {
654  retval = ( ( ip - 1 )/4 )*4 + ( ( ip - 1 )/2 )*22 +
655  2*( ie - 29 ) + ( dp - 1 ) + zn*kHFhalf;
656  }
657  return retval;
658 }
auto dp
Definition: deltaR.h:24
unsigned int HcalTopology::detId2denseIdHO ( const DetId id) const

return a linear packed id from HO

Definition at line 627 of file HcalTopology.cc.

References HcalDetId::ietaAbs(), HcalDetId::iphi(), kHOhalf, topoVersion_, and HcalDetId::zside().

Referenced by HcalLogicalMapGenerator::buildHOXMap(), HcalLogicalMap::checkHashIds(), HcalLogicalMap::getHcalFrontEndId(), PFRecHitProducerHO::hoNeighbArray(), HcalCondObjectContainerBase::indexFor(), and PFRecHitProducerHO::move().

627  {
628  HcalDetId hid(id);
629  const int ip (hid.iphi() ) ;
630  const int ie (hid.ietaAbs() ) ;
631  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
632 
633  unsigned int retval = 0xFFFFFFFFu;
634  if (topoVersion_==0) {
635  retval=( ip - 1 )*15 + ( ie - 1 ) + zn*kHOhalf;
636  } else if (topoVersion_==10) {
637  retval=( ip - 1 )*15 + ( ie - 1 ) + zn*kHOhalf;
638  }
639  return retval;
640 }
unsigned int HcalTopology::detId2denseIdHT ( const DetId id) const

return a linear packed id from HT

Definition at line 660 of file HcalTopology.cc.

References HcalTrigTowerDetId::ietaAbs(), getHLTprescales::index, HcalTrigTowerDetId::iphi(), kHThalf, and HcalTrigTowerDetId::zside().

Referenced by HcalLogicalMap::checkHashIds(), and HcalCondObjectContainerBase::indexFor().

660  {
661  HcalTrigTowerDetId tid(id);
662  int zside = tid.zside();
663  unsigned int ietaAbs = tid.ietaAbs();
664  unsigned int iphi = tid.iphi();
665 
666  unsigned int index;
667  if ((iphi-1)%4==0) index = (iphi-1)*32 + (ietaAbs-1) - (12*((iphi-1)/4));
668  else index = (iphi-1)*28 + (ietaAbs-1) + (4*(((iphi-1)/4)+1));
669 
670  if (zside == -1) index += kHThalf;
671 
672  return index;
673 }
unsigned int HcalTopology::detId2denseIdPreLS1 ( const DetId id) const
private

Definition at line 565 of file HcalTopology.cc.

References HcalDetId::depth(), reco::dp, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalDetId::ietaAbs(), HcalDetId::iphi(), kHBhalf, kHEhalf, kHFhalf, kHOhalf, sd, HcalDetId::subdet(), and HcalDetId::zside().

Referenced by detId2denseId().

565  {
566 
567  HcalDetId hid(id);
568  const HcalSubdetector sd (hid.subdet() ) ;
569  const int ip (hid.iphi() ) ;
570  const int ie (hid.ietaAbs() ) ;
571  const int dp (hid.depth() ) ;
572  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
573  unsigned int retval = ( ( sd == HcalBarrel ) ?
574  ( ip - 1 )*18 + dp - 1 + ie - ( ie<16 ? 1 : 0 ) + zn*kHBhalf :
575  ( ( sd == HcalEndcap ) ?
576  2*kHBhalf + ( ip - 1 )*8 + ( ip/2 )*20 +
577  ( ( ie==16 || ie==17 ) ? ie - 16 :
578  ( ( ie>=18 && ie<=20 ) ? 2 + 2*( ie - 18 ) + dp - 1 :
579  ( ( ie>=21 && ie<=26 ) ? 8 + 2*( ie - 21 ) + dp - 1 :
580  ( ( ie>=27 && ie<=28 ) ? 20 + 3*( ie - 27 ) + dp - 1 :
581  26 + 2*( ie - 29 ) + dp - 1 ) ) ) ) + zn*kHEhalf :
582  ( ( sd == HcalOuter ) ?
583  2*kHBhalf + 2*kHEhalf + ( ip - 1 )*15 + ( ie - 1 ) + zn*kHOhalf :
584  ( ( sd == HcalForward ) ?
585  2*kHBhalf + 2*kHEhalf + 2*kHOhalf +
586  ( ( ip - 1 )/4 )*4 + ( ( ip - 1 )/2 )*22 +
587  2*( ie - 29 ) + ( dp - 1 ) + zn*kHFhalf : 0xFFFFFFFFu ) ) ) ) ;
588  return retval;
589 }
HcalSubdetector
Definition: HcalAssistant.h:31
auto dp
Definition: deltaR.h:24
double sd
int HcalTopology::doublePhiBins ( ) const
inline

Definition at line 90 of file HcalTopology.h.

References doublePhiBins_.

90 {return doublePhiBins_;}
const int doublePhiBins_
Definition: HcalTopology.h:165
std::vector< DetId > HcalTopology::down ( const DetId id) const
virtual

Get the neighbors of the given cell in down direction (inward)

Implements CaloSubdetectorTopology.

Definition at line 151 of file HcalTopology.cc.

References gather_cfg::cout.

151  {
152  std::cout << "HcalTopology::down() not yet implemented" << std::endl;
153  std::vector<DetId> vNeighborsDetId;
154  return vNeighborsDetId;
155 }
tuple cout
Definition: gather_cfg.py:121
std::vector< DetId > HcalTopology::east ( const DetId id) const
virtual

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 107 of file HcalTopology.cc.

References decIEta(), and i.

Referenced by spr::newHCALIdEW().

107  {
108  std::vector<DetId> vNeighborsDetId;
109  HcalDetId neighbors[2];
110  for (int i=0;i<decIEta(HcalDetId(id),neighbors);i++)
111  vNeighborsDetId.push_back(DetId(neighbors[i].rawId()));
112  return vNeighborsDetId;
113 }
int i
Definition: DBlmapReader.cc:9
int decIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
Definition: DetId.h:18
void HcalTopology::exclude ( const HcalDetId id)

Add a cell to exclusion list

Definition at line 90 of file HcalTopology.cc.

References exclusionList_, and i.

Referenced by exclude(), and HcalTopologyRestrictionParser::parse().

90  {
91  std::vector<HcalDetId>::iterator i=std::lower_bound(exclusionList_.begin(),exclusionList_.end(),id);
92  if (i==exclusionList_.end() || *i!=id) {
93  exclusionList_.insert(i,id);
94  }
95 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalDetId > exclusionList_
Definition: HcalTopology.h:145
int HcalTopology::exclude ( HcalSubdetector  subdet,
int  ieta1,
int  ieta2,
int  iphi1,
int  iphi2,
int  depth1 = 1,
int  depth2 = 4 
)

Exclude an eta/phi/depth range for a given subdetector

Definition at line 157 of file HcalTopology.cc.

References exclude(), excludeHB_, excludeHE_, excludeHF_, excludeHO_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, max(), bookConverter::min, n, and validRaw().

157  {
158 
159  bool exed=false;
160  // first, check the full detector exclusions... (fast)
161  switch (subdet) {
162  case(HcalBarrel): exed=excludeHB_; break;
163  case(HcalEndcap): exed=excludeHE_; break;
164  case(HcalOuter): exed=excludeHO_; break;
165  case(HcalForward): exed=excludeHF_; break;
166  default: exed=false;
167  }
168  if (exed) return 0; // if the whole detector is excluded...
169 
170  int ieta_l=std::min(ieta1,ieta2);
171  int ieta_h=std::max(ieta1,ieta2);
172  int iphi_l=std::min(iphi1,iphi2);
173  int iphi_h=std::max(iphi1,iphi2);
174  int depth_l=std::min(depth1,depth2);
175  int depth_h=std::max(depth1,depth2);
176 
177  int n=0;
178  for (int ieta=ieta_l; ieta<=ieta_h; ieta++)
179  for (int iphi=iphi_l; iphi<=iphi_h; iphi++)
180  for (int depth=depth_l; depth<=depth_h; depth++) {
181  HcalDetId id(subdet,ieta,iphi,depth);
182  if (validRaw(id)) { // use 'validRaw' to include check validity in "uncut" detector
183  exclude(id);
184  n++;
185  }
186  }
187  return n;
188 }
void exclude(const HcalDetId &id)
Definition: HcalTopology.cc:90
bool validRaw(const HcalDetId &id) const
const T & max(const T &a, const T &b)
void HcalTopology::excludeSubdetector ( HcalSubdetector  subdet)

Exclude an entire subdetector

Definition at line 97 of file HcalTopology.cc.

References excludeHB_, excludeHE_, excludeHF_, excludeHO_, HcalBarrel, HcalEndcap, HcalForward, and HcalOuter.

Referenced by HcalTopologyRestrictionParser::parse().

97  {
98  switch (subdet) {
99  case(HcalBarrel): excludeHB_=true; break;
100  case(HcalEndcap): excludeHE_=true; break;
101  case(HcalOuter): excludeHO_=true; break;
102  case(HcalForward): excludeHF_=true; break;
103  default: break;
104  }
105 }
int HcalTopology::firstHBRing ( ) const
inline

Definition at line 77 of file HcalTopology.h.

References firstHBRing_.

Referenced by HcalHardcodeGeometryLoader::load().

77 {return firstHBRing_;}
const int firstHBRing_
Definition: HcalTopology.h:152
int HcalTopology::firstHEDoublePhiRing ( ) const
inline
int HcalTopology::firstHERing ( ) const
inline
int HcalTopology::firstHETripleDepthRing ( ) const
inline
int HcalTopology::firstHFQuadPhiRing ( ) const
inline
int HcalTopology::firstHFRing ( ) const
inline
int HcalTopology::firstHORing ( ) const
inline

Definition at line 83 of file HcalTopology.h.

References firstHORing_.

Referenced by HcalHardcodeGeometryLoader::load().

83 {return firstHORing_;}
const int firstHORing_
Definition: HcalTopology.h:158
unsigned int HcalTopology::getCALIBSize ( ) const
inline

Definition at line 114 of file HcalTopology.h.

References CALIBSize_.

Referenced by HcalCondObjectContainerBase::sizeFor().

114 {return CALIBSize_;}
unsigned int CALIBSize_
Definition: HcalTopology.h:174
void HcalTopology::getDepthSegmentation ( unsigned  ring,
std::vector< int > &  readoutDepths 
) const

for each of the ~17 depth segments, specify which readout bin they belong to if the ring is not found, the first one with a lower ring will be returned.

Definition at line 539 of file HcalTopology.cc.

References depthSegmentation_, edm::hlt::Exception, and relativeConstraints::ring.

Referenced by segmentBoundaries().

540 {
541  // if it doesn't exist, return the first entry with a lower index. So if we only
542  // have entries for 1 and 17, any input from 1-16 should return the entry for ring 1
543  SegmentationMap::const_iterator pos = depthSegmentation_.upper_bound(ring);
544  if(pos == depthSegmentation_.begin()) {
545  throw cms::Exception("HcalTopology") << "No depth segmentation found for ring" << ring;
546  }
547  --pos;
548  // pos now refers to the last element with key <= ring.
549  readoutDepths = pos->second;
550 }
SegmentationMap depthSegmentation_
Definition: HcalTopology.h:181
unsigned int HcalTopology::getHBSize ( ) const
inline

Definition at line 109 of file HcalTopology.h.

References HBSize_.

Referenced by HcalGeometry::init(), and HcalCondObjectContainerBase::sizeFor().

109 {return HBSize_;}
unsigned int HBSize_
Definition: HcalTopology.h:169
unsigned int HcalTopology::getHESize ( ) const
inline

Definition at line 110 of file HcalTopology.h.

References HESize_.

Referenced by HcalGeometry::init(), and HcalCondObjectContainerBase::sizeFor().

110 {return HESize_;}
unsigned int HESize_
Definition: HcalTopology.h:170
unsigned int HcalTopology::getHFSize ( ) const
inline

Definition at line 112 of file HcalTopology.h.

References HFSize_.

Referenced by HcalGeometry::init(), and HcalCondObjectContainerBase::sizeFor().

112 {return HFSize_;}
unsigned int HFSize_
Definition: HcalTopology.h:172
unsigned int HcalTopology::getHOSize ( ) const
inline

Definition at line 111 of file HcalTopology.h.

References HOSize_.

Referenced by PFRecHitProducerHO::hoNeighbArray(), HcalGeometry::init(), and HcalCondObjectContainerBase::sizeFor().

111 {return HOSize_;}
unsigned int HOSize_
Definition: HcalTopology.h:171
unsigned int HcalTopology::getHTSize ( ) const
inline

Definition at line 113 of file HcalTopology.h.

References HTSize_.

Referenced by HcalCondObjectContainerBase::sizeFor().

113 {return HTSize_;}
unsigned int HTSize_
Definition: HcalTopology.h:173
unsigned int HcalTopology::getNumberOfShapes ( ) const
inline

Definition at line 132 of file HcalTopology.h.

References numberOfShapes_.

Referenced by HcalGeometry::numberOfShapes().

132 { return numberOfShapes_; }
const unsigned int numberOfShapes_
Definition: HcalTopology.h:175
int HcalTopology::incAIEta ( const HcalDetId id,
HcalDetId  neighbors[2] 
) const
private

Get the neighbors of the given cell with higher absolute ieta

Increasing in |ieta|, there is always at most one neighbor

Definition at line 378 of file HcalTopology.cc.

References firstHEDoublePhiRing(), firstHFQuadPhiRing(), HcalEndcap, HcalForward, lastHBRing(), lastHERing(), n, and valid().

Referenced by decIEta(), and incIEta().

378  {
379  int n=1;
380  int aieta=id.ietaAbs();
381 
382  if (aieta==firstHEDoublePhiRing()-1 && (id.iphi()%2)==0)
383  neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),id.iphi()-1,id.depth());
384  else if (aieta==firstHFQuadPhiRing()-1 && ((id.iphi()+1)%4)!=0)
385  neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),((id.iphi()==1)?(71):(id.iphi()-2)),id.depth());
386  else if (aieta==lastHBRing())
387  neighbors[0]=HcalDetId(HcalEndcap,(aieta+1)*id.zside(),id.iphi(),1);
388  else if (aieta==lastHERing())
389  neighbors[0]=HcalDetId(HcalForward,(aieta+1)*id.zside(),id.iphi(),1);
390  else
391  neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),id.iphi(),id.depth());
392 
393  if (!valid(neighbors[0])) n=0;
394  return n;
395 }
int lastHBRing() const
Definition: HcalTopology.h:78
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:86
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:87
int lastHERing() const
Definition: HcalTopology.h:80
int HcalTopology::incIEta ( const HcalDetId id,
HcalDetId  neighbors[2] 
) const

Get the neighbors of the given cell with higher (signed) ieta

Definition at line 367 of file HcalTopology.cc.

References decAIEta(), and incAIEta().

Referenced by west().

367  {
368  if (id.zside()==1) return incAIEta(id,neighbors);
369  else return decAIEta(id,neighbors);
370 }
int decAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
int incAIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
bool HcalTopology::incIPhi ( const HcalDetId id,
HcalDetId neighbor 
) const

Get the neighbor (if present) of the given cell with higher iphi

Definition at line 300 of file HcalTopology.cc.

References firstHEDoublePhiRing(), firstHFQuadPhiRing(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, IPHI_MAX, convertSQLiteXML::ok, and valid().

Referenced by north().

300  {
301  bool ok=valid(id);
302  if (ok) {
303  switch (id.subdet()) {
304  case (HcalBarrel):
305  case (HcalOuter):
306  if (id.iphi()==IPHI_MAX) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth());
307  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+1,id.depth());
308  break;
309  case (HcalEndcap):
310  if (id.ietaAbs()>=firstHEDoublePhiRing()) {
311  if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth());
312  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+2,id.depth());
313  } else {
314  if (id.iphi()==IPHI_MAX) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth());
315  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+1,id.depth());
316  }
317  break;
318  case (HcalForward):
319  if (id.ietaAbs()>=firstHFQuadPhiRing()) {
320  if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),3,id.depth());
321  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+4,id.depth());
322  } else {
323  if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth());
324  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+2,id.depth());
325  }
326  break;
327  default: ok=false;
328  }
329  }
330  return ok;
331 }
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:86
virtual bool valid(const DetId &id) const
Definition: HcalTopology.cc:58
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:87
static const int IPHI_MAX
Definition: HcalTopology.cc:11
bool HcalTopology::incrementDepth ( HcalDetId id) const

Get the detector behind this one

Definition at line 490 of file HcalTopology.cc.

References HcalDetId::depth(), depthBinInformation(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), lastHBRing(), lastHERing(), lastHORing(), HcalDetId::subdet(), and validRaw().

Referenced by HcalGeometry::getClosestCell(), and up().

491 {
492  HcalSubdetector subdet = detId.subdet();
493  int ieta = detId.ieta();
494  int etaRing = detId.ietaAbs();
495  int depth = detId.depth();
496  int nDepthBins, startingBin;
497  depthBinInformation(subdet, etaRing, nDepthBins, startingBin);
498 
499  // see if the new depth bin exists
500  ++depth;
501  if(depth > nDepthBins) {
502  // handle on a case-by-case basis
503  if(subdet == HcalBarrel && etaRing < lastHORing()) {
504  // HO
505  subdet = HcalOuter;
506  depth = 4;
507  } else if(subdet == HcalBarrel && etaRing == lastHBRing()) {
508  // overlap
509  subdet = HcalEndcap;
510  } else if(subdet == HcalEndcap && etaRing == lastHERing()-1) {
511  // guard ring HF29 is behind HE 28
512  subdet = HcalForward;
513  (ieta > 0) ? ++ieta : --ieta;
514  depth = 1;
515  } else if(subdet == HcalEndcap && etaRing == lastHERing()) {
516  // split cells go to bigger granularity. Ring 29 -> 28
517  (ieta > 0) ? --ieta : ++ieta;
518  } else {
519  // no more chances
520  detId = HcalDetId();
521  return false;
522  }
523  }
524  detId = HcalDetId(subdet, ieta, detId.iphi(), depth);
525  //A.N.
526  // assert(validRaw(detId));
527  return validRaw(detId);
528  //A.N. return true;
529 }
int lastHBRing() const
Definition: HcalTopology.h:78
bool validRaw(const HcalDetId &id) const
HcalSubdetector
Definition: HcalAssistant.h:31
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 lastHORing() const
Definition: HcalTopology.h:84
int lastHERing() const
Definition: HcalTopology.h:80
bool HcalTopology::isExcluded ( const HcalDetId id) const
private

Definition at line 72 of file HcalTopology.cc.

References excludeHB_, excludeHE_, excludeHF_, excludeHO_, exclusionList_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, and i.

Referenced by validHcal().

72  {
73  bool exed=false;
74  // first, check the full detector exclusions... (fast)
75  switch (id.subdet()) {
76  case(HcalBarrel): exed=excludeHB_; break;
77  case(HcalEndcap): exed=excludeHE_; break;
78  case(HcalOuter): exed=excludeHO_; break;
79  case(HcalForward): exed=excludeHF_; break;
80  default: exed=false;
81  }
82  // next, check the list (slower)
83  if (!exed && !exclusionList_.empty()) {
84  std::vector<HcalDetId>::const_iterator i=std::lower_bound(exclusionList_.begin(),exclusionList_.end(),id);
85  if (i!=exclusionList_.end() && *i==id) exed=true;
86  }
87  return exed;
88 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalDetId > exclusionList_
Definition: HcalTopology.h:145
int HcalTopology::lastHBRing ( ) const
inline
int HcalTopology::lastHERing ( ) const
inline
int HcalTopology::lastHFRing ( ) const
inline
int HcalTopology::lastHORing ( ) const
inline
int HcalTopology::maxDepthHB ( ) const
inline

Definition at line 116 of file HcalTopology.h.

References maxDepthHB_.

Referenced by HcalTopologyIdealEP::produce().

116 { return maxDepthHB_;}
const int maxDepthHB_
Definition: HcalTopology.h:166
int HcalTopology::maxDepthHE ( ) const
inline

Definition at line 117 of file HcalTopology.h.

References maxDepthHE_.

Referenced by HcalTopologyIdealEP::produce().

117 { return maxDepthHE_;}
const int maxDepthHE_
Definition: HcalTopology.h:167
HcalTopologyMode::Mode HcalTopology::mode ( void  ) const
inline
unsigned int HcalTopology::ncells ( ) const
virtual

return a count of valid cells (for dense indexing use)

Reimplemented from CaloSubdetectorTopology.

Definition at line 874 of file HcalTopology.cc.

References HBSize_, HESize_, HFSize_, and HOSize_.

Referenced by denseId2detId(), HcalGeometry::getSummary(), HcalFlexiHardcodeGeometryLoader::load(), HcalHardcodeGeometryLoader::load(), and HcalGeometry::sizeForDenseIndex().

874  {
876 }
unsigned int HESize_
Definition: HcalTopology.h:170
unsigned int HFSize_
Definition: HcalTopology.h:172
unsigned int HBSize_
Definition: HcalTopology.h:169
unsigned int HOSize_
Definition: HcalTopology.h:171
std::vector< DetId > HcalTopology::north ( const DetId id) const
virtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 123 of file HcalTopology.cc.

References incIPhi(), and DetId::rawId().

Referenced by spr::newHCALIdNS().

123  {
124  std::vector<DetId> vNeighborsDetId;
125  HcalDetId neighbor;
126  if (incIPhi(HcalDetId(id),neighbor))
127  vNeighborsDetId.push_back(DetId(neighbor.rawId()));
128  return vNeighborsDetId;
129 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool incIPhi(const HcalDetId &id, HcalDetId &neighbor) const
Definition: DetId.h:18
int HcalTopology::nPhiBins ( int  etaRing) const

how many phi segments in this ring

Definition at line 532 of file HcalTopology.cc.

References doublePhiBins_, firstHEDoublePhiRing(), firstHFQuadPhiRing(), and singlePhiBins_.

Referenced by HcalHardcodeGeometryLoader::fill(), CaloTowerHardcodeGeometryLoader::makeCell(), HcalHardcodeGeometryLoader::makeCell(), and HcalGeometry::phiBin().

532  {
533  int lastPhiBin=singlePhiBins_;
534  if (etaRing>= firstHFQuadPhiRing()) lastPhiBin=doublePhiBins_/2;
535  else if (etaRing>= firstHEDoublePhiRing()) lastPhiBin=doublePhiBins_;
536  return lastPhiBin;
537 }
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:86
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:87
const int singlePhiBins_
Definition: HcalTopology.h:164
const int doublePhiBins_
Definition: HcalTopology.h:165
std::pair< int, int > HcalTopology::segmentBoundaries ( unsigned  ring,
unsigned  depth 
) const

returns the boundaries of the depth segmentation, so that the first result is the first segment, and the second result is the first one of the next segment. Used for calculating physical bounds.

Definition at line 557 of file HcalTopology.cc.

References getDepthSegmentation().

557  {
558  std::vector<int> readoutDepths;
559  getDepthSegmentation(ring, readoutDepths);
560  int d1 = std::lower_bound(readoutDepths.begin(), readoutDepths.end(), depth) - readoutDepths.begin();
561  int d2 = std::upper_bound(readoutDepths.begin(), readoutDepths.end(), depth) - readoutDepths.begin();
562  return std::pair<int, int>(d1, d2);
563 }
void getDepthSegmentation(unsigned ring, std::vector< int > &readoutDepths) const
void HcalTopology::setDepthSegmentation ( unsigned  ring,
const std::vector< int > &  readoutDepths 
)

Definition at line 552 of file HcalTopology.cc.

References depthSegmentation_, and relativeConstraints::ring.

553 {
554  depthSegmentation_[ring] = readoutDepths;
555 }
SegmentationMap depthSegmentation_
Definition: HcalTopology.h:181
int HcalTopology::singlePhiBins ( ) const
inline

Definition at line 89 of file HcalTopology.h.

References singlePhiBins_.

89 {return singlePhiBins_;}
const int singlePhiBins_
Definition: HcalTopology.h:164
std::vector< DetId > HcalTopology::south ( const DetId id) const
virtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 131 of file HcalTopology.cc.

References decIPhi(), and DetId::rawId().

Referenced by spr::newHCALIdNS().

131  {
132  std::vector<DetId> vNeighborsDetId;
133  HcalDetId neighbor;
134  if (decIPhi(HcalDetId(id),neighbor))
135  vNeighborsDetId.push_back(DetId(neighbor.rawId()));
136  return vNeighborsDetId;
137 }
bool decIPhi(const HcalDetId &id, HcalDetId &neighbor) const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
int HcalTopology::topoVersion ( ) const
virtual

return a version which identifies the given topology

Reimplemented from CaloSubdetectorTopology.

Definition at line 878 of file HcalTopology.cc.

References topoVersion_.

Referenced by HcalCondObjectContainerBase::HcalCondObjectContainerBase(), and HcalCondObjectContainerBase::setTopo().

878  {
879  return topoVersion_;
880 }
HcalTopologyMode::TriggerMode HcalTopology::triggerMode ( ) const
inline

Definition at line 31 of file HcalTopology.h.

References triggerMode_.

31 { return triggerMode_; }
HcalTopologyMode::TriggerMode triggerMode_
Definition: HcalTopology.h:149
std::vector< DetId > HcalTopology::up ( const DetId id) const
virtual

Get the neighbors of the given cell in up direction (outward)

Implements CaloSubdetectorTopology.

Definition at line 139 of file HcalTopology.cc.

References incrementDepth().

Referenced by spr::matrixHCALIdsDepth().

139  {
140  HcalDetId neighbor = id;
141  //A.N.
142  // incrementDepth(neighbor);
143  std::vector<DetId> vNeighborsDetId;
144  if(incrementDepth(neighbor))
145  {
146  vNeighborsDetId.push_back(neighbor);
147  }
148  return vNeighborsDetId;
149 }
bool incrementDepth(HcalDetId &id) const
bool HcalTopology::valid ( const DetId id) const
virtual

Is this a valid cell id?

Reimplemented from CaloSubdetectorTopology.

Definition at line 58 of file HcalTopology.cc.

References DetId::Hcal, and validHcal().

Referenced by decAIEta(), decIPhi(), HcalHardcodeGeometryLoader::fill(), fillDefaults(), HcalGeometry::getCells(), incAIEta(), incIPhi(), CaloMiscalibMapHcal::prefillMap(), undefinedCells(), HcaluLUTTPGCoder::update(), and HcaluLUTTPGCoder::updateXML().

58  {
59  assert(id.det()==DetId::Hcal);
60  return validHcal(id);
61 }
bool validHcal(const HcalDetId &id) const
Definition: HcalTopology.cc:63
bool HcalTopology::validDetIdPreLS1 ( const HcalDetId id) const
private

Is this a valid cell id, ignoring the exclusion list

Basic rules used to derive this code:

HB has 72 towers in iphi. Ieta 1-14 have depth=1, Ieta 15-16 have depth=1 or 2.

HE ieta=16-20 have 72 towers in iphi ieta=21-29 have 36 towers in iphi ieta=16 is depth 3 only ieta=17 is depth 1 only ieta=18-26 & 29 have depth 1 and 2 ieta=27-28 has depth 1-3

HF ieta=29-39 have 36 in iphi ieta=40-41 have 18 in iphi (71,3,7,11...) all have two depths

HO has 15 towers in ieta and 72 in iphi and depth = 4 (one value)

At H2:

HE ieta 17 is two depths HE ieta 22- have 36 towers in iphi (starts one higher) HE ieta 24- has three depths

Definition at line 216 of file HcalTopology.cc.

References reco::dp, firstHERing(), firstHFQuadPhiRing(), firstHFRing(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, IPHI_MAX, lastHFRing(), and sd.

216  {
217  const HcalSubdetector sd (id.subdet());
218  const int ie (id.ietaAbs());
219  const int ip (id.iphi());
220  const int dp (id.depth());
221 
222  return ( ( ip >= 1 ) &&
223  ( ip <= IPHI_MAX ) &&
224  ( dp >= 1 ) &&
225  ( ie >= 1 ) &&
226  ( ( ( sd == HcalBarrel ) &&
227  ( ( ( ie <= 14 ) &&
228  ( dp == 1 ) ) ||
229  ( ( ( ie == 15 ) || ( ie == 16 ) ) &&
230  ( dp <= 2 ) ) ) ) ||
231  ( ( sd == HcalEndcap ) &&
232  ( ( ( ie == firstHERing() ) &&
233  ( dp == 3 ) ) ||
234  ( ( ie == 17 ) &&
235  ( dp == 1 ) ) ||
236  ( ( ie >= 18 ) &&
237  ( ie <= 20 ) &&
238  ( dp <= 2 ) ) ||
239  ( ( ie >= 21 ) &&
240  ( ie <= 26 ) &&
241  ( dp <= 2 ) &&
242  ( ip%2 == 1 ) ) ||
243  ( ( ie >= 27 ) &&
244  ( ie <= 28 ) &&
245  ( dp <= 3 ) &&
246  ( ip%2 == 1 ) ) ||
247  ( ( ie == 29 ) &&
248  ( dp <= 2 ) &&
249  ( ip%2 == 1 ) ) ) ) ||
250  ( ( sd == HcalOuter ) &&
251  ( ie <= 15 ) &&
252  ( dp == 4 ) ) ||
253  ( ( sd == HcalForward ) &&
254  ( dp <= 2 ) &&
255  ( ( ( ie >= firstHFRing() ) &&
256  ( ie < firstHFQuadPhiRing() ) &&
257  ( ip%2 == 1 ) ) ||
258  ( ( ie >= firstHFQuadPhiRing() ) &&
259  ( ie <= lastHFRing() ) &&
260  ( ip%4 == 3 ) ) ) ) ) ) ;
261 }
int firstHFRing() const
Definition: HcalTopology.h:81
int lastHFRing() const
Definition: HcalTopology.h:82
HcalSubdetector
Definition: HcalAssistant.h:31
auto dp
Definition: deltaR.h:24
double sd
int firstHERing() const
Definition: HcalTopology.h:79
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:87
static const int IPHI_MAX
Definition: HcalTopology.cc:11
bool HcalTopology::validHcal ( const HcalDetId id) const

Is this a valid cell id?

Definition at line 63 of file HcalTopology.cc.

References isExcluded(), convertSQLiteXML::ok, and validRaw().

Referenced by valid().

63  {
64  // check the raw rules
65  bool ok=validRaw(id);
66 
67  ok=ok && !isExcluded(id);
68 
69  return ok;
70 }
bool isExcluded(const HcalDetId &id) const
Definition: HcalTopology.cc:72
bool validRaw(const HcalDetId &id) const
bool HcalTopology::validRaw ( const HcalDetId id) const
private

Is this a valid cell id?

Definition at line 264 of file HcalTopology.cc.

References firstHEDoublePhiRing(), firstHERing(), firstHETripleDepthRing(), firstHFQuadPhiRing(), firstHFRing(), HcalTopologyMode::H2, HcalTopologyMode::H2HE, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, IPHI_MAX, lastHBRing(), lastHERing(), lastHFRing(), lastHORing(), maxDepthHB_, maxDepthHE_, mode_, convertSQLiteXML::ok, and HcalTopologyMode::SLHC.

Referenced by exclude(), incrementDepth(), and validHcal().

264  {
265  bool ok=true;
266  int ieta=id.ieta();
267  int aieta=id.ietaAbs();
268  int depth=id.depth();
269  int iphi=id.iphi();
270  if ((ieta==0 || iphi<=0 || iphi>IPHI_MAX) || aieta>lastHFRing()) return false; // outer limits
271 
272  if (ok) {
273  HcalSubdetector subdet=id.subdet();
274  if (subdet==HcalBarrel) {
276  if ((aieta>lastHBRing() || depth>maxDepthHB_ || (aieta==lastHBRing() && depth > 2))) ok=false;
277  } else {
278  if (aieta>lastHBRing() || depth>2 || (aieta<=14 && depth>1)) ok=false;
279  }
280  } else if (subdet==HcalEndcap) {
282  if (depth>maxDepthHE_ || aieta<firstHERing() || aieta>lastHERing() || (aieta==firstHERing() && depth<3) || (aieta>=firstHEDoublePhiRing() && (iphi%2)==0)) ok=false;
283  } else {
284  if (depth>3 || aieta<firstHERing() || aieta>lastHERing() || (aieta==firstHERing() && depth!=3) || (aieta==17 && depth!=1 && mode_!=HcalTopologyMode::H2) || // special case at H2
285  (((aieta>=17 && aieta<firstHETripleDepthRing()) || aieta==lastHERing()) && depth>2) ||
286  (aieta>=firstHEDoublePhiRing() && (iphi%2)==0)) ok=false;
287  }
288  } else if (subdet==HcalOuter) {
289  if (aieta>lastHORing() || iphi>IPHI_MAX || depth!=4) ok=false;
290  } else if (subdet==HcalForward) {
291  if (aieta<firstHFRing() || aieta>lastHFRing() || ((iphi%2)==0) || (depth>2) || (aieta>=firstHFQuadPhiRing() && ((iphi+1)%4)!=0)) ok=false;
292  } else {
293  ok=false;
294  }
295  }
296  return ok;
297 }
int firstHFRing() const
Definition: HcalTopology.h:81
int lastHBRing() const
Definition: HcalTopology.h:78
const int maxDepthHE_
Definition: HcalTopology.h:167
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:148
int firstHETripleDepthRing() const
Definition: HcalTopology.h:88
int lastHFRing() const
Definition: HcalTopology.h:82
HcalSubdetector
Definition: HcalAssistant.h:31
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:86
int firstHERing() const
Definition: HcalTopology.h:79
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:87
const int maxDepthHB_
Definition: HcalTopology.h:166
int lastHORing() const
Definition: HcalTopology.h:84
int lastHERing() const
Definition: HcalTopology.h:80
static const int IPHI_MAX
Definition: HcalTopology.cc:11
std::vector< DetId > HcalTopology::west ( const DetId id) const
virtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 115 of file HcalTopology.cc.

References i, and incIEta().

Referenced by spr::newHCALIdEW().

115  {
116  std::vector<DetId> vNeighborsDetId;
117  HcalDetId neighbors[2];
118  for (int i=0;i<incIEta(HcalDetId(id),neighbors);i++)
119  vNeighborsDetId.push_back(DetId(neighbors[i].rawId()));
120  return vNeighborsDetId;
121 }
int i
Definition: DBlmapReader.cc:9
int incIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
Definition: DetId.h:18

Member Data Documentation

unsigned int HcalTopology::CALIBSize_
private

Definition at line 174 of file HcalTopology.h.

Referenced by getCALIBSize().

SegmentationMap HcalTopology::depthSegmentation_
private

Definition at line 181 of file HcalTopology.h.

Referenced by getDepthSegmentation(), and setDepthSegmentation().

const int HcalTopology::doublePhiBins_
private

Definition at line 165 of file HcalTopology.h.

Referenced by doublePhiBins(), and nPhiBins().

bool HcalTopology::excludeHB_
private

Definition at line 146 of file HcalTopology.h.

Referenced by exclude(), excludeSubdetector(), and isExcluded().

bool HcalTopology::excludeHE_
private

Definition at line 146 of file HcalTopology.h.

Referenced by exclude(), excludeSubdetector(), and isExcluded().

bool HcalTopology::excludeHF_
private

Definition at line 146 of file HcalTopology.h.

Referenced by exclude(), excludeSubdetector(), and isExcluded().

bool HcalTopology::excludeHO_
private

Definition at line 146 of file HcalTopology.h.

Referenced by exclude(), excludeSubdetector(), and isExcluded().

std::vector<HcalDetId> HcalTopology::exclusionList_
private

Definition at line 145 of file HcalTopology.h.

Referenced by exclude(), and isExcluded().

const int HcalTopology::firstHBRing_
private

Definition at line 152 of file HcalTopology.h.

Referenced by firstHBRing().

const int HcalTopology::firstHEDoublePhiRing_
private

Definition at line 161 of file HcalTopology.h.

Referenced by firstHEDoublePhiRing().

const int HcalTopology::firstHERing_
private

Definition at line 154 of file HcalTopology.h.

Referenced by firstHERing().

const int HcalTopology::firstHETripleDepthRing_
private

Definition at line 163 of file HcalTopology.h.

Referenced by firstHETripleDepthRing().

const int HcalTopology::firstHFQuadPhiRing_
private

Definition at line 162 of file HcalTopology.h.

Referenced by firstHFQuadPhiRing().

const int HcalTopology::firstHFRing_
private

Definition at line 156 of file HcalTopology.h.

Referenced by firstHFRing().

const int HcalTopology::firstHORing_
private

Definition at line 158 of file HcalTopology.h.

Referenced by firstHORing().

unsigned int HcalTopology::HBSize_
private

Definition at line 169 of file HcalTopology.h.

Referenced by denseId2detId(), detId2denseId(), getHBSize(), HcalTopology(), and ncells().

unsigned int HcalTopology::HESize_
private

Definition at line 170 of file HcalTopology.h.

Referenced by denseId2detId(), detId2denseId(), getHESize(), HcalTopology(), and ncells().

unsigned int HcalTopology::HFSize_
private

Definition at line 172 of file HcalTopology.h.

Referenced by getHFSize(), HcalTopology(), and ncells().

unsigned int HcalTopology::HOSize_
private

Definition at line 171 of file HcalTopology.h.

Referenced by denseId2detId(), detId2denseId(), getHOSize(), HcalTopology(), and ncells().

unsigned int HcalTopology::HTSize_
private

Definition at line 173 of file HcalTopology.h.

Referenced by getHTSize().

const int HcalTopology::lastHBRing_
private

Definition at line 153 of file HcalTopology.h.

Referenced by lastHBRing().

const int HcalTopology::lastHERing_
private

Definition at line 155 of file HcalTopology.h.

Referenced by lastHERing().

const int HcalTopology::lastHFRing_
private

Definition at line 157 of file HcalTopology.h.

Referenced by lastHFRing().

const int HcalTopology::lastHORing_
private

Definition at line 159 of file HcalTopology.h.

Referenced by lastHORing().

const int HcalTopology::maxDepthHB_
private
const int HcalTopology::maxDepthHE_
private
HcalTopologyMode::Mode HcalTopology::mode_
private

Definition at line 148 of file HcalTopology.h.

Referenced by depthBinInformation(), HcalTopology(), mode(), and validRaw().

const unsigned int HcalTopology::numberOfShapes_
private

Definition at line 175 of file HcalTopology.h.

Referenced by getNumberOfShapes().

const int HcalTopology::singlePhiBins_
private

Definition at line 164 of file HcalTopology.h.

Referenced by nPhiBins(), and singlePhiBins().

int HcalTopology::topoVersion_
private
HcalTopologyMode::TriggerMode HcalTopology::triggerMode_
private

Definition at line 149 of file HcalTopology.h.

Referenced by triggerMode().