CMS 3D CMS Logo

HcalCalibDetId Class Reference

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

#include <DataFormats/HcalDetId/interface/HcalCalibDetId.h>

Inheritance diagram for HcalCalibDetId:

HcalOtherDetId DetId

List of all members.

Public Types

enum  CalibDetType { CalibrationBox = 1, HOCrosstalk = 2 }
 Type identifier within calibration det ids. More...

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 (int ieta, int iphi)
 Construct an HO Crosstalk id.
 HcalCalibDetId (HcalSubdetector subdet, int ieta, int iphi, int ctype)
 Construct a calibration box - channel detid.
 HcalCalibDetId (const DetId &id)
 Create from a generic cell id.
 HcalCalibDetId (uint32_t rawid)
 Create from a raw id.
 HcalCalibDetId ()
 Create a null det 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)
 Assignment from a generic cell 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

enum HcalCalibDetId::CalibDetType

Type identifier within calibration det ids.

Enumerator:
CalibrationBox 
HOCrosstalk 

Definition at line 32 of file HcalCalibDetId.h.

00032 { CalibrationBox = 1, HOCrosstalk = 2 };


Constructor & Destructor Documentation

HcalCalibDetId::HcalCalibDetId (  ) 

Create a null det id.

Definition at line 5 of file HcalCalibDetId.cc.

00005                                : HcalOtherDetId() {
00006 }

HcalCalibDetId::HcalCalibDetId ( uint32_t  rawid  ) 

Create from a raw id.

Definition at line 9 of file HcalCalibDetId.cc.

00009                                              : HcalOtherDetId(rawid) {
00010 }

HcalCalibDetId::HcalCalibDetId ( const DetId id  ) 

Create from a generic cell id.

Definition at line 27 of file HcalCalibDetId.cc.

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

00027                                                {
00028   if (!gen.null() && (gen.det()!=Hcal || gen.subdetId()!=HcalOther)) {
00029     throw cms::Exception("Invalid DetId") << "Cannot initialize HcalCalibDetId from " << std::hex << gen.rawId() << std::dec; 
00030   }
00031   id_=gen.rawId();
00032   if (subdet()!=HcalCalibration) {
00033     throw cms::Exception("Invalid DetId") << "Cannot initialize HcalCalibDetId from " << std::hex << gen.rawId() << std::dec; 
00034   }
00035 }

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

Construct a calibration box - channel detid.

Definition at line 12 of file HcalCalibDetId.cc.

References CalibrationBox, and DetId::id_.

00012                                                                                     : HcalOtherDetId(HcalCalibration) {
00013   id_|=(CalibrationBox<<17); // Calibration Category, bits [17:19] (= "1" for CalibrationBox)
00014   id_|=(ctype&0xF)           // calibration channel type, bits [0:3]
00015       |((iphi&0x1F)<<4)      // phi index, bits [4:10]
00016       |(((ieta+2)&0x7)<<11)     // eta index, bits [11:13]
00017       |((subdet&0x7)<<14);   // subdetector, bits [14:16]
00018 }

HcalCalibDetId::HcalCalibDetId ( int  ieta,
int  iphi 
)

Construct an HO Crosstalk id.

Definition at line 20 of file HcalCalibDetId.cc.

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

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


Member Function Documentation

CalibDetType HcalCalibDetId::calibFlavor (  )  const [inline]

get the flavor of this calibration detid

Definition at line 47 of file HcalCalibDetId.h.

References DetId::id_.

Referenced by cboxChannel(), HcalGenericDetId::hashedId(), hcalSubdet(), ieta(), HcalText2DetIdConverter::init(), iphi(), operator<<(), HcalLedAnalysis::ProcessCalibEvent(), and zside().

00047 { return (CalibDetType)((id_>>17)&0x7); }

int HcalCalibDetId::cboxChannel (  )  const

get the calibration box channel (if relevant)

Definition at line 48 of file HcalCalibDetId.cc.

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

Referenced by cboxChannelString(), HcalGenericDetId::hashedId(), and HcalText2DetIdConverter::init().

00048                                       {
00049   return (calibFlavor()==CalibrationBox)?(id_&0xF):(0);
00050 }

std::string HcalCalibDetId::cboxChannelString (  )  const

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

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

00068                                                   {
00069   switch (cboxChannel()) {
00070   case(cbox_MixerHigh): return "Mixer-High";
00071   case(cbox_MixerLow): return "Mixer-Low";
00072   case(cbox_LaserMegatile): return "Megatile";
00073   case(cbox_RadDam_Layer0_RM4): return "RadDam-L0-RM4";
00074   case(cbox_RadDam_Layer7_RM4): return "RadDam-L7-RM4";
00075   case(cbox_RadDam_Layer0_RM1): return "RadDam-L0-RM1";
00076   case(cbox_RadDam_Layer7_RM1): return "RadDam-L7-RM1";
00077   case(cbox_HOCrosstalkPIN): return "HO-Crosstalk-PIN";
00078   case(cbox_HF_ScintillatorPIN): return "HF-Scint-PIN";
00079   default : return "";
00080   }
00081 }

HcalSubdetector HcalCalibDetId::hcalSubdet (  )  const

get the HcalSubdetector (if relevant)

Definition at line 52 of file HcalCalibDetId.cc.

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

Referenced by HcalGenericDetId::hashedId(), HcalText2DetIdConverter::init(), operator<<(), and HcalLedAnalysis::ProcessCalibEvent().

00052                                                  {  
00053   return (HcalSubdetector)((calibFlavor()==CalibrationBox)?((id_>>14)&0x7):(0));
00054 }

int HcalCalibDetId::ieta (  )  const

get the rbx name (if relevant)

get the "ieta" identifier (if relevant)

Definition at line 56 of file HcalCalibDetId.cc.

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

Referenced by HcalGenericDetId::hashedId(), HcalText2DetIdConverter::init(), and HcalLedAnalysis::ProcessCalibEvent().

00056                                {
00057   return (calibFlavor()==CalibrationBox)?(((id_>>11)&0x7)-2):((calibFlavor()==HOCrosstalk)?(((id_>>7)&0xF)*zside()):(0));
00058 }

int HcalCalibDetId::iphi (  )  const

get the low-edge iphi (if relevant)

Definition at line 60 of file HcalCalibDetId.cc.

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

Referenced by HcalGenericDetId::hashedId(), HcalText2DetIdConverter::init(), and HcalLedAnalysis::ProcessCalibEvent().

00060                                {
00061   return (calibFlavor()==CalibrationBox)?((id_>>4)&0x3F):((calibFlavor()==HOCrosstalk)?(id_&0x3F):(0));
00062 }

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

Assignment from a generic cell id.

Reimplemented from HcalOtherDetId.

Definition at line 37 of file HcalCalibDetId.cc.

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

00037                                                           {
00038   if (!gen.null() && (gen.det()!=Hcal || gen.subdetId()!=HcalOther)) {
00039     throw cms::Exception("Invalid DetId") << "Cannot assign HcalCalibDetId from " << std::hex << gen.rawId() << std::dec; 
00040   }
00041   id_=gen.rawId();
00042   if (subdet()!=HcalCalibration) {
00043     throw cms::Exception("Invalid DetId") << "Cannot assign HcalCalibDetId from " << std::hex << gen.rawId() << std::dec; 
00044   }
00045   return *this;
00046 }

int HcalCalibDetId::zside (  )  const

get the sign of ieta (+/-1)

Definition at line 64 of file HcalCalibDetId.cc.

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

Referenced by HcalGenericDetId::hashedId(), and ieta().

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


Member Data Documentation

const int HcalCalibDetId::cbox_HF_ScintillatorPIN = 8 [static]

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().

const int HcalCalibDetId::cbox_RadDam_Layer0_RM1 = 5 [static]

Definition at line 72 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

const int HcalCalibDetId::cbox_RadDam_Layer0_RM4 = 3 [static]

Definition at line 70 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

const int HcalCalibDetId::cbox_RadDam_Layer7_RM1 = 6 [static]

Definition at line 73 of file HcalCalibDetId.h.

Referenced by cboxChannelString().

const int HcalCalibDetId::cbox_RadDam_Layer7_RM4 = 4 [static]

Definition at line 71 of file HcalCalibDetId.h.

Referenced by cboxChannelString().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:23:29 2009 for CMSSW by  doxygen 1.5.4