CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Static 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
 
bool decrementDepth (HcalDetId &id) 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
 
double etaMax (HcalSubdetector subdet) const
 
std::pair< double, double > etaRange (HcalSubdetector subdet, int ieta) const
 
int etaRing (HcalSubdetector subdet, double eta) const
 eta and phi index from eta, phi values More...
 
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 firstHEQuadPhiRing () 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 (const HcalDDDRecConstants *hcons, HcalTopologyMode::TriggerMode tmode=HcalTopologyMode::tm_LHC_PreLS1)
 
 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 maxDepth (HcalSubdetector subdet) 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...
 
int nPhiBins (HcalSubdetector subdet, int etaRing) const
 
int phiBin (HcalSubdetector subdet, int etaRing, double phi) const
 
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 validDetId (HcalSubdetector subdet, int ieta, int iphi, int depth) 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...
 

Static Public Member Functions

static std::string producerTag ()
 

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_
 
int doublePhiBins_
 
std::vector< double > dPhiTable
 
std::vector< double > dPhiTableHF
 
std::vector
< HcalDDDRecConstants::HcalEtaBin
etaBinsHB_
 
std::vector
< HcalDDDRecConstants::HcalEtaBin
etaBinsHE_
 
int etaHE2HF_
 
int etaHF2HE_
 
std::vector< double > etaTable
 
std::vector< double > etaTableHF
 
bool excludeHB_
 
bool excludeHE_
 
bool excludeHF_
 
bool excludeHO_
 
std::vector< HcalDetIdexclusionList_
 
int firstHBRing_
 
int firstHEDoublePhiRing_
 
int firstHEQuadPhiRing_
 
int firstHERing_
 
int firstHETripleDepthRing_
 
int firstHFQuadPhiRing_
 
int firstHFRing_
 
int firstHORing_
 
unsigned int HBSize_
 
const HcalDDDRecConstantshcons_
 
unsigned int HESize_
 
unsigned int HFSize_
 
unsigned int HOSize_
 
unsigned int HTSize_
 
int lastHBRing_
 
int lastHERing_
 
int lastHFRing_
 
int lastHORing_
 
int maxDepthHB_
 
int maxDepthHE_
 
int maxDepthHF_
 
int maxEta_
 
HcalTopologyMode::Mode mode_
 
int nEtaHB_
 
int nEtaHE_
 
unsigned int numberOfShapes_
 
std::vector< double > phioff
 
int singlePhiBins_
 
int topoVersion_
 
HcalTopologyMode::TriggerMode triggerMode_
 
std::vector< int > unitPhi
 
std::vector< int > unitPhiHF
 

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 26 of file HcalTopology.h.

Member Typedef Documentation

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

Definition at line 198 of file HcalTopology.h.

Member Enumeration Documentation

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

Definition at line 201 of file HcalTopology.h.

anonymous enum
private
Enumerator
kSizeForDenseIndexingPreLS1 

Definition at line 210 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHBSizePreLS1 

Definition at line 211 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHESizePreLS1 

Definition at line 212 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHOSizePreLS1 

Definition at line 213 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHFSizePreLS1 

Definition at line 214 of file HcalTopology.h.

anonymous enum
private
Enumerator
kHTSizePreLS1 

Definition at line 215 of file HcalTopology.h.

anonymous enum
private
Enumerator
kCALIBSizePreLS1 

Definition at line 216 of file HcalTopology.h.

Constructor & Destructor Documentation

HcalTopology::HcalTopology ( const HcalDDDRecConstants hcons,
HcalTopologyMode::TriggerMode  tmode = HcalTopologyMode::tm_LHC_PreLS1 
)

Definition at line 16 of file HcalTopology.cc.

References gather_cfg::cout, dPhiTable, dPhiTableHF, eta, etaBinsHB_, etaBinsHE_, etaHE2HF_, etaHF2HE_, etaMax(), etaTable, etaTableHF, firstHBRing_, firstHEDoublePhiRing_, firstHEQuadPhiRing_, firstHERing_, firstHETripleDepthRing_, firstHFQuadPhiRing_, firstHFRing_, firstHORing_, HcalDDDRecConstants::getDepth(), HcalDDDRecConstants::getEtaBins(), HcalDDDRecConstants::getEtaRange(), HcalDDDRecConstants::getEtaTable(), HcalDDDRecConstants::getEtaTableHF(), HcalDDDRecConstants::getMaxDepth(), HcalDDDRecConstants::getNEta(), HcalDDDRecConstants::getPhiOffs(), HcalDDDRecConstants::getPhiTable(), HcalDDDRecConstants::getPhiTableHF(), HcalDDDRecConstants::getTopoMode(), HBSize_, hcons_, HESize_, HFSize_, HOSize_, HTSize_, i, relval_steps::k, kHBSizePreLS1, kHESizePreLS1, kHFSizePreLS1, kHOSizePreLS1, kHTSizePreLS1, lastHBRing_, lastHERing_, lastHFRing_, lastHORing_, HcalTopologyMode::LHC, M_PI, maxDepthHB_, maxDepthHE_, maxDepthHF_, maxEta_, mode_, HLT_25ns14e33_v1_cff::nEta, nEtaHB_, nEtaHE_, numberOfShapes_, phioff, relativeConstraints::ring, setDepthSegmentation(), HcalTopologyMode::SLHC, topoVersion_, csvLumiCalc::unit, unitPhi, unitPhiHF, and units().

Referenced by HcalTopologyIdealEP::produce().

16  :
17  hcons_(hcons),
18  excludeHB_(false), excludeHE_(false), excludeHO_(false), excludeHF_(false),
19  triggerMode_(tmode),
20  firstHBRing_(1),
21  firstHERing_(999), lastHERing_(0),
22  firstHFRing_(29), lastHFRing_(41),
23  firstHORing_(1), lastHORing_(15),
27 
34  nEtaHB_ = (int)(etaBinsHB_.size());
36  for (int i = 0; i < (int)(etaBinsHE_.size()); ++i) {
37  if (firstHERing_ > etaBinsHE_[i].ieta) firstHERing_ = etaBinsHE_[i].ieta;
38  if (lastHERing_ < etaBinsHE_[i].ieta) lastHERing_ = etaBinsHE_[i].ieta;
39  int unit = (int)((etaBinsHE_[i].dphi+0.01)/(5.0*CLHEP::deg));
40  if (unit == 2 && firstHEDoublePhiRing_ > etaBinsHE_[i].ieta)
42  if (unit == 4 && firstHEQuadPhiRing_ > etaBinsHE_[i].ieta)
44  if (etaBinsHE_[i].layer.size() > 2 && firstHETripleDepthRing_ > etaBinsHE_[i].ieta)
46  }
49  topoVersion_=0; //DL
50  HBSize_ = kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal
51  HESize_ = kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal
52  HOSize_ = kHOSizePreLS1; // ieta * iphi * 2
53  HFSize_ = kHFSizePreLS1; // phi * eta * depth * pm
55  numberOfShapes_ = 87;
56  } else if (mode_==HcalTopologyMode::SLHC) { // need to know more eventually
57  topoVersion_=10;
58  HBSize_ = nEtaHB_*72*maxDepthHB_*2;
60  HOSize_ = (lastHORing_-firstHORing_+1)*72*2; // ieta * iphi * 2
61  HFSize_ = (lastHFRing_-firstHFRing_+1)*72*maxDepthHF_*2; // ieta * iphi * depth * 2
62  HTSize_ = kHTSizePreLS1; //no clue!
63  numberOfShapes_ = 500;
64  }
66 #ifdef DebugLog
67  std::cout << "Topo sizes " << HBSize_ << ":" << HESize_ << ":" << HOSize_
68  << ":" << HFSize_ << " for mode " << mode_ << std::endl;
69 #endif
70 
71  //The transition between HE/HF in eta
77  std::pair<int,int> ietaHF = hcons_->getEtaRange(2);
78  double eta = etaBinsHE_[etaBinsHE_.size()-1].etaMax;
80  for (unsigned int i=1; i<etaTableHF.size(); ++i) {
81  if (eta < etaTableHF[i]) {
82  etaHE2HF_ = ietaHF.first + i - 1;
83  break;
84  }
85  }
86  eta = etaTableHF[0];
88  for (unsigned int i=0; i<etaBinsHE_.size(); ++i) {
89  if (eta < etaBinsHE_[i].etaMax) {
90  etaHF2HE_ = etaBinsHE_[i].ieta;
91  break;
92  }
93  }
94  const double fiveDegInRad = 2*M_PI/72;
95  for (unsigned int k=0; k<dPhiTable.size(); ++k) {
96  int units = (int)(dPhiTable[k]/fiveDegInRad+0.5);
97  unitPhi.push_back(units);
98  }
99  for (unsigned int k=0; k<dPhiTableHF.size(); ++k) {
100  int units = (int)(dPhiTableHF[k]/fiveDegInRad+0.5);
101  unitPhiHF.push_back(units);
102  }
103  int nEta = hcons_->getNEta();
104  for (int ring=1; ring<=nEta; ++ring) {
105  std::vector<int> segmentation = hcons_->getDepth(ring-1);
106  setDepthSegmentation(ring,segmentation);
107 #ifdef DebugLog
108  std::cout << "Set segmentation for ring " << ring << " with "
109  << segmentation.size() << " elements:";
110  for (unsigned int k=0; k<segmentation.size(); ++k)
111  std::cout << " " << segmentation[k];
112  std::cout << std::endl;
113 #endif
114  }
115 
116 #ifdef DebugLog
117  std::cout << "Constants in HcalTopology " << firstHBRing_ << ":"
118  << lastHBRing_ << " " << firstHERing_ << ":" << lastHERing_ << ":"
119  << firstHEDoublePhiRing_ << ":" << firstHEQuadPhiRing_ << ":"
120  << firstHETripleDepthRing_ << " " << firstHFRing_ << ":"
121  << lastHFRing_ << ":" << firstHFQuadPhiRing_ << " " << firstHORing_
122  << ":" << lastHORing_ << " " << maxDepthHB_ << ":" << maxDepthHE_
123  << " " << nEtaHB_ << ":" << nEtaHE_ << " " << etaHE2HF_ << ":"
124  << etaHF2HE_ << std::endl;
125 #endif
126 }
std::vector< int > unitPhiHF
Definition: HcalTopology.h:193
int i
Definition: DBlmapReader.cc:9
unsigned int numberOfShapes_
Definition: HcalTopology.h:189
std::vector< double > dPhiTableHF
Definition: HcalTopology.h:191
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHB_
Definition: HcalTopology.h:173
std::vector< int > unitPhi
Definition: HcalTopology.h:193
const std::vector< double > & getEtaTableHF() const
HcalTopologyMode::TriggerMode triggerMode_
Definition: HcalTopology.h:166
unsigned int HESize_
Definition: HcalTopology.h:184
unsigned int HTSize_
Definition: HcalTopology.h:187
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHE_
Definition: HcalTopology.h:173
const std::vector< double > & getPhiOffs() const
int getMaxDepth(const int type) const
unsigned int HFSize_
Definition: HcalTopology.h:186
string unit
Definition: csvLumiCalc.py:46
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:165
void setDepthSegmentation(unsigned ring, const std::vector< int > &readoutDepths)
unsigned int HBSize_
Definition: HcalTopology.h:183
std::vector< double > etaTableHF
Definition: HcalTopology.h:191
unsigned int HOSize_
Definition: HcalTopology.h:185
std::vector< double > etaTable
Definition: HcalTopology.h:191
#define M_PI
int firstHEQuadPhiRing_
Definition: HcalTopology.h:176
std::vector< double > phioff
Definition: HcalTopology.h:192
const std::vector< double > & getPhiTable() const
const std::vector< double > & getEtaTable() const
std::pair< int, int > getEtaRange(const int i) const
const std::vector< int > & getDepth(const unsigned int i) const
std::vector< double > dPhiTable
Definition: HcalTopology.h:191
TString units(TString variable, Char_t axis)
const std::vector< double > & getPhiTableHF() const
int firstHETripleDepthRing_
Definition: HcalTopology.h:177
tuple cout
Definition: gather_cfg.py:121
double etaMax(HcalSubdetector subdet) const
int firstHEDoublePhiRing_
Definition: HcalTopology.h:176
const HcalDDDRecConstants * hcons_
Definition: HcalTopology.h:161
int firstHFQuadPhiRing_
Definition: HcalTopology.h:176
std::vector< HcalEtaBin > getEtaBins(const int itype) const
HcalTopology::HcalTopology ( HcalTopologyMode::Mode  mode,
int  maxDepthHB,
int  maxDepthHE,
HcalTopologyMode::TriggerMode  tmode = HcalTopologyMode::tm_LHC_PreLS1 
)

Definition at line 128 of file HcalTopology.cc.

References firstHBRing_, firstHERing_, HBSize_, HESize_, HFSize_, HOSize_, HTSize_, kHBSizePreLS1, kHESizePreLS1, kHFSizePreLS1, kHOSizePreLS1, kHTSizePreLS1, lastHBRing_, lastHERing_, HcalTopologyMode::LHC, maxDepthHF_, mode_, nEtaHB_, nEtaHE_, HcalTopologyMode::SLHC, and topoVersion_.

128  :
129  hcons_(0),
130  excludeHB_(false), excludeHE_(false), excludeHO_(false), excludeHF_(false),
131  mode_(mode), triggerMode_(tmode),
132  firstHBRing_(1), lastHBRing_(16),
133  firstHERing_(16), lastHERing_(29),
134  firstHFRing_(29), lastHFRing_(41),
135  firstHORing_(1), lastHORing_(15),
141  etaHE2HF_(30), etaHF2HE_(29),
147  numberOfShapes_(( mode==HcalTopologyMode::SLHC ) ? 500 : 87 ) {
148 
150  topoVersion_=0; //DL
151  HBSize_= kHBSizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/barrel * barrel/hcal
152  HESize_= kHESizePreLS1; // qie-per-fiber * fiber/rm * rm/rbx * rbx/endcap * endcap/hcal
153  HOSize_= kHOSizePreLS1; // ieta * iphi * 2
154  HFSize_= kHFSizePreLS1; // phi * eta * depth * pm
156  } else if (mode_==HcalTopologyMode::SLHC) { // need to know more eventually
157  HBSize_= maxDepthHB*16*72*2;
158  HESize_= maxDepthHE*(29-16+1)*72*2;
159  HOSize_= 15*72*2; // ieta * iphi * 2
160  HFSize_= 72*13*maxDepthHF_*2; // phi * eta * depth * pm
161  HTSize_= kHTSizePreLS1; //no clue!
162  topoVersion_=10;
163  }
166 
167  edm::LogWarning("CaloTopology") << "This is an incomplete constructor of HcalTopology - be warned that many functionalities will not be there - revert from this - get from EventSetup";
168 
169 }
unsigned int numberOfShapes_
Definition: HcalTopology.h:189
int maxDepthHE() const
Definition: HcalTopology.h:129
HcalTopologyMode::TriggerMode triggerMode_
Definition: HcalTopology.h:166
unsigned int HESize_
Definition: HcalTopology.h:184
unsigned int HTSize_
Definition: HcalTopology.h:187
HcalTopologyMode::Mode mode() const
Definition: HcalTopology.h:32
unsigned int HFSize_
Definition: HcalTopology.h:186
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:165
unsigned int HBSize_
Definition: HcalTopology.h:183
unsigned int HOSize_
Definition: HcalTopology.h:185
int firstHEQuadPhiRing_
Definition: HcalTopology.h:176
int maxDepthHB() const
Definition: HcalTopology.h:128
int firstHETripleDepthRing_
Definition: HcalTopology.h:177
int firstHEDoublePhiRing_
Definition: HcalTopology.h:176
const HcalDDDRecConstants * hcons_
Definition: HcalTopology.h:161
int firstHFQuadPhiRing_
Definition: HcalTopology.h:176

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 538 of file HcalTopology.cc.

References HLT_25ns14e33_v1_cff::depth, etaHF2HE_, firstHEDoublePhiRing(), firstHEQuadPhiRing(), firstHERing(), firstHFQuadPhiRing(), firstHFRing(), HcalBarrel, HcalEndcap, IPHI_MAX, gen::n, valid(), and ecaldqm::zside().

Referenced by decIEta(), and incIEta().

538  {
539  int n=1;
540  int aieta=id.ietaAbs();
541 
542  if (aieta==firstHEDoublePhiRing()) {
543  n=2;
544  neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth());
545  neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi()+1,id.depth());
546  } else if (aieta==firstHFQuadPhiRing()) {
547  n=2;
548  neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth());
549  if (id.iphi()==IPHI_MAX-1) neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),1,id.depth());
550  else neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi()+2,id.depth());
551  } else if (aieta==firstHEQuadPhiRing()) {
552  n=2;
553  neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth());
554  if (id.iphi()==IPHI_MAX-1) neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),1,id.depth());
555  else neighbors[1]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi()+2,id.depth());
556  } else if (aieta==1) {
557  neighbors[0]=HcalDetId(id.subdet(),-aieta*id.zside(),id.iphi(),id.depth());
558  } else if (aieta==firstHERing()) {
559  neighbors[0]=HcalDetId(HcalBarrel,(aieta-1)*id.zside(),id.iphi(),1);
560  } else if (aieta==firstHFRing()) {
561  neighbors[0]=HcalDetId(HcalEndcap,etaHF2HE_*id.zside(),id.iphi(),1);
562  } else
563  neighbors[0]=HcalDetId(id.subdet(),(aieta-1)*id.zside(),id.iphi(),id.depth());
564 
565  if (!valid(neighbors[0]) && n==2) {
566  if (!valid(neighbors[1])) n=0;
567  else {
568  n=1;
569  neighbors[0]=neighbors[1];
570  }
571  }
572  if (n==2 && !valid(neighbors[1])) n=1;
573  if (n==1 && !valid(neighbors[0])) n=0;
574 
575  return n;
576 }
int firstHFRing() const
Definition: HcalTopology.h:87
int zside(DetId const &)
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:92
int firstHERing() const
Definition: HcalTopology.h:85
virtual bool valid(const DetId &id) const
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:94
int firstHEQuadPhiRing() const
Definition: HcalTopology.h:93
static const int IPHI_MAX
Definition: HcalTopology.cc:13
int HcalTopology::decIEta ( const HcalDetId id,
HcalDetId  neighbors[2] 
) const

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

Definition at line 510 of file HcalTopology.cc.

References decAIEta(), incAIEta(), and ecaldqm::zside().

Referenced by east().

510  {
511  if (id.zside()==1) return decAIEta(id,neighbors);
512  else return incAIEta(id,neighbors);
513 }
int zside(DetId const &)
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 469 of file HcalTopology.cc.

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

Referenced by south().

469  {
470  bool ok=valid(id);
471  if (ok) {
472  switch (id.subdet()) {
473  case (HcalBarrel):
474  case (HcalOuter):
475  if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX,id.depth());
476  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-1,id.depth());
477  break;
478  case (HcalEndcap):
479  if (id.ietaAbs()>=firstHEQuadPhiRing()) {
480  if (id.iphi()==3) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth());
481  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-4,id.depth());
482  } else if (id.ietaAbs()>=firstHEDoublePhiRing()) {
483  if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth());
484  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-2,id.depth());
485  } else {
486  if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX,id.depth());
487  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-1,id.depth());
488  }
489  break;
490  case (HcalForward):
491  if (id.ietaAbs()>=firstHFQuadPhiRing()) {
492  if (id.iphi()==3) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth());
493  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-4,id.depth());
494  } else {
495  if (id.iphi()==1) neighbor=HcalDetId(id.subdet(),id.ieta(),IPHI_MAX-1,id.depth());
496  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()-2,id.depth());
497  }
498  break;
499  default: ok=false;
500  }
501  }
502  return ok;
503 }
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:92
virtual bool valid(const DetId &id) const
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:94
int firstHEQuadPhiRing() const
Definition: HcalTopology.h:93
static const int IPHI_MAX
Definition: HcalTopology.cc:13
bool HcalTopology::decrementDepth ( HcalDetId id) const

Get the detector in front of this one

Definition at line 674 of file HcalTopology.cc.

References HcalDetId::depth(), HLT_25ns14e33_v1_cff::depth, depthBinInformation(), etaBinsHB_, etaBinsHE_, etaHF2HE_, etaRing(), firstHERing(), firstHFRing(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, i, HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), lastHERing(), mode_, nEtaHB_, HcalTopologyMode::SLHC, HcalDetId::subdet(), and validRaw().

Referenced by down().

674  {
675  HcalSubdetector subdet = detId.subdet();
676  int ieta = detId.ieta();
677  int etaRing = detId.ietaAbs();
678  int depth = detId.depth();
679  int nDepthBins, startingBin;
680  depthBinInformation(subdet, etaRing, nDepthBins, startingBin);
681 
682  // see if the new depth bin exists
683  --depth;
684  if ((subdet == HcalOuter) ||
685  (subdet == HcalEndcap && etaRing == firstHERing())) {
686  subdet = HcalBarrel;
687  for (int i=0; i<nEtaHB_; ++i) {
688  if (etaRing == etaBinsHB_[i].ieta) {
689  depth = etaBinsHB_[i].depthStart+etaBinsHB_[i].layer.size()-1;
690  break;
691  }
692  }
693  } else if (subdet == HcalEndcap && etaRing == lastHERing() && depth == 2 &&
695  (ieta > 0) ? --ieta : ++ieta;
696  } else if (depth <= 0) {
697  if (subdet == HcalForward && etaRing == firstHFRing()) {
698  // overlap
699  subdet = HcalEndcap;
700  etaRing= etaHF2HE_;
701  ieta = (ieta > 0) ? etaRing : -etaRing;
702  for (unsigned int i=0; i<etaBinsHE_.size(); ++i) {
703  if (etaRing == etaBinsHE_[i].ieta) {
704  depth = etaBinsHE_[i].depthStart+etaBinsHE_[i].layer.size()-1;
705  break;
706  }
707  }
708  } else {
709  // no more chances
710  detId = HcalDetId();
711  return false;
712  }
713  }
714  detId = HcalDetId(subdet, ieta, detId.iphi(), depth);
715  return validRaw(detId);
716 }
int firstHFRing() const
Definition: HcalTopology.h:87
int i
Definition: DBlmapReader.cc:9
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHB_
Definition: HcalTopology.h:173
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHE_
Definition: HcalTopology.h:173
bool validRaw(const HcalDetId &id) const
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:165
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
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 firstHERing() const
Definition: HcalTopology.h:85
int lastHERing() const
Definition: HcalTopology.h:86
DetId HcalTopology::denseId2detId ( unsigned int  denseid) const
virtual

return a linear packed id

Reimplemented from CaloSubdetectorTopology.

Definition at line 1068 of file HcalTopology.cc.

References gather_cfg::cout, TauDecayModes::dec, firstHBRing(), firstHERing(), HBSize_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HESize_, HOSize_, recoMuon::in, kHBhalf, kHEhalf, kHFhalf, kHOhalf, kSizeForDenseIndexingPreLS1, lastHBRing(), lastHERing(), maxDepthHB_, maxDepthHE_, maxDepthHF_, ncells(), nEtaHB_, nEtaHE_, sd, and topoVersion_.

Referenced by HcalGeometry::localCorners().

1068  {
1069 
1071  int ie ( 0 ) ;
1072  int ip ( 0 ) ;
1073  int dp ( 0 ) ;
1074  int in ( denseid ) ;
1075  int iz ( 1 ) ;
1076  if (topoVersion_==0) { //DL// pre-LS1
1077  if (denseid < kSizeForDenseIndexingPreLS1) {
1078  if ( in > 2*( kHBhalf + kHEhalf + kHOhalf ) - 1 ) { // HF
1079  sd = HcalForward ;
1080  in -= 2*( kHBhalf + kHEhalf + kHOhalf ) ;
1081  iz = ( in<kHFhalf ? 1 : -1 ) ;
1082  in %= kHFhalf ;
1083  ip = 4*( in/48 ) ;
1084  in %= 48 ;
1085  ip += 1 + ( in>21 ? 2 : 0 ) ;
1086  if( 3 == ip%4 ) in -= 22 ;
1087  ie = 29 + in/2 ;
1088  dp = 1 + in%2 ;
1089  } else if ( in > 2*( kHBhalf + kHEhalf ) - 1 ) { // HO
1090  sd = HcalOuter ;
1091  in -= 2*( kHBhalf + kHEhalf ) ;
1092  iz = ( in<kHOhalf ? 1 : -1 ) ;
1093  in %= kHOhalf ;
1094  dp = 4 ;
1095  ip = 1 + in/15 ;
1096  ie = 1 + ( in - 15*( ip - 1 ) ) ;
1097  } else if ( in > 2*kHBhalf - 1 ) { // Endcap
1098  sd = HcalEndcap ;
1099  in -= 2*kHBhalf ;
1100  iz = ( in<kHEhalf ? 1 : -1 ) ;
1101  in %= kHEhalf ;
1102  ip = 2*( in/36 ) ;
1103  in %= 36 ;
1104  ip += 1 + in/28 ;
1105  if( 0 == ip%2 ) in %= 28 ;
1106  ie = 15 + ( in<2 ? 1 + in : 2 +
1107  ( in<20 ? 1 + ( in - 2 )/2 : 9 +
1108  ( in<26 ? 1 + ( in - 20 )/3 : 3 ) ) ) ;
1109  dp = ( in<1 ? 3 :
1110  ( in<2 ? 1 :
1111  ( in<20 ? 1 + ( in - 2 )%2 :
1112  ( in<26 ? 1 + ( in - 20 )%3 :
1113  ( 1 + ( in - 26 )%2 ) ) ) ) ) ;
1114  } else { // barrel
1115  iz = ( in<kHBhalf ? 1 : -1 ) ;
1116  in %= kHBhalf ;
1117  ip = in/18 + 1 ;
1118  in %= 18 ;
1119  if ( in < 14 ) {
1120  dp = 1 ;
1121  ie = in + 1 ;
1122  } else {
1123  in %= 14 ;
1124  dp = 1 + in%2 ;
1125  ie = 15 + in/2 ;
1126  }
1127  }
1128  }
1129  } else if (topoVersion_==10) {
1130  if (denseid < ncells()) {
1131  if (denseid >= (HBSize_+HESize_+HOSize_)) {
1132  sd = HcalForward ;
1133  in -= (HBSize_+HESize_+HOSize_);
1134  dp = (in%maxDepthHF_) + 1;
1135  ip = (in - dp + 1)%(maxDepthHF_*72);
1136  ip = (ip/maxDepthHF_) + 1;
1137  ie = (in - dp + 1 - maxDepthHF_*(ip -1))/(72*maxDepthHF_);
1138  if (ie > 12) {ie = 54 -ie; iz = -1;}
1139  else {ie += 29; iz = 1;}
1140  } else if (denseid >= (HBSize_+HESize_)) {
1141  sd = HcalOuter ;
1142  in -= (HBSize_+HESize_);
1143  dp = 4;
1144  ip = (in%72) + 1;
1145  ie = (in - ip + 1)/72;
1146  if (ie > 14) {ie = 30 -ie; iz = -1;}
1147  else {ie += 1; iz = 1;}
1148  } else if (denseid >= (HBSize_)) {
1149  sd = HcalEndcap ;
1150  in -= (HBSize_);
1151  dp = (in%maxDepthHE_)+1;
1152  ip = (in - dp + 1)%(maxDepthHE_*72);
1153  ip = (ip/maxDepthHE_) + 1;
1154  ie = (in - dp + 1 - maxDepthHE_*(ip-1))/(72*maxDepthHE_);
1155  if (ie >= nEtaHE_) {ie = lastHERing()+nEtaHE_ - ie; iz = -1;}
1156  else {ie = firstHERing() + ie; iz = 1;}
1157  } else {
1158  sd = HcalBarrel ;
1159  dp = (in%maxDepthHB_)+1;
1160  ip = (in - dp + 1)%(maxDepthHB_*72);
1161  ip = (ip/maxDepthHB_) + 1;
1162  ie = (in - dp + 1 - maxDepthHB_*(ip-1))/(72*maxDepthHB_);
1163  if (ie >= nEtaHB_) {ie = lastHBRing()+nEtaHB_ - ie; iz = -1;}
1164  else {ie = firstHBRing() + ie; iz = 1;}
1165  }
1166  }
1167  }
1168 #ifdef DebugLog
1169  std::cout << "Dens2Det " << topoVersion_ << " i/p " << std::hex << denseid << std::dec << " : " << HcalDetId(sd,iz*int(ie),ip,dp) << std::endl;
1170 #endif
1171  return HcalDetId( sd, iz*int(ie), ip, dp );
1172 }
int firstHBRing() const
Definition: HcalTopology.h:83
unsigned int HESize_
Definition: HcalTopology.h:184
int lastHBRing() const
Definition: HcalTopology.h:84
HcalSubdetector
Definition: HcalAssistant.h:31
unsigned int HBSize_
Definition: HcalTopology.h:183
unsigned int HOSize_
Definition: HcalTopology.h:185
double sd
int firstHERing() const
Definition: HcalTopology.h:85
tuple cout
Definition: gather_cfg.py:121
virtual unsigned int ncells() const
return a count of valid cells (for dense indexing use)
int lastHERing() const
Definition: HcalTopology.h:86
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 579 of file HcalTopology.cc.

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

Referenced by CaloTowerConstituentsMap::constituentsOf(), decrementDepth(), HcalTrigTowerGeometry::detIds(), incrementDepth(), and CaloTowersCreationAlgo::setGeometry().

580  {
581 
582  if(subdet == HcalBarrel) {
584  startingBin = 1;
585  if (etaRing==lastHBRing()) {
586  nDepthBins = 2;
587  } else {
588  nDepthBins = maxDepthHB_;
589  }
590  } else {
591  if (etaRing<=14) {
592  nDepthBins = 1;
593  startingBin = 1;
594  } else {
595  nDepthBins = 2;
596  startingBin = 1;
597  }
598  }
599  } else if(subdet == HcalEndcap) {
601  if (etaRing==firstHERing()) {
602  nDepthBins = maxDepthHE_ - 2;
603  startingBin = 3;
604  } else {
605  nDepthBins = maxDepthHE_;
606  startingBin = 1;
607  }
608  } else {
609  if (etaRing==firstHERing()) {
610  nDepthBins = 1;
611  startingBin = 3;
612  } else if (etaRing==17) {
613  nDepthBins = 1;
614  startingBin = 1;
615  } else if (etaRing==lastHERing()) {
616  nDepthBins = 2;
617  startingBin = 1;
618  } else {
619  nDepthBins = (etaRing >= firstHETripleDepthRing()) ? 3 : 2;
620  startingBin = 1;
621  }
622  }
623  } else if(subdet == HcalForward) {
624  nDepthBins = maxDepthHF_;
625  startingBin = 1;
626  } else if(subdet == HcalOuter) {
627  nDepthBins = 1;
628  startingBin = 4;
629  } else {
630  std::cerr << "Bad HCAL subdetector " << subdet << std::endl;
631  }
632 }
int lastHBRing() const
Definition: HcalTopology.h:84
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:165
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
int firstHETripleDepthRing() const
Definition: HcalTopology.h:95
int firstHERing() const
Definition: HcalTopology.h:85
int lastHERing() const
Definition: HcalTopology.h:86
unsigned int HcalTopology::detId2denseId ( const DetId id) const
virtual

return a linear packed id

Reimplemented from CaloSubdetectorTopology.

Definition at line 1034 of file HcalTopology.cc.

References gather_cfg::cout, TauDecayModes::dec, HcalDetId::depth(), detId2denseIdPreLS1(), firstHBRing(), firstHERing(), HBSize_, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HESize_, HOSize_, HcalDetId::ieta(), HcalDetId::iphi(), lastHBRing(), lastHERing(), maxDepthHB_, maxDepthHE_, maxDepthHF_, nEtaHB_, nEtaHE_, HcalDetId::subdet(), and topoVersion_.

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

1034  {
1035  unsigned int retval(0);
1036  if (topoVersion_==0) { // pre-LS1
1037  retval = detId2denseIdPreLS1(id);
1038  } else if (topoVersion_==10) {
1039  HcalDetId hid(id);
1040  if (hid.subdet()==HcalBarrel) {
1041  retval = (hid.depth()-1)+maxDepthHB_*(hid.iphi()-1);
1042  if (hid.ieta()>0) retval+=maxDepthHB_*72*(hid.ieta()-firstHBRing());
1043  else retval+=maxDepthHB_*72*(hid.ieta()+lastHBRing()+nEtaHB_);
1044  } else if (hid.subdet()==HcalEndcap) {
1045  retval = HBSize_;
1046  retval+= (hid.depth()-1)+maxDepthHE_*(hid.iphi()-1);
1047  if (hid.ieta()>0) retval+=maxDepthHE_*72*(hid.ieta()-firstHERing());
1048  else retval+=maxDepthHE_*72*(hid.ieta()+lastHERing()+nEtaHE_);
1049  } else if (hid.subdet()==HcalOuter) {
1050  retval = HBSize_+HESize_;
1051  if (hid.ieta()>0) retval+=(hid.iphi()-1)+72*(hid.ieta()-1);
1052  else retval+=(hid.iphi()-1)+72*(30+hid.ieta());
1053  } else if (hid.subdet()==HcalForward) {
1054  retval = HBSize_+HESize_+HOSize_;
1055  retval+= (hid.depth()-1)+maxDepthHF_*(hid.iphi()-1);
1056  if (hid.ieta()>0) retval+=maxDepthHF_*72*(hid.ieta()-29);
1057  else retval+=maxDepthHF_*72*((41+13)+hid.ieta());
1058  } else {
1059  return 0xFFFFFFFu;
1060  }
1061  }
1062 #ifdef DebugLog
1063  std::cout << "DetId2Dense " << topoVersion_ << " ID " << HcalDetId(id) << " : " << std::hex << retval << std::dec << std::endl;
1064 #endif
1065  return retval;
1066 }
unsigned int detId2denseIdPreLS1(const DetId &id) const
int firstHBRing() const
Definition: HcalTopology.h:83
unsigned int HESize_
Definition: HcalTopology.h:184
int lastHBRing() const
Definition: HcalTopology.h:84
unsigned int HBSize_
Definition: HcalTopology.h:183
unsigned int HOSize_
Definition: HcalTopology.h:185
int firstHERing() const
Definition: HcalTopology.h:85
tuple cout
Definition: gather_cfg.py:121
int lastHERing() const
Definition: HcalTopology.h:86
unsigned int HcalTopology::detId2denseIdCALIB ( const DetId id) const

return a linear packed id from CALIB

Definition at line 975 of file HcalTopology.cc.

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

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

975  {
976  HcalCalibDetId tid(id);
977  int channel = tid.cboxChannel();
978  int ieta = tid.ieta();
979  int iphi = tid.iphi();
980  int zside = tid.zside();
981  unsigned int index=0xFFFFFFFFu;
982 
983  if (tid.calibFlavor()==HcalCalibDetId::CalibrationBox) {
984 
985  HcalSubdetector subDet = tid.hcalSubdet();
986 
987  if (subDet==HcalBarrel) {
988  //std::cout<<"CALIB_HB: ";
989  //dphi = 4 (18 phi values), 3 channel types (0,1,2), eta = -1 or 1
990  //total of 18*3*2=108 channels
991  index = ((iphi+1)/4-1) + 18*channel + 27*(ieta+1);
992  } else if (subDet==HcalEndcap) {
993  //std::cout<<"CALIB_HE: ";
994  //dphi = 4 (18 phi values), 6 channel types (0,1,3,4,5,6), eta = -1 or 1
995  //total of 18*6*2=216 channels
996  if (channel>2) channel-=1;
997  index = ((iphi+1)/4-1) + 18*channel + 54*(ieta+1) + 108;
998  } else if (subDet==HcalForward) {
999  //std::cout<<"CALIB_HF: ";
1000  //dphi = 18 (4 phi values), 3 channel types (0,1,8), eta = -1 or 1
1001  if (channel==8) channel = 2;
1002  //total channels 4*3*2=24
1003  index = (iphi-1)/18 + 4*channel + 6*(ieta+1) + 324;
1004  } else if (subDet==HcalOuter) {
1005  //std::cout<<"CALIB_HO: ";
1006  //there are 5 special calib crosstalk channels, one in each ring
1007  if (channel==7) {
1008  channel = 2;
1009  index = (ieta+2) + 420;
1010  //for HOM/HOP dphi = 6 (12 phi values), 2 channel types (0,1), eta = -2,-1 or 1,2
1011  //for HO0/YB0 dphi = 12 (6 phi values), 2 channel types (0,1), eta = 0
1012  } else{
1013  if (ieta<0) index = ((iphi+1)/12-1) + 36*channel + 6*(ieta+2) + 348;
1014  else if (ieta>0) index = ((iphi+1)/12-1) + 36*channel + 6*(ieta+2) + 6 + 348;
1015  else index = ((iphi+1)/6-1) + 36*channel + 6*(ieta+2) + 348;
1016  }
1017  } else {
1018  edm::LogWarning("CaloTopology") << "HCAL Det Id not valid!";
1019  index = 0;
1020  }
1021 
1022  } else if (tid.calibFlavor()==HcalCalibDetId::HOCrosstalk) {
1023  //std::cout<<"HX: ";
1024  //for YB0/HO0 phi is grouped in 6 groups of 6 with dphi=2 but the transitions are 1 or 3
1025  // in such a way that the %36 operation yeilds unique values for every iphi
1026  if (abs(ieta)==4) index = ((iphi-1)%36) + (((zside+1)*36)/2) + 72 + 425; //ieta = 1 YB0/HO0;
1027  else index = (iphi-1) + (36*(zside+1)*2) + 425; //ieta = 0 for HO2M/HO1M ieta=2 for HO1P/HO2P;
1028  }
1029  //std::cout << " " << ieta << " " << zside << " " << iphi << " " << depth << " " << index << std::endl;
1030  return index;
1031 }
int zside(DetId const &)
HcalSubdetector
Definition: HcalAssistant.h:31
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int HcalTopology::detId2denseIdHB ( const DetId id) const

return a linear packed id from HB

Definition at line 886 of file HcalTopology.cc.

References HcalDetId::depth(), firstHBRing(), HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), kHBhalf, lastHBRing(), maxDepthHB_, nEtaHB_, topoVersion_, and HcalDetId::zside().

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

886  {
887  HcalDetId hid(id);
888  const int ip (hid.iphi() ) ;
889  const int ie (hid.ietaAbs() ) ;
890  const int dp (hid.depth() ) ;
891  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
892  unsigned int retval = 0xFFFFFFFFu;
893  if (topoVersion_==0) {
894  retval=( ip - 1 )*18 + dp - 1 + ie - ( ie<16 ? 1 : 0 ) + zn*kHBhalf;
895  } else if (topoVersion_==10) {
896  retval=(dp-1)+maxDepthHB_*(ip-1);
897  if (hid.ieta()>0) retval+=maxDepthHB_*72*(hid.ieta()-firstHBRing());
898  else retval+=maxDepthHB_*72*(hid.ieta()+lastHBRing()+nEtaHB_);
899  }
900  return retval;
901 }
int firstHBRing() const
Definition: HcalTopology.h:83
int lastHBRing() const
Definition: HcalTopology.h:84
unsigned int HcalTopology::detId2denseIdHE ( const DetId id) const

return a linear packed id from HE

Definition at line 903 of file HcalTopology.cc.

References HcalDetId::depth(), firstHERing(), HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), kHEhalf, lastHERing(), maxDepthHE_, nEtaHE_, topoVersion_, and HcalDetId::zside().

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

903  {
904  HcalDetId hid(id);
905  const int ip (hid.iphi() ) ;
906  const int ie (hid.ietaAbs() ) ;
907  const int dp (hid.depth() ) ;
908  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
909  unsigned int retval = 0xFFFFFFFFu;
910  if (topoVersion_==0) {
911  retval=( ip - 1 )*8 + ( ip/2 )*20 +
912  ( ( ie==16 || ie==17 ) ? ie - 16 :
913  ( ( ie>=18 && ie<=20 ) ? 2 + 2*( ie - 18 ) + dp - 1 :
914  ( ( ie>=21 && ie<=26 ) ? 8 + 2*( ie - 21 ) + dp - 1 :
915  ( ( ie>=27 && ie<=28 ) ? 20 + 3*( ie - 27 ) + dp - 1 :
916  26 + 2*( ie - 29 ) + dp - 1 ) ) ) ) + zn*kHEhalf;
917  } else if (topoVersion_==10) {
918  retval=(dp-1)+maxDepthHE_*(ip-1);
919  if (hid.ieta()>0) retval+=maxDepthHE_*72*(hid.ieta()-firstHERing());
920  else retval+=maxDepthHE_*72*(hid.ieta()+lastHERing()+nEtaHE_);
921  }
922  return retval;
923 }
int firstHERing() const
Definition: HcalTopology.h:85
int lastHERing() const
Definition: HcalTopology.h:86
unsigned int HcalTopology::detId2denseIdHF ( const DetId id) const

return a linear packed id from HF

Definition at line 941 of file HcalTopology.cc.

References HcalDetId::depth(), HcalDetId::ieta(), HcalDetId::ietaAbs(), HcalDetId::iphi(), kHFhalf, maxDepthHF_, topoVersion_, and HcalDetId::zside().

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

941  {
942  HcalDetId hid(id);
943  const int ip (hid.iphi() ) ;
944  const int ie (hid.ietaAbs() ) ;
945  const int dp (hid.depth() ) ;
946  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
947 
948  unsigned int retval = 0xFFFFFFFFu;
949  if (topoVersion_==0) {
950  retval = ( ( ip - 1 )/4 )*4 + ( ( ip - 1 )/2 )*22 +
951  2*( ie - 29 ) + ( dp - 1 ) + zn*kHFhalf;
952  } else if (topoVersion_==10) {
953  retval=dp-1+2*(ip-1);
954  if (hid.ieta()>0) retval+=maxDepthHF_*72*(hid.ieta()-29);
955  else retval+=maxDepthHF_*72*((41+13)+hid.ieta());
956  }
957  return retval;
958 }
unsigned int HcalTopology::detId2denseIdHO ( const DetId id) const

return a linear packed id from HO

Definition at line 925 of file HcalTopology.cc.

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

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

925  {
926  HcalDetId hid(id);
927  const int ip (hid.iphi() ) ;
928  const int ie (hid.ietaAbs() ) ;
929  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
930 
931  unsigned int retval = 0xFFFFFFFFu;
932  if (topoVersion_==0) {
933  retval=( ip - 1 )*15 + ( ie - 1 ) + zn*kHOhalf;
934  } else if (topoVersion_==10) {
935  if (hid.ieta()>0) retval=(ip-1)+72*(hid.ieta()-1);
936  else retval=(ip-1)+72*(30+hid.ieta());
937  }
938  return retval;
939 }
unsigned int HcalTopology::detId2denseIdHT ( const DetId id) const

return a linear packed id from HT

Definition at line 960 of file HcalTopology.cc.

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

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

960  {
961  HcalTrigTowerDetId tid(id);
962  int zside = tid.zside();
963  unsigned int ietaAbs = tid.ietaAbs();
964  unsigned int iphi = tid.iphi();
965 
966  unsigned int index;
967  if ((iphi-1)%4==0) index = (iphi-1)*32 + (ietaAbs-1) - (12*((iphi-1)/4));
968  else index = (iphi-1)*28 + (ietaAbs-1) + (4*(((iphi-1)/4)+1));
969 
970  if (zside == -1) index += kHThalf;
971 
972  return index;
973 }
int zside(DetId const &)
unsigned int HcalTopology::detId2denseIdPreLS1 ( const DetId id) const
private

Definition at line 859 of file HcalTopology.cc.

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

Referenced by detId2denseId().

859  {
860 
861  HcalDetId hid(id);
862  const HcalSubdetector sd (hid.subdet() ) ;
863  const int ip (hid.iphi() ) ;
864  const int ie (hid.ietaAbs() ) ;
865  const int dp (hid.depth() ) ;
866  const int zn (hid.zside() < 0 ? 1 : 0 ) ;
867  unsigned int retval = ( ( sd == HcalBarrel ) ?
868  ( ip - 1 )*18 + dp - 1 + ie - ( ie<16 ? 1 : 0 ) + zn*kHBhalf :
869  ( ( sd == HcalEndcap ) ?
870  2*kHBhalf + ( ip - 1 )*8 + ( ip/2 )*20 +
871  ( ( ie==16 || ie==17 ) ? ie - 16 :
872  ( ( ie>=18 && ie<=20 ) ? 2 + 2*( ie - 18 ) + dp - 1 :
873  ( ( ie>=21 && ie<=26 ) ? 8 + 2*( ie - 21 ) + dp - 1 :
874  ( ( ie>=27 && ie<=28 ) ? 20 + 3*( ie - 27 ) + dp - 1 :
875  26 + 2*( ie - 29 ) + dp - 1 ) ) ) ) + zn*kHEhalf :
876  ( ( sd == HcalOuter ) ?
877  2*kHBhalf + 2*kHEhalf + ( ip - 1 )*15 + ( ie - 1 ) + zn*kHOhalf :
878  ( ( sd == HcalForward ) ?
879  2*kHBhalf + 2*kHEhalf + 2*kHOhalf +
880  ( ( ip - 1 )/4 )*4 + ( ( ip - 1 )/2 )*22 +
881  2*( ie - 29 ) + ( dp - 1 ) + zn*kHFhalf : 0xFFFFFFFFu ) ) ) ) ;
882  return retval;
883 }
HcalSubdetector
Definition: HcalAssistant.h:31
double sd
int HcalTopology::doublePhiBins ( ) const
inline

Definition at line 97 of file HcalTopology.h.

References doublePhiBins_.

97 {return doublePhiBins_;}
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 267 of file HcalTopology.cc.

References decrementDepth().

267  {
268  HcalDetId neighbor = id;
269  std::vector<DetId> vNeighborsDetId;
270  if (decrementDepth(neighbor)) {
271  vNeighborsDetId.push_back(neighbor);
272  }
273  return vNeighborsDetId;
274 }
bool decrementDepth(HcalDetId &id) const
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 226 of file HcalTopology.cc.

References decIEta(), and i.

Referenced by spr::newHCALIdEW().

226  {
227  std::vector<DetId> vNeighborsDetId;
228  HcalDetId neighbors[2];
229  for (int i=0;i<decIEta(HcalDetId(id),neighbors);i++)
230  vNeighborsDetId.push_back(DetId(neighbors[i].rawId()));
231  return vNeighborsDetId;
232 }
int i
Definition: DBlmapReader.cc:9
int decIEta(const HcalDetId &id, HcalDetId neighbors[2]) const
Definition: DetId.h:18
double HcalTopology::etaMax ( HcalSubdetector  subdet) const

Definition at line 827 of file HcalTopology.cc.

References eta, etaTable, etaTableHF, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, lastHBRing_, lastHERing_, lastHORing_, and nEtaHE_.

Referenced by HcalGeometry::getCells(), HcalGeometry::getClosestCell(), and HcalTopology().

827  {
828  double eta(0);
829  switch (subdet) {
830  case(HcalBarrel):
831  if (lastHBRing_ < (int)(etaTable.size())) eta=etaTable[lastHBRing_]; break;
832  case(HcalEndcap):
833  if (lastHERing_ < (int)(etaTable.size()) && nEtaHE_ > 0) eta=etaTable[lastHERing_]; break;
834  case(HcalOuter):
835  if (lastHORing_ < (int)(etaTable.size())) eta=etaTable[lastHORing_]; break;
836  case(HcalForward):
837  if (etaTableHF.size() > 0) eta=etaTableHF[etaTableHF.size()-1]; break;
838  default: eta=0;
839  }
840  return eta;
841 }
std::vector< double > etaTableHF
Definition: HcalTopology.h:191
std::vector< double > etaTable
Definition: HcalTopology.h:191
std::pair< double, double > HcalTopology::etaRange ( HcalSubdetector  subdet,
int  ieta 
) const

Definition at line 842 of file HcalTopology.cc.

References etaTable, etaTableHF, firstHFRing_, HcalForward, cuy::ii, lastHERing_, HcalTopologyMode::LHC, and mode_.

Referenced by HcalHF_PETalgorithm::HFSetFlagFromPET(), HcalHFStatusBitFromRecHits::hfSetFlagFromRecHits(), HcalHF_S9S1algorithm::HFSetFlagFromS9S1(), HcalBeamMonitor::processEvent(), HcalRecHitMonitor::processEvent_rechit(), HcalHotCellMonitor::processEvent_rechitenergy(), HcalHotCellMonitor::processHit_rechitNeighbors(), HcalTrigTowerGeometry::towerEtaBounds(), and HcaluLUTTPGCoder::update().

843  {
844  int ieta = (keta > 0) ? keta : -keta;
845  if (subdet == HcalForward) {
846  if (ieta >= firstHFRing_) {
847  unsigned int ii = (unsigned int)(ieta-firstHFRing_);
848  if (ii+1 < etaTableHF.size())
849  return std::pair<double,double>(etaTableHF[ii],etaTableHF[ii+1]);
850  }
851  } else {
852  int ietal = (mode_==HcalTopologyMode::LHC && ieta == lastHERing_-1) ? (ieta+1) : ieta;
853  if ((ietal < (int)(etaTable.size())) && (ieta > 0))
854  return std::pair<double,double>(etaTable[ieta-1],etaTable[ietal]);
855  }
856  return std::pair<double,double>(0,0);
857 }
int ii
Definition: cuy.py:588
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:165
std::vector< double > etaTableHF
Definition: HcalTopology.h:191
std::vector< double > etaTable
Definition: HcalTopology.h:191
int HcalTopology::etaRing ( HcalSubdetector  subdet,
double  eta 
) const

eta and phi index from eta, phi values

Definition at line 744 of file HcalTopology.cc.

References etaTable, etaTableHF, firstHBRing_, firstHFRing_, HcalForward, relval_steps::k, and lastHERing_.

Referenced by decrementDepth(), HcalGeometry::etaRing(), and incrementDepth().

744  {
745  int etaring = firstHBRing_;
746  if (bc == HcalForward) {
747  etaring = firstHFRing_;
748  for (unsigned int k=0; k<etaTableHF.size()-1; ++k) {
749  if (abseta < etaTableHF[k+1]) {
750  etaring += k;
751  break;
752  }
753  }
754  } else {
755  for (unsigned int k=0; k<etaTable.size()-1; ++k) {
756  if (abseta < etaTable[k+1]) {
757  etaring += k;
758  break;
759  }
760  }
761  if (abseta > etaTable[etaTable.size()-1]) etaring = lastHERing_;
762  }
763  return etaring;
764 }
std::vector< double > etaTableHF
Definition: HcalTopology.h:191
std::vector< double > etaTable
Definition: HcalTopology.h:191
void HcalTopology::exclude ( const HcalDetId id)

Add a cell to exclusion list

Definition at line 209 of file HcalTopology.cc.

References exclusionList_, and i.

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

209  {
210  std::vector<HcalDetId>::iterator i=std::lower_bound(exclusionList_.begin(),exclusionList_.end(),id);
211  if (i==exclusionList_.end() || *i!=id) {
212  exclusionList_.insert(i,id);
213  }
214 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalDetId > exclusionList_
Definition: HcalTopology.h:162
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 276 of file HcalTopology.cc.

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

276  {
277 
278  bool exed=false;
279  // first, check the full detector exclusions... (fast)
280  switch (subdet) {
281  case(HcalBarrel): exed=excludeHB_; break;
282  case(HcalEndcap): exed=excludeHE_; break;
283  case(HcalOuter): exed=excludeHO_; break;
284  case(HcalForward): exed=excludeHF_; break;
285  default: exed=false;
286  }
287  if (exed) return 0; // if the whole detector is excluded...
288 
289  int ieta_l=std::min(ieta1,ieta2);
290  int ieta_h=std::max(ieta1,ieta2);
291  int iphi_l=std::min(iphi1,iphi2);
292  int iphi_h=std::max(iphi1,iphi2);
293  int depth_l=std::min(depth1,depth2);
294  int depth_h=std::max(depth1,depth2);
295 
296  int n=0;
297  for (int ieta=ieta_l; ieta<=ieta_h; ieta++)
298  for (int iphi=iphi_l; iphi<=iphi_h; iphi++)
299  for (int depth=depth_l; depth<=depth_h; depth++) {
300  HcalDetId id(subdet,ieta,iphi,depth);
301  if (validRaw(id)) { // use 'validRaw' to include check validity in "uncut" detector
302  exclude(id);
303  n++;
304  }
305  }
306  return n;
307 }
void exclude(const HcalDetId &id)
bool validRaw(const HcalDetId &id) const
T min(T a, T b)
Definition: MathUtil.h:58
void HcalTopology::excludeSubdetector ( HcalSubdetector  subdet)

Exclude an entire subdetector

Definition at line 216 of file HcalTopology.cc.

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

Referenced by HcalTopologyRestrictionParser::parse().

216  {
217  switch (subdet) {
218  case(HcalBarrel): excludeHB_=true; break;
219  case(HcalEndcap): excludeHE_=true; break;
220  case(HcalOuter): excludeHO_=true; break;
221  case(HcalForward): excludeHF_=true; break;
222  default: break;
223  }
224 }
int HcalTopology::firstHBRing ( ) const
inline
int HcalTopology::firstHEDoublePhiRing ( ) const
inline
int HcalTopology::firstHEQuadPhiRing ( ) const
inline
int HcalTopology::firstHERing ( ) const
inline
int HcalTopology::firstHETripleDepthRing ( ) const
inline

Definition at line 95 of file HcalTopology.h.

References firstHETripleDepthRing_.

Referenced by depthBinInformation(), and HcalHardcodeGeometryLoader::makeHECells().

int firstHETripleDepthRing_
Definition: HcalTopology.h:177
int HcalTopology::firstHFQuadPhiRing ( ) const
inline
int HcalTopology::firstHFRing ( ) const
inline
int HcalTopology::firstHORing ( ) const
inline

Definition at line 89 of file HcalTopology.h.

References firstHORing_.

Referenced by CaloTowerTopology::CaloTowerTopology(), and CaloTowerTopology::convertHcaltoCT().

89 {return firstHORing_;}
unsigned int HcalTopology::getCALIBSize ( ) const
inline

Definition at line 126 of file HcalTopology.h.

References CALIBSize_.

Referenced by HcalCondObjectContainerBase::sizeFor().

126 {return CALIBSize_;}
unsigned int CALIBSize_
Definition: HcalTopology.h:188
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 803 of file HcalTopology.cc.

References depthSegmentation_, Exception, and relativeConstraints::ring.

Referenced by HcalHardcodeGeometryLoader::load(), HcalHardcodeCalibrations::produceRespCorrs(), segmentBoundaries(), and CaloTowersCreationAlgo::setGeometry().

803  {
804  // if it doesn't exist, return the first entry with a lower index. So if we only
805  // have entries for 1 and 17, any input from 1-16 should return the entry for ring 1
806  SegmentationMap::const_iterator pos = depthSegmentation_.upper_bound(ring);
807  if (pos == depthSegmentation_.begin()) {
808  throw cms::Exception("HcalTopology") << "No depth segmentation found for ring" << ring;
809  }
810  --pos;
811  // pos now refers to the last element with key <= ring.
812  readoutDepths = pos->second;
813 }
SegmentationMap depthSegmentation_
Definition: HcalTopology.h:199
unsigned int HcalTopology::getHBSize ( ) const
inline

Definition at line 121 of file HcalTopology.h.

References HBSize_.

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

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

Definition at line 122 of file HcalTopology.h.

References HESize_.

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

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

Definition at line 124 of file HcalTopology.h.

References HFSize_.

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

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

Definition at line 123 of file HcalTopology.h.

References HOSize_.

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

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

Definition at line 125 of file HcalTopology.h.

References HTSize_.

Referenced by HcalCondObjectContainerBase::sizeFor().

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

Definition at line 147 of file HcalTopology.h.

References numberOfShapes_.

Referenced by HcalGeometry::numberOfShapes().

147 { return numberOfShapes_; }
unsigned int numberOfShapes_
Definition: HcalTopology.h:189
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 516 of file HcalTopology.cc.

References HLT_25ns14e33_v1_cff::depth, etaHE2HF_, firstHEDoublePhiRing(), firstHEQuadPhiRing(), firstHFQuadPhiRing(), HcalEndcap, HcalForward, lastHBRing(), lastHERing(), gen::n, valid(), and ecaldqm::zside().

Referenced by decIEta(), and incIEta().

516  {
517  int n=1;
518  int aieta=id.ietaAbs();
519 
520  if (aieta==firstHEDoublePhiRing()-1 && (id.iphi()%2)==0)
521  neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),id.iphi()-1,id.depth());
522  else if (aieta==firstHFQuadPhiRing()-1 && ((id.iphi()+1)%4)!=0)
523  neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),((id.iphi()==1)?(71):(id.iphi()-2)),id.depth());
524  else if (aieta==firstHEQuadPhiRing()-1 && ((id.iphi()+1)%4)!=0)
525  neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),((id.iphi()==1)?(71):(id.iphi()-2)),id.depth());
526  else if (aieta==lastHBRing())
527  neighbors[0]=HcalDetId(HcalEndcap,(aieta+1)*id.zside(),id.iphi(),1);
528  else if (aieta==lastHERing())
529  neighbors[0]=HcalDetId(HcalForward,etaHE2HF_*id.zside(),id.iphi(),1);
530  else
531  neighbors[0]=HcalDetId(id.subdet(),(aieta+1)*id.zside(),id.iphi(),id.depth());
532 
533  if (!valid(neighbors[0])) n=0;
534  return n;
535 }
int lastHBRing() const
Definition: HcalTopology.h:84
int zside(DetId const &)
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:92
virtual bool valid(const DetId &id) const
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:94
int firstHEQuadPhiRing() const
Definition: HcalTopology.h:93
int lastHERing() const
Definition: HcalTopology.h:86
int HcalTopology::incIEta ( const HcalDetId id,
HcalDetId  neighbors[2] 
) const

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

Definition at line 505 of file HcalTopology.cc.

References decAIEta(), incAIEta(), and ecaldqm::zside().

Referenced by west().

505  {
506  if (id.zside()==1) return incAIEta(id,neighbors);
507  else return decAIEta(id,neighbors);
508 }
int zside(DetId const &)
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 432 of file HcalTopology.cc.

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

Referenced by north().

432  {
433  bool ok=valid(id);
434  if (ok) {
435  switch (id.subdet()) {
436  case (HcalBarrel):
437  case (HcalOuter):
438  if (id.iphi()==IPHI_MAX) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth());
439  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+1,id.depth());
440  break;
441  case (HcalEndcap):
442  if (id.ietaAbs()>=firstHEQuadPhiRing()) {
443  if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),3,id.depth());
444  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+4,id.depth());
445  } else if (id.ietaAbs()>=firstHEDoublePhiRing()) {
446  if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth());
447  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+2,id.depth());
448  } else {
449  if (id.iphi()==IPHI_MAX) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth());
450  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+1,id.depth());
451  }
452  break;
453  case (HcalForward):
454  if (id.ietaAbs()>=firstHFQuadPhiRing()) {
455  if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),3,id.depth());
456  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+4,id.depth());
457  } else {
458  if (id.iphi()==IPHI_MAX-1) neighbor=HcalDetId(id.subdet(),id.ieta(),1,id.depth());
459  else neighbor=HcalDetId(id.subdet(),id.ieta(),id.iphi()+2,id.depth());
460  }
461  break;
462  default: ok=false;
463  }
464  }
465  return ok;
466 }
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:92
virtual bool valid(const DetId &id) const
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:94
int firstHEQuadPhiRing() const
Definition: HcalTopology.h:93
static const int IPHI_MAX
Definition: HcalTopology.cc:13
bool HcalTopology::incrementDepth ( HcalDetId id) const

Get the detector behind this one

Definition at line 634 of file HcalTopology.cc.

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

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

634  {
635 
636  HcalSubdetector subdet = detId.subdet();
637  int ieta = detId.ieta();
638  int etaRing = detId.ietaAbs();
639  int depth = detId.depth();
640  int nDepthBins, startingBin;
641  depthBinInformation(subdet, etaRing, nDepthBins, startingBin);
642 
643  // see if the new depth bin exists
644  ++depth;
645  if (depth > nDepthBins) {
646  // handle on a case-by-case basis
647  if (subdet == HcalBarrel && etaRing < lastHORing()) {
648  // HO
649  subdet = HcalOuter;
650  depth = 4;
651  } else if (subdet == HcalBarrel && etaRing == lastHBRing()) {
652  // overlap
653  subdet = HcalEndcap;
654  } else if (subdet == HcalEndcap && etaRing == lastHERing()-1 &&
656  // guard ring HF29 is behind HE 28
657  subdet = HcalForward;
658  (ieta > 0) ? ++ieta : --ieta;
659  depth = 1;
660  } else if (subdet == HcalEndcap && etaRing == lastHERing() &&
662  // split cells go to bigger granularity. Ring 29 -> 28
663  (ieta > 0) ? --ieta : ++ieta;
664  } else {
665  // no more chances
666  detId = HcalDetId();
667  return false;
668  }
669  }
670  detId = HcalDetId(subdet, ieta, detId.iphi(), depth);
671  return validRaw(detId);
672 }
int lastHBRing() const
Definition: HcalTopology.h:84
bool validRaw(const HcalDetId &id) const
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:165
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
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:90
int lastHERing() const
Definition: HcalTopology.h:86
bool HcalTopology::isExcluded ( const HcalDetId id) const
private

Definition at line 191 of file HcalTopology.cc.

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

Referenced by validHcal().

191  {
192  bool exed=false;
193  // first, check the full detector exclusions... (fast)
194  switch (id.subdet()) {
195  case(HcalBarrel): exed=excludeHB_; break;
196  case(HcalEndcap): exed=excludeHE_; break;
197  case(HcalOuter): exed=excludeHO_; break;
198  case(HcalForward): exed=excludeHF_; break;
199  default: exed=false;
200  }
201  // next, check the list (slower)
202  if (!exed && !exclusionList_.empty()) {
203  std::vector<HcalDetId>::const_iterator i=std::lower_bound(exclusionList_.begin(),exclusionList_.end(),id);
204  if (i!=exclusionList_.end() && *i==id) exed=true;
205  }
206  return exed;
207 }
int i
Definition: DBlmapReader.cc:9
std::vector< HcalDetId > exclusionList_
Definition: HcalTopology.h:162
int HcalTopology::lastHBRing ( ) const
inline
int HcalTopology::lastHERing ( ) const
inline
int HcalTopology::lastHFRing ( ) const
inline
int HcalTopology::lastHORing ( ) const
inline
int HcalTopology::maxDepth ( HcalSubdetector  subdet) const

Definition at line 737 of file HcalTopology.cc.

References HcalBarrel, HcalEndcap, HcalForward, maxDepthHB_, maxDepthHE_, and maxDepthHF_.

Referenced by HcalGeometry::getCells().

737  {
738  if (bc == HcalBarrel) return maxDepthHB_;
739  else if (bc == HcalEndcap) return maxDepthHE_;
740  else if (bc == HcalForward) return maxDepthHF_;
741  else return 4;
742 }
int HcalTopology::maxDepthHB ( ) const
inline

Definition at line 128 of file HcalTopology.h.

References maxDepthHB_.

Referenced by RecAnalyzerMinbias::beginRun().

128 { return maxDepthHB_;}
int HcalTopology::maxDepthHE ( ) const
inline

Definition at line 129 of file HcalTopology.h.

References maxDepthHE_.

129 { return maxDepthHE_;}
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 1174 of file HcalTopology.cc.

References HBSize_, HESize_, HFSize_, and HOSize_.

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

1174  {
1175  return HBSize_+HESize_+HOSize_+HFSize_;
1176 }
unsigned int HESize_
Definition: HcalTopology.h:184
unsigned int HFSize_
Definition: HcalTopology.h:186
unsigned int HBSize_
Definition: HcalTopology.h:183
unsigned int HOSize_
Definition: HcalTopology.h:185
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 242 of file HcalTopology.cc.

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

Referenced by spr::newHCALIdNS().

242  {
243  std::vector<DetId> vNeighborsDetId;
244  HcalDetId neighbor;
245  if (incIPhi(HcalDetId(id),neighbor))
246  vNeighborsDetId.push_back(DetId(neighbor.rawId()));
247  return vNeighborsDetId;
248 }
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 718 of file HcalTopology.cc.

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

Referenced by CaloTowerHardcodeGeometryLoader::makeCell().

718  {
719  int lastPhiBin=singlePhiBins_;
720  if (etaRing>= firstHFQuadPhiRing()) lastPhiBin=doublePhiBins_/2;
721  else if (etaRing>= firstHEQuadPhiRing()) lastPhiBin=doublePhiBins_/2;
722  else if (etaRing>= firstHEDoublePhiRing()) lastPhiBin=doublePhiBins_;
723  return lastPhiBin;
724 }
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:92
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:94
int firstHEQuadPhiRing() const
Definition: HcalTopology.h:93
int HcalTopology::nPhiBins ( HcalSubdetector  subdet,
int  etaRing 
) const

Definition at line 726 of file HcalTopology.cc.

References dPhiTable, dPhiTableHF, firstHBRing_, firstHFRing_, HcalForward, M_PI, and singlePhiBins_.

726  {
727  static const double twopi = M_PI+M_PI;
728  int lastPhiBin=singlePhiBins_;
729  if (bc == HcalForward) {
730  lastPhiBin = (int)((twopi+0.001)/dPhiTableHF[etaRing-firstHFRing_]);
731  } else {
732  lastPhiBin = (int)((twopi+0.001)/dPhiTable[etaRing-firstHBRing_]);
733  }
734  return lastPhiBin;
735 }
std::vector< double > dPhiTableHF
Definition: HcalTopology.h:191
int etaRing(HcalSubdetector subdet, double eta) const
eta and phi index from eta, phi values
#define M_PI
std::vector< double > dPhiTable
Definition: HcalTopology.h:191
int HcalTopology::phiBin ( HcalSubdetector  subdet,
int  etaRing,
double  phi 
) const

Definition at line 766 of file HcalTopology.cc.

References dPhiTable, dPhiTableHF, firstHBRing_, firstHFRing_, HcalBarrel, HcalEndcap, HcalForward, cmsHarvester::index, M_PI, phioff, csvLumiCalc::unit, unitPhi, and unitPhiHF.

Referenced by HcalGeometry::phiBin().

766  {
767  static const double twopi = M_PI+M_PI;
768  //put phi in correct range (0->2pi)
769  int index(0);
770  if (bc == HcalBarrel) {
771  index = (etaring-firstHBRing_);
772  phi -= phioff[0];
773  } else if (bc == HcalEndcap) {
774  index = (etaring-firstHBRing_);
775  phi -= phioff[1];
776  } else if (bc == HcalForward) {
777  index = (etaring-firstHFRing_);
778  if (index < (int)(dPhiTableHF.size())) {
779  if (unitPhiHF[index] > 2) phi -= phioff[4];
780  else phi -= phioff[2];
781  }
782  }
783  if (phi<0.0) phi += twopi;
784  if (phi>twopi) phi -= twopi;
785  int phibin(1), unit(1);
786  if (bc == HcalForward) {
787  if (index < (int)(dPhiTableHF.size())) {
788  unit = unitPhiHF[index];
789  phibin = static_cast<int>(phi/dPhiTableHF[index])+1;
790  }
791  } else {
792  if (index < (int)(dPhiTable.size())) {
793  phibin = static_cast<int>(phi/dPhiTable[index])+1;
794  unit = unitPhi[index];
795  }
796  }
797  int iphi(phibin);
798  if (unit == 2) iphi = (phibin-1)*2+1;
799  else if (unit == 4) iphi = (phibin-1)*4+3;
800  return iphi;
801 }
std::vector< int > unitPhiHF
Definition: HcalTopology.h:193
std::vector< double > dPhiTableHF
Definition: HcalTopology.h:191
std::vector< int > unitPhi
Definition: HcalTopology.h:193
string unit
Definition: csvLumiCalc.py:46
#define M_PI
std::vector< double > phioff
Definition: HcalTopology.h:192
std::vector< double > dPhiTable
Definition: HcalTopology.h:191
static std::string HcalTopology::producerTag ( )
inlinestatic

Definition at line 41 of file HcalTopology.h.

41 { return "HCAL" ; }
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 819 of file HcalTopology.cc.

References HLT_25ns14e33_v1_cff::depth, and getDepthSegmentation().

819  {
820  std::vector<int> readoutDepths;
821  getDepthSegmentation(ring, readoutDepths);
822  int d1 = std::lower_bound(readoutDepths.begin(), readoutDepths.end(), depth) - readoutDepths.begin();
823  int d2 = std::upper_bound(readoutDepths.begin(), readoutDepths.end(), depth) - readoutDepths.begin();
824  return std::pair<int, int>(d1, d2);
825 }
void getDepthSegmentation(unsigned ring, std::vector< int > &readoutDepths) const
void HcalTopology::setDepthSegmentation ( unsigned  ring,
const std::vector< int > &  readoutDepths 
)

Definition at line 815 of file HcalTopology.cc.

References depthSegmentation_, and relativeConstraints::ring.

Referenced by HcalTopology().

815  {
816  depthSegmentation_[ring] = readoutDepths;
817 }
SegmentationMap depthSegmentation_
Definition: HcalTopology.h:199
int HcalTopology::singlePhiBins ( ) const
inline

Definition at line 96 of file HcalTopology.h.

References singlePhiBins_.

96 {return singlePhiBins_;}
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 250 of file HcalTopology.cc.

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

Referenced by spr::newHCALIdNS().

250  {
251  std::vector<DetId> vNeighborsDetId;
252  HcalDetId neighbor;
253  if (decIPhi(HcalDetId(id),neighbor))
254  vNeighborsDetId.push_back(DetId(neighbor.rawId()));
255  return vNeighborsDetId;
256 }
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 1178 of file HcalTopology.cc.

References topoVersion_.

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

1178  {
1179  return topoVersion_;
1180 }
HcalTopologyMode::TriggerMode HcalTopology::triggerMode ( ) const
inline

Definition at line 33 of file HcalTopology.h.

References triggerMode_.

33 { return triggerMode_; }
HcalTopologyMode::TriggerMode triggerMode_
Definition: HcalTopology.h:166
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 258 of file HcalTopology.cc.

References incrementDepth().

Referenced by spr::matrixHCALIdsDepth().

258  {
259  HcalDetId neighbor = id;
260  std::vector<DetId> vNeighborsDetId;
261  if (incrementDepth(neighbor)) {
262  vNeighborsDetId.push_back(neighbor);
263  }
264  return vNeighborsDetId;
265 }
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 171 of file HcalTopology.cc.

References assert(), DetId::Hcal, and validHcal().

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

171  {
172  assert(id.det()==DetId::Hcal);
173  return validHcal(id);
174 }
assert(m_qm.get())
bool validHcal(const HcalDetId &id) const
bool HcalTopology::validDetId ( HcalSubdetector  subdet,
int  ieta,
int  iphi,
int  depth 
) const
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 335 of file HcalTopology.cc.

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

335  {
336  const HcalSubdetector sd (id.subdet());
337  const int ie (id.ietaAbs());
338  const int ip (id.iphi());
339  const int dp (id.depth());
340 
341  return ( ( ip >= 1 ) &&
342  ( ip <= IPHI_MAX ) &&
343  ( dp >= 1 ) &&
344  ( ie >= 1 ) &&
345  ( ( ( sd == HcalBarrel ) &&
346  ( ( ( ie <= 14 ) &&
347  ( dp == 1 ) ) ||
348  ( ( ( ie == 15 ) || ( ie == 16 ) ) &&
349  ( dp <= 2 ) ) ) ) ||
350  ( ( sd == HcalEndcap ) &&
351  ( ( ( ie == firstHERing() ) &&
352  ( dp == 3 ) ) ||
353  ( ( ie == 17 ) &&
354  ( dp == 1 ) ) ||
355  ( ( ie >= 18 ) &&
356  ( ie <= 20 ) &&
357  ( dp <= 2 ) ) ||
358  ( ( ie >= 21 ) &&
359  ( ie <= 26 ) &&
360  ( dp <= 2 ) &&
361  ( ip%2 == 1 ) ) ||
362  ( ( ie >= 27 ) &&
363  ( ie <= 28 ) &&
364  ( dp <= 3 ) &&
365  ( ip%2 == 1 ) ) ||
366  ( ( ie == 29 ) &&
367  ( dp <= 2 ) &&
368  ( ip%2 == 1 ) ) ) ) ||
369  ( ( sd == HcalOuter ) &&
370  ( ie <= 15 ) &&
371  ( dp == 4 ) ) ||
372  ( ( sd == HcalForward ) &&
373  ( dp <= 2 ) &&
374  ( ( ( ie >= firstHFRing() ) &&
375  ( ie < firstHFQuadPhiRing() ) &&
376  ( ip%2 == 1 ) ) ||
377  ( ( ie >= firstHFQuadPhiRing() ) &&
378  ( ie <= lastHFRing() ) &&
379  ( ip%4 == 3 ) ) ) ) ) ) ;
380 }
int firstHFRing() const
Definition: HcalTopology.h:87
int lastHFRing() const
Definition: HcalTopology.h:88
HcalSubdetector
Definition: HcalAssistant.h:31
double sd
int firstHERing() const
Definition: HcalTopology.h:85
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:94
static const int IPHI_MAX
Definition: HcalTopology.cc:13
bool HcalTopology::validHcal ( const HcalDetId id) const

Is this a valid cell id?

Definition at line 176 of file HcalTopology.cc.

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

Referenced by HcalDigitizer::accumulateCaloHits(), valid(), and validDetId().

176  {
177  // check the raw rules
178  bool ok=validRaw(id);
179 
180  ok=ok && !isExcluded(id);
181 
182  return ok;
183 }
bool isExcluded(const HcalDetId &id) const
bool validRaw(const HcalDetId &id) const
bool HcalTopology::validRaw ( const HcalDetId id) const
private

Is this a valid cell id?

Definition at line 383 of file HcalTopology.cc.

References HLT_25ns14e33_v1_cff::depth, etaBinsHE_, firstHEDoublePhiRing(), firstHEQuadPhiRing(), firstHERing(), firstHFQuadPhiRing(), firstHFRing(), HcalTopologyMode::H2, HcalTopologyMode::H2HE, HcalBarrel, HcalEndcap, HcalForward, HcalOuter, i, IPHI_MAX, lastHBRing(), lastHERing(), lastHFRing(), lastHORing(), maxDepthHB_, maxDepthHE_, maxDepthHF_, maxEta_, mode_, convertSQLiteXML::ok, and HcalTopologyMode::SLHC.

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

383  {
384  bool ok=true;
385  int ieta=id.ieta();
386  int aieta=id.ietaAbs();
387  int depth=id.depth();
388  int iphi=id.iphi();
389  if ((ieta==0 || iphi<=0 || iphi>IPHI_MAX) || aieta>maxEta_) return false; // outer limits
390 
391  if (ok) {
392  HcalSubdetector subdet=id.subdet();
393  if (subdet==HcalBarrel) {
395  if ((aieta>lastHBRing() || depth>maxDepthHB_ || (aieta==lastHBRing() && depth > 2))) ok=false;
396  } else {
397  if (aieta>lastHBRing() || depth>2 || (aieta<=14 && depth>1)) ok=false;
398  }
399  } else if (subdet==HcalEndcap) {
401  if (depth>maxDepthHE_ || aieta<firstHERing() || aieta>lastHERing() ||
402  (aieta==firstHERing() && depth<3)) {
403  ok = false;
404  } else {
405  for (unsigned int i=0; i<etaBinsHE_.size(); ++i) {
406  if (aieta == etaBinsHE_[i].ieta) {
407  if (aieta >= firstHEDoublePhiRing() && (iphi%2)==0) ok=false;
408  if (aieta >= firstHEQuadPhiRing() && (iphi%4)!=3) ok=false;
409  if (depth < etaBinsHE_[i].depthStart ||
410  depth > (etaBinsHE_[i].depthStart+(int)(etaBinsHE_[i].layer.size())))
411  ok = false;
412  break;
413  }
414  }
415  }
416  } else {
417  if (depth>3 || aieta<firstHERing() || aieta>lastHERing() || (aieta==firstHERing() && depth!=3) || (aieta==17 && depth!=1 && mode_!=HcalTopologyMode::H2) || // special case at H2
418  (((aieta>=17 && aieta<firstHETripleDepthRing()) || aieta==lastHERing()) && depth>2) ||
419  (aieta>=firstHEDoublePhiRing() && (iphi%2)==0)) ok=false;
420  }
421  } else if (subdet==HcalOuter) {
422  if (aieta>lastHORing() || iphi>IPHI_MAX || depth!=4) ok=false;
423  } else if (subdet==HcalForward) {
424  if (aieta<firstHFRing() || aieta>lastHFRing() || ((iphi%2)==0) || (depth>maxDepthHF_) || (aieta>=firstHFQuadPhiRing() && ((iphi+1)%4)!=0)) ok=false;
425  } else {
426  ok=false;
427  }
428  }
429  return ok;
430 }
int firstHFRing() const
Definition: HcalTopology.h:87
int i
Definition: DBlmapReader.cc:9
int lastHBRing() const
Definition: HcalTopology.h:84
std::vector< HcalDDDRecConstants::HcalEtaBin > etaBinsHE_
Definition: HcalTopology.h:173
HcalTopologyMode::Mode mode_
Definition: HcalTopology.h:165
int lastHFRing() const
Definition: HcalTopology.h:88
HcalSubdetector
Definition: HcalAssistant.h:31
int firstHEDoublePhiRing() const
Definition: HcalTopology.h:92
int firstHERing() const
Definition: HcalTopology.h:85
int firstHFQuadPhiRing() const
Definition: HcalTopology.h:94
int firstHEQuadPhiRing() const
Definition: HcalTopology.h:93
int lastHORing() const
Definition: HcalTopology.h:90
int lastHERing() const
Definition: HcalTopology.h:86
static const int IPHI_MAX
Definition: HcalTopology.cc:13
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 234 of file HcalTopology.cc.

References i, and incIEta().

Referenced by spr::newHCALIdEW().

234  {
235  std::vector<DetId> vNeighborsDetId;
236  HcalDetId neighbors[2];
237  for (int i=0;i<incIEta(HcalDetId(id),neighbors);i++)
238  vNeighborsDetId.push_back(DetId(neighbors[i].rawId()));
239  return vNeighborsDetId;
240 }
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 188 of file HcalTopology.h.

Referenced by getCALIBSize().

SegmentationMap HcalTopology::depthSegmentation_
private

Definition at line 199 of file HcalTopology.h.

Referenced by getDepthSegmentation(), and setDepthSegmentation().

int HcalTopology::doublePhiBins_
private

Definition at line 178 of file HcalTopology.h.

Referenced by doublePhiBins(), and nPhiBins().

std::vector<double> HcalTopology::dPhiTable
private

Definition at line 191 of file HcalTopology.h.

Referenced by HcalTopology(), nPhiBins(), and phiBin().

std::vector<double> HcalTopology::dPhiTableHF
private

Definition at line 191 of file HcalTopology.h.

Referenced by HcalTopology(), nPhiBins(), and phiBin().

std::vector<HcalDDDRecConstants::HcalEtaBin> HcalTopology::etaBinsHB_
private

Definition at line 173 of file HcalTopology.h.

Referenced by decrementDepth(), and HcalTopology().

std::vector<HcalDDDRecConstants::HcalEtaBin> HcalTopology::etaBinsHE_
private

Definition at line 173 of file HcalTopology.h.

Referenced by decrementDepth(), HcalTopology(), and validRaw().

int HcalTopology::etaHE2HF_
private

Definition at line 180 of file HcalTopology.h.

Referenced by HcalTopology(), and incAIEta().

int HcalTopology::etaHF2HE_
private

Definition at line 180 of file HcalTopology.h.

Referenced by decAIEta(), decrementDepth(), and HcalTopology().

std::vector<double> HcalTopology::etaTable
private

Definition at line 191 of file HcalTopology.h.

Referenced by etaMax(), etaRange(), etaRing(), and HcalTopology().

std::vector<double> HcalTopology::etaTableHF
private

Definition at line 191 of file HcalTopology.h.

Referenced by etaMax(), etaRange(), etaRing(), and HcalTopology().

bool HcalTopology::excludeHB_
private

Definition at line 163 of file HcalTopology.h.

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

bool HcalTopology::excludeHE_
private

Definition at line 163 of file HcalTopology.h.

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

bool HcalTopology::excludeHF_
private

Definition at line 163 of file HcalTopology.h.

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

bool HcalTopology::excludeHO_
private

Definition at line 163 of file HcalTopology.h.

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

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

Definition at line 162 of file HcalTopology.h.

Referenced by exclude(), and isExcluded().

int HcalTopology::firstHBRing_
private

Definition at line 168 of file HcalTopology.h.

Referenced by etaRing(), firstHBRing(), HcalTopology(), nPhiBins(), and phiBin().

int HcalTopology::firstHEDoublePhiRing_
private

Definition at line 176 of file HcalTopology.h.

Referenced by firstHEDoublePhiRing(), and HcalTopology().

int HcalTopology::firstHEQuadPhiRing_
private

Definition at line 176 of file HcalTopology.h.

Referenced by firstHEQuadPhiRing(), and HcalTopology().

int HcalTopology::firstHERing_
private

Definition at line 169 of file HcalTopology.h.

Referenced by firstHERing(), and HcalTopology().

int HcalTopology::firstHETripleDepthRing_
private

Definition at line 177 of file HcalTopology.h.

Referenced by firstHETripleDepthRing(), and HcalTopology().

int HcalTopology::firstHFQuadPhiRing_
private

Definition at line 176 of file HcalTopology.h.

Referenced by firstHFQuadPhiRing(), and HcalTopology().

int HcalTopology::firstHFRing_
private

Definition at line 170 of file HcalTopology.h.

Referenced by etaRange(), etaRing(), firstHFRing(), HcalTopology(), nPhiBins(), and phiBin().

int HcalTopology::firstHORing_
private

Definition at line 171 of file HcalTopology.h.

Referenced by firstHORing(), and HcalTopology().

unsigned int HcalTopology::HBSize_
private

Definition at line 183 of file HcalTopology.h.

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

const HcalDDDRecConstants* HcalTopology::hcons_
private

Definition at line 161 of file HcalTopology.h.

Referenced by HcalTopology().

unsigned int HcalTopology::HESize_
private

Definition at line 184 of file HcalTopology.h.

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

unsigned int HcalTopology::HFSize_
private

Definition at line 186 of file HcalTopology.h.

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

unsigned int HcalTopology::HOSize_
private

Definition at line 185 of file HcalTopology.h.

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

unsigned int HcalTopology::HTSize_
private

Definition at line 187 of file HcalTopology.h.

Referenced by getHTSize(), and HcalTopology().

int HcalTopology::lastHBRing_
private

Definition at line 168 of file HcalTopology.h.

Referenced by etaMax(), HcalTopology(), and lastHBRing().

int HcalTopology::lastHERing_
private

Definition at line 169 of file HcalTopology.h.

Referenced by etaMax(), etaRange(), etaRing(), HcalTopology(), and lastHERing().

int HcalTopology::lastHFRing_
private

Definition at line 170 of file HcalTopology.h.

Referenced by HcalTopology(), and lastHFRing().

int HcalTopology::lastHORing_
private

Definition at line 171 of file HcalTopology.h.

Referenced by etaMax(), HcalTopology(), and lastHORing().

int HcalTopology::maxDepthHB_
private
int HcalTopology::maxDepthHE_
private
int HcalTopology::maxDepthHF_
private
int HcalTopology::maxEta_
private

Definition at line 181 of file HcalTopology.h.

Referenced by HcalTopology(), and validRaw().

HcalTopologyMode::Mode HcalTopology::mode_
private
int HcalTopology::nEtaHB_
private
int HcalTopology::nEtaHE_
private

Definition at line 174 of file HcalTopology.h.

Referenced by denseId2detId(), detId2denseId(), detId2denseIdHE(), etaMax(), and HcalTopology().

unsigned int HcalTopology::numberOfShapes_
private

Definition at line 189 of file HcalTopology.h.

Referenced by getNumberOfShapes(), and HcalTopology().

std::vector<double> HcalTopology::phioff
private

Definition at line 192 of file HcalTopology.h.

Referenced by HcalTopology(), and phiBin().

int HcalTopology::singlePhiBins_
private

Definition at line 178 of file HcalTopology.h.

Referenced by nPhiBins(), and singlePhiBins().

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

Definition at line 166 of file HcalTopology.h.

Referenced by triggerMode().

std::vector<int> HcalTopology::unitPhi
private

Definition at line 193 of file HcalTopology.h.

Referenced by HcalTopology(), and phiBin().

std::vector<int> HcalTopology::unitPhiHF
private

Definition at line 193 of file HcalTopology.h.

Referenced by HcalTopology(), and phiBin().