CMS 3D CMS Logo

PHcalTB04Info.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalTestBeam
4 // Class : PHcalTB04Info
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Sunanda Banerjee
10 // Created: Sun May 14 10:25:44 CEST 2006
11 //
12 
13 // system include files
14 
15 // user include files
18 
19 //
20 // constants, enums and typedefs
21 //
22 
23 //
24 // static data member definitions
25 //
26 
27 //
28 // constructors and destructor
29 //
31 
32 // PHcalTB04Info::PHcalTB04Info(const PHcalTB04Info& rhs) {
33 // // do actual copying here;
34 // }
35 
37 
38 //
39 // assignment operators
40 //
41 // const PHcalTB04Info& PHcalTB04Info::operator=(const PHcalTB04Info& rhs) {
42 // //An exception safe implementation is
43 // PHcalTB04Info temp(rhs);
44 // swap(rhs);
45 //
46 // return *this;
47 // }
48 
49 //
50 // member functions
51 //
52 
54  nPrimary = idBeam = 0;
55  eBeam = etaBeam = phiBeam = 0;
56 
57  simEtot = simEEc = simEHc = 0;
58  digEtot = digEEc = digEHc = 0;
59 
60  nCrystal = nTower = 0;
61 
62  hit = 0;
63 
64  v1EvNum = v1Type = v1Nsec = 0;
65  v1X = v1Y = v1Z = v1U = v1V = v1W = 0;
66  v1Px = v1Py = v1Pz = 0;
67 }
68 
69 void PHcalTB04Info::setIDs(const std::vector<int>& ide, const std::vector<int>& idh) {
70  nCrystal = ide.size();
71  if (nCrystal > 0) {
72  idEcal.reserve(nCrystal);
73  esime.reserve(nCrystal);
74  edige.reserve(nCrystal);
75  }
76  LogDebug("SimHCalData") << "PHcalTB04Info:: Called with " << nCrystal << " crystals";
77  for (int i = 0; i < nCrystal; i++) {
78  idEcal.push_back(ide[i]);
79  LogDebug("SimHCalData") << "\tIndex for " << i << " = 0x" << std::hex << idEcal[i] << std::dec;
80  }
81 
82  nTower = idh.size();
83  if (nTower > 0) {
84  idHcal.reserve(nTower);
85  esimh.reserve(nTower);
86  edigh.reserve(nTower);
87  }
88  LogDebug("SimHCalData") << "PHcalTB04Info:: Called with " << nTower << " HCal towers";
89  for (int i = 0; i < nTower; i++) {
90  idHcal.push_back(idh[i]);
91  LogDebug("SimHCalData") << "\tIndex for " << i << " = 0x" << std::hex << idHcal[i] << std::dec;
92  }
93 }
94 
95 void PHcalTB04Info::setPrimary(int primary, int id, double energy, double etav, double phiv) {
96  nPrimary = primary;
97  idBeam = id;
98  eBeam = (float)(energy);
99  etaBeam = (float)(etav);
100  phiBeam = (float)(phiv);
101  LogDebug("SimHCalData") << "PHcalTB04Info::setPrimary: nPrimary " << nPrimary << " partID " << idBeam << " initE "
102  << eBeam << " eta " << etaBeam << " phi " << phiBeam;
103 }
104 
105 void PHcalTB04Info::setEdep(double simtot, double sime, double simh, double digtot, double dige, double digh) {
106  simEtot = (float)simtot;
107  simEEc = (float)sime;
108  simEHc = (float)simh;
109  digEtot = (float)digtot;
110  digEEc = (float)dige;
111  digEHc = (float)digh;
112 
113  LogDebug("SimHCalData") << "PHcalTB04Info::setEdep: simEtot " << simEtot << " simEEc " << simEEc << " simEHc "
114  << simEHc << " digEtot " << digEtot << " digEEc " << digEEc << " digEHc " << digEHc;
115 }
116 
117 void PHcalTB04Info::setEdepEcal(const std::vector<double>& esim, const std::vector<double>& eqie) {
118  for (int i = 0; i < nCrystal; i++) {
119  float edep = 0;
120  if (i < int(esim.size()))
121  esime.push_back(esim[i]);
122  else
123  esime.push_back(edep);
124  if (i < int(eqie.size()))
125  edige.push_back(eqie[i]);
126  else
127  edige.push_back(edep);
128 
129  LogDebug("SimHCalData") << "PHcalTB04Info::setEdepEcal [" << i << "] Esim = " << esime[i] << " Edig = " << edige[i];
130  }
131 }
132 
133 void PHcalTB04Info::setEdepHcal(const std::vector<double>& esim, const std::vector<double>& eqie) {
134  for (int i = 0; i < nTower; i++) {
135  float edep = 0;
136  if (i < int(esim.size()))
137  esimh.push_back(esim[i]);
138  else
139  esimh.push_back(edep);
140  if (i < int(eqie.size()))
141  edigh.push_back(eqie[i]);
142  else
143  edigh.push_back(edep);
144 
145  LogDebug("SimHCalData") << "PHcalTB04Info::setEdepHcal [" << i << "] Esim = " << esimh[i] << " Edig = " << edigh[i];
146  }
147 }
148 
149 void PHcalTB04Info::setTrnsProf(const std::vector<double>& es1,
150  const std::vector<double>& eq1,
151  const std::vector<double>& es2,
152  const std::vector<double>& eq2) {
153  int siz = (int)(es1.size());
154  if (siz > 0) {
155  latsimEta.reserve(siz);
156  latdigEta.reserve(siz);
157  latsimPhi.reserve(siz);
158  latdigPhi.reserve(siz);
159  for (int i = 0; i < siz; i++) {
160  latsimEta.push_back((float)(es1[i]));
161  latdigEta.push_back((float)(eq1[i]));
162  latsimPhi.push_back((float)(es2[i]));
163  latdigPhi.push_back((float)(eq2[i]));
164  LogDebug("SimHCalData") << "PHcalTB04Info::setTrnsProf [" << i << "] latsimEta = " << latsimEta[i]
165  << " latdigEta = " << latdigEta[i] << " latsimPhi = " << latsimPhi[i]
166  << " latdigPhi = " << latdigPhi[i];
167  }
168  }
169 }
170 
171 void PHcalTB04Info::setLongProf(const std::vector<double>& es, const std::vector<double>& eq) {
172  int siz = (int)(es.size());
173  if (siz > 0) {
174  longsim.reserve(siz);
175  longdig.reserve(siz);
176  for (int i = 0; i < siz; i++) {
177  longsim.push_back((float)(es[i]));
178  longdig.push_back((float)(eq[i]));
179  LogDebug("SimHCalData") << "PHcalTB04Info::setLongProf [" << i << "] longsim = " << longsim[i]
180  << " longdig = " << longdig[i];
181  }
182  }
183 }
184 
185 void PHcalTB04Info::saveHit(int det, int lay, int eta, int phi, double e, double t) {
186  int nh = hit;
187  hit++;
188  detHit.push_back(det);
189  layHit.push_back(lay);
190  etaHit.push_back(eta);
191  phiHit.push_back(phi);
192  eHit.push_back((float)(e));
193  tHit.push_back((float)(t));
194  LogDebug("SimHCalData") << "PHcalTB04Info::saveHit " << hit << " Det " << detHit[nh] << " layer " << layHit[nh]
195  << " Eta " << etaHit[nh] << " Phi " << phiHit[nh] << " E " << eHit[nh] << " t " << tHit[nh];
196 }
197 
199  int evNum, int type, double x, double y, double z, double u, double v, double w, double px, double py, double pz) {
200  v1EvNum = evNum;
201  v1Type = type;
202  double r = sqrt(x * x + y * y + z * z);
203  v1X = (float)(x);
204  v1Y = (float)(y);
205  v1Z = (float)(z);
206  v1R = (float)(r);
207  v1Px = (float)(px);
208  v1Py = (float)(py);
209  v1Pz = (float)(pz);
210  v1U = (float)(u);
211  v1V = (float)(v);
212  v1W = (float)(w);
213  LogDebug("SimHCalData") << "PHcalTB04Info::setVtxPrim: EvNum " << v1EvNum << " Type " << v1Type << " X/Y/Z/R " << v1X
214  << "/" << v1Y << "/" << v1Z << "/" << v1R << " Px/Py/Pz " << v1Px << "/" << v1Py << "/"
215  << v1Pz << " U/V/W " << v1U << "/" << v1V << "/" << v1W;
216 }
217 
218 void PHcalTB04Info::setVtxSec(int id, int pdg, double px, double py, double pz, double ek) {
219  int ns = v1Nsec;
220  v1Nsec++;
221  v1secTrackID.push_back(id);
222  v1secPartID.push_back(pdg);
223  v1secPx.push_back((float)(px));
224  v1secPy.push_back((float)(py));
225  v1secPz.push_back((float)(pz));
226  v1secEk.push_back((float)(ek));
227  LogDebug("SimHCalData") << "PHcalTB04Info::setVtxSec " << v1Nsec << " ID " << v1secTrackID[ns] << " PDG Code "
228  << v1secPartID[ns] << " Px/Py/Pz/Ek " << v1secPx[ns] << "/" << v1secPy[ns] << "/"
229  << v1secPz[ns] << "/" << v1secEk[ns];
230 }
PHcalTB04Info::v1Z
float v1Z
Definition: PHcalTB04Info.h:146
PHcalTB04Info::v1secEk
FloatVector v1secEk
Definition: PHcalTB04Info.h:148
PHcalTB04Info::v1U
float v1U
Definition: PHcalTB04Info.h:146
PHcalTB04Info::v1Py
float v1Py
Definition: PHcalTB04Info.h:147
DDAxes::y
PHcalTB04Info::eta
float eta() const
Definition: PHcalTB04Info.h:46
PHcalTB04Info::nCrystal
int nCrystal
Definition: PHcalTB04Info.h:133
mps_fire.i
i
Definition: mps_fire.py:355
PHcalTB04Info::etaBeam
float etaBeam
Definition: PHcalTB04Info.h:121
MessageLogger.h
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
PHcalTB04Info::v1W
float v1W
Definition: PHcalTB04Info.h:146
PHcalTB04Info::v1Pz
float v1Pz
Definition: PHcalTB04Info.h:147
detailsBasic3DVector::z
float float float z
Definition: extBasic3DVector.h:14
PHcalTB04Info::phiBeam
float phiBeam
Definition: PHcalTB04Info.h:121
PHcalTB04Info::v1secPx
FloatVector v1secPx
Definition: PHcalTB04Info.h:148
multPhiCorr_741_25nsDY_cfi.py
py
Definition: multPhiCorr_741_25nsDY_cfi.py:12
PHcalTB04Info::layHit
IntVector layHit
Definition: PHcalTB04Info.h:140
PHcalTB04Info::v1Nsec
int v1Nsec
Definition: PHcalTB04Info.h:144
PHcalTB04Info::setIDs
void setIDs(const std::vector< int > &, const std::vector< int > &)
Definition: PHcalTB04Info.cc:69
PHcalTB04Info::latsimPhi
FloatVector latsimPhi
Definition: PHcalTB04Info.h:129
PHcalTB04Info::setPrimary
void setPrimary(int primary, int id, double energy, double eta, double phi)
Definition: PHcalTB04Info.cc:95
PHcalTB04Info::tHit
FloatVector tHit
Definition: PHcalTB04Info.h:141
PHcalTB04Info::longsim
FloatVector longsim
Definition: PHcalTB04Info.h:130
DDAxes::x
PHcalTB04Info::saveHit
void saveHit(int det, int lay, int eta, int phi, double e, double t)
Definition: PHcalTB04Info.cc:185
PHcalTB04Info::edige
FloatVector edige
Definition: PHcalTB04Info.h:126
findQualityFiles.v
v
Definition: findQualityFiles.py:179
PHcalTB04Info::setEdep
void setEdep(double simtot, double sime, double simh, double digtot, double dige, double digh)
Definition: PHcalTB04Info.cc:105
PHcalTB04Info::setTrnsProf
void setTrnsProf(const std::vector< double > &es1, const std::vector< double > &eq1, const std::vector< double > &es2, const std::vector< double > &eq2)
Definition: PHcalTB04Info.cc:149
PHcalTB04Info::hit
int hit
Definition: PHcalTB04Info.h:139
PHcalTB04Info::phiHit
IntVector phiHit
Definition: PHcalTB04Info.h:140
PHcalTB04Info::latdigPhi
FloatVector latdigPhi
Definition: PHcalTB04Info.h:129
PHcalTB04Info::v1Y
float v1Y
Definition: PHcalTB04Info.h:146
PHcalTB04Info::v1Px
float v1Px
Definition: PHcalTB04Info.h:147
PHcalTB04Info::v1EvNum
int v1EvNum
Definition: PHcalTB04Info.h:144
PHcalTB04Info::simEEc
float simEEc
Definition: PHcalTB04Info.h:124
PHcalTB04Info::esime
FloatVector esime
Definition: PHcalTB04Info.h:126
PHcalTB04Info::evNum
int evNum() const
Definition: PHcalTB04Info.h:71
PHcalTB04Info::PHcalTB04Info
PHcalTB04Info()
Definition: PHcalTB04Info.cc:30
PHcalTB04Info::latsimEta
FloatVector latsimEta
Definition: PHcalTB04Info.h:128
PHcalTB04Info::detHit
IntVector detHit
Definition: PHcalTB04Info.h:140
PHcalTB04Info::setEdepEcal
void setEdepEcal(const std::vector< double > &esim, const std::vector< double > &edig)
Definition: PHcalTB04Info.cc:117
PHcalTB04Info::eBeam
float eBeam
Definition: PHcalTB04Info.h:121
PVValHelper::eta
Definition: PVValidationHelpers.h:69
w
const double w
Definition: UKUtility.cc:23
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
vertices_cff.x
x
Definition: vertices_cff.py:29
cms::cuda::nh
uint32_t nh
Definition: HistoContainer.h:23
DDAxes::z
PHcalTB04Info::setLongProf
void setLongProf(const std::vector< double > &es, const std::vector< double > &eq)
Definition: PHcalTB04Info.cc:171
HCALHighEnergyHPDFilter_cfi.energy
energy
Definition: HCALHighEnergyHPDFilter_cfi.py:5
PHcalTB04Info::edigh
FloatVector edigh
Definition: PHcalTB04Info.h:127
OrderedSet.t
t
Definition: OrderedSet.py:90
PHcalTB04Info::primary
int primary() const
Definition: PHcalTB04Info.h:43
PHcalTB04Info.h
PHcalTB04Info::nPrimary
int nPrimary
Definition: PHcalTB04Info.h:120
PHcalTB04Info::v1X
float v1X
Definition: PHcalTB04Info.h:146
PHcalTB04Info::phi
float phi() const
Definition: PHcalTB04Info.h:47
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
PVValHelper::phi
Definition: PVValidationHelpers.h:68
PHcalTB04Info::setVtxSec
void setVtxSec(int id, int pdg, double px, double py, double pz, double ek)
Definition: PHcalTB04Info.cc:218
PHcalTB04Info::setVtxPrim
void setVtxPrim(int evNum, int type, double x, double y, double z, double u, double v, double w, double px, double py, double pz)
Definition: PHcalTB04Info.cc:198
PHcalTB04Info::v1V
float v1V
Definition: PHcalTB04Info.h:146
createfilelist.int
int
Definition: createfilelist.py:10
PHcalTB04Info::idEcal
IntVector idEcal
Definition: PHcalTB04Info.h:134
PHcalTB04Info::simEtot
float simEtot
Definition: PHcalTB04Info.h:124
edm::eq
bool eq(const ELstring &s1, const ELstring s2)
Definition: ELstring.cc:39
PHcalTB04Info::esimh
FloatVector esimh
Definition: PHcalTB04Info.h:127
PHcalTB04Info::v1secPz
FloatVector v1secPz
Definition: PHcalTB04Info.h:148
PHcalTB04Info::idHcal
IntVector idHcal
Definition: PHcalTB04Info.h:136
PHcalTB04Info::digEEc
float digEEc
Definition: PHcalTB04Info.h:125
PHcalTB04Info::setEdepHcal
void setEdepHcal(const std::vector< double > &esim, const std::vector< double > &edig)
Definition: PHcalTB04Info.cc:133
alignCSCRings.r
r
Definition: alignCSCRings.py:93
PHcalTB04Info::idBeam
int idBeam
Definition: PHcalTB04Info.h:120
PHcalTB04Info::digEHc
float digEHc
Definition: PHcalTB04Info.h:125
PHcalTB04Info::nTower
int nTower
Definition: PHcalTB04Info.h:135
multPhiCorr_741_25nsDY_cfi.px
px
Definition: multPhiCorr_741_25nsDY_cfi.py:10
type
type
Definition: HCALResponse.h:21
PHcalTB04Info::eHit
FloatVector eHit
Definition: PHcalTB04Info.h:141
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
pdg
Definition: pdg_functions.h:28
PHcalTB04Info::etaHit
IntVector etaHit
Definition: PHcalTB04Info.h:140
PHcalTB04Info::clear
void clear()
Definition: PHcalTB04Info.cc:53
PHcalTB04Info::v1Type
int v1Type
Definition: PHcalTB04Info.h:144
PHcalTB04Info::v1R
float v1R
Definition: PHcalTB04Info.h:146
PHcalTB04Info::longdig
FloatVector longdig
Definition: PHcalTB04Info.h:130
PHcalTB04Info::v1secPy
FloatVector v1secPy
Definition: PHcalTB04Info.h:148
TauDecayModes.dec
dec
Definition: TauDecayModes.py:143
PHcalTB04Info::digEtot
float digEtot
Definition: PHcalTB04Info.h:125
PHcalTB04Info::v1secPartID
IntVector v1secPartID
Definition: PHcalTB04Info.h:145
PHcalTB04Info::~PHcalTB04Info
virtual ~PHcalTB04Info()
Definition: PHcalTB04Info.cc:36
hit
Definition: SiStripHitEffFromCalibTree.cc:88
PHcalTB04Info::v1secTrackID
IntVector v1secTrackID
Definition: PHcalTB04Info.h:145
PHcalTB04Info::simEHc
float simEHc
Definition: PHcalTB04Info.h:124
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
PHcalTB04Info::latdigEta
FloatVector latdigEta
Definition: PHcalTB04Info.h:128