CMS 3D CMS Logo

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

#include <HGCalTopology.h>

Inheritance diagram for HGCalTopology:
CaloSubdetectorTopology

Classes

struct  DecodedDetId
 

Public Member Functions

const HGCalDDDConstantsdddConstants () const
 
DecodedDetId decode (const DetId &id) const
 
virtual DetId denseId2detId (uint32_t denseId) const
 
bool detectorType () const
 
virtual uint32_t detId2denseGeomId (const DetId &id) const
 
virtual uint32_t detId2denseId (const DetId &id) const
 Dense indexing. More...
 
virtual std::vector< DetIddown (const DetId &id) const
 
virtual std::vector< DetIdeast (const DetId &id) const
 
DetId encode (const DecodedDetId &id_) const
 
DecodedDetId geomDenseId2decId (const uint32_t &hi) const
 
virtual DetId goEast (const DetId &id) const
 move the Topology east (positive ix) More...
 
virtual DetId goNorth (const DetId &id) const
 move the Topology north (increment iy) More...
 
virtual DetId goSouth (const DetId &id) const
 move the Topology south (decrement iy) More...
 
virtual DetId goWest (const DetId &id) const
 move the Topology west (negative ix) More...
 
 HGCalTopology (const HGCalDDDConstants &hdcons, ForwardSubdetector subdet, bool halfChamber)
 create a new Topology More...
 
virtual std::vector< DetIdnorth (const DetId &id) const
 
DetId offsetBy (const DetId startId, int nrStepsX, int nrStepsY) const
 
virtual std::vector< DetIdsouth (const DetId &id) const
 
ForwardSubdetector subDetector () const
 
DetId switchZSide (const DetId startId) const
 
unsigned int totalGeomModules () const
 
unsigned int totalModules () const
 
virtual std::vector< DetIdup (const DetId &id) const
 
virtual bool valid (const DetId &id) const
 Is this a valid cell id. More...
 
bool validHashIndex (uint32_t ix) const
 
virtual std::vector< DetIdwest (const DetId &id) const
 
virtual ~HGCalTopology ()
 virtual destructor More...
 
- Public Member Functions inherited from CaloSubdetectorTopology
 CaloSubdetectorTopology ()
 standard constructor More...
 
virtual DetId denseId2detId (unsigned int) const
 return a linear packed id 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 goUp (const DetId &id) const
 
virtual unsigned int ncells () const
 return a count of valid cells (for dense indexing use) More...
 
virtual int topoVersion () const
 return a version which identifies the given topology More...
 
virtual ~CaloSubdetectorTopology ()
 virtual destructor More...
 

Static Public Attributes

static const int subSectors_ = 2
 

Private Member Functions

DetId changeXY (const DetId &id, int nrStepsX, int nrStepsY) const
 move the nagivator along x, y More...
 
DetId changeZ (const DetId &id, int nrStepsZ) const
 move the nagivator along z More...
 

Private Attributes

int cells_
 
bool half_
 
const HGCalDDDConstantshdcons_
 
int kHGeomHalf_
 
int kHGhalf_
 
unsigned int kSizeForDenseIndexing
 
int layers_
 
std::vector< int > maxcells_
 
int sectors_
 
ForwardSubdetector subdet_
 

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

Definition at line 12 of file HGCalTopology.h.

Constructor & Destructor Documentation

HGCalTopology::HGCalTopology ( const HGCalDDDConstants hdcons,
ForwardSubdetector  subdet,
bool  halfChamber 
)

create a new Topology

Definition at line 6 of file HGCalTopology.cc.

References cells_, gather_cfg::cout, half_, hdcons_, kHGeomHalf_, kHGhalf_, kSizeForDenseIndexing, HGCalDDDConstants::layers(), layers_, HGCalDDDConstants::maxCells(), HGCalDDDConstants::sectors(), sectors_, subdet_, and subSectors_.

8  : hdcons_(hdcons), subdet_(subdet),
9  half_(half) {
11  layers_ = hdcons_.layers(true);
12  cells_ = hdcons_.maxCells(true);
15  kSizeForDenseIndexing = (unsigned int)(2*kHGhalf_);
16 #ifdef DebugLog
17  std::cout << "HGCalTopology initialized for subdetector " << subdet_
18  << " having half-chamber flag " << half_ << " with " << sectors_
19  << " Sectors " << layers_ << " Layers " << cells_
20  << " cells and total channels " << kSizeForDenseIndexing << ":"
21  << (2*kHGeomHalf_) << std::endl;
22 #endif
23 }
unsigned int layers(bool reco) const
static const int subSectors_
int sectors() const
ForwardSubdetector subdet_
const HGCalDDDConstants & hdcons_
unsigned int kSizeForDenseIndexing
tuple cout
Definition: gather_cfg.py:121
int maxCells(bool reco) const
virtual HGCalTopology::~HGCalTopology ( )
inlinevirtual

virtual destructor

Definition at line 19 of file HGCalTopology.h.

19 { }

Member Function Documentation

DetId HGCalTopology::changeXY ( const DetId id,
int  nrStepsX,
int  nrStepsY 
) const
private

move the nagivator along x, y

Definition at line 141 of file HGCalTopology.cc.

References decode(), encode(), half_, hdcons_, HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, HGCalDDDConstants::newCell(), and valid().

Referenced by goEast(), goNorth(), goSouth(), goWest(), and offsetBy().

142  {
143 
145  std::pair<int,int> kcell= hdcons_.newCell(id_.iCell,id_.iLay,id_.iSec,
146  id_.iSubSec,nrStepsX,nrStepsY,
147  half_);
148  id_.iSubSec= kcell.second;
149  id_.iSec = (kcell.second > 0) ? kcell.second : -kcell.second;
150  id_.iCell = kcell.first;
151  DetId nextPoint = encode(id_);
152  if (valid(nextPoint)) return nextPoint;
153  else return DetId(0);
154 }
DetId encode(const DecodedDetId &id_) const
virtual bool valid(const DetId &id) const
Is this a valid cell id.
const HGCalDDDConstants & hdcons_
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
std::pair< int, int > newCell(int cell, int layer, int sector, int subsector, int incrx, int incry, bool half) const
DetId HGCalTopology::changeZ ( const DetId id,
int  nrStepsZ 
) const
private

move the nagivator along z

Definition at line 157 of file HGCalTopology.cc.

References decode(), encode(), half_, hdcons_, HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSubSec, HGCalDDDConstants::newCell(), and valid().

Referenced by down(), and up().

157  {
158 
160  std::pair<int,int> kcell = hdcons_.newCell(id_.iCell,id_.iLay,
161  id_.iSubSec,nrStepsZ,half_);
162  id_.iLay = kcell.second;
163  id_.iCell = kcell.first;
164  DetId nextPoint = encode(id_);
165  if (valid(nextPoint)) return nextPoint;
166  else return DetId(0);
167 }
DetId encode(const DecodedDetId &id_) const
virtual bool valid(const DetId &id) const
Is this a valid cell id.
const HGCalDDDConstants & hdcons_
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
std::pair< int, int > newCell(int cell, int layer, int sector, int subsector, int incrx, int incry, bool half) const
const HGCalDDDConstants& HGCalTopology::dddConstants ( ) const
inline
HGCalTopology::DecodedDetId HGCalTopology::decode ( const DetId id) const

Definition at line 106 of file HGCalTopology.cc.

References HGCEE, HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, HGCalTopology::DecodedDetId::subdet, subdet_, and HGCalTopology::DecodedDetId::zside.

Referenced by changeXY(), changeZ(), detId2denseGeomId(), detId2denseId(), HGCalGeometry::getClosestCell(), HGCalGeometry::getCorners(), HGCalGeometry::getPosition(), HGCalGeometry::newCell(), switchZSide(), and valid().

106  {
107 
109  if (subdet_ == HGCEE) {
110  HGCEEDetId id(startId);
111  id_.iCell = id.cell();
112  id_.iLay = id.layer();
113  id_.iSec = id.sector();
114  id_.iSubSec= id.subsector();
115  id_.zside = id.zside();
116  id_.subdet = id.subdetId();
117  } else {
118  HGCHEDetId id(startId);
119  id_.iCell = id.cell();
120  id_.iLay = id.layer();
121  id_.iSec = id.sector();
122  id_.iSubSec= id.subsector();
123  id_.zside = id.zside();
124  id_.subdet = id.subdetId();
125  }
126  return id_;
127 }
ForwardSubdetector subdet_
DetId HGCalTopology::denseId2detId ( uint32_t  denseId) const
virtual

Definition at line 35 of file HGCalTopology.cc.

References encode(), HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, kHGhalf_, layers_, sectors_, subSectors_, validHashIndex(), and HGCalTopology::DecodedDetId::zside.

35  {
36 
37  if (validHashIndex(hi)) {
39  id_.zside = ((int)(hi)<kHGhalf_ ? -1 : 1);
40  int di = ((int)(hi)%kHGhalf_);
41  int iSubSec= (di%subSectors_);
42  id_.iSubSec= (iSubSec == 0 ? -1 : 1);
43  id_.iSec = (((di-iSubSec)/subSectors_)%sectors_+1);
44  id_.iLay = (((((di-iSubSec)/subSectors_)-id_.iSec+1)/sectors_)%layers_+1);
45  id_.iCell = (((((di-iSubSec)/subSectors_)-id_.iSec+1)/sectors_-id_.iLay+1)/layers_+1);
46  return encode(id_);
47  } else {
48  return DetId(0);
49  }
50 }
bool validHashIndex(uint32_t ix) const
Definition: HGCalTopology.h:92
DetId encode(const DecodedDetId &id_) const
static const int subSectors_
Definition: DetId.h:18
bool HGCalTopology::detectorType ( ) const
inline

Definition at line 117 of file HGCalTopology.h.

References half_.

Referenced by HGCDigitizer::accumulate(), HGCalGeometryLoader::build(), and HGCalGeometry::HGCalGeometry().

117 { return half_;}
uint32_t HGCalTopology::detId2denseGeomId ( const DetId id) const
virtual

Definition at line 52 of file HGCalTopology.cc.

References decode(), half_, customizeTrackingMonitorSeedNumber::idx, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, kHGeomHalf_, layers_, sectors_, and HGCalTopology::DecodedDetId::zside.

Referenced by HGCalGeometry::indexFor().

52  {
53 
55  int isubsec= (half_ && id_.iSubSec > 0) ? 1 : 0;
56  uint32_t idx = (uint32_t)(((id_.zside > 0) ? kHGeomHalf_ : 0) +
57  ((isubsec*layers_+id_.iLay-1)*sectors_+
58  id_.iSec-1));
59  return idx;
60 }
DecodedDetId decode(const DetId &id) const
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
uint32_t HGCalTopology::detId2denseId ( const DetId id) const
virtual

Dense indexing.

Reimplemented from CaloSubdetectorTopology.

Definition at line 25 of file HGCalTopology.cc.

References decode(), HGCalTopology::DecodedDetId::iCell, customizeTrackingMonitorSeedNumber::idx, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, kHGhalf_, layers_, sectors_, subSectors_, and HGCalTopology::DecodedDetId::zside.

25  {
26 
28  int isubsec= (id_.iSubSec > 0) ? 1 : 0;
29  uint32_t idx = (uint32_t)((((id_.zside > 0) ? kHGhalf_ : 0) +
30  ((((id_.iCell-1)*layers_+id_.iLay-1)*sectors_+
31  id_.iSec-1)*subSectors_+isubsec)));
32  return idx;
33 }
static const int subSectors_
DecodedDetId decode(const DetId &id) const
tuple idx
DEBUGGING if hasattr(process,&quot;trackMonIterativeTracking2012&quot;): print &quot;trackMonIterativeTracking2012 D...
virtual std::vector<DetId> HGCalTopology::down ( const DetId id) const
inlinevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 77 of file HGCalTopology.h.

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

77  {
78  DetId nextId=changeZ(id,-1);
79  std::vector<DetId> vNeighborsDetId;
80  if (! (nextId==DetId(0)))
81  vNeighborsDetId.push_back(DetId(nextId.rawId()));
82  return vNeighborsDetId;
83  }
DetId changeZ(const DetId &id, int nrStepsZ) const
move the nagivator along z
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual std::vector<DetId> HGCalTopology::east ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 49 of file HGCalTopology.h.

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

49  {
50  DetId nextId=goEast(id);
51  std::vector<DetId> vNeighborsDetId;
52  if (! (nextId==DetId(0)))
53  vNeighborsDetId.push_back(DetId(nextId.rawId()));
54  return vNeighborsDetId;
55  }
virtual DetId goEast(const DetId &id) const
move the Topology east (positive ix)
Definition: HGCalTopology.h:46
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
DetId HGCalTopology::encode ( const DecodedDetId id_) const

Definition at line 129 of file HGCalTopology.cc.

References HGCEE, HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, DetId::rawId(), subdet_, and HGCalTopology::DecodedDetId::zside.

Referenced by changeXY(), changeZ(), denseId2detId(), HGCalGeometry::getClosestCell(), HGCalGeometry::newCell(), and switchZSide().

129  {
130 
131  int isubsec= (id_.iSubSec > 0) ? 1 : 0;
132  DetId id;
133  if (subdet_ == HGCEE) {
134  id = HGCEEDetId(subdet_,id_.zside,id_.iLay,id_.iSec,isubsec,id_.iCell).rawId();
135  } else {
136  id = HGCHEDetId(subdet_,id_.zside,id_.iLay,id_.iSec,isubsec,id_.iCell).rawId();
137  }
138  return id;
139 }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
ForwardSubdetector subdet_
Definition: DetId.h:18
HGCalTopology::DecodedDetId HGCalTopology::geomDenseId2decId ( const uint32_t &  hi) const

Definition at line 92 of file HGCalTopology.cc.

References HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, HGCalTopology::DecodedDetId::iSubSec, kHGeomHalf_, layers_, sectors_, subSectors_, totalGeomModules(), and HGCalTopology::DecodedDetId::zside.

92  {
93 
95  if (hi < totalGeomModules()) {
96  id_.zside = ((int)(hi)<kHGeomHalf_ ? -1 : 1);
97  int di = ((int)(hi)%kHGeomHalf_);
98  int iSubSec= (di%subSectors_);
99  id_.iSubSec= (iSubSec == 0 ? -1 : 1);
100  id_.iSec = (((di-iSubSec)/subSectors_)%sectors_+1);
101  id_.iLay = (((((di-iSubSec)/subSectors_)-id_.iSec+1)/sectors_)%layers_+1);
102  }
103  return id_;
104 }
unsigned int totalGeomModules() const
Definition: HGCalTopology.h:95
static const int subSectors_
virtual DetId HGCalTopology::goEast ( const DetId id) const
inlinevirtual

move the Topology east (positive ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 46 of file HGCalTopology.h.

References changeXY().

Referenced by east().

46  {
47  return changeXY(id,+1,0);
48  }
DetId changeXY(const DetId &id, int nrStepsX, int nrStepsY) const
move the nagivator along x, y
virtual DetId HGCalTopology::goNorth ( const DetId id) const
inlinevirtual

move the Topology north (increment iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 22 of file HGCalTopology.h.

References changeXY().

Referenced by north().

22  {
23  return changeXY(id,0,+1);
24  }
DetId changeXY(const DetId &id, int nrStepsX, int nrStepsY) const
move the nagivator along x, y
virtual DetId HGCalTopology::goSouth ( const DetId id) const
inlinevirtual

move the Topology south (decrement iy)

Reimplemented from CaloSubdetectorTopology.

Definition at line 34 of file HGCalTopology.h.

References changeXY().

Referenced by south().

34  {
35  return changeXY(id,0,-1);
36  }
DetId changeXY(const DetId &id, int nrStepsX, int nrStepsY) const
move the nagivator along x, y
virtual DetId HGCalTopology::goWest ( const DetId id) const
inlinevirtual

move the Topology west (negative ix)

Reimplemented from CaloSubdetectorTopology.

Definition at line 58 of file HGCalTopology.h.

References changeXY().

Referenced by west().

58  {
59  return changeXY(id,-1,0);
60  }
DetId changeXY(const DetId &id, int nrStepsX, int nrStepsY) const
move the nagivator along x, y
virtual std::vector<DetId> HGCalTopology::north ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 25 of file HGCalTopology.h.

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

25  {
26  DetId nextId= goNorth(id);
27  std::vector<DetId> vNeighborsDetId;
28  if (! (nextId==DetId(0)))
29  vNeighborsDetId.push_back(DetId(nextId.rawId()));
30  return vNeighborsDetId;
31  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual DetId goNorth(const DetId &id) const
move the Topology north (increment iy)
Definition: HGCalTopology.h:22
Definition: DetId.h:18
DetId HGCalTopology::offsetBy ( const DetId  startId,
int  nrStepsX,
int  nrStepsY 
) const

returns a new DetId offset by nrStepsX and nrStepsY (can be negative), returns DetId(0) if invalid

Definition at line 71 of file HGCalTopology.cc.

References changeXY(), DetId::det(), DetId::Forward, subdet_, DetId::subdetId(), and valid().

72  {
73 
74  if (startId.det() == DetId::Forward && startId.subdetId() == (int)(subdet_)){
75  DetId id = changeXY(startId,nrStepsX,nrStepsY);
76  if (valid(id)) return id.rawId();
77  }
78  return DetId(0);
79 }
DetId changeXY(const DetId &id, int nrStepsX, int nrStepsY) const
move the nagivator along x, y
virtual bool valid(const DetId &id) const
Is this a valid cell id.
ForwardSubdetector subdet_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
virtual std::vector<DetId> HGCalTopology::south ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 37 of file HGCalTopology.h.

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

37  {
38  DetId nextId= goSouth(id);
39  std::vector<DetId> vNeighborsDetId;
40  if (! (nextId==DetId(0)))
41  vNeighborsDetId.push_back(DetId(nextId.rawId()));
42  return vNeighborsDetId;
43  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual DetId goSouth(const DetId &id) const
move the Topology south (decrement iy)
Definition: HGCalTopology.h:34
Definition: DetId.h:18
ForwardSubdetector HGCalTopology::subDetector ( ) const
inline

Definition at line 116 of file HGCalTopology.h.

References subdet_.

Referenced by HGCalGeometryLoader::build(), and HGCalGeometry::HGCalGeometry().

116 { return subdet_;}
ForwardSubdetector subdet_
DetId HGCalTopology::switchZSide ( const DetId  startId) const

Definition at line 81 of file HGCalTopology.cc.

References decode(), DetId::det(), encode(), DetId::Forward, subdet_, DetId::subdetId(), valid(), and HGCalTopology::DecodedDetId::zside.

81  {
82 
83  if (startId.det() == DetId::Forward && startId.subdetId() == (int)(subdet_)){
84  HGCalTopology::DecodedDetId id_ = decode(startId);
85  id_.zside =-id_.zside;
86  DetId id = encode(id_);
87  if (valid(id)) return id.rawId();
88  }
89  return DetId(0);
90 }
DetId encode(const DecodedDetId &id_) const
virtual bool valid(const DetId &id) const
Is this a valid cell id.
ForwardSubdetector subdet_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
DecodedDetId decode(const DetId &id) const
Definition: DetId.h:18
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
unsigned int HGCalTopology::totalGeomModules ( ) const
inline

Definition at line 95 of file HGCalTopology.h.

References kHGeomHalf_.

Referenced by HGCalGeometryLoader::build(), geomDenseId2decId(), HGCalGeometry::HGCalGeometry(), and HGCalGeometry::sizeForDenseIndex().

95 {return (unsigned int)(2*kHGeomHalf_);}
unsigned int HGCalTopology::totalModules ( ) const
inline

Definition at line 94 of file HGCalTopology.h.

References kSizeForDenseIndexing.

94 {return kSizeForDenseIndexing;}
unsigned int kSizeForDenseIndexing
virtual std::vector<DetId> HGCalTopology::up ( const DetId id) const
inlinevirtual

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

Implements CaloSubdetectorTopology.

Definition at line 69 of file HGCalTopology.h.

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

69  {
70  DetId nextId=changeZ(id,+1);
71  std::vector<DetId> vNeighborsDetId;
72  if (! (nextId==DetId(0)))
73  vNeighborsDetId.push_back(DetId(nextId.rawId()));
74  return vNeighborsDetId;
75  }
DetId changeZ(const DetId &id, int nrStepsZ) const
move the nagivator along z
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
bool HGCalTopology::valid ( const DetId id) const
virtual

Is this a valid cell id.

Reimplemented from CaloSubdetectorTopology.

Definition at line 62 of file HGCalTopology.cc.

References cells_, decode(), DetId::Forward, HGCalTopology::DecodedDetId::iCell, HGCalTopology::DecodedDetId::iLay, HGCalTopology::DecodedDetId::iSec, layers_, sectors_, and subdet_.

Referenced by changeXY(), changeZ(), offsetBy(), and switchZSide().

62  {
63 
65  bool flag = (id.det() == DetId::Forward && id.subdetId() == (int)(subdet_) &&
66  id_.iCell >= 0 && id_.iCell < cells_ && id_.iLay > 0 &&
67  id_.iLay <= layers_ && id_.iSec > 0 && id_.iSec <= sectors_);
68  return flag;
69 }
ForwardSubdetector subdet_
DecodedDetId decode(const DetId &id) const
bool HGCalTopology::validHashIndex ( uint32_t  ix) const
inline

Definition at line 92 of file HGCalTopology.h.

References kSizeForDenseIndexing.

Referenced by denseId2detId().

92 {return (ix < kSizeForDenseIndexing);}
unsigned int kSizeForDenseIndexing
virtual std::vector<DetId> HGCalTopology::west ( const DetId id) const
inlinevirtual

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 61 of file HGCalTopology.h.

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

61  {
62  DetId nextId=goWest(id);
63  std::vector<DetId> vNeighborsDetId;
64  if (! (nextId==DetId(0)))
65  vNeighborsDetId.push_back(DetId(nextId.rawId()));
66  return vNeighborsDetId;
67  }
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
Definition: DetId.h:18
virtual DetId goWest(const DetId &id) const
move the Topology west (negative ix)
Definition: HGCalTopology.h:58

Member Data Documentation

int HGCalTopology::cells_
private

Definition at line 129 of file HGCalTopology.h.

Referenced by HGCalTopology(), and valid().

bool HGCalTopology::half_
private

Definition at line 128 of file HGCalTopology.h.

Referenced by changeXY(), changeZ(), detectorType(), detId2denseGeomId(), and HGCalTopology().

const HGCalDDDConstants& HGCalTopology::hdcons_
private

Definition at line 126 of file HGCalTopology.h.

Referenced by changeXY(), changeZ(), dddConstants(), and HGCalTopology().

int HGCalTopology::kHGeomHalf_
private
int HGCalTopology::kHGhalf_
private

Definition at line 129 of file HGCalTopology.h.

Referenced by denseId2detId(), detId2denseId(), and HGCalTopology().

unsigned int HGCalTopology::kSizeForDenseIndexing
private

Definition at line 131 of file HGCalTopology.h.

Referenced by HGCalTopology(), totalModules(), and validHashIndex().

int HGCalTopology::layers_
private
std::vector<int> HGCalTopology::maxcells_
private

Definition at line 130 of file HGCalTopology.h.

int HGCalTopology::sectors_
private
ForwardSubdetector HGCalTopology::subdet_
private

Definition at line 127 of file HGCalTopology.h.

Referenced by decode(), encode(), HGCalTopology(), offsetBy(), subDetector(), switchZSide(), and valid().

const int HGCalTopology::subSectors_ = 2
static

Definition at line 104 of file HGCalTopology.h.

Referenced by denseId2detId(), detId2denseId(), geomDenseId2decId(), and HGCalTopology().