CMS 3D CMS Logo

Public Types | Public Member Functions | Static Public Attributes

HcalCalibDetId Class Reference

#include <HcalCalibDetId.h>

Inheritance diagram for HcalCalibDetId:
HcalOtherDetId DetId

List of all members.

Public Types

enum  CalibDetType { CalibrationBox = 1, HOCrosstalk = 2 }

Public Member Functions

CalibDetType calibFlavor () const
 get the flavor of this calibration detid
int cboxChannel () const
 get the calibration box channel (if relevant)
std::string cboxChannelString () const
 get the calibration box channel as a string (if relevant)
 HcalCalibDetId (uint32_t rawid)
 HcalCalibDetId (HcalSubdetector subdet, int ieta, int iphi, int ctype)
 HcalCalibDetId (int ieta, int iphi)
 HcalCalibDetId ()
 HcalCalibDetId (const DetId &id)
HcalSubdetector hcalSubdet () const
 get the HcalSubdetector (if relevant)
int ieta () const
 get the rbx name (if relevant)
int iphi () const
 get the low-edge iphi (if relevant)
HcalCalibDetIdoperator= (const DetId &id)
int zside () const
 get the sign of ieta (+/-1)

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
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

Detailed Description

Contents of the HcalCalibDetId : [19:17] Calibration Category (1 = CalibUnit, 2 = HX)

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

Date:
2008/07/22 11:41:11
Revision:
1.6
Author:
J. Mans - Minnesota

Definition at line 29 of file HcalCalibDetId.h.


Member Enumeration Documentation

Type identifier within calibration det ids

Enumerator:
CalibrationBox 
HOCrosstalk 

Definition at line 32 of file HcalCalibDetId.h.


Constructor & Destructor Documentation

HcalCalibDetId::HcalCalibDetId ( )

Create a null det id

Definition at line 7 of file HcalCalibDetId.cc.

                               : HcalOtherDetId() {
}
HcalCalibDetId::HcalCalibDetId ( uint32_t  rawid)

Create from a raw id

Definition at line 11 of file HcalCalibDetId.cc.

                                             : HcalOtherDetId(rawid) {
}
HcalCalibDetId::HcalCalibDetId ( const DetId id)

Create from a generic cell id

Definition at line 36 of file HcalCalibDetId.cc.

References DetId::det(), Exception, DetId::Hcal, HcalCalibration, HcalOther, DetId::id_, DetId::null(), DetId::rawId(), HcalOtherDetId::subdet(), and DetId::subdetId().

                                               {
  if (!gen.null() && (gen.det()!=Hcal || gen.subdetId()!=HcalOther)) {
    throw cms::Exception("Invalid DetId") << "Cannot initialize HcalCalibDetId from " << std::hex << gen.rawId() << std::dec; 
  }
  id_=gen.rawId();
  if (subdet()!=HcalCalibration) {
    throw cms::Exception("Invalid DetId") << "Cannot initialize HcalCalibDetId from " << std::hex << gen.rawId() << std::dec; 
  }
}
HcalCalibDetId::HcalCalibDetId ( HcalSubdetector  subdet,
int  ieta,
int  iphi,
int  ctype 
)

Construct a calibration box - channel detid

Definition at line 14 of file HcalCalibDetId.cc.

References CalibrationBox, and DetId::id_.

                                                                                    : HcalOtherDetId(HcalCalibration) {

  id_|=(CalibrationBox<<17); // Calibration Category, bits [17:19] (= "1" for CalibrationBox)
  id_|=(ctype&0xF);           // calibration channel type, bits [0:3]
  id_|=(((ieta+2)&0x7)<<11);     // eta index, bits [11:13]
  id_|=((subdet&0x7)<<14);   // subdetector, bits [14:16]
  if (subdet==4) id_|=((((((((iphi-1)&0x7E)+1)/18)*18)+1)&0x7F)<<4);      // phi index, bits [4:10] dphi = 18 for HF, values 1,19,37,55 (lower edge)
  //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)
  //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)
  else if (subdet==1||subdet==2) id_|=(((((((iphi+1)>>2)&0x1F)<<2)+71)%72)<<4);      // phi index, bits [4:10] dphi=4 for HBHE, values 3,7,...,71, (lower edge)
  else if (subdet==3&&ieta==0) id_|=( ((((((iphi+1)/6)*6)+71)%72)&0x7F) <<4);      // phi index, bits [4:10] dphi=6 for HO0, values 5,11,...,71, (lower edge)
  else if (subdet==3&&ieta!=0) id_|=( ((((((iphi+1)/12)*12)+71)%72)&0x7F) <<4);      // phi index, bits [4:10] dphi=12 for HOP and HOM, values 11,23,,...,71, (lower edge)
  else id_|=((iphi&0x7F)<<4);      // phi index, bits [4:10], simply allow all values from 0-127, shouldn't be any
}
HcalCalibDetId::HcalCalibDetId ( int  ieta,
int  iphi 
)

Construct an HO Crosstalk id

Definition at line 29 of file HcalCalibDetId.cc.

References abs, HOCrosstalk, and DetId::id_.

                                                 : HcalOtherDetId(HcalCalibration) {
  id_|=(HOCrosstalk<<17); // Calibration Category, bits [17:19] (= "2" for HOX)
  id_|=(iphi&0x7F)               // phi index, bits [0:6]
      |((abs(ieta)&0xF)<<7)     // eta index, bits [7:10]
      |(((ieta > 0)?(1):(0))<<11); // z side, bit [11]
}

Member Function Documentation

CalibDetType HcalCalibDetId::calibFlavor ( ) const [inline]
int HcalCalibDetId::cboxChannel ( ) const

get the calibration box channel (if relevant)

Definition at line 57 of file HcalCalibDetId.cc.

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

Referenced by cboxChannelString(), HcalTopology::detId2denseIdCALIB(), HcalText2DetIdConverter::init(), and CALIBLogicalMapEntry::printLMapLine().

                                      {
  return (calibFlavor()==CalibrationBox)?(id_&0xF):(0);
}
std::string HcalCalibDetId::cboxChannelString ( ) const

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

Definition at line 77 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().

                                                  {
  switch (cboxChannel()) {
  case(cbox_MixerHigh): return "Mixer-High";
  case(cbox_MixerLow): return "Mixer-Low";
  case(cbox_LaserMegatile): return "Megatile";
  case(cbox_RadDam_Layer0_RM4): return "RadDam-L0-RM4";
  case(cbox_RadDam_Layer7_RM4): return "RadDam-L7-RM4";
  case(cbox_RadDam_Layer0_RM1): return "RadDam-L0-RM1";
  case(cbox_RadDam_Layer7_RM1): return "RadDam-L7-RM1";
  case(cbox_HOCrosstalkPIN): return "HO-Crosstalk-PIN";
  case(cbox_HF_ScintillatorPIN): return "HF-Scint-PIN";
  default : return "";
  }
}
HcalSubdetector HcalCalibDetId::hcalSubdet ( ) const
int HcalCalibDetId::ieta ( ) const

get the rbx name (if relevant)

get the "ieta" identifier (if relevant)

Definition at line 65 of file HcalCalibDetId.cc.

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

Referenced by HcalTopology::detId2denseIdCALIB(), HcalText2DetIdConverter::init(), HOHXLogicalMapEntry::printLMapLine(), CALIBLogicalMapEntry::printLMapLine(), and HcalLedAnalysis::ProcessCalibEvent().

                               {
  return (calibFlavor()==CalibrationBox)?(((id_>>11)&0x7)-2):((calibFlavor()==HOCrosstalk)?(((id_>>7)&0xF)*zside()):(0));
}
int HcalCalibDetId::iphi ( ) const
HcalCalibDetId & HcalCalibDetId::operator= ( const DetId id)

Assignment from a generic cell id

Reimplemented from HcalOtherDetId.

Definition at line 46 of file HcalCalibDetId.cc.

References DetId::det(), Exception, DetId::Hcal, HcalCalibration, HcalOther, DetId::id_, DetId::null(), DetId::rawId(), HcalOtherDetId::subdet(), and DetId::subdetId().

                                                          {
  if (!gen.null() && (gen.det()!=Hcal || gen.subdetId()!=HcalOther)) {
    throw cms::Exception("Invalid DetId") << "Cannot assign HcalCalibDetId from " << std::hex << gen.rawId() << std::dec; 
  }
  id_=gen.rawId();
  if (subdet()!=HcalCalibration) {
    throw cms::Exception("Invalid DetId") << "Cannot assign HcalCalibDetId from " << std::hex << gen.rawId() << std::dec; 
  }
  return *this;
}
int HcalCalibDetId::zside ( ) const

get the sign of ieta (+/-1)

Definition at line 73 of file HcalCalibDetId.cc.

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

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

                                {
  return (calibFlavor()==HOCrosstalk)?(((id_>>11)&0x1)?(1):(-1)):(0);
}

Member Data Documentation

Definition at line 75 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

const int HcalCalibDetId::cbox_HOCrosstalkPIN = 7 [static]

Definition at line 74 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

const int HcalCalibDetId::cbox_LaserMegatile = 2 [static]

Definition at line 69 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

const int HcalCalibDetId::cbox_MixerHigh = 0 [static]

constants

Definition at line 67 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

const int HcalCalibDetId::cbox_MixerLow = 1 [static]

Definition at line 68 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

Definition at line 72 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

Definition at line 70 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

Definition at line 73 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

Definition at line 71 of file HcalCalibDetId.h.

Referenced by cboxChannelString().