#include <SimG4CMS/HcalTestBeam/interface/HcalTBNumberingScheme.h>
Public Member Functions | |
HcalTBNumberingScheme () | |
virtual | ~HcalTBNumberingScheme () |
Static Public Member Functions | |
static uint32_t | getUnitID (const uint32_t id, const int mode) |
static std::vector< uint32_t > | getUnitIDs (const int type, const int mode) |
Usage: Sets up tower ID's of all towers in the 2004 Hcal test beam setup
Definition at line 26 of file HcalTBNumberingScheme.h.
HcalTBNumberingScheme::HcalTBNumberingScheme | ( | ) | [inline] |
virtual HcalTBNumberingScheme::~HcalTBNumberingScheme | ( | ) | [inline, virtual] |
uint32_t HcalTBNumberingScheme::getUnitID | ( | const uint32_t | id, | |
const int | mode | |||
) | [static] |
Definition at line 27 of file HcalTBNumberingScheme.cc.
References group, HcalBarrel, LogDebug, HcalTestNumbering::packHcalIndex(), and HcalTestNumbering::unpackHcalIndex().
Referenced by HcalTB04Analysis::fillBuffer().
00028 { 00029 00030 int subdet, zside, group, ieta, iphi, lay; 00031 HcalTestNumbering::unpackHcalIndex(idHit, subdet, zside, group, 00032 ieta, iphi, lay); 00033 LogDebug("HcalTBSim") << "HcalTBNumberingScheme: i/p ID 0x" << std::hex 00034 << idHit << std::dec << " det " << zside << " group " 00035 << group << " layer " << lay << " eta " << ieta 00036 << " phi " << iphi; 00037 00038 uint32_t idunit; 00039 if (subdet == static_cast<int>(HcalBarrel)) { 00040 if (lay <= 17) group = 1; 00041 else group = 2; 00042 } 00043 if (mode > 0) { 00044 if (subdet == static_cast<int>(HcalBarrel) && iphi > 4) { 00045 if (lay <= 17) { 00046 // HB2 (unmasked and masked) 00047 if (ieta > 4 && ieta < 10) { 00048 idunit = HcalTestNumbering::packHcalIndex(0,0,1,0,iphi,lay); 00049 } else { 00050 idunit = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,group); 00051 } 00052 } else { 00053 // HO behind HB2 00054 idunit = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,18); 00055 } 00056 } else { 00057 // HB1, HE, HO behind HB1 00058 idunit = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,group); 00059 } 00060 } else { 00061 idunit = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,group); 00062 } 00063 00064 HcalTestNumbering::unpackHcalIndex(idunit, subdet, zside, group, 00065 ieta, iphi, lay); 00066 LogDebug("HcalTBSim") << "HcalTBNumberingScheme: idHit 0x" << std::hex 00067 << idHit << " idunit 0x" << idunit << std::dec << "\n" 00068 << "HcalTBNumberingScheme: o/p ID 0x" << std::hex 00069 << idunit << std::dec << " det " << zside << " group " 00070 << group << " layer " << lay << " eta " << ieta 00071 << " phi " << iphi; 00072 00073 return idunit; 00074 }
std::vector< uint32_t > HcalTBNumberingScheme::getUnitIDs | ( | const int | type, | |
const int | mode | |||
) | [static] |
Definition at line 76 of file HcalTBNumberingScheme.cc.
References id, HcalTestNumbering::packHcalIndex(), and tmp.
Referenced by HcalTB04Analysis::init().
00077 { 00078 00079 std::vector<uint32_t> tmp; 00080 int iphi, ieta, lay; 00081 uint32_t id; 00082 00083 if (type != 1) { 00084 // Include HB and HO id's 00085 if (mode>0) { 00086 // HB1 and masked part of HB2 00087 for (ieta=1; ieta<17; ieta++) { 00088 for (iphi=1; iphi<9; iphi++) { 00089 id = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,1); 00090 tmp.push_back(id); 00091 } 00092 } 00093 // HO behind HB1 00094 for (ieta=1; ieta<16; ieta++) { 00095 for (iphi=2; iphi<5; iphi++) { 00096 id = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,2); 00097 tmp.push_back(id); 00098 } 00099 } 00100 // HB2 00101 for (lay=1; lay<18; lay++) { 00102 for (iphi=5; iphi<9; iphi++) { 00103 id = HcalTestNumbering::packHcalIndex(0,0,1,0,iphi,lay); 00104 tmp.push_back(id); 00105 } 00106 } 00107 // HO behind HB2 00108 lay = 18; 00109 for (ieta=1; ieta<16; ieta++) { 00110 for (iphi=5; iphi<8; iphi++) { 00111 id = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,lay); 00112 tmp.push_back(id); 00113 } 00114 } 00115 } else { 00116 // HB1 & HB2 00117 for (ieta=1; ieta<17; ieta++) { 00118 for (iphi=1; iphi<9; iphi++) { 00119 id = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,1); 00120 tmp.push_back(id); 00121 } 00122 } 00123 // HO behind HB 00124 for (ieta=1; ieta<16; ieta++) { 00125 for (iphi=2; iphi<8; iphi++) { 00126 id = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,2); 00127 tmp.push_back(id); 00128 } 00129 } 00130 } 00131 } 00132 00133 if (type > 0) { 00134 // Include HE id's 00135 for (ieta=15; ieta<17; ieta++) { 00136 for (iphi=3; iphi<7; iphi++) { 00137 id = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,3); 00138 tmp.push_back(id); 00139 } 00140 } 00141 for (iphi=3; iphi<7; iphi++) { 00142 id = HcalTestNumbering::packHcalIndex(0,0,1,17,iphi,1); 00143 tmp.push_back(id); 00144 } 00145 for (ieta=18; ieta<21; ieta++) { 00146 for (iphi=3; iphi<7; iphi++) { 00147 for (int idep=1; idep<3; idep++) { 00148 id = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,idep); 00149 tmp.push_back(id); 00150 } 00151 } 00152 } 00153 for (ieta=21; ieta<26; ieta++) { 00154 for (iphi=2; iphi<4; iphi++) { 00155 for (int idep=1; idep<3; idep++) { 00156 id = HcalTestNumbering::packHcalIndex(0,0,1,ieta,iphi,idep); 00157 tmp.push_back(id); 00158 } 00159 } 00160 } 00161 } 00162 00163 return tmp; 00164 }