HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
base/TpcSimIonisationTrack.cxx
Go to the documentation of this file.
1 //
2 // File TpcSimIonisationTrack.cxx
3 //
4 /*
5 
6  */
7 
8 #include "HarpoDebug.h"
9 #include "TClonesArray.h"
10 
11 #include "TpcSimIonisationTrack.h"
12 
13 
14 ClassImp(TpcSimIonisationTrack)
15 
17 {
18  fNe = 0;
19  fX = 0;
20  fY = 0;
21  fZ = 0;
22  fT = 0;
23  fEloss = 0;
24  fEleft = 0;
25 }
26 
28  TObject(pt), fNe(pt.fNe), fX(pt.fX), fY(pt.fY), fZ(pt.fZ), fT(pt.fT), fEloss(pt.fEloss), fEleft(pt.fEleft)
29 {
30 }
31 
32 
33 TpcSimIonisationPoint::TpcSimIonisationPoint(Int_t Ne, Double_t X, Double_t Y, Double_t Z, Double_t T, Double_t Eloss, Double_t Eleft)
34 {
35  fNe = Ne;
36  fX = X;
37  fY = Y;
38  fZ = Z;
39  fT = T;
40  fEloss = Eloss;
41  fEleft = Eleft;
42 }
43 
44 
45 
46 
48 {
49  fPoints = new TClonesArray("TpcSimIonisationPoint",fkMaxNpoints);
50  fNpoints = 0;
51  fMCTrackId = 0;
52  fEventId = 0;
53  fRunId = 0;
54  fParticleId = 0;
55  fPx = 0;
56  fPy = 0;
57  fPz = 0;
58  fXorig = 0;
59  fYorig = 0;
60  fZorig = 0;
61  fTorig = 0;
62  //fChamber = 0;//new TpcSimChamber();
63 
64 }
65 
67  TObject(tr),
68  fNpoints(tr.fNpoints),
69  fMCTrackId(tr.fMCTrackId),
70  fEventId(tr.fEventId),
71  fRunId(tr.fRunId),
72  fParticleId(tr.fParticleId),
73  fPx(tr.fPx),
74  fPy(tr.fPy),
75  fPz(tr.fPz),
76  fXorig(tr.fXorig),
77  fYorig(tr.fYorig),
78  fZorig(tr.fZorig),
79  fTorig(tr.fTorig),
80  //fChamber(tr.fChamber),
81  fPoints(tr.fPoints)
82 {
83 }
84 
85 TpcSimIonisationTrack::TpcSimIonisationTrack(Double_t Xorig, Double_t Yorig, Double_t Zorig, Double_t Torig,
86  Double_t Px, Double_t Py, Double_t Pz,
87  Int_t pID,
88  Int_t rId, Int_t eId, Int_t tId)
89 {
90 
91 
92  fNpoints = 0;
93  fMCTrackId = tId;
94  fEventId = eId;
95  fRunId = rId;
96  fParticleId = pID;
97  fPx = Px;
98  fPy = Py;
99  fPz = Pz;
100  fXorig = Xorig;
101  fYorig = Yorig;
102  fZorig = Zorig;
103  fTorig = Torig;
104  //fChamber = 0;//new TpcSimChamber();
105  fPoints = new TClonesArray("TpcSimIonisationPoint",fkMaxNpoints);
106 
107 }
108 
110 {
111  if(gHarpoDebug>1)
112  Info("~TpcSimIonisationTrack","Deleting");
113  fPoints->Delete();
114  delete fPoints;
115 }
116 
118 {
119  if(fNpoints>=fkMaxNpoints){
120  Warning("AddPoint","Too many points in tracks (%d)",fNpoints);
121  return;
122  }
123  new((*fPoints)[fNpoints]) TpcSimIonisationPoint(*point);
124  //fPoints->AddAt(point,fNpoints);
125  //fPoints[fNpoints] = point;
126  fNpoints++;
127 
128 }
129 
130 // void TpcSimIonisationTrack::GenerateTrack(Int_t seed)
131 // {
132 
133 // if(!fChamber){
134 // Warning("GenerateTrack","fChamber not defined");
135 // return;
136 // }
137 // Double_t x = fXorig, y = fYorig, z = fZorig;
138 // while(fChamber->GetGeom()->GetVolume(x,y,z)==1 && fNpoints<fkMaxNpoints){
139 // //TpcSimIonisation* point =
140 // new((*fPoints)[fNpoints]) TpcSimIonisationPoint(1,x,y,z,0,0);
141 // fNpoints++;
142 // x += fPx;
143 // y += fPy;
144 // z += fPz;
145 // }
146 
147 // }
void AddPoint(TpcSimIonisationPoint *point)
Long64_t gHarpoDebug
Definition: HarpoDebug.cxx:9