CMS 3D CMS Logo

List of all members | Static Public Member Functions | Static Public Attributes | Private Member Functions
HcalHPDRBXMap Class Reference

#include <HcalHPDRBXMap.h>

Static Public Member Functions

static int indexHPD (const HcalDetId &)
 
static void indexHPDfromEtaPhi (int ieta, int iphi, std::vector< int > &hpdindices)
 
static int indexRBX (const HcalDetId &)
 
static void indexRBXfromEtaPhi (int ieta, int iphi, std::vector< int > &rbxindices)
 
static int indexRBXfromHPD (int hpdindex)
 
static void indicesHPDfromRBX (int rbxindex, std::array< int, NUM_HPDS_PER_RBX > &hpdindices)
 
static int iphihiHPD (int index)
 
static int iphihiRBX (int index)
 
static int iphiloHPD (int index)
 
static int iphiloRBX (int index)
 
static bool isValid (const HcalDetId &)
 
static bool isValid (int ieta, int iphi)
 
static bool isValidHPD (int index)
 
static bool isValidRBX (int index)
 
static int numHPDs (void)
 
static int numHPDsPerRBX (void)
 
static int numHPDsPerSubdet (void)
 
static int numRBXs (void)
 
static int numRBXsPerSubdet (void)
 
static HcalSubdetector subdetHPD (int index)
 
static HcalSubdetector subdetRBX (int index)
 
static int zsideHPD (int index)
 
static int zsideRBX (int index)
 

Static Public Attributes

const static int NUM_HPDS = 288
 
const static int NUM_HPDS_PER_RBX = 4
 
const static int NUM_HPDS_PER_SUBDET = 72
 
const static int NUM_RBXS = 72
 
const static int NUM_RBXS_PER_SUBDET = 18
 

Private Member Functions

 HcalHPDRBXMap ()
 
 ~HcalHPDRBXMap ()
 

Detailed Description

Definition at line 22 of file HcalHPDRBXMap.h.

Constructor & Destructor Documentation

◆ HcalHPDRBXMap()

HcalHPDRBXMap::HcalHPDRBXMap ( )
private

Definition at line 14 of file HcalHPDRBXMap.cc.

14 {}

◆ ~HcalHPDRBXMap()

HcalHPDRBXMap::~HcalHPDRBXMap ( )
private

Definition at line 15 of file HcalHPDRBXMap.cc.

15 {}

Member Function Documentation

◆ indexHPD()

int HcalHPDRBXMap::indexHPD ( const HcalDetId id)
static

Definition at line 186 of file HcalHPDRBXMap.cc.

186  {
187  // return bad index if subdetector is invalid
188  if (!isValid(id)) {
190  << " HcalDetId " << id << " is invalid in HcalHPDRBXMap::indexHPD().\n";
191  }
192 
193  // specify the readout module (subdet and number)
194  int subdet = -1;
195  if (id.subdet() == HcalBarrel && id.zside() == 1)
196  subdet = 0;
197  if (id.subdet() == HcalBarrel && id.zside() == -1)
198  subdet = 1;
199  if (id.subdet() == HcalEndcap && id.zside() == 1)
200  subdet = 2;
201  if (id.subdet() == HcalEndcap && id.zside() == -1)
202  subdet = 3;
203 
204  int iphi = id.iphi();
205  int absieta = abs(id.ieta());
206 
207  // adjust for offset between iphi and the HPD index
208  // index-->iphi
209  // 0-->71, 1-->72, 2-->1, 3-->2, 4-->3, ..., 70-->69, 71-->70
210  int index = iphi + 1;
211  if (index >= NUM_HPDS_PER_SUBDET)
213  index += subdet * NUM_HPDS_PER_SUBDET;
214 
215  // modify the index in the HE
216  if ((subdet == 2 || subdet == 3) && absieta >= 21 && absieta <= 29) {
217  if (iphi % 4 == 3 && absieta % 2 == 1 && absieta != 29)
218  index++;
219  if (iphi % 4 == 3 && absieta == 29 && id.depth() == 2)
220  index++;
221  if (iphi % 4 == 1 && absieta % 2 == 0 && absieta != 29)
222  index++;
223  if (iphi % 4 == 1 && absieta == 29 && id.depth() == 1)
224  index++;
225  }
226  return index;
227 }

References funct::abs(), LEDCalibrationChannels::depth, Exception, HcalBarrel, HcalEndcap, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, isValid(), edm::errors::LogicError, NUM_HPDS_PER_SUBDET, and ecaldqm::zside().

Referenced by reco::HcalNoiseRBXArray::findHPD(), indexHPDfromEtaPhi(), and indexRBX().

◆ indexHPDfromEtaPhi()

void HcalHPDRBXMap::indexHPDfromEtaPhi ( int  ieta,
int  iphi,
std::vector< int > &  hpdindices 
)
static

Definition at line 231 of file HcalHPDRBXMap.cc.

231  {
232  // clear the vector
233  hpdindices.clear();
234  int absieta = abs(ieta);
235 
236  if (absieta <= 15) { // HB only, depth doesn't matter
237  hpdindices.push_back(indexHPD(HcalDetId(HcalBarrel, ieta, iphi, 1)));
238  } else if (absieta == 16) { // HB and HE, depth doesn't matter
239  hpdindices.push_back(indexHPD(HcalDetId(HcalBarrel, ieta, iphi, 1)));
240  hpdindices.push_back(indexHPD(HcalDetId(HcalEndcap, ieta, iphi, 3)));
241  } else if (absieta < 29) { // HE only, depth doesn't matter
242  hpdindices.push_back(indexHPD(HcalDetId(HcalEndcap, ieta, iphi, 1)));
243  } else { // HE only, but depth matters
244  hpdindices.push_back(indexHPD(HcalDetId(HcalEndcap, ieta, iphi, 1)));
245  hpdindices.push_back(indexHPD(HcalDetId(HcalEndcap, ieta, iphi, 2)));
246  }
247 
248  return;
249 }

References funct::abs(), HcalBarrel, HcalEndcap, LEDCalibrationChannels::ieta, indexHPD(), and LEDCalibrationChannels::iphi.

Referenced by reco::HcalNoiseRBXArray::findHPD().

◆ indexRBX()

int HcalHPDRBXMap::indexRBX ( const HcalDetId id)
static

Definition at line 229 of file HcalHPDRBXMap.cc.

229 { return indexRBXfromHPD(indexHPD(id)); }

References indexHPD(), and indexRBXfromHPD().

Referenced by reco::HcalNoiseRBXArray::findRBX(), and indexRBXfromEtaPhi().

◆ indexRBXfromEtaPhi()

void HcalHPDRBXMap::indexRBXfromEtaPhi ( int  ieta,
int  iphi,
std::vector< int > &  rbxindices 
)
static

Definition at line 251 of file HcalHPDRBXMap.cc.

251  {
252  // clear the vector
253  rbxindices.clear();
254  int absieta = abs(ieta);
255 
256  if (absieta <= 15) { // HB only
257  rbxindices.push_back(indexRBX(HcalDetId(HcalBarrel, ieta, iphi, 1)));
258  } else if (absieta == 16) { // HB and HE
259  rbxindices.push_back(indexRBX(HcalDetId(HcalBarrel, ieta, iphi, 1)));
260  rbxindices.push_back(indexRBX(HcalDetId(HcalEndcap, ieta, iphi, 3)));
261  } else { // HE only
262  rbxindices.push_back(indexRBX(HcalDetId(HcalEndcap, ieta, iphi, 1)));
263  }
264 
265  return;
266 }

References funct::abs(), HcalBarrel, HcalEndcap, LEDCalibrationChannels::ieta, indexRBX(), and LEDCalibrationChannels::iphi.

Referenced by reco::HcalNoiseRBXArray::findRBX().

◆ indexRBXfromHPD()

int HcalHPDRBXMap::indexRBXfromHPD ( int  hpdindex)
static

Definition at line 177 of file HcalHPDRBXMap.cc.

177  {
178  if (!isValidHPD(hpdindex))
180  << " HPD index " << hpdindex << " is invalid in HcalHPDRBXMap::indexRBX().\n";
181 
182  return hpdindex / NUM_HPDS_PER_RBX;
183 }

References Exception, isValidHPD(), edm::errors::LogicError, and NUM_HPDS_PER_RBX.

Referenced by reco::HcalNoiseRBXArray::findHPD(), and indexRBX().

◆ indicesHPDfromRBX()

void HcalHPDRBXMap::indicesHPDfromRBX ( int  rbxindex,
std::array< int, NUM_HPDS_PER_RBX > &  hpdindices 
)
static

Definition at line 165 of file HcalHPDRBXMap.cc.

165  {
166  if (!isValidRBX(rbxindex))
168  << " RBX index " << rbxindex << " is invalid in HcalHPDRBXMap::indicesHPD().\n";
169 
170  for (unsigned int i = 0; i < hpdindices.size(); i++)
171  hpdindices[i] = rbxindex * NUM_HPDS_PER_RBX + i;
172 
173  return;
174 }

References Exception, mps_fire::i, isValidRBX(), edm::errors::LogicError, and NUM_HPDS_PER_RBX.

Referenced by reco::HcalNoiseRBXArray::HcalNoiseRBXArray(), iphihiRBX(), and iphiloRBX().

◆ iphihiHPD()

int HcalHPDRBXMap::iphihiHPD ( int  index)
static

Definition at line 127 of file HcalHPDRBXMap.cc.

127  {
128  if (!isValidHPD(index))
130  << " HPD index " << index << " is invalid in HcalHPDRBXMap::iphihiHPD().\n";
131 
132  // adjust for offset between iphi and the HPD index
133  // index-->iphi
134  // 0-->71, 1-->72, 2-->1, 3-->2, 4-->3, ..., 70-->69, 71-->70
135  int iphi = index % NUM_HPDS_PER_SUBDET - 1;
136  if (iphi <= 0)
138 
139  // HB
140  if (subdetHPD(index) == HcalBarrel)
141  return iphi;
142 
143  // HE
144  if (iphi % 2 == 0)
145  return iphi;
146  else
147  return iphi + 1;
148 }

References Exception, HcalBarrel, LEDCalibrationChannels::iphi, isValidHPD(), edm::errors::LogicError, NUM_HPDS_PER_SUBDET, and subdetHPD().

Referenced by iphihiRBX().

◆ iphihiRBX()

int HcalHPDRBXMap::iphihiRBX ( int  index)
static

Definition at line 151 of file HcalHPDRBXMap.cc.

151  {
152  if (!isValidRBX(index))
154  << " RBX index " << index << " is invalid in HcalHPDRBXMap::iphihiRBX().\n";
155 
156  // get the list of HPD indices in the RBX
157  std::array<int, NUM_HPDS_PER_RBX> arr;
158  indicesHPDfromRBX(index, arr);
159 
160  // return the highest iphi of the last HPD
161  return iphihiHPD(arr[NUM_HPDS_PER_RBX - 1]);
162 }

References Exception, indicesHPDfromRBX(), iphihiHPD(), isValidRBX(), edm::errors::LogicError, and NUM_HPDS_PER_RBX.

◆ iphiloHPD()

int HcalHPDRBXMap::iphiloHPD ( int  index)
static

Definition at line 89 of file HcalHPDRBXMap.cc.

89  {
90  if (!isValidHPD(index))
92  << " HPD index " << index << " is invalid in HcalHPDRBXMap::iphiloHPD().\n";
93 
94  // adjust for offset between iphi and the HPD index
95  // index-->iphi
96  // 0-->71, 1-->72, 2-->1, 3-->2, 4-->3, ..., 70-->69, 71-->70
97  int iphi = index % NUM_HPDS_PER_SUBDET - 1;
98  if (iphi <= 0)
100 
101  // HB
102  if (subdetHPD(index) == HcalBarrel)
103  return iphi;
104 
105  // HE
106  if (iphi % 2 == 0)
107  return iphi - 1;
108  else
109  return iphi;
110 }

References Exception, HcalBarrel, LEDCalibrationChannels::iphi, isValidHPD(), edm::errors::LogicError, NUM_HPDS_PER_SUBDET, and subdetHPD().

Referenced by iphiloRBX().

◆ iphiloRBX()

int HcalHPDRBXMap::iphiloRBX ( int  index)
static

Definition at line 113 of file HcalHPDRBXMap.cc.

113  {
114  if (!isValidRBX(index))
116  << " RBX index " << index << " is invalid in HcalHPDRBXMap::iphiloRBX().\n";
117 
118  // get the list of HPD indices in the RBX
119  std::array<int, NUM_HPDS_PER_RBX> arr;
120  indicesHPDfromRBX(index, arr);
121 
122  // return the lowest iphi of the first HPD
123  return iphiloHPD(arr[0]);
124 }

References Exception, indicesHPDfromRBX(), iphiloHPD(), isValidRBX(), and edm::errors::LogicError.

◆ isValid() [1/2]

bool HcalHPDRBXMap::isValid ( const HcalDetId id)
static

◆ isValid() [2/2]

bool HcalHPDRBXMap::isValid ( int  ieta,
int  iphi 
)
static

Definition at line 29 of file HcalHPDRBXMap.cc.

29  {
30  int absieta = abs(ieta);
31  if (absieta <= 29 && absieta >= 1 && iphi >= 1 && iphi <= 72) {
32  if (absieta <= 20)
33  return true;
34  if (absieta >= 21 && iphi % 2 == 1)
35  return true;
36  }
37  return false;
38 }

References funct::abs(), LEDCalibrationChannels::ieta, and LEDCalibrationChannels::iphi.

Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().

◆ isValidHPD()

bool HcalHPDRBXMap::isValidHPD ( int  index)
static

Definition at line 18 of file HcalHPDRBXMap.cc.

18 { return (index >= 0 && index <= NUM_HPDS - 1); }

References NUM_HPDS.

Referenced by reco::HcalNoiseRBXArray::findHPD(), indexRBXfromHPD(), iphihiHPD(), iphiloHPD(), subdetHPD(), and zsideHPD().

◆ isValidRBX()

bool HcalHPDRBXMap::isValidRBX ( int  index)
static

Definition at line 21 of file HcalHPDRBXMap.cc.

21 { return (index >= 0 && index <= NUM_RBXS - 1); }

References NUM_RBXS.

Referenced by reco::HcalNoiseRBXArray::findRBX(), indicesHPDfromRBX(), iphihiRBX(), iphiloRBX(), subdetRBX(), and zsideRBX().

◆ numHPDs()

static int HcalHPDRBXMap::numHPDs ( void  )
inlinestatic

Definition at line 37 of file HcalHPDRBXMap.h.

37 { return NUM_HPDS; }

References NUM_HPDS.

◆ numHPDsPerRBX()

static int HcalHPDRBXMap::numHPDsPerRBX ( void  )
inlinestatic

Definition at line 39 of file HcalHPDRBXMap.h.

39 { return NUM_HPDS_PER_RBX; }

References NUM_HPDS_PER_RBX.

◆ numHPDsPerSubdet()

static int HcalHPDRBXMap::numHPDsPerSubdet ( void  )
inlinestatic

Definition at line 38 of file HcalHPDRBXMap.h.

38 { return NUM_HPDS_PER_SUBDET; }

References NUM_HPDS_PER_SUBDET.

◆ numRBXs()

static int HcalHPDRBXMap::numRBXs ( void  )
inlinestatic

Definition at line 40 of file HcalHPDRBXMap.h.

40 { return NUM_RBXS; }

References NUM_RBXS.

◆ numRBXsPerSubdet()

static int HcalHPDRBXMap::numRBXsPerSubdet ( void  )
inlinestatic

Definition at line 41 of file HcalHPDRBXMap.h.

41 { return NUM_RBXS_PER_SUBDET; }

References NUM_RBXS_PER_SUBDET.

◆ subdetHPD()

HcalSubdetector HcalHPDRBXMap::subdetHPD ( int  index)
static

Definition at line 41 of file HcalHPDRBXMap.cc.

41  {
42  if (!isValidHPD(index))
44  << " HPD index " << index << " is invalid in HcalHPDRBXMap::subdetHPD().\n";
45 
46  if (index / NUM_HPDS_PER_SUBDET <= 1)
47  return HcalBarrel;
48  else
49  return HcalEndcap;
50 }

References Exception, HcalBarrel, HcalEndcap, isValidHPD(), edm::errors::LogicError, and NUM_HPDS_PER_SUBDET.

Referenced by iphihiHPD(), and iphiloHPD().

◆ subdetRBX()

HcalSubdetector HcalHPDRBXMap::subdetRBX ( int  index)
static

Definition at line 53 of file HcalHPDRBXMap.cc.

53  {
54  if (!isValidRBX(index))
56  << " RBX index " << index << " is invalid in HcalHPDRBXMap::subdetRBX().\n";
57 
58  if (index / NUM_RBXS_PER_SUBDET <= 1)
59  return HcalBarrel;
60  else
61  return HcalEndcap;
62 }

References Exception, HcalBarrel, HcalEndcap, isValidRBX(), edm::errors::LogicError, and NUM_RBXS_PER_SUBDET.

◆ zsideHPD()

int HcalHPDRBXMap::zsideHPD ( int  index)
static

Definition at line 65 of file HcalHPDRBXMap.cc.

65  {
66  if (!isValidHPD(index))
68  << " HPD index " << index << " is invalid in HcalHPDRBXMap::zsideHPD().\n";
69 
71  return 1;
72  else
73  return -1;
74 }

References Exception, isValidHPD(), edm::errors::LogicError, and NUM_HPDS_PER_SUBDET.

◆ zsideRBX()

int HcalHPDRBXMap::zsideRBX ( int  index)
static

Definition at line 77 of file HcalHPDRBXMap.cc.

77  {
78  if (!isValidRBX(index))
80  << " RBX index " << index << " is invalid in HcalHPDRBXMap::zsideRBX().\n";
81 
83  return 1;
84  else
85  return -1;
86 }

References Exception, isValidRBX(), edm::errors::LogicError, and NUM_RBXS_PER_SUBDET.

Member Data Documentation

◆ NUM_HPDS

const static int HcalHPDRBXMap::NUM_HPDS = 288
static

Definition at line 26 of file HcalHPDRBXMap.h.

Referenced by isValidHPD(), and numHPDs().

◆ NUM_HPDS_PER_RBX

const static int HcalHPDRBXMap::NUM_HPDS_PER_RBX = 4
static

◆ NUM_HPDS_PER_SUBDET

const static int HcalHPDRBXMap::NUM_HPDS_PER_SUBDET = 72
static

Definition at line 28 of file HcalHPDRBXMap.h.

Referenced by indexHPD(), iphihiHPD(), iphiloHPD(), numHPDsPerSubdet(), subdetHPD(), and zsideHPD().

◆ NUM_RBXS

const static int HcalHPDRBXMap::NUM_RBXS = 72
static

Definition at line 32 of file HcalHPDRBXMap.h.

Referenced by isValidRBX(), and numRBXs().

◆ NUM_RBXS_PER_SUBDET

const static int HcalHPDRBXMap::NUM_RBXS_PER_SUBDET = 18
static

Definition at line 34 of file HcalHPDRBXMap.h.

Referenced by numRBXsPerSubdet(), subdetRBX(), and zsideRBX().

HcalHPDRBXMap::indicesHPDfromRBX
static void indicesHPDfromRBX(int rbxindex, std::array< int, NUM_HPDS_PER_RBX > &hpdindices)
Definition: HcalHPDRBXMap.cc:165
mps_fire.i
i
Definition: mps_fire.py:428
HcalHPDRBXMap::iphiloHPD
static int iphiloHPD(int index)
Definition: HcalHPDRBXMap.cc:89
edm::errors::LogicError
Definition: EDMException.h:37
HcalHPDRBXMap::NUM_HPDS_PER_RBX
const static int NUM_HPDS_PER_RBX
Definition: HcalHPDRBXMap.h:30
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
HcalHPDRBXMap::NUM_HPDS
const static int NUM_HPDS
Definition: HcalHPDRBXMap.h:26
HcalHPDRBXMap::iphihiHPD
static int iphihiHPD(int index)
Definition: HcalHPDRBXMap.cc:127
HcalBarrel
Definition: HcalAssistant.h:33
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HcalHPDRBXMap::subdetHPD
static HcalSubdetector subdetHPD(int index)
Definition: HcalHPDRBXMap.cc:41
HcalHPDRBXMap::isValidHPD
static bool isValidHPD(int index)
Definition: HcalHPDRBXMap.cc:18
HcalHPDRBXMap::indexRBX
static int indexRBX(const HcalDetId &)
Definition: HcalHPDRBXMap.cc:229
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HcalHPDRBXMap::NUM_RBXS_PER_SUBDET
const static int NUM_RBXS_PER_SUBDET
Definition: HcalHPDRBXMap.h:34
HcalDetId
Definition: HcalDetId.h:12
HcalHPDRBXMap::NUM_HPDS_PER_SUBDET
const static int NUM_HPDS_PER_SUBDET
Definition: HcalHPDRBXMap.h:28
HcalHPDRBXMap::isValid
static bool isValid(const HcalDetId &)
Definition: HcalHPDRBXMap.cc:23
HcalEndcap
Definition: HcalAssistant.h:34
Exception
Definition: hltDiff.cc:246
HcalHPDRBXMap::NUM_RBXS
const static int NUM_RBXS
Definition: HcalHPDRBXMap.h:32
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HcalHPDRBXMap::indexRBXfromHPD
static int indexRBXfromHPD(int hpdindex)
Definition: HcalHPDRBXMap.cc:177
HcalHPDRBXMap::isValidRBX
static bool isValidRBX(int index)
Definition: HcalHPDRBXMap.cc:21
HcalHPDRBXMap::indexHPD
static int indexHPD(const HcalDetId &)
Definition: HcalHPDRBXMap.cc:186