CMS 3D CMS Logo

HcalCalibDetId.cc
Go to the documentation of this file.
4 
6 
7 HcalCalibDetId::HcalCalibDetId(uint32_t rawid) : HcalOtherDetId(rawid) {}
8 
11  id_ |= (CalibrationBox << 17); // Calibration Category, bits [17:19] (= "1" for CalibrationBox)
12  id_ |= (ctype & 0xF); // calibration channel type, bits [0:3]
13  id_ |= (((ieta + 2) & 0x7) << 11); // eta index, bits [11:13]
14  id_ |= ((subdet & 0x7) << 14); // subdetector, bits [14:16]
15  if (subdet == 4)
16  id_ |= ((((((((iphi - 1) & 0x7E) + 1) / 18) * 18) + 1) & 0x7F)
17  << 4); // phi index, bits [4:10] dphi = 18 for HF, values 1,19,37,55 (lower edge)
18  //if (subdet==4) id_|=(((((((((iphi-1)>>1)<<1)+1)/18)*18)+1)&0x7F)<<4); // phi index, bits [4:10] dphi = 18 for HF, values 1,19,37,55 (lower edge)
19  //else if (subdet==1||subdet==2||subdet==3) id_|=((((((iphi+1)&0x7C)+71)%72)&0x7F)<<4); // phi index, bits [4:10] dphi=4 for HBHEHO, values 3,7,...,71, (lower edge)
20  else if (subdet == 1 || subdet == 2)
21  id_ |= (((((((iphi + 1) >> 2) & 0x1F) << 2) + 71) % 72)
22  << 4); // phi index, bits [4:10] dphi=4 for HBHE, values 3,7,...,71, (lower edge)
23  else if (subdet == 3 && ieta == 0)
24  id_ |= (((((((iphi + 1) / 6) * 6) + 71) % 72) & 0x7F)
25  << 4); // phi index, bits [4:10] dphi=6 for HO0, values 5,11,...,71, (lower edge)
26  else if (subdet == 3 && ieta != 0)
27  id_ |= (((((((iphi + 1) / 12) * 12) + 71) % 72) & 0x7F)
28  << 4); // phi index, bits [4:10] dphi=12 for HOP and HOM, values 11,23,,...,71, (lower edge)
29  else
30  id_ |= ((iphi & 0x7F) << 4); // phi index, bits [4:10], simply allow all values from 0-127, shouldn't be any
31 }
32 
33 // keep old HOX constructor for back-compatibility
35  id_ |= (HOCrosstalk << 17); // Calibration Category, bits [17:19] (= "2" for HOX)
36  id_ |= (iphi & 0x7F) // phi index, bits [0:6]
37  | ((abs(ieta) & 0xF) << 7) // eta index, bits [7:10]
38  | (((ieta > 0) ? (1) : (0)) << 11); // z side, bit [11]
39 }
40 
42  id_ |= (dt << 17); // Calibration Category, bits [17:19] (= "2" for HOX, "6" for HBX, "7" for HEX)
43  id_ |= (iphi & 0x7F); // phi index, bits [0:6];
44 
45  (dt == HOCrosstalk) ? (id_ |= ((abs(ieta) & 0xF) << 7) | (((ieta > 0) ? (1) : (0)) << 11))
46  : (id_ |= ((abs(ieta) & 0x1F) << 7) | (((ieta > 0) ? (1) : (0)) << 12));
47 }
48 
50  id_ |= (dt << 17);
51  id_ |= value & 0xFF;
52 }
53 
55  id_ |= (dt << 17); // Calibration Category, bits [17:19]
56  id_ |= (value1 & 0x3F) << 10;
57  id_ |= (value2 & 0x1F) << 5;
58  id_ |= (value3 & 0x1F);
59 }
60 
62  if (!gen.null() && (gen.det() != Hcal || gen.subdetId() != HcalOther)) {
63  throw cms::Exception("Invalid DetId")
64  << "Cannot initialize HcalCalibDetId from " << std::hex << gen.rawId() << std::dec;
65  }
66  id_ = gen.rawId();
67  if (subdet() != HcalCalibration) {
68  throw cms::Exception("Invalid DetId")
69  << "Cannot initialize HcalCalibDetId from " << std::hex << gen.rawId() << std::dec;
70  }
71 }
72 
74  if (!gen.null() && (gen.det() != Hcal || gen.subdetId() != HcalOther)) {
75  throw cms::Exception("Invalid DetId")
76  << "Cannot assign HcalCalibDetId from " << std::hex << gen.rawId() << std::dec;
77  }
78  id_ = gen.rawId();
79  if (subdet() != HcalCalibration) {
80  throw cms::Exception("Invalid DetId")
81  << "Cannot assign HcalCalibDetId from " << std::hex << gen.rawId() << std::dec;
82  }
83  return *this;
84 }
85 
87  return (calibFlavor() == CalibrationBox || calibFlavor() == LASERMON) ? (id_ & 0xF) : (0);
88 }
89 
91  return (HcalSubdetector)((calibFlavor() == CalibrationBox) ? ((id_ >> 14) & 0x7) : (0));
92 }
93 
94 int HcalCalibDetId::ieta() const {
96  return (cf == CalibrationBox)
97  ? (((id_ >> 11) & 0x7) - 2)
98  : ((cf == HOCrosstalk)
99  ? (((id_ >> 7) & 0xF) * zside())
100  : (cf == LASERMON ? ((id_ >> 10) & 0x3F)
101  : (((cf == HBX || cf == HEX) ? ((id_ >> 7) & 0x1F) * zside() : (0)))));
102 }
103 
104 int HcalCalibDetId::iphi() const {
105  CalibDetType cf = calibFlavor();
106  return (cf == CalibrationBox)
107  ? ((id_ >> 4) & 0x7F)
108  : ((cf == HOCrosstalk || cf == HBX || cf == HEX) ? (id_ & 0x7F)
109  : (cf == LASERMON ? ((id_ >> 5) & 0x1F) : (0)));
110 }
111 
113  CalibDetType cf = calibFlavor();
114  return (cf == HOCrosstalk) ? (((id_ >> 11) & 0x1) ? (1) : (-1))
115  : ((cf == HBX || cf == HEX) ? (((id_ >> 12) & 0x1) ? (1) : (-1)) : (0));
116 }
117 
119  switch (cboxChannel()) {
120  case (cbox_MixerHigh):
121  return "Mixer-High";
122  case (cbox_MixerLow):
123  return "Mixer-Low";
124  case (cbox_LaserMegatile):
125  return "Megatile";
126  case (cbox_RadDam_Layer0_RM4):
127  return "RadDam-L0-RM4";
128  case (cbox_RadDam_Layer7_RM4):
129  return "RadDam-L7-RM4";
130  case (cbox_RadDam_Layer0_RM1):
131  return "RadDam-L0-RM1";
132  case (cbox_RadDam_Layer7_RM1):
133  return "RadDam-L7-RM1";
134  case (cbox_HOCrosstalkPIN):
135  return "HO-Crosstalk-PIN";
137  return "HF-Scint-PIN";
138  default:
139  return "";
140  }
141 }
142 
143 int HcalCalibDetId::channel() const { return (calibFlavor() == uMNqie) ? (id_ & 0xFF) : (id_ & 0x1F); }
144 
145 int HcalCalibDetId::fiber() const { return (calibFlavor() == CastorRadFacility) ? ((id_ >> 5) & 0x1F) : (0); }
146 
147 int HcalCalibDetId::rm() const { return (calibFlavor() == CastorRadFacility) ? ((id_ >> 10) & 0x3F) : (0); }
148 
149 std::ostream& operator<<(std::ostream& s, const HcalCalibDetId& id) {
150  std::string sd;
151  switch (id.hcalSubdet()) {
152  case (HcalBarrel):
153  sd = "HB";
154  break;
155  case (HcalEndcap):
156  sd = "HE";
157  break;
158  case (HcalOuter):
159  sd = "HO";
160  break;
161  case (HcalForward):
162  sd = "HF";
163  break;
164  default:
165  break;
166  }
167  switch (id.calibFlavor()) {
169  return s << "(HcalCalibBox " << sd << ' ' << id.ieta() << "," << id.iphi() << ' ' << id.cboxChannelString()
170  << ')';
172  return s << "(HOCrosstalk " << id.ieta() << "," << id.iphi() << ')';
173  case (HcalCalibDetId::uMNqie):
174  return s << "(uMNqie " << id.channel() << ')';
176  return s << "(LASERMON" << id.channel() << ')';
178  return s << "(CastorRadFacility " << id.rm() << " / " << id.fiber() << " / " << id.channel() << ')';
179  case (HcalCalibDetId::HBX):
180  return s << "(HBX " << id.ieta() << "," << id.iphi() << ")";
181  case (HcalCalibDetId::HEX):
182  return s << "(HEX " << id.ieta() << "," << id.iphi() << ")";
183  default:
184  return s;
185  };
186 }
HcalOther
Definition: HcalAssistant.h:38
HcalCalibDetId::cbox_HOCrosstalkPIN
static const int cbox_HOCrosstalkPIN
Definition: HcalCalibDetId.h:109
HcalCalibDetId::cbox_LaserMegatile
static const int cbox_LaserMegatile
Definition: HcalCalibDetId.h:104
HcalCalibDetId::cbox_RadDam_Layer7_RM4
static const int cbox_RadDam_Layer7_RM4
Definition: HcalCalibDetId.h:106
HcalCalibDetId
Definition: HcalCalibDetId.h:45
DetId::Hcal
Definition: DetId.h:28
HcalCalibDetId::cbox_RadDam_Layer0_RM4
static const int cbox_RadDam_Layer0_RM4
Definition: HcalCalibDetId.h:105
HcalCalibDetId::ieta
int ieta() const
Definition: HcalCalibDetId.cc:94
HcalCalibDetId::uMNqie
Definition: HcalCalibDetId.h:51
HcalBarrel
Definition: HcalAssistant.h:33
HcalCalibDetId::HEX
Definition: HcalCalibDetId.h:55
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
dt
float dt
Definition: AMPTWrapper.h:136
DetId
Definition: DetId.h:17
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
alignCSCRings.s
s
Definition: alignCSCRings.py:92
HcalCalibDetId::zside
int zside() const
get the sign of ieta (+/-1)
Definition: HcalCalibDetId.cc:112
HcalCalibDetId::HBX
Definition: HcalCalibDetId.h:54
HcalCalibDetId::operator=
HcalCalibDetId & operator=(const DetId &id)
Definition: HcalCalibDetId.cc:73
HcalOuter
Definition: HcalAssistant.h:35
HcalCalibDetId.h
HcalCalibration
Definition: HcalAssistant.h:40
gen
Definition: PythiaDecays.h:13
HcalCalibDetId::HcalCalibDetId
HcalCalibDetId()
Definition: HcalCalibDetId.cc:5
HcalCalibDetId::CalibDetType
CalibDetType
Definition: HcalCalibDetId.h:48
HcalCalibDetId::cbox_HF_ScintillatorPIN
static const int cbox_HF_ScintillatorPIN
Definition: HcalCalibDetId.h:110
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
HcalCalibDetId::CastorRadFacility
Definition: HcalCalibDetId.h:52
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
HcalCalibDetId::channel
int channel() const
get the channel (for uMNio/qie or similar)
Definition: HcalCalibDetId.cc:143
DetId::id_
uint32_t id_
Definition: DetId.h:69
HcalCalibDetId::cbox_RadDam_Layer7_RM1
static const int cbox_RadDam_Layer7_RM1
Definition: HcalCalibDetId.h:108
HLT_FULL_cff.value2
value2
Definition: HLT_FULL_cff.py:9868
value
Definition: value.py:1
HcalCalibDetId::iphi
int iphi() const
get the low-edge iphi (if relevant)
Definition: HcalCalibDetId.cc:104
HcalCalibDetId::hcalSubdet
HcalSubdetector hcalSubdet() const
get the HcalSubdetector (if relevant)
Definition: HcalCalibDetId.cc:90
HcalSubdetector.h
HcalCalibDetId::LASERMON
Definition: HcalCalibDetId.h:53
operator<<
std::ostream & operator<<(std::ostream &s, const HcalCalibDetId &id)
Definition: HcalCalibDetId.cc:149
HcalCalibDetId::calibFlavor
CalibDetType calibFlavor() const
get the flavor of this calibration detid
Definition: HcalCalibDetId.h:77
HcalCalibDetId::cbox_RadDam_Layer0_RM1
static const int cbox_RadDam_Layer0_RM1
Definition: HcalCalibDetId.h:107
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalForward
Definition: HcalAssistant.h:36
HLT_FULL_cff.value1
value1
Definition: HLT_FULL_cff.py:9869
HcalCalibDetId::HOCrosstalk
Definition: HcalCalibDetId.h:50
HcalEndcap
Definition: HcalAssistant.h:34
Exception
Definition: hltDiff.cc:246
HcalCalibDetId::cboxChannelString
std::string cboxChannelString() const
get the calibration box channel as a string (if relevant)
Definition: HcalCalibDetId.cc:118
HcalCalibDetId::cboxChannel
int cboxChannel() const
get the calibration box channel (if relevant)
Definition: HcalCalibDetId.cc:86
HcalOtherDetId
Definition: HcalOtherDetId.h:22
HcalCalibDetId::rm
int rm() const
get the rm (where relevant)
Definition: HcalCalibDetId.cc:147
Exception.h
HcalCalibDetId::cbox_MixerLow
static const int cbox_MixerLow
Definition: HcalCalibDetId.h:103
sd
double sd
Definition: CascadeWrapper.h:113
HcalOtherDetId::subdet
HcalOtherSubdetector subdet() const
get the category
Definition: HcalOtherDetId.h:30
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HcalCalibDetId::cbox_MixerHigh
static const int cbox_MixerHigh
constants
Definition: HcalCalibDetId.h:102
HcalCalibDetId::CalibrationBox
Definition: HcalCalibDetId.h:49
HcalCalibDetId::fiber
int fiber() const
get the fiber (where relevant)
Definition: HcalCalibDetId.cc:145
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143