CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Attributes
HcalCalibDetId Class Reference

#include <HcalCalibDetId.h>

Inheritance diagram for HcalCalibDetId:
HcalOtherDetId DetId

Public Types

enum  CalibDetType {
  CalibrationBox = 1, HOCrosstalk = 2, uMNqie = 3, CastorRadFacility = 4,
  LASERMON = 5, HBX = 6, HEX = 7
}
 
- Public Types inherited from DetId
enum  Detector {
  Tracker = 1, Muon = 2, Ecal = 3, Hcal = 4,
  Calo = 5, Forward = 6, VeryForward = 7, HGCalEE = 8,
  HGCalHSi = 9, HGCalHSc = 10, HGCalTrigger = 11
}
 

Public Member Functions

CalibDetType calibFlavor () const
 get the flavor of this calibration detid More...
 
int cboxChannel () const
 get the calibration box channel (if relevant) More...
 
std::string cboxChannelString () const
 get the calibration box channel as a string (if relevant) More...
 
int channel () const
 get the channel (for uMNio/qie or similar) More...
 
int fiber () const
 get the fiber (where relevant) More...
 
 HcalCalibDetId ()
 
 HcalCalibDetId (uint32_t rawid)
 
 HcalCalibDetId (const DetId &id)
 
 HcalCalibDetId (HcalSubdetector subdet, int ieta, int iphi, int ctype)
 
 HcalCalibDetId (CalibDetType dt, int ieta, int iphi)
 
 HcalCalibDetId (int ieta, int iphi)
 
 HcalCalibDetId (CalibDetType dt, int value)
 
 HcalCalibDetId (CalibDetType dt, int value1, int value2, int value3)
 
HcalSubdetector hcalSubdet () const
 get the HcalSubdetector (if relevant) More...
 
int ieta () const
 
int iphi () const
 get the low-edge iphi (if relevant) More...
 
HcalCalibDetIdoperator= (const DetId &id)
 
int rm () const
 get the rm (where relevant) More...
 
int zside () const
 get the sign of ieta (+/-1) More...
 
- Public Member Functions inherited from HcalOtherDetId
 HcalOtherDetId (const DetId &id)
 
HcalOtherDetIdoperator= (const DetId &id)
 
HcalOtherSubdetector subdet () const
 get the category More...
 
- Public Member Functions inherited from DetId
constexpr Detector det () const
 get the detector field from this detid More...
 
constexpr DetId ()
 Create an empty or null id (also for persistence) More...
 
constexpr DetId (uint32_t id)
 Create an id from a raw number. More...
 
constexpr DetId (Detector det, int subdet)
 Create an id, filling the detector and subdetector fields as specified. More...
 
constexpr bool null () const
 is this a null id ? More...
 
constexpr operator uint32_t () const
 
constexpr bool operator!= (DetId id) const
 inequality More...
 
constexpr uint32_t operator() () const
 
constexpr bool operator< (DetId id) const
 comparison More...
 
constexpr bool operator== (DetId id) const
 equality More...
 
constexpr uint32_t rawId () const
 get the raw id More...
 
constexpr int subdetId () const
 get the contents of the subdetector field (not cast into any detector's numbering enum) More...
 

Static Public Attributes

static const int cbox_HF_ScintillatorPIN = 8
 
static const int cbox_HOCrosstalkPIN = 7
 
static const int cbox_LaserMegatile = 2
 
static const int cbox_MixerHigh = 0
 constants More...
 
static const int cbox_MixerLow = 1
 
static const int cbox_RadDam_Layer0_RM1 = 5
 
static const int cbox_RadDam_Layer0_RM4 = 3
 
static const int cbox_RadDam_Layer7_RM1 = 6
 
static const int cbox_RadDam_Layer7_RM4 = 4
 
- Static Public Attributes inherited from DetId
static const int kDetMask = 0xF
 
static const int kDetOffset = 28
 
static const int kSubdetMask = 0x7
 
static const int kSubdetOffset = 25
 

Additional Inherited Members

- Protected Member Functions inherited from HcalOtherDetId
 HcalOtherDetId ()
 
 HcalOtherDetId (uint32_t rawid)
 
 HcalOtherDetId (HcalOtherSubdetector subdet)
 Constructor from signed ieta, iphi plus composite type and composite data. More...
 
- Protected Attributes inherited from DetId
uint32_t id_
 

Detailed Description

Contents of the HcalCalibDetId : [19:17] Calibration Category (1 = CalibUnit, 2 = HOX, 3=uMNio/qie, 4=CastorRad, 5=LASMON, 6=HBX, 7=HEX)

For CalibUnit: [16:14] Subdetector [13:11] Ieta (-2 -> 2) [10:4] Iphi ("low edge") [3:0] Calibration channel type

For HX (HOCrosstalk) channels: [11] side (true = positive) [10:7] ieta [6:0] iphi

For uMNqie channels: [7:0] channel (typically just 0 or 1, but space for more if needed)

For Castor Radiation Facility: [16:10] RM [9:5] fiber-in-rm [4:0] channel-on-fiber

For Laser Monitoring channels: [16:10] ieta [9:5] iphi [3:0] cbox
For HBX/HEX: [19:17] 6 or 7 (CalibType) [12:12] side (true = positive) [11:7] ieta (1-29) [6:0] iphi (1-72)

Author
J. Mans - Minnesota

Definition at line 45 of file HcalCalibDetId.h.

Member Enumeration Documentation

◆ CalibDetType

Type identifier within calibration det ids

Enumerator
CalibrationBox 
HOCrosstalk 
uMNqie 
CastorRadFacility 
LASERMON 
HBX 
HEX 

Definition at line 48 of file HcalCalibDetId.h.

Constructor & Destructor Documentation

◆ HcalCalibDetId() [1/8]

HcalCalibDetId::HcalCalibDetId ( )

Create a null det id

Definition at line 5 of file HcalCalibDetId.cc.

◆ HcalCalibDetId() [2/8]

HcalCalibDetId::HcalCalibDetId ( uint32_t  rawid)

Create from a raw id

Definition at line 7 of file HcalCalibDetId.cc.

7 : HcalOtherDetId(rawid) {}

◆ HcalCalibDetId() [3/8]

HcalCalibDetId::HcalCalibDetId ( const DetId id)

Create from a generic cell id

Definition at line 61 of file HcalCalibDetId.cc.

References TauDecayModes::dec, Exception, DetId::Hcal, HcalCalibration, HcalOther, DetId::id_, and HcalOtherDetId::subdet().

61  {
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 }
uint32_t id_
Definition: DetId.h:69
HcalOtherSubdetector subdet() const
get the category

◆ HcalCalibDetId() [4/8]

HcalCalibDetId::HcalCalibDetId ( HcalSubdetector  subdet,
int  ieta,
int  iphi,
int  ctype 
)

Construct a calibration box - channel detid

Definition at line 9 of file HcalCalibDetId.cc.

References CalibrationBox, DetId::id_, ieta(), iphi(), and HcalOtherDetId::subdet().

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 }
int ieta() const
int iphi() const
get the low-edge iphi (if relevant)
uint32_t id_
Definition: DetId.h:69
HcalOtherSubdetector subdet() const
get the category

◆ HcalCalibDetId() [5/8]

HcalCalibDetId::HcalCalibDetId ( CalibDetType  dt,
int  ieta,
int  iphi 
)

Construct an HOX/HBX/HEX Crosstalk id

Definition at line 41 of file HcalCalibDetId.cc.

References funct::abs(), dt, HOCrosstalk, DetId::id_, ieta(), and iphi().

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 }
float dt
Definition: AMPTWrapper.h:136
int ieta() const
int iphi() const
get the low-edge iphi (if relevant)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
uint32_t id_
Definition: DetId.h:69

◆ HcalCalibDetId() [6/8]

HcalCalibDetId::HcalCalibDetId ( int  ieta,
int  iphi 
)

Keep old HOX constructor for back-compatibility

Definition at line 34 of file HcalCalibDetId.cc.

References funct::abs(), HOCrosstalk, DetId::id_, ieta(), and iphi().

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 }
int ieta() const
int iphi() const
get the low-edge iphi (if relevant)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
uint32_t id_
Definition: DetId.h:69

◆ HcalCalibDetId() [7/8]

HcalCalibDetId::HcalCalibDetId ( CalibDetType  dt,
int  value 
)

Construct a uMNqie id or other id which uses a single value plus a DetType

Definition at line 49 of file HcalCalibDetId.cc.

References dt, and DetId::id_.

50  id_ |= (dt << 17);
51  id_ |= value & 0xFF;
52 }
float dt
Definition: AMPTWrapper.h:136
Definition: value.py:1
uint32_t id_
Definition: DetId.h:69

◆ HcalCalibDetId() [8/8]

HcalCalibDetId::HcalCalibDetId ( CalibDetType  dt,
int  value1,
int  value2,
int  value3 
)

Construct a Castor radiation test facility id or other id which uses three values plus a DetType

Definition at line 54 of file HcalCalibDetId.cc.

References dt, DetId::id_, HLT_2022v15_cff::value1, and HLT_2022v15_cff::value2.

55  id_ |= (dt << 17); // Calibration Category, bits [17:19]
56  id_ |= (value1 & 0x3F) << 10;
57  id_ |= (value2 & 0x1F) << 5;
58  id_ |= (value3 & 0x1F);
59 }
float dt
Definition: AMPTWrapper.h:136
uint32_t id_
Definition: DetId.h:69

Member Function Documentation

◆ calibFlavor()

CalibDetType HcalCalibDetId::calibFlavor ( ) const
inline

◆ cboxChannel()

int HcalCalibDetId::cboxChannel ( ) const

◆ cboxChannelString()

std::string HcalCalibDetId::cboxChannelString ( ) const

get the calibration box channel as a string (if relevant)

Definition at line 118 of file HcalCalibDetId.cc.

References cbox_HF_ScintillatorPIN, cbox_HOCrosstalkPIN, cbox_LaserMegatile, cbox_MixerHigh, cbox_MixerLow, cbox_RadDam_Layer0_RM1, cbox_RadDam_Layer0_RM4, cbox_RadDam_Layer7_RM1, cbox_RadDam_Layer7_RM4, and cboxChannel().

Referenced by HcalLedAnalysis::ProcessCalibEvent().

118  {
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 }
int cboxChannel() const
get the calibration box channel (if relevant)
static const int cbox_RadDam_Layer7_RM4
static const int cbox_HF_ScintillatorPIN
static const int cbox_RadDam_Layer7_RM1
static const int cbox_LaserMegatile
static const int cbox_RadDam_Layer0_RM1
static const int cbox_HOCrosstalkPIN
static const int cbox_MixerLow
static const int cbox_RadDam_Layer0_RM4
static const int cbox_MixerHigh
constants

◆ channel()

int HcalCalibDetId::channel ( ) const

get the channel (for uMNio/qie or similar)

Definition at line 143 of file HcalCalibDetId.cc.

References calibFlavor(), DetId::id_, and uMNqie.

Referenced by HcalText2DetIdConverter::init().

143 { return (calibFlavor() == uMNqie) ? (id_ & 0xFF) : (id_ & 0x1F); }
uint32_t id_
Definition: DetId.h:69
CalibDetType calibFlavor() const
get the flavor of this calibration detid

◆ fiber()

int HcalCalibDetId::fiber ( ) const

get the fiber (where relevant)

Definition at line 145 of file HcalCalibDetId.cc.

References calibFlavor(), CastorRadFacility, and DetId::id_.

Referenced by HcalText2DetIdConverter::init().

145 { return (calibFlavor() == CastorRadFacility) ? ((id_ >> 5) & 0x1F) : (0); }
uint32_t id_
Definition: DetId.h:69
CalibDetType calibFlavor() const
get the flavor of this calibration detid

◆ hcalSubdet()

HcalSubdetector HcalCalibDetId::hcalSubdet ( ) const

◆ ieta()

int HcalCalibDetId::ieta ( ) const

get the rbx name (if relevant) std::string rbx() const; get the "ieta" identifier (if relevant)

Definition at line 94 of file HcalCalibDetId.cc.

References calibFlavor(), CalibrationBox, HBX, HEX, HOCrosstalk, DetId::id_, LASERMON, and zside().

Referenced by LEDTask::bookHistograms(), DigiTask::bookHistograms(), HcalTopology::detId2denseIdCALIB(), HcalCalibDetId(), HcalText2DetIdConverter::init(), HOHXLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HcalLedAnalysis::ProcessCalibEvent(), and HcalTopology::validCalib().

94  {
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 }
int zside() const
get the sign of ieta (+/-1)
uint32_t id_
Definition: DetId.h:69
CalibDetType calibFlavor() const
get the flavor of this calibration detid

◆ iphi()

int HcalCalibDetId::iphi ( ) const

get the low-edge iphi (if relevant)

Definition at line 104 of file HcalCalibDetId.cc.

References calibFlavor(), CalibrationBox, HBX, HEX, HOCrosstalk, DetId::id_, and LASERMON.

Referenced by LEDTask::bookHistograms(), DigiTask::bookHistograms(), HcalTopology::detId2denseIdCALIB(), HcalCalibDetId(), HcalText2DetIdConverter::init(), HOHXLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), HcalLedAnalysis::ProcessCalibEvent(), and HcalTopology::validCalib().

104  {
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 }
uint32_t id_
Definition: DetId.h:69
CalibDetType calibFlavor() const
get the flavor of this calibration detid

◆ operator=()

HcalCalibDetId & HcalCalibDetId::operator= ( const DetId id)

Definition at line 73 of file HcalCalibDetId.cc.

References TauDecayModes::dec, Exception, DetId::Hcal, HcalCalibration, HcalOther, DetId::id_, and HcalOtherDetId::subdet().

73  {
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 }
uint32_t id_
Definition: DetId.h:69
HcalOtherSubdetector subdet() const
get the category

◆ rm()

int HcalCalibDetId::rm ( ) const

get the rm (where relevant)

Definition at line 147 of file HcalCalibDetId.cc.

References calibFlavor(), CastorRadFacility, and DetId::id_.

Referenced by HcalText2DetIdConverter::init().

147 { return (calibFlavor() == CastorRadFacility) ? ((id_ >> 10) & 0x3F) : (0); }
uint32_t id_
Definition: DetId.h:69
CalibDetType calibFlavor() const
get the flavor of this calibration detid

◆ zside()

int HcalCalibDetId::zside ( ) const

get the sign of ieta (+/-1)

Definition at line 112 of file HcalCalibDetId.cc.

References calibFlavor(), HBX, HEX, HOCrosstalk, DetId::id_, and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by HcalTopology::detId2denseIdCALIB(), ieta(), and HOHXLogicalMapEntry::printLMapLine().

112  {
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 }
uint32_t id_
Definition: DetId.h:69
CalibDetType calibFlavor() const
get the flavor of this calibration detid

Member Data Documentation

◆ cbox_HF_ScintillatorPIN

const int HcalCalibDetId::cbox_HF_ScintillatorPIN = 8
static

Definition at line 110 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

◆ cbox_HOCrosstalkPIN

const int HcalCalibDetId::cbox_HOCrosstalkPIN = 7
static

Definition at line 109 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

◆ cbox_LaserMegatile

const int HcalCalibDetId::cbox_LaserMegatile = 2
static

Definition at line 104 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

◆ cbox_MixerHigh

const int HcalCalibDetId::cbox_MixerHigh = 0
static

constants

Definition at line 102 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

◆ cbox_MixerLow

const int HcalCalibDetId::cbox_MixerLow = 1
static

Definition at line 103 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

◆ cbox_RadDam_Layer0_RM1

const int HcalCalibDetId::cbox_RadDam_Layer0_RM1 = 5
static

Definition at line 107 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

◆ cbox_RadDam_Layer0_RM4

const int HcalCalibDetId::cbox_RadDam_Layer0_RM4 = 3
static

Definition at line 105 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

◆ cbox_RadDam_Layer7_RM1

const int HcalCalibDetId::cbox_RadDam_Layer7_RM1 = 6
static

Definition at line 108 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

◆ cbox_RadDam_Layer7_RM4

const int HcalCalibDetId::cbox_RadDam_Layer7_RM4 = 4
static

Definition at line 106 of file HcalCalibDetId.h.

Referenced by cboxChannelString().