#include <DataFormats/EcalDetId/interface/EcalTrigTowerDetId.h>
Public Member Functions | |
EcalTrigTowerDetId (const DetId &id) | |
Constructor from a generic cell id. | |
EcalTrigTowerDetId (int zside, EcalSubdetector subdet, int i, int j, int mode=SUBDETIJMODE) | |
Constructor from signed ieta, iphi. | |
EcalTrigTowerDetId (uint32_t rawid) | |
Constructor from a raw value. | |
EcalTrigTowerDetId () | |
Constructor of a null id. | |
int | hashedIndex () const |
get a compact index for arrays [TODO: NEEDS WORK] | |
int | iDCC () const |
get the ECAL DCC id - in the barrrel ism == iDCC | |
int | ieta () const |
get the tower ieta | |
int | ietaAbs () const |
get the absolute value of the tower ieta | |
int | iphi () const |
get the tower iphi | |
int | iquadrant () const |
int | iTT () const |
sequential index within one DCC | |
EcalTrigTowerDetId & | operator= (const DetId &id) |
Assignment from a generic cell id. | |
EcalSubdetector | subDet () const |
get the subDetector associated to the Trigger Tower | |
int | zside () const |
get the z-side of the tower (1/-1) | |
Static Public Attributes | |
static const int | kEBTowersInEta = 17 |
static const int | kEBTowersInPhi = 4 |
static const int | kEBTowersPerSM = 68 |
static const int | kEETowersInEta = 11 |
static const int | kEETowersInPhiPerQuadrant = 18 |
static const int | MAX_I = 127 |
static const int | MAX_J = 127 |
static const int | MIN_I = 1 |
static const int | MIN_J = 1 |
static const int | SUBDETDCCTTMODE = 1 |
static const int | SUBDETIJMODE = 0 |
Definition at line 17 of file EcalTrigTowerDetId.h.
EcalTrigTowerDetId::EcalTrigTowerDetId | ( | ) |
EcalTrigTowerDetId::EcalTrigTowerDetId | ( | uint32_t | rawid | ) |
EcalTrigTowerDetId::EcalTrigTowerDetId | ( | int | zside, | |
EcalSubdetector | subdet, | |||
int | i, | |||
int | j, | |||
int | mode = SUBDETIJMODE | |||
) |
Constructor from signed ieta, iphi.
Definition at line 12 of file EcalTrigTowerDetId.cc.
References EcalBarrel, Exception, DetId::id_, MAX_I, MAX_J, MIN_J, SUBDETDCCTTMODE, and SUBDETIJMODE.
00013 : DetId(Ecal,EcalTriggerTower) 00014 { 00015 int tower_i=0; 00016 int tower_j=0; 00017 00018 if (mode == SUBDETIJMODE) 00019 { 00020 tower_i=i; 00021 tower_j=j; 00022 } 00023 else if (mode == SUBDETDCCTTMODE) 00024 { 00025 throw cms::Exception("InvalidDetId") << "EcalTriggerTowerDetId: Cannot create object. SUBDETDCCTTMODE not yet implemented."; 00026 } 00027 else 00028 throw cms::Exception("InvalidDetId") << "EcalTriggerTowerDetId: Cannot create object. Unknown mode for (int, EcalSubdetector, int, int) constructor."; 00029 00030 if (tower_i > MAX_I || tower_i < MIN_I || tower_j > MAX_J || tower_j < MIN_J) 00031 throw cms::Exception("InvalidDetId") << "EcalTriggerTowerDetId: Cannot create object. Indexes out of bounds."; 00032 00033 id_|= ((zside>0)?(0x8000):(0x0)) | ((subDet == EcalBarrel)?(0x4000):(0x0)) | (tower_i<<7) | (tower_j & 0x7F); 00034 00035 }
EcalTrigTowerDetId::EcalTrigTowerDetId | ( | const DetId & | id | ) |
Constructor from a generic cell id.
Definition at line 37 of file EcalTrigTowerDetId.cc.
References DetId::det(), DetId::Ecal, EcalTriggerTower, Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().
00038 { 00039 if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalTriggerTower )) { 00040 throw cms::Exception("InvalidDetId"); } 00041 id_=gen.rawId(); 00042 }
int EcalTrigTowerDetId::hashedIndex | ( | ) | const |
get a compact index for arrays [TODO: NEEDS WORK]
Definition at line 96 of file EcalTrigTowerDetId.cc.
References iDCC(), iTT(), and kEBTowersPerSM.
00097 { 00098 return (iDCC()-1) * kEBTowersPerSM + iTT() - 1; 00099 }
int EcalTrigTowerDetId::iDCC | ( | ) | const |
get the ECAL DCC id - in the barrrel ism == iDCC
Definition at line 53 of file EcalTrigTowerDetId.cc.
References EcalBarrel, Exception, iphi(), kEBTowersInPhi, subDet(), and zside().
Referenced by hashedIndex().
00054 { 00055 if ( subDet() == EcalBarrel ) 00056 { 00057 //Correction since iphi is uniformized with HB convention 00058 int iphi_simple = iphi() + 2 ; 00059 if (iphi_simple > 72 ) iphi_simple = iphi_simple % 72; 00060 int id = ( iphi_simple - 1 ) / kEBTowersInPhi + 1; 00061 if ( zside() < 0 ) id += 18; 00062 return id; 00063 } 00064 else 00065 throw cms::Exception("MethodNotImplemented") << "EcalTriggerTowerDetId: iDCC not yet implemented"; 00066 }
int EcalTrigTowerDetId::ieta | ( | ) | const [inline] |
get the tower ieta
Definition at line 49 of file EcalTrigTowerDetId.h.
References ietaAbs(), and zside().
Referenced by EcalTrigPrimAnalyzer::analyze(), EcalTrigPrimAnalyzerMIPs::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), TCCBlockFormatter::DigiToRaw(), EcalSimRawData::getSrfs(), EcalSelectiveReadout::getTowerInterest(), EcalSimRawData::getTp(), EcalFEtoDigi::produce(), EcalSelectiveReadoutValidation::setTtEtSums(), and EcalSelectiveReadoutSuppressor::setTtFlags().
00050 { 00051 /* if ( subDet() == EcalBarrel) */ 00052 return zside()*ietaAbs(); 00053 /* else */ 00054 /* throw(std::runtime_error("EcalTrigTowerDetId: ieta not applicable for this subDetector.")); */ 00055 }
int EcalTrigTowerDetId::ietaAbs | ( | ) | const [inline] |
get the absolute value of the tower ieta
Definition at line 40 of file EcalTrigTowerDetId.h.
References DetId::id_.
Referenced by EcalTPGParamBuilder::analyze(), TPGCheck::analyze(), EcalTrigPrimAnalyzer::analyze(), EcalTrigPrimAnalyzerMIPs::analyze(), TCCBlockFormatter::DigiToRaw(), ieta(), iTT(), EcalTrigPrimFunctionalAlgo::run_part2(), and EcalTrigTowerConstituentsMap::wrapEcalTrigTowerDetId().
00041 { 00042 /* if ( subDet() == EcalBarrel) */ 00043 return (id_>>7)&0x7f; 00044 /* else */ 00045 /* throw(std::runtime_error("EcalTrigTowerDetId: ietaAbs not applicable for this subDetector.")); */ 00046 }
int EcalTrigTowerDetId::iphi | ( | ) | const [inline] |
get the tower iphi
Definition at line 58 of file EcalTrigTowerDetId.h.
References DetId::id_.
Referenced by EcalTPGParamBuilder::analyze(), EcalTrigPrimAnalyzer::analyze(), EcalTrigPrimAnalyzerMIPs::analyze(), EcalSelectiveReadoutValidation::analyzeEB(), TCCBlockFormatter::DigiToRaw(), EcalSimRawData::getSrfs(), EcalSelectiveReadout::getTowerInterest(), EcalSimRawData::getTp(), iDCC(), iquadrant(), iTT(), EcalFEtoDigi::produce(), EcalTrigPrimFunctionalAlgo::run_part2(), EcalSelectiveReadoutValidation::setTtEtSums(), EcalSelectiveReadoutSuppressor::setTtFlags(), and EcalTrigTowerConstituentsMap::wrapEcalTrigTowerDetId().
00059 { 00060 /* if ( subDet() == EcalBarrel) */ 00061 return id_&0x7F; 00062 /* else */ 00063 /* throw(std::runtime_error("EcalTrigTowerDetId: iphi not applicable for this subDetector.")); */ 00064 00065 }
int EcalTrigTowerDetId::iquadrant | ( | ) | const |
Definition at line 88 of file EcalTrigTowerDetId.cc.
References EcalEndcap, Exception, int, iphi(), kEETowersInPhiPerQuadrant, and subDet().
Referenced by EcalTrigTowerConstituentsMap::wrapEcalTrigTowerDetId().
00089 { 00090 if ( subDet() == EcalEndcap ) 00091 return int((iphi()-1)/kEETowersInPhiPerQuadrant)+1; 00092 else 00093 throw cms::Exception("MethodNotApplicable") << "EcalTriggerTowerDetId: iquadrant not applicable"; 00094 }
int EcalTrigTowerDetId::iTT | ( | ) | const |
sequential index within one DCC
Definition at line 68 of file EcalTrigTowerDetId.cc.
References EcalBarrel, Exception, ietaAbs(), iphi(), kEBTowersInPhi, subDet(), and zside().
Referenced by hashedIndex(), and EcalHVScanAnalyzer::pnFromTT().
00069 { 00070 if ( subDet() == EcalBarrel ) 00071 { 00072 int ie = ietaAbs() -1; 00073 int ip; 00074 int iphi_simple = iphi() + 2 ; 00075 if (iphi_simple > 72 ) iphi_simple = iphi_simple % 72; 00076 if (zside() < 0) { 00077 ip = (( iphi_simple -1 ) % kEBTowersInPhi ) + 1; 00078 } else { 00079 ip = kEBTowersInPhi - ((iphi_simple -1 ) % kEBTowersInPhi ); 00080 } 00081 00082 return (ie * kEBTowersInPhi) + ip; 00083 } 00084 else 00085 throw cms::Exception("MethodNotImplemented") << "EcalTriggerTowerDetId: iTT not yet implemented"; 00086 }
EcalTrigTowerDetId & EcalTrigTowerDetId::operator= | ( | const DetId & | id | ) |
Assignment from a generic cell id.
Definition at line 44 of file EcalTrigTowerDetId.cc.
References DetId::det(), DetId::Ecal, EcalTriggerTower, Exception, DetId::id_, DetId::null(), DetId::rawId(), and DetId::subdetId().
00044 { 00045 if (!gen.null() && ( gen.det()!=Ecal || gen.subdetId()!=EcalTriggerTower )) { 00046 throw cms::Exception("InvalidDetId"); 00047 } 00048 id_=gen.rawId(); 00049 return *this; 00050 }
EcalSubdetector EcalTrigTowerDetId::subDet | ( | ) | const [inline] |
get the subDetector associated to the Trigger Tower
Definition at line 37 of file EcalTrigTowerDetId.h.
References EcalBarrel, EcalEndcap, and DetId::id_.
Referenced by EcalTPGParamBuilder::analyze(), TPGCheck::analyze(), EcalTrigPrimAnalyzer::analyze(), TCCBlockFormatter::DigiToRaw(), EcalTPGScale::getTPGInADC(), EcalTPGScale::getTPGInGeV(), iDCC(), iquadrant(), iTT(), EcalDigiToRaw::produce(), EcalTrigPrimFunctionalAlgo::run_part2(), and EcalTrigTowerConstituentsMap::wrapEcalTrigTowerDetId().
00037 { return (id_&0x4000) ? EcalBarrel:EcalEndcap; }
int EcalTrigTowerDetId::zside | ( | ) | const [inline] |
get the z-side of the tower (1/-1)
Definition at line 34 of file EcalTrigTowerDetId.h.
References DetId::id_.
Referenced by EcalTPGParamBuilder::analyze(), iDCC(), ieta(), iTT(), and EcalTrigPrimFunctionalAlgo::run_part2().
00034 { return (id_&0x8000)?(1):(-1); }
const int EcalTrigTowerDetId::kEBTowersInEta = 17 [static] |
Definition at line 105 of file EcalTrigTowerDetId.h.
const int EcalTrigTowerDetId::kEBTowersInPhi = 4 [static] |
const int EcalTrigTowerDetId::kEBTowersPerSM = 68 [static] |
const int EcalTrigTowerDetId::kEETowersInEta = 11 [static] |
Definition at line 106 of file EcalTrigTowerDetId.h.
const int EcalTrigTowerDetId::kEETowersInPhiPerQuadrant = 18 [static] |
Definition at line 107 of file EcalTrigTowerDetId.h.
Referenced by EcalTrigTowerConstituentsMap::changeTowerQuadrant(), iquadrant(), and EcalTrigTowerConstituentsMap::wrapEcalTrigTowerDetId().
const int EcalTrigTowerDetId::MAX_I = 127 [static] |
const int EcalTrigTowerDetId::MAX_J = 127 [static] |
const int EcalTrigTowerDetId::MIN_I = 1 [static] |
Definition at line 98 of file EcalTrigTowerDetId.h.
const int EcalTrigTowerDetId::MIN_J = 1 [static] |
const int EcalTrigTowerDetId::SUBDETDCCTTMODE = 1 [static] |
const int EcalTrigTowerDetId::SUBDETIJMODE = 0 [static] |
Definition at line 110 of file EcalTrigTowerDetId.h.
Referenced by EcalTrigTowerDetId(), EcalElectronicsMapping::getTrigTowerDetId(), and Ecal2004TBSource::produce().