CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PHcalTB06Info.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalTestBeam
4 // Class : PHcalTB06Info
5 //
6 // Implementation:
7 // <Notes on implementation>
8 //
9 // Original Author: Sunanda Banerjee
10 // Created: Tue Oct 10 10:25:44 CEST 2006
11 //
12 
13 // system include files
14 
15 // user include files
18 
19 
20 
21 //
22 // constants, enums and typedefs
23 //
24 
25 //
26 // static data member definitions
27 //
28 
29 //
30 // constructors and destructor
31 //
33  clear();
34 }
35 
36 // PHcalTB06Info::PHcalTB06Info(const PHcalTB06Info& rhs) {
37 // // do actual copying here;
38 // }
39 
41 }
42 
43 //
44 // assignment operators
45 //
46 // const PHcalTB06Info& PHcalTB06Info::operator=(const PHcalTB06Info& rhs) {
47 // //An exception safe implementation is
48 // PHcalTB06Info temp(rhs);
49 // swap(rhs);
50 //
51 // return *this;
52 // }
53 
54 //
55 // member functions
56 //
57 
59  nPrimary = idBeam =0;
60  eBeam = etaBeam = phiBeam = 0;
61 
62  simEtot = simEEc = simEHc = 0;
63 
64  hit = 0;
65  hits.clear();
66 
67  v1EvNum = v1Type = v1Nsec = 0;
68  v1X = v1Y = v1Z = v1U = v1V = v1W = 0;
69  v1Px = v1Py = v1Pz = 0;
70  v1Sec.clear();
71 }
72 
73 void PHcalTB06Info::setPrimary(int primary, int id, double energy, double etav,
74  double phiv) {
75 
76  nPrimary = primary;
77  idBeam = id;
78  eBeam = (float)(energy);
79  etaBeam = (float)(etav);
80  phiBeam = (float)(phiv);
81  LogDebug("SimHCalData") << "PHcalTB06Info::setPrimary: nPrimary " << nPrimary
82  << " partID " << idBeam << " initE " << eBeam
83  << " eta " << etaBeam << " phi " << phiBeam;
84 }
85 
86 void PHcalTB06Info::setEdep(double simtot, double sime, double simh) {
87 
88  simEtot = (float)simtot;
89  simEEc = (float)sime;
90  simEHc = (float)simh;
91 
92  LogDebug("SimHCalData") << "PHcalTB06Info::setEdep: simEtot " << simEtot
93  << " simEEc " << simEEc << " simEHc " << simEHc;
94 }
95 
96 void PHcalTB06Info::saveHit(unsigned int id, double eta, double phi, double e,
97  double t) {
98 
99  int nh = hit;
100  hit++;
101  PHcalTB06Info::Hit newHit;
102  newHit.id = id;
103  newHit.eta = (float)(eta);
104  newHit.phi = (float)(phi);
105  newHit.e = (float)(e);
106  newHit.t = (float)(t);
107  hits.push_back(newHit);
108  LogDebug("SimHCalData") << "PHcalTB06Info::saveHit " << hit << " ID 0x"
109  << std::hex << hits[nh].id << std::dec << " Eta "
110  << hits[nh].eta << " Phi " << hits[nh].phi
111  << " E " << hits[nh].e << " t " << hits[nh].t;
112 }
113 
114 void PHcalTB06Info::setVtxPrim(int evNum, int type, double x, double y,
115  double z, double u, double v, double w,
116  double px, double py, double pz) {
117 
118  v1EvNum = evNum;
119  v1Type = type;
120  double r= sqrt(x*x+y*y+z*z);
121  v1X = (float)(x);
122  v1Y = (float)(y);
123  v1Z = (float)(z);
124  v1R = (float)(r);
125  v1Px = (float)(px);
126  v1Py = (float)(py);
127  v1Pz = (float)(pz);
128  v1U = (float)(u);
129  v1V = (float)(v);
130  v1W = (float)(w);
131  LogDebug("SimHCalData") << "PHcalTB06Info::setVtxPrim: EvNum " << v1EvNum
132  << " Type " << v1Type << " X/Y/Z/R " << v1X << "/"
133  << v1Y << "/" << v1Z << "/" << v1R << " Px/Py/Pz "
134  << v1Px << "/" << v1Py << "/" << v1Pz << " U/V/W "
135  << v1U << "/" << v1V << "/" << v1W;
136 }
137 
138 void PHcalTB06Info::setVtxSec(int id, int pdg, double px, double py, double pz,
139  double ek) {
140 
141  int ns = v1Nsec;
142  v1Nsec++;
144  newVtx.trackID = id;
145  newVtx.partID = pdg;
146  newVtx.px = (float)(px);
147  newVtx.py = (float)(py);
148  newVtx.pz = (float)(pz);
149  newVtx.eKin = (float)(ek);
150  v1Sec.push_back(newVtx);
151  LogDebug("SimHCalData") << "PHcalTB06Info::setVtxSec " << v1Nsec << " ID "
152  << v1Sec[ns].trackID << " PDG Code "
153  << v1Sec[ns].partID << " Px/Py/Pz/Ek "
154  << v1Sec[ns].px << "/" << v1Sec[ns].py << "/"
155  << v1Sec[ns].pz << "/" << v1Sec[ns].eKin;
156 }
#define LogDebug(id)
type
Definition: HCALResponse.h:22
void setEdep(double simtot, double sime, double simh)
unsigned int id
Definition: PHcalTB06Info.h:48
T eta() const
void setVtxPrim(int evNum, int type, double x, double y, double z, double u, double v, double w, double px, double py, double pz)
double double double z
virtual ~PHcalTB06Info()
T sqrt(T t)
Definition: SSEVec.h:46
VtxVector v1Sec
void setVtxSec(int id, int pdg, double px, double py, double pz, double ek)
void saveHit(unsigned int det, double eta, double phi, double e, double t)
HitVector hits
void setPrimary(int primary, int id, double energy, double eta, double phi)
int primary() const
Definition: PHcalTB06Info.h:61
x
Definition: VDTMath.h:216
mathSSE::Vec4< T > v
T w() const
int evNum() const
Definition: PHcalTB06Info.h:78
Definition: DDAxes.h:10