22 double edepHBHE,
double* muxy) {
26 for (
int i = 0;
i < 20;
i++) {
27 double ed = 0.001*edepl[
i];
28 LogDebug(
"HcalSim") <<
"HcalTestHistoClass:: fillLayer: nLayers, ed " <<
i
43 int nHit = hitcache.size();
46 std::vector<CaloHit>::iterator itr;
47 std::vector<CaloHit*> lhits(nHit);
48 for (i = 0, itr = hitcache.begin(); itr != hitcache.end(); i++, itr++) {
49 uint32_t unitID=itr->id();
55 group = (subdet&15)<<20;
56 group += ((lay-1)&31)<<15;
57 group += (zside&1)<<14;
58 group += (ieta&127)<<7;
61 lhits[
i] = &hitcache[
i];
62 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillHits:Original " << i
63 <<
" " << hitcache[
i];
64 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillHits:Copied " << i
68 std::vector<CaloHit*>::iterator k1, k2;
69 for (i = 0, k1 = lhits.begin(); k1 != lhits.end(); i++, k1++)
70 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillHits:Sorted " << i <<
" "
73 hits.resize(lhits.size());
74 for (i = 0, k1 = lhits.begin(); k1 != lhits.end(); i++, k1++) {
75 double ehit = (**k1).e();
76 double jitter= (**k1).t();
77 unsigned int unitID= (**k1).id();
79 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillHits:Start " << i
80 <<
" U/T/E 0x" << std::hex << unitID <<
std::dec <<
" "
81 << jitter <<
" " << ehit;
82 for (k2 = k1+1; k2 != lhits.end() && (jitter-(**k2).t())<1. &&
83 (jitter-(**k2).t())>-1. && unitID==(**k2).id(); k2++) {
85 LogDebug(
"HcalSim") <<
" + " << (**k2).e();
88 LogDebug(
"HcalSim") <<
" = " << ehit <<
" in " << jump;
90 float eta = itr->eta();
91 float phi = itr->phi();
93 int lay = ((unitID>>15)&31)+1;
105 int subdet = (unitID>>20)&15;
106 int zside = (unitID>>14)&1;
107 int ieta = (unitID>>7)&127;
108 int iphi = (unitID)&127;
109 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillHits:Hit " << hit <<
" "
110 << i <<
" ID 0x" << std::hex << unitID <<
std::dec
111 <<
" " << subdet <<
" " << lay <<
" " << zside <<
" "
112 << ieta <<
" " << iphi <<
" Time " << jitter <<
" E "
119 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillHits called with " << nHit
120 <<
" hits" <<
" and writes out " <<
nHits <<
'(' << hit
126 int nGroup,
const std::vector<double>& longs,
127 const std::vector<double>& longq,
int nTower,
128 const std::vector<double>& latphi,
129 const std::vector<double>& latfs,
130 const std::vector<double>& latfq) {
136 unsigned int qiesiz = (
unsigned int)(
id+1);
137 if (
qie.size()<qiesiz) {
146 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillQie: id, esimtot, eqietot"
147 <<
" = " <<
id <<
" " << esimtot <<
" " << eqietot;
149 for (
int i=0;
i<nGroup;
i++) {
150 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillQie: id, nGroupQIE, "
151 <<
"longs, longq = " <<
id <<
" " <<
nGroupQIE
152 <<
" " << longs[
i] <<
" " << longq[
i];
153 qie[id].lngs.push_back(longs[
i]);
154 qie[id].lngq.push_back(longq[i]);
158 for (
int i=0;
i<nTower;
i++) {
159 int tow = (int)latphi[
i];
160 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillQie: id, nTowerQIE, "
161 <<
"tower, latfs, latfq = " <<
id <<
" " <<
nTowerQIE
162 <<
" " << tow <<
" " << latfs[
i] <<
" " << latfq[
i];
163 qie[id].lats.push_back(latfs[
i]);
164 qie[id].latq.push_back(latfq[i]);
165 qie[id].tow.push_back(tow);
169 LogDebug(
"HcalSim") <<
"HcalTestHistoClass::fillQie: Called with ID " <<
id
void fillQie(int id, double esimtot, double eqietot, int nGroup, const std::vector< double > &longs, const std::vector< double > &longq, int nTower, const std::vector< double > &latphi, const std::vector< double > &latfs, const std::vector< double > &latfq)
void fillLayers(double el[], double ho, double hbhe, double muxy[])
void fillHits(std::vector< CaloHit > &)
std::vector< Layer > layers
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
static const int nLayersMAX