#include <HcalTestHistoClass.h>
Classes | |
struct | Hit |
struct | Layer |
struct | QIE |
Public Member Functions | |
void | fillHits (std::vector< CaloHit >) |
void | fillLayers (double el[], double ho, double hbhe, double muxy[]) |
void | fillQie (int id, double esimtot, double eqietot, int nGroup, std::vector< double > longs, std::vector< double > longq, int nTower, std::vector< double > latphi, std::vector< double > latfs, std::vector< double > latfq) |
HcalTestHistoClass () | |
HcalTestHistoClass (int i) | |
void | setCounters () |
virtual | ~HcalTestHistoClass () |
Private Attributes | |
float | eHBHE |
float | eHO |
std::vector< Hit > | hits |
std::vector< Layer > | layers |
int | nGroupQIE |
int | nHits |
int | nLayers |
int | nQIE |
int | nTowerQIE |
std::vector< QIE > | qie |
Static Private Attributes | |
static const int | nLayersMAX = 20 |
Definition at line 16 of file HcalTestHistoClass.h.
HcalTestHistoClass::HcalTestHistoClass | ( | int | i | ) | [inline] |
Definition at line 20 of file HcalTestHistoClass.h.
{}
HcalTestHistoClass::HcalTestHistoClass | ( | ) | [inline, explicit] |
Definition at line 21 of file HcalTestHistoClass.h.
{}
virtual HcalTestHistoClass::~HcalTestHistoClass | ( | ) | [inline, virtual] |
Definition at line 22 of file HcalTestHistoClass.h.
{}
void HcalTestHistoClass::fillHits | ( | std::vector< CaloHit > | hitcache | ) |
Definition at line 41 of file HcalTestHistoClass.cc.
References eta(), hits, i, LogDebug, nHits, phi, python::multivaluedict::sort(), matplotRender::t, and HcalTestNumbering::unpackHcalIndex().
Referenced by HcalTestAnalysis::qieAnalysis().
{ int nHit = hitcache.size(); int hit = 0; int i; std::vector<CaloHit>::iterator itr; std::vector<CaloHit*> lhits(nHit); for (i = 0, itr = hitcache.begin(); itr != hitcache.end(); i++, itr++) { uint32_t unitID=itr->id(); int subdet, zside, group, ieta, iphi, lay; HcalTestNumbering::unpackHcalIndex(unitID, subdet, zside, group, ieta, iphi, lay); subdet = itr->det(); lay = itr->layer(); group = (subdet&15)<<20; group += ((lay-1)&31)<<15; group += (zside&1)<<14; group += (ieta&127)<<7; group += (iphi&127); itr->setId(group); lhits[i] = &hitcache[i]; LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Original " << i << " " << hitcache[i]; LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Copied " << i << " " << *lhits[i]; } sort(lhits.begin(),lhits.end(),CaloHitIdMore()); std::vector<CaloHit*>::iterator k1, k2; for (i = 0, k1 = lhits.begin(); k1 != lhits.end(); i++, k1++) LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Sorted " << i << " " << **k1; hits.resize(lhits.size()); for (i = 0, k1 = lhits.begin(); k1 != lhits.end(); i++, k1++) { double ehit = (**k1).e(); double jitter= (**k1).t(); unsigned int unitID= (**k1).id(); int jump = 0; LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Start " << i << " U/T/E 0x" << std::hex << unitID << std::dec << " " << jitter << " " << ehit; for (k2 = k1+1; k2 != lhits.end() && (jitter-(**k2).t())<1. && (jitter-(**k2).t())>-1. && unitID==(**k2).id(); k2++) { ehit += (**k2).e(); LogDebug("HcalSim") << " + " << (**k2).e(); jump++; } LogDebug("HcalSim") << " = " << ehit << " in " << jump; float eta = itr->eta(); float phi = itr->phi(); float t = itr->t(); int lay = ((unitID>>15)&31)+1; hits[nHits].layer = lay; hits[nHits].id = unitID; hits[nHits].eta = eta; hits[nHits].phi = phi; hits[nHits].e = ehit; hits[nHits].t = t; hits[nHits].jitter = jitter; nHits++; hit++; int subdet = (unitID>>20)&15; int zside = (unitID>>14)&1; int ieta = (unitID>>7)&127; int iphi = (unitID)&127; LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Hit " << hit << " " << i << " ID 0x" << std::hex << unitID << std::dec << " " << subdet << " " << lay << " " << zside << " " << ieta << " " << iphi << " Time " << jitter << " E " << ehit; i += jump; k1 += jump; } LogDebug("HcalSim") << "HcalTestHistoClass::fillHits called with " << nHit << " hits" << " and writes out " << nHits << '(' << hit << ") hits"; }
void HcalTestHistoClass::fillLayers | ( | double | el[], |
double | ho, | ||
double | hbhe, | ||
double | muxy[] | ||
) |
Referenced by HcalTestAnalysis::layerAnalysis().
void HcalTestHistoClass::fillQie | ( | int | id, |
double | esimtot, | ||
double | eqietot, | ||
int | nGroup, | ||
std::vector< double > | longs, | ||
std::vector< double > | longq, | ||
int | nTower, | ||
std::vector< double > | latphi, | ||
std::vector< double > | latfs, | ||
std::vector< double > | latfq | ||
) |
Definition at line 125 of file HcalTestHistoClass.cc.
References i, LogDebug, nGroupQIE, nQIE, nTowerQIE, and qie.
Referenced by HcalTestAnalysis::qieAnalysis().
{ nGroupQIE = 0; nTowerQIE = 0; if (id>=0 && id<4) { unsigned int qiesiz = (unsigned int)(id+1); if (qie.size()<qiesiz) { qie.resize(qiesiz); } qie[id].sim=esimtot; qie[id].qie=eqietot; qie[id].id = id; nQIE++; LogDebug("HcalSim") << "HcalTestHistoClass::fillQie: id, esimtot, eqietot" << " = " << id << " " << esimtot << " " << eqietot; for (int i=0; i<nGroup; i++) { LogDebug("HcalSim") << "HcalTestHistoClass::fillQie: id, nGroupQIE, " << "longs, longq = " << id << " " << nGroupQIE << " " << longs[i] << " " << longq[i]; qie[id].lngs.push_back(longs[i]); qie[id].lngq.push_back(longq[i]); nGroupQIE++; } for (int i=0; i<nTower; i++) { int tow = (int)latphi[i]; LogDebug("HcalSim") << "HcalTestHistoClass::fillQie: id, nTowerQIE, " << "tower, latfs, latfq = " << id << " " << nTowerQIE << " " << tow << " " << latfs[i] << " " << latfq[i]; qie[id].lats.push_back(latfs[i]); qie[id].latq.push_back(latfq[i]); qie[id].tow.push_back(tow); nTowerQIE++; } } LogDebug("HcalSim") << "HcalTestHistoClass::fillQie: Called with ID " << id << " nQIE " << nQIE << " nGroup " << nGroupQIE << " nTower " << nTowerQIE; }
void HcalTestHistoClass::setCounters | ( | ) |
float HcalTestHistoClass::eHBHE [private] |
Definition at line 64 of file HcalTestHistoClass.h.
Referenced by PHcalValidInfoLayer::fillLayers().
float HcalTestHistoClass::eHO [private] |
Definition at line 64 of file HcalTestHistoClass.h.
Referenced by PHcalValidInfoLayer::fillLayers().
std::vector<Hit> HcalTestHistoClass::hits [private] |
Definition at line 67 of file HcalTestHistoClass.h.
Referenced by fillHits().
std::vector<Layer> HcalTestHistoClass::layers [private] |
Definition at line 63 of file HcalTestHistoClass.h.
Referenced by PHcalValidInfoLayer::fillLayers().
int HcalTestHistoClass::nGroupQIE [private] |
Definition at line 69 of file HcalTestHistoClass.h.
Referenced by fillQie(), and setCounters().
int HcalTestHistoClass::nHits [private] |
Definition at line 66 of file HcalTestHistoClass.h.
Referenced by fillHits(), and setCounters().
int HcalTestHistoClass::nLayers [private] |
Definition at line 62 of file HcalTestHistoClass.h.
Referenced by PHcalValidInfoLayer::fillLayers(), and setCounters().
const int HcalTestHistoClass::nLayersMAX = 20 [static, private] |
Definition at line 61 of file HcalTestHistoClass.h.
Referenced by PHcalValidInfoLayer::fillLayers().
int HcalTestHistoClass::nQIE [private] |
Definition at line 69 of file HcalTestHistoClass.h.
Referenced by fillQie(), and setCounters().
int HcalTestHistoClass::nTowerQIE [private] |
Definition at line 69 of file HcalTestHistoClass.h.
Referenced by fillQie(), and setCounters().
std::vector<QIE> HcalTestHistoClass::qie [private] |
Definition at line 70 of file HcalTestHistoClass.h.
Referenced by fillQie().