CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Classes | Public Member Functions | Private Attributes | Static Private Attributes
HcalTestHistoClass Class Reference

#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, 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)
 
 HcalTestHistoClass ()
 
 HcalTestHistoClass (int i)
 
void setCounters ()
 
virtual ~HcalTestHistoClass ()
 

Private Attributes

float eHBHE
 
float eHO
 
std::vector< Hithits
 
std::vector< Layerlayers
 
int nGroupQIE
 
int nHits
 
int nLayers
 
int nQIE
 
int nTowerQIE
 
std::vector< QIEqie
 

Static Private Attributes

const static int nLayersMAX = 20
 

Detailed Description

Definition at line 15 of file HcalTestHistoClass.h.

Constructor & Destructor Documentation

◆ HcalTestHistoClass() [1/2]

HcalTestHistoClass::HcalTestHistoClass ( int  i)
inline

Definition at line 17 of file HcalTestHistoClass.h.

17 {}

◆ HcalTestHistoClass() [2/2]

HcalTestHistoClass::HcalTestHistoClass ( )
inlineexplicit

Definition at line 18 of file HcalTestHistoClass.h.

18 {}

◆ ~HcalTestHistoClass()

virtual HcalTestHistoClass::~HcalTestHistoClass ( )
inlinevirtual

Definition at line 19 of file HcalTestHistoClass.h.

19 {}

Member Function Documentation

◆ fillHits()

void HcalTestHistoClass::fillHits ( std::vector< CaloHit > &  hitcache)

Definition at line 38 of file HcalTestHistoClass.cc.

38  {
39  int nHit = hitcache.size();
40  int hit = 0;
41  int i;
42  std::vector<CaloHit>::iterator itr;
43  std::vector<CaloHit*> lhits(nHit);
44  for (i = 0, itr = hitcache.begin(); itr != hitcache.end(); i++, itr++) {
45  uint32_t unitID = itr->id();
46  int subdet, zside, group, ieta, iphi, lay;
47  HcalTestNumbering::unpackHcalIndex(unitID, subdet, zside, group, ieta, iphi, lay);
48  subdet = itr->det();
49  lay = itr->layer();
50  group = (subdet & 15) << 20;
51  group += ((lay - 1) & 31) << 15;
52  group += (zside & 1) << 14;
53  group += (ieta & 127) << 7;
54  group += (iphi & 127);
55  itr->setId(group);
56  lhits[i] = &hitcache[i];
57  LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Original " << i << " " << hitcache[i];
58  LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Copied " << i << " " << *lhits[i];
59  }
60  sort(lhits.begin(), lhits.end(), CaloHitIdMore());
61  std::vector<CaloHit*>::iterator k1, k2;
62  for (i = 0, k1 = lhits.begin(); k1 != lhits.end(); i++, k1++)
63  LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Sorted " << i << " " << **k1;
64 
65  hits.resize(lhits.size());
66  for (i = 0, k1 = lhits.begin(); k1 != lhits.end(); i++, k1++) {
67  double ehit = (**k1).e();
68  double jitter = (**k1).t();
69  unsigned int unitID = (**k1).id();
70  int jump = 0;
71  LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Start " << i << " U/T/E 0x" << std::hex << unitID << std::dec
72  << " " << jitter << " " << ehit;
73  for (k2 = k1 + 1;
74  k2 != lhits.end() && (jitter - (**k2).t()) < 1. && (jitter - (**k2).t()) > -1. && unitID == (**k2).id();
75  k2++) {
76  ehit += (**k2).e();
77  LogDebug("HcalSim") << " + " << (**k2).e();
78  jump++;
79  }
80  LogDebug("HcalSim") << " = " << ehit << " in " << jump;
81 
82  float eta = itr->eta();
83  float phi = itr->phi();
84  float t = itr->t();
85  int lay = ((unitID >> 15) & 31) + 1;
86 
87  hits[nHits].layer = lay;
88  hits[nHits].id = unitID;
89  hits[nHits].eta = eta;
90  hits[nHits].phi = phi;
91  hits[nHits].e = ehit;
92  hits[nHits].t = t;
93  hits[nHits].jitter = jitter;
94  nHits++;
95  hit++;
96 
97  int subdet = (unitID >> 20) & 15;
98  int zside = (unitID >> 14) & 1;
99  int ieta = (unitID >> 7) & 127;
100  int iphi = (unitID)&127;
101  LogDebug("HcalSim") << "HcalTestHistoClass::fillHits:Hit " << hit << " " << i << " ID 0x" << std::hex << unitID
102  << std::dec << " " << subdet << " " << lay << " " << zside << " " << ieta << " " << iphi
103  << " Time " << jitter << " E " << ehit;
104 
105  i += jump;
106  k1 += jump;
107  }
108 
109  LogDebug("HcalSim") << "HcalTestHistoClass::fillHits called with " << nHit << " hits"
110  << " and writes out " << nHits << '(' << hit << ") hits";
111 }

References TauDecayModes::dec, PVValHelper::eta, watchdog::group, hits, mps_fire::i, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, LogDebug, nHits, phi, OrderedSet::t, HcalTestNumbering::unpackHcalIndex(), and ecaldqm::zside().

Referenced by HcalTestAnalysis::qieAnalysis().

◆ fillLayers()

void HcalTestHistoClass::fillLayers ( double  el[],
double  ho,
double  hbhe,
double  muxy[] 
)

Definition at line 21 of file HcalTestHistoClass.cc.

21  {
22  nLayers = 0;
23  layers.resize(nLayersMAX);
24  for (int i = 0; i < 20; i++) {
25  double ed = 0.001 * edepl[i];
26  LogDebug("HcalSim") << "HcalTestHistoClass:: fillLayer: nLayers, ed " << i << " " << ed;
27  if (nLayers < nLayersMAX) {
28  layers[i].e = ed;
29  layers[i].muDist = muxy[i];
30  nLayers++;
31  }
32  }
33 
34  eHO = edepHO;
35  eHBHE = edepHBHE;
36 }

References eHBHE, eHO, mps_fire::i, layers, LogDebug, nLayers, and nLayersMAX.

Referenced by HcalTestAnalysis::layerAnalysis().

◆ fillQie()

void HcalTestHistoClass::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 
)

Definition at line 113 of file HcalTestHistoClass.cc.

122  {
123  nGroupQIE = 0;
124  nTowerQIE = 0;
125 
126  if (id >= 0 && id < 4) {
127  unsigned int qiesiz = (unsigned int)(id + 1);
128  if (qie.size() < qiesiz) {
129  qie.resize(qiesiz);
130  }
131 
132  qie[id].sim = esimtot;
133  qie[id].qie = eqietot;
134  qie[id].id = id;
135  nQIE++;
136 
137  LogDebug("HcalSim") << "HcalTestHistoClass::fillQie: id, esimtot, eqietot"
138  << " = " << id << " " << esimtot << " " << eqietot;
139 
140  for (int i = 0; i < nGroup; i++) {
141  LogDebug("HcalSim") << "HcalTestHistoClass::fillQie: id, nGroupQIE, "
142  << "longs, longq = " << id << " " << nGroupQIE << " " << longs[i] << " " << longq[i];
143  qie[id].lngs.push_back(longs[i]);
144  qie[id].lngq.push_back(longq[i]);
145  nGroupQIE++;
146  }
147 
148  for (int i = 0; i < nTower; i++) {
149  int tow = (int)latphi[i];
150  LogDebug("HcalSim") << "HcalTestHistoClass::fillQie: id, nTowerQIE, "
151  << "tower, latfs, latfq = " << id << " " << nTowerQIE << " " << tow << " " << latfs[i] << " "
152  << latfq[i];
153  qie[id].lats.push_back(latfs[i]);
154  qie[id].latq.push_back(latfq[i]);
155  qie[id].tow.push_back(tow);
156  nTowerQIE++;
157  }
158  }
159  LogDebug("HcalSim") << "HcalTestHistoClass::fillQie: Called with ID " << id << " nQIE " << nQIE << " nGroup "
160  << nGroupQIE << " nTower " << nTowerQIE;
161 }

References mps_fire::i, triggerObjects_cff::id, createfilelist::int, LogDebug, nGroupQIE, nQIE, nTowerQIE, and qie.

Referenced by HcalTestAnalysis::qieAnalysis().

◆ setCounters()

void HcalTestHistoClass::setCounters ( )

Definition at line 13 of file HcalTestHistoClass.cc.

13  {
14  nLayers = 0;
15  nHits = 0;
16  nQIE = 0;
17  nTowerQIE = 0;
18  nGroupQIE = 0;
19 }

References nGroupQIE, nHits, nLayers, nQIE, and nTowerQIE.

Referenced by HcalTestAnalysis::update().

Member Data Documentation

◆ eHBHE

float HcalTestHistoClass::eHBHE
private

Definition at line 66 of file HcalTestHistoClass.h.

Referenced by fillLayers().

◆ eHO

float HcalTestHistoClass::eHO
private

Definition at line 66 of file HcalTestHistoClass.h.

Referenced by fillLayers().

◆ hits

std::vector<Hit> HcalTestHistoClass::hits
private

Definition at line 69 of file HcalTestHistoClass.h.

Referenced by fillHits().

◆ layers

std::vector<Layer> HcalTestHistoClass::layers
private

Definition at line 65 of file HcalTestHistoClass.h.

Referenced by fillLayers().

◆ nGroupQIE

int HcalTestHistoClass::nGroupQIE
private

Definition at line 71 of file HcalTestHistoClass.h.

Referenced by fillQie(), and setCounters().

◆ nHits

int HcalTestHistoClass::nHits
private

Definition at line 68 of file HcalTestHistoClass.h.

Referenced by fillHits(), and setCounters().

◆ nLayers

int HcalTestHistoClass::nLayers
private

Definition at line 64 of file HcalTestHistoClass.h.

Referenced by fillLayers(), and setCounters().

◆ nLayersMAX

const static int HcalTestHistoClass::nLayersMAX = 20
staticprivate

Definition at line 63 of file HcalTestHistoClass.h.

Referenced by fillLayers().

◆ nQIE

int HcalTestHistoClass::nQIE
private

Definition at line 71 of file HcalTestHistoClass.h.

Referenced by fillQie(), and setCounters().

◆ nTowerQIE

int HcalTestHistoClass::nTowerQIE
private

Definition at line 71 of file HcalTestHistoClass.h.

Referenced by fillQie(), and setCounters().

◆ qie

std::vector<QIE> HcalTestHistoClass::qie
private

Definition at line 72 of file HcalTestHistoClass.h.

Referenced by fillQie().

mps_fire.i
i
Definition: mps_fire.py:355
ecaldqm::zside
int zside(DetId const &)
Definition: EcalDQMCommonUtils.cc:189
HcalTestHistoClass::nQIE
int nQIE
Definition: HcalTestHistoClass.h:71
HcalTestHistoClass::nLayers
int nLayers
Definition: HcalTestHistoClass.h:64
LEDCalibrationChannels.iphi
iphi
Definition: LEDCalibrationChannels.py:64
HcalTestHistoClass::nGroupQIE
int nGroupQIE
Definition: HcalTestHistoClass.h:71
HcalTestHistoClass::eHO
float eHO
Definition: HcalTestHistoClass.h:66
HcalTestHistoClass::layers
std::vector< Layer > layers
Definition: HcalTestHistoClass.h:65
HcalTestNumbering::unpackHcalIndex
static void unpackHcalIndex(const uint32_t &idx, int &det, int &z, int &depth, int &eta, int &phi, int &lay)
Definition: HcalTestNumbering.cc:18
PVValHelper::eta
Definition: PVValidationHelpers.h:69
HcalTestHistoClass::nTowerQIE
int nTowerQIE
Definition: HcalTestHistoClass.h:71
OrderedSet.t
t
Definition: OrderedSet.py:90
CaloHitIdMore
Definition: CaloHit.h:41
HcalTestHistoClass::qie
std::vector< QIE > qie
Definition: HcalTestHistoClass.h:72
LEDCalibrationChannels.ieta
ieta
Definition: LEDCalibrationChannels.py:63
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
createfilelist.int
int
Definition: createfilelist.py:10
HcalTestHistoClass::eHBHE
float eHBHE
Definition: HcalTestHistoClass.h:66
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
HcalTestHistoClass::nHits
int nHits
Definition: HcalTestHistoClass.h:68
DDAxes::phi
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
hit
Definition: SiStripHitEffFromCalibTree.cc:88
watchdog.group
group
Definition: watchdog.py:82
HcalTestHistoClass::nLayersMAX
const static int nLayersMAX
Definition: HcalTestHistoClass.h:63
HcalTestHistoClass::hits
std::vector< Hit > hits
Definition: HcalTestHistoClass.h:69