CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 // constants, enums and typedefs
21 //
22 
23 //
24 // static data member definitions
25 //
26 
27 //
28 // constructors and destructor
29 //
31 
32 // PHcalTB06Info::PHcalTB06Info(const PHcalTB06Info& rhs) {
33 // // do actual copying here;
34 // }
35 
37 
38 //
39 // assignment operators
40 //
41 // const PHcalTB06Info& PHcalTB06Info::operator=(const PHcalTB06Info& rhs) {
42 // //An exception safe implementation is
43 // PHcalTB06Info 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 
59  hit = 0;
60  hits.clear();
61 
62  v1EvNum = v1Type = v1Nsec = 0;
63  v1X = v1Y = v1Z = v1U = v1V = v1W = 0;
64  v1Px = v1Py = v1Pz = 0;
65  v1Sec.clear();
66 }
67 
68 void PHcalTB06Info::setPrimary(int primary, int id, double energy, double etav, double phiv) {
69  nPrimary = primary;
70  idBeam = id;
71  eBeam = (float)(energy);
72  etaBeam = (float)(etav);
73  phiBeam = (float)(phiv);
74  LogDebug("SimHCalData") << "PHcalTB06Info::setPrimary: nPrimary " << nPrimary << " partID " << idBeam << " initE "
75  << eBeam << " eta " << etaBeam << " phi " << phiBeam;
76 }
77 
78 void PHcalTB06Info::setEdep(double simtot, double sime, double simh) {
79  simEtot = (float)simtot;
80  simEEc = (float)sime;
81  simEHc = (float)simh;
82 
83  LogDebug("SimHCalData") << "PHcalTB06Info::setEdep: simEtot " << simEtot << " simEEc " << simEEc << " simEHc "
84  << simEHc;
85 }
86 
87 void PHcalTB06Info::saveHit(unsigned int id, double eta, double phi, double e, double t) {
88  int nh = hit;
89  hit++;
90  PHcalTB06Info::Hit newHit;
91  newHit.id = id;
92  newHit.eta = (float)(eta);
93  newHit.phi = (float)(phi);
94  newHit.e = (float)(e);
95  newHit.t = (float)(t);
96  hits.push_back(newHit);
97  LogDebug("SimHCalData") << "PHcalTB06Info::saveHit " << hit << " ID 0x" << std::hex << hits[nh].id << std::dec
98  << " Eta " << hits[nh].eta << " Phi " << hits[nh].phi << " E " << hits[nh].e << " t "
99  << hits[nh].t;
100 }
101 
103  int evNum, int type, double x, double y, double z, double u, double v, double w, double px, double py, double pz) {
104  v1EvNum = evNum;
105  v1Type = type;
106  double r = sqrt(x * x + y * y + z * z);
107  v1X = (float)(x);
108  v1Y = (float)(y);
109  v1Z = (float)(z);
110  v1R = (float)(r);
111  v1Px = (float)(px);
112  v1Py = (float)(py);
113  v1Pz = (float)(pz);
114  v1U = (float)(u);
115  v1V = (float)(v);
116  v1W = (float)(w);
117  LogDebug("SimHCalData") << "PHcalTB06Info::setVtxPrim: EvNum " << v1EvNum << " Type " << v1Type << " X/Y/Z/R " << v1X
118  << "/" << v1Y << "/" << v1Z << "/" << v1R << " Px/Py/Pz " << v1Px << "/" << v1Py << "/"
119  << v1Pz << " U/V/W " << v1U << "/" << v1V << "/" << v1W;
120 }
121 
122 void PHcalTB06Info::setVtxSec(int id, int pdg, double px, double py, double pz, double ek) {
123  int ns = v1Nsec;
124  v1Nsec++;
126  newVtx.trackID = id;
127  newVtx.partID = pdg;
128  newVtx.px = (float)(px);
129  newVtx.py = (float)(py);
130  newVtx.pz = (float)(pz);
131  newVtx.eKin = (float)(ek);
132  v1Sec.push_back(newVtx);
133  LogDebug("SimHCalData") << "PHcalTB06Info::setVtxSec " << v1Nsec << " ID " << v1Sec[ns].trackID << " PDG Code "
134  << v1Sec[ns].partID << " Px/Py/Pz/Ek " << v1Sec[ns].px << "/" << v1Sec[ns].py << "/"
135  << v1Sec[ns].pz << "/" << v1Sec[ns].eKin;
136 }
const double w
Definition: UKUtility.cc:23
uint16_t *__restrict__ id
void setEdep(double simtot, double sime, double simh)
unsigned int id
Definition: PHcalTB06Info.h:47
void setVtxPrim(int evNum, int type, double x, double y, double z, double u, double v, double w, double px, double py, double pz)
float float float z
virtual ~PHcalTB06Info()
T sqrt(T t)
Definition: SSEVec.h:19
VtxVector v1Sec
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
void setVtxSec(int id, int pdg, double px, double py, double pz, double ek)
uint32_t nh
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:60
#define LogDebug(id)
int evNum() const
Definition: PHcalTB06Info.h:77