#include <HcalGenericDetId.h>
Public Types | |
enum | hashlimits { HBhalf = 1296, HEhalf = 1296, HEhalfh2mode = 4032, HOhalf = 1080, HFhalf = 864, HThalf = 2088, ZDChalf = 11, CASTORhalf = 224, CALIBhalf = 693 } |
enum | HcalGenericSubdetector { HcalGenEmpty = 0, HcalGenBarrel = 1, HcalGenEndcap = 2, HcalGenOuter = 3, HcalGenForward = 4, HcalGenTriggerTower = 5, HcalGenZDC = 8, HcalGenCalibration = 9, HcalGenCastor = 10, HcalGenUnknown = 99 } |
Public Member Functions | |
HcalGenericSubdetector | genericSubdet () const |
int | hashedId (bool h2mode_=false) const |
HcalGenericDetId (uint32_t rawid) | |
HcalGenericDetId () | |
HcalGenericDetId (const DetId &id) | |
bool | isHcalCalibDetId () const |
bool | isHcalCastorDetId () const |
bool | isHcalDetId () const |
bool | isHcalTrigTowerDetId () const |
bool | isHcalZDCDetId () const |
HcalOtherSubdetector | otherSubdet () const |
R.Ofierzynski, 22.02.2008, added hashedId
Definition at line 16 of file HcalGenericDetId.h.
Definition at line 35 of file HcalGenericDetId.h.
{ HBhalf = 1296, HEhalf = 1296, HEhalfh2mode = 4032, HOhalf = 1080, HFhalf = 864, HThalf = 2088, ZDChalf = 11, CASTORhalf = 224, CALIBhalf = 693 };
HcalGenEmpty | |
HcalGenBarrel | |
HcalGenEndcap | |
HcalGenOuter | |
HcalGenForward | |
HcalGenTriggerTower | |
HcalGenZDC | |
HcalGenCalibration | |
HcalGenCastor | |
HcalGenUnknown |
Definition at line 18 of file HcalGenericDetId.h.
{HcalGenEmpty=0, HcalGenBarrel=1, HcalGenEndcap=2, HcalGenOuter=3, HcalGenForward=4, HcalGenTriggerTower=5, HcalGenZDC=8, HcalGenCalibration=9, HcalGenCastor=10, HcalGenUnknown=99};
HcalGenericDetId::HcalGenericDetId | ( | ) | [inline] |
Definition at line 20 of file HcalGenericDetId.h.
: DetId () {}
HcalGenericDetId::HcalGenericDetId | ( | uint32_t | rawid | ) | [inline] |
Definition at line 21 of file HcalGenericDetId.h.
: DetId (rawid) {}
HcalGenericDetId::HcalGenericDetId | ( | const DetId & | id | ) | [inline] |
Definition at line 22 of file HcalGenericDetId.h.
: DetId (id) {}
HcalGenericDetId::HcalGenericSubdetector HcalGenericDetId::genericSubdet | ( | ) | const |
Definition at line 20 of file HcalGenericDetId.cc.
References DetId::Calo, DetId::det(), DetId::Hcal, HcalBarrel, HcalCalibration, HcalEndcap, HcalForward, HcalGenBarrel, HcalGenCalibration, HcalGenCastor, HcalGenEmpty, HcalGenEndcap, HcalGenForward, HcalGenOuter, HcalGenTriggerTower, HcalGenUnknown, HcalGenZDC, HcalOther, HcalOuter, HcalTriggerTower, DetId::null(), otherSubdet(), HcalCastorDetId::SubdetectorId, HcalZDCDetId::SubdetectorId, and DetId::subdetId().
Referenced by HcalAmplifier::addPedestals(), CastorCondObjectContainer< Item >::addValues(), HcalCholeskyMatrices::addValues(), HcalCondObjectContainer< Item >::addValues(), HcalCovarianceMatrices::addValues(), HcalLuttoDB::analyze(), HcalCondObjectContainer< Item >::exists(), CastorCondObjectContainer< Item >::exists(), HcalCholeskyMatrices::exists(), HcalCovarianceMatrices::exists(), HcalPacker::findSamples(), HcalLogicalMap::getHcalFrontEndId(), HcalSeverityLevelComputer::getSeverityLevel(), CastorCondObjectContainer< Item >::getValues(), HcalCholeskyMatrices::getValues(), HcalCondObjectContainer< Item >::getValues(), HcalCovarianceMatrices::getValues(), hashedId(), HcalText2DetIdConverter::init(), isHcalCalibDetId(), isHcalCastorDetId(), isHcalDetId(), isHcalTrigTowerDetId(), isHcalZDCDetId(), CastorDbHardcode::makeGain(), CastorDbHardcode::makePedestal(), CastorDbHardcode::makeQIECoder(), CastorDbASCIIIO::DetIdLess::operator()(), HcalSeverityLevelComputer::recoveredRecHit(), and HcalShapes::shape().
{ if (null()) return HcalGenEmpty; switch (det()) { case Calo : switch (subdetId()) { case HcalZDCDetId::SubdetectorId : return HcalGenZDC; case HcalCastorDetId::SubdetectorId : return HcalGenCastor; default: return HcalGenUnknown; } case Hcal : switch (HcalSubdetector(subdetId())) { case 0: return HcalGenEmpty; case HcalBarrel: return HcalGenBarrel; case HcalEndcap: return HcalGenEndcap; case HcalOuter: return HcalGenOuter; case HcalForward: return HcalGenForward; case HcalTriggerTower: return HcalGenTriggerTower; case HcalOther: switch (otherSubdet ()) { case HcalCalibration: return HcalGenCalibration; default: return HcalGenUnknown; } default: return HcalGenUnknown; } default: return HcalGenUnknown; } return HcalGenUnknown; }
int HcalGenericDetId::hashedId | ( | bool | h2mode_ = false | ) | const |
Definition at line 91 of file HcalGenericDetId.cc.
References abs, HcalCalibDetId::calibFlavor(), HcalCalibDetId::CalibrationBox, CASTORhalf, HcalCalibDetId::cboxChannel(), HcalZDCDetId::channel(), gather_cfg::cout, HcalDetId::depth(), HcalZDCDetId::EM, genericSubdet(), HcalZDCDetId::HAD, HBhalf, HcalBarrel, HcalEndcap, HcalForward, HcalGenBarrel, HcalGenCalibration, HcalGenCastor, HcalGenEndcap, HcalGenForward, HcalGenOuter, HcalGenTriggerTower, HcalGenZDC, HcalOuter, HcalCalibDetId::hcalSubdet(), HEhalf, HFhalf, HcalCalibDetId::HOCrosstalk, HOhalf, HThalf, HcalCalibDetId::ieta(), HcalDetId::ietaAbs(), HcalTrigTowerDetId::ietaAbs(), getHLTprescales::index, HcalCalibDetId::iphi(), HcalTrigTowerDetId::iphi(), HcalDetId::iphi(), HcalZDCDetId::LUM, HcalCastorDetId::module(), DetId::rawId(), HcalZDCDetId::section(), HcalCastorDetId::sector(), ZDChalf, HcalCalibDetId::zside(), HcalCastorDetId::zside(), HcalZDCDetId::zside(), HcalDetId::zside(), and HcalTrigTowerDetId::zside().
Referenced by CastorCondObjectContainer< Item >::addValues(), HcalCholeskyMatrices::addValues(), HcalCondObjectContainer< Item >::addValues(), HcalCovarianceMatrices::addValues(), HcalLogicalMapGenerator::buildCALIBMap(), HcalLogicalMapGenerator::buildHBEFTMap(), HcalLogicalMapGenerator::buildHOXMap(), HcalCondObjectContainer< Item >::exists(), CastorCondObjectContainer< Item >::exists(), HcalCholeskyMatrices::exists(), HcalCovarianceMatrices::exists(), HcalLogicalMap::getHcalFrontEndId(), CastorCondObjectContainer< Item >::getValues(), HcalCholeskyMatrices::getValues(), HcalCondObjectContainer< Item >::getValues(), and HcalCovarianceMatrices::getValues().
{ int index = -1; int zside=0, ietaAbs=0, ieta=0, iphi=0, depth=0, channel=0, sector=0, module=0; switch (genericSubdet()) { // HB valid DetIds: phi=1-72,eta=1-14,depth=1; phi=1-72,eta=15-16,depth=1-2 case HcalGenericDetId::HcalGenBarrel: { HcalDetId tid(rawId() ); zside = tid.zside(); ietaAbs = tid.ietaAbs(); iphi = tid.iphi(); depth = tid.depth(); // if (ietaAbs < 16) index = (iphi - 1)*18 + (ietaAbs - 1) + (depth - 1); // if (ietaAbs == 16) index = (iphi - 1)*18 + ietaAbs + (depth - 1); index = (iphi - 1)*18 + ietaAbs + depth - 2; if (ietaAbs == 16) ++index; if (zside == -1) index += HBhalf; } break; // HE valid DetIds: phi=1-72,eta=16-17,depth=1; phi=1-72,eta=18-20,depth=1-2; // phi=1-71(in steps of 2),eta=21-26,depth=1-2; phi=1-71(in steps of 2),eta=27-28,depth=1-3 // phi=1-71(in steps of 2),eta=29,depth=1-2 case HcalGenericDetId::HcalGenEndcap: { HcalDetId tid(rawId() ); zside = tid.zside(); ietaAbs = tid.ietaAbs(); iphi = tid.iphi(); depth = tid.depth(); if (!h2mode_) { if (ietaAbs == 16 || ietaAbs == 17) index = (iphi - 1)*8 + (iphi/2)*20 + (ietaAbs - 16); if (ietaAbs >= 18 && ietaAbs <= 20) index = (iphi - 1)*8 + (iphi/2)*20 + 2 + 2*(ietaAbs-18) + (depth - 1); if (ietaAbs >= 21 && ietaAbs <= 26) index = (iphi - 1)*8 + (iphi/2)*20 + 8 + 2*(ietaAbs-21) + (depth - 1); if (ietaAbs >= 27 && ietaAbs <= 28) index = (iphi - 1)*8 + (iphi/2)*20 + 20 + 3*(ietaAbs-27) + (depth - 1); if (ietaAbs == 29) index = (iphi - 1)*8 + (iphi/2)*20 + 26 + 2*(ietaAbs-29) + (depth - 1); } else { // make as general as possible, don't care about tight packing for the moment // index = (iphi-1)*(4*14) + (ietaAbs - 16)*4 + (depth - 1); index = 4*( 14*(iphi-1) + (ietaAbs - 16)) + (depth - 1); // if (ietaAbs == 16) index = (iphi - 1)*11 + (iphi/2)*20 + (ietaAbs - 16); // if (ietaAbs == 17) index = (iphi - 1)*11 + (iphi/2)*20 + 1 + (ietaAbs - 17) + (depth - 1); // if (ietaAbs >= 18 && ietaAbs <= 20) index = (iphi - 1)*11 + (iphi/2)*20 + 5 + 2*(ietaAbs-18) + (depth - 1); // if (ietaAbs >= 21 && ietaAbs <= 26) index = (iphi - 1)*11 + (iphi/2)*20 + 11 + 2*(ietaAbs-21) + (depth - 1); // if (ietaAbs >= 27 && ietaAbs <= 28) index = (iphi - 1)*11 + (iphi/2)*20 + 23 + 3*(ietaAbs-27) + (depth - 1); // if (ietaAbs == 29) index = (iphi - 1)*11 + (iphi/2)*20 + 29 + 2*(ietaAbs-29) + (depth - 1); } if (zside == -1) index += HEhalf; } break; // HO valid DetIds: phi=1-72,eta=1-15,depth=4! case HcalGenericDetId::HcalGenOuter: { HcalDetId tid(rawId() ); zside = tid.zside(); ietaAbs = tid.ietaAbs(); iphi = tid.iphi(); depth = tid.depth(); index = (iphi - 1)*15 + (ietaAbs - 1); if (zside == -1) index += HOhalf; } break; // HF valid DetIds: phi=1-71(in steps of 2),eta=29-39,depth=1-2; phi=3-71(in steps of 4),eta=40-41,depth=1-2 case HcalGenericDetId::HcalGenForward: { HcalDetId tid(rawId() ); zside = tid.zside(); ietaAbs = tid.ietaAbs(); iphi = tid.iphi(); depth = tid.depth(); index = ((iphi-1)/4)*4 + ((iphi-1)/2)*22 + 2*(ietaAbs-29) + (depth - 1); if (zside == -1) index += HFhalf; } break; // TriggerTower: case HcalGenericDetId::HcalGenTriggerTower: { HcalTrigTowerDetId tid(rawId() ); zside = tid.zside(); ietaAbs = tid.ietaAbs(); iphi = tid.iphi(); if ((iphi-1)%4==0) index = (iphi-1)*32 + (ietaAbs-1) - (12*((iphi-1)/4)); else index = (iphi-1)*28 + (ietaAbs-1) + (4*(((iphi-1)/4)+1)); if (zside == -1) index += HThalf; // ieta = ietaAbs*zside; } break; // ZDC: ZDC_EM: 1 to 5, ZDC_HAD: 1 to 4, ZDC_LUM: 1,2, eta = +1, -1 case HcalGenericDetId::HcalGenZDC: { HcalZDCDetId tid(rawId() ); zside = tid.zside(); channel = tid.channel(); //depth = tid.depth();//depth is not unique, channel is switch (tid.section() ) { case HcalZDCDetId::EM: index = (channel-1); break; case HcalZDCDetId::HAD: index = 5 + (channel-1); break; case HcalZDCDetId::LUM: index = 9 + (channel-1); break; default: break; } if (zside == -1) index += ZDChalf; } break; // Castor: zside +-1, sector (phi-segmentation) 1..16, module (z segm.) 1..14 // total: 14*16=224 per zside case HcalGenericDetId::HcalGenCastor: { HcalCastorDetId tid(rawId() ); zside = tid.zside(); sector = tid.sector(); module = tid.module(); index = 14*(sector-1) + (module-1); if (zside == -1) index += CASTORhalf; } break; // Calibration channels: no zside=-1 ! with current naming convention case HcalGenericDetId::HcalGenCalibration: { HcalCalibDetId tid(rawId() ); channel = tid.cboxChannel(); ieta = tid.ieta(); iphi = tid.iphi(); zside = tid.zside(); if (tid.calibFlavor()==HcalCalibDetId::CalibrationBox) { HcalSubdetector subDet = tid.hcalSubdet(); if (subDet==HcalBarrel) { //std::cout<<"CALIB_HB: "; //dphi = 4 (18 phi values), 3 channel types (0,1,2), eta = -1 or 1 //total of 18*3*2=108 channels index = ((iphi+1)/4-1) + 18*channel + 27*(ieta+1); } else if (subDet==HcalEndcap) { //std::cout<<"CALIB_HE: "; //dphi = 4 (18 phi values), 6 channel types (0,1,3,4,5,6), eta = -1 or 1 //total of 18*6*2=216 channels if (channel>2) channel-=1; index = ((iphi+1)/4-1) + 18*channel + 54*(ieta+1) + 108; } else if (subDet==HcalForward) { //std::cout<<"CALIB_HF: "; //dphi = 18 (4 phi values), 3 channel types (0,1,8), eta = -1 or 1 if (channel==8) channel = 2; //total channels 4*3*2=24 index = (iphi-1)/18 + 4*channel + 6*(ieta+1) + 324; } else if (subDet==HcalOuter) { //std::cout<<"CALIB_HO: "; //there are 5 special calib crosstalk channels, one in each ring if (channel==7) { channel = 2; index = (ieta+2) + 420; } //for HOM/HOP dphi = 6 (12 phi values), 2 channel types (0,1), eta = -2,-1 or 1,2 //for HO0/YB0 dphi = 12 (6 phi values), 2 channel types (0,1), eta = 0 else{ if (ieta<0) index = ((iphi+1)/12-1) + 36*channel + 6*(ieta+2) + 348; else if (ieta>0) index = ((iphi+1)/12-1) + 36*channel + 6*(ieta+2) + 6 + 348; else index = ((iphi+1)/6-1) + 36*channel + 6*(ieta+2) + 348; } } else { std::cout << "HCAL Det Id not valid!" << std::endl; index = 0; } } else if (tid.calibFlavor()==HcalCalibDetId::HOCrosstalk) { //std::cout<<"HX: "; //for YB0/HO0 phi is grouped in 6 groups of 6 with dphi=2 but the transitions are 1 or 3 // in such a way that the %36 operation yeilds unique values for every iphi if (abs(ieta)==4) index = ((iphi-1)%36) + (((zside+1)*36)/2) + 72 + 425; //ieta = 1 YB0/HO0; else index = (iphi-1) + (36*(zside+1)*2) + 425; //ieta = 0 for HO2M/HO1M ieta=2 for HO1P/HO2P; } //std::cout << " " << ieta << " " << zside << " " << iphi << " " << depth << " " << index << std::endl; } //std::cout << "eta: " << ieta << " side: " << zside << " phi: " << iphi << " depth: " << depth << " index: " << index << std::endl; break; default: break; } // end switch return index; }
bool HcalGenericDetId::isHcalCalibDetId | ( | ) | const |
Definition at line 54 of file HcalGenericDetId.cc.
References genericSubdet(), and HcalGenCalibration.
Referenced by HcalText2DetIdConverter::init(), HcalText2DetIdConverter::isHcalCalibDetId(), and HOHXLogicalMapEntry::printLMapLine().
{ HcalGenericSubdetector subdet = genericSubdet (); return subdet == HcalGenCalibration; }
bool HcalGenericDetId::isHcalCastorDetId | ( | ) | const |
Definition at line 69 of file HcalGenericDetId.cc.
References genericSubdet(), and HcalGenCastor.
Referenced by CastorText2DetIdConverter::init(), CastorText2DetIdConverter::isHcalCastorDetId(), and CastorSimParameterMap::simParameters().
{ HcalGenericSubdetector subdet = genericSubdet (); return subdet == HcalGenCastor; }
bool HcalGenericDetId::isHcalDetId | ( | ) | const |
Definition at line 49 of file HcalGenericDetId.cc.
References genericSubdet(), HcalGenBarrel, HcalGenEndcap, HcalGenForward, and HcalGenOuter.
Referenced by HcalText2DetIdConverter::init(), HcalText2DetIdConverter::isHcalDetId(), CastorDbASCIIIO::DetIdLess::operator()(), and HOHXLogicalMapEntry::printLMapLine().
{ HcalGenericSubdetector subdet = genericSubdet (); return subdet == HcalGenBarrel || subdet == HcalGenEndcap || subdet == HcalGenOuter || subdet == HcalGenForward; }
bool HcalGenericDetId::isHcalTrigTowerDetId | ( | ) | const |
Definition at line 59 of file HcalGenericDetId.cc.
References genericSubdet(), and HcalGenTriggerTower.
Referenced by HcalText2DetIdConverter::init(), and HcalText2DetIdConverter::isHcalTrigTowerDetId().
{ HcalGenericSubdetector subdet = genericSubdet (); return subdet == HcalGenTriggerTower; }
bool HcalGenericDetId::isHcalZDCDetId | ( | ) | const |
Definition at line 64 of file HcalGenericDetId.cc.
References genericSubdet(), and HcalGenZDC.
Referenced by HcalText2DetIdConverter::init(), HcalText2DetIdConverter::isHcalZDCDetId(), HcalSimParameterMap::setFrameSize(), and HcalSimParameterMap::simParameters().
{ HcalGenericSubdetector subdet = genericSubdet (); return subdet == HcalGenZDC; }
HcalOtherSubdetector HcalGenericDetId::otherSubdet | ( | ) | const |
Definition at line 15 of file HcalGenericDetId.cc.
References HcalOther, HcalOtherEmpty, DetId::rawId(), and DetId::subdetId().
Referenced by genericSubdet().
{ if (HcalSubdetector(subdetId()) != HcalOther) return HcalOtherEmpty; return HcalOtherSubdetector ((rawId()>>20)&0x1F); }