HARPO  5.1.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
simbase/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  if(gHarpoDebug>4)
43  Info("TpcSimIonisationPoint","%d %g %g %g %g %g %g",Ne, X, Y, Z, T, Eloss, Eleft);
44 }
45 
46 
47 
48 
50 {
51  fNpoints = 0;
52  fMCTrackId = 0;
53  fEventId = 0;
54  fRunId = 0;
55  fParticleId = 0;
56  fPx = 0;
57  fPy = 0;
58  fPz = 0;
59  fXorig = 0;
60  fYorig = 0;
61  fZorig = 0;
62  fTorig = 0;
63  fPoints = new TClonesArray("TpcSimIonisationPoint",fkMaxNpoints);
64  //fChamber = 0;//new TpcSimChamber();
65 
66 }
67 
69  TObject(tr),
70  fNpoints(tr.fNpoints),
71  fMCTrackId(tr.fMCTrackId),
72  fEventId(tr.fEventId),
73  fRunId(tr.fRunId),
74  fParticleId(tr.fParticleId),
75  fPx(tr.fPx),
76  fPy(tr.fPy),
77  fPz(tr.fPz),
78  fXorig(tr.fXorig),
79  fYorig(tr.fYorig),
80  fZorig(tr.fZorig),
81  fTorig(tr.fTorig),
82  fPoints(tr.fPoints)
83  //fChamber(tr.fChamber)
84 {
85 }
86 
87 TpcSimIonisationTrack::TpcSimIonisationTrack(Double_t Xorig, Double_t Yorig, Double_t Zorig, Double_t Torig,
88  Double_t Px, Double_t Py, Double_t Pz,
89  Int_t pID,
90  Int_t rId, Int_t eId, Int_t tId)
91 {
92 
93 
94  fNpoints = 0;
95  fMCTrackId = tId;
96  fEventId = eId;
97  fRunId = rId;
98  fParticleId = pID;
99  fPx = Px;
100  fPy = Py;
101  fPz = Pz;
102  fXorig = Xorig;
103  fYorig = Yorig;
104  fZorig = Zorig;
105  fTorig = Torig;
106  //fChamber = 0;//new TpcSimChamber();
107  fPoints = new TClonesArray("TpcSimIonisationPoint",fkMaxNpoints);
108 
109 }
110 
112 {
113  if(gHarpoDebug>1)
114  Info("~TpcSimIonisationTrack","Deleting");
115  fPoints->Delete();
116  // delete fPoints;
117 
118 }
119 
121 {
122  if(fNpoints>=fkMaxNpoints){
123  Warning("AddPoint","Too many points in tracks (%d)",fNpoints);
124  return;
125  }
126  new((*fPoints)[fNpoints]) TpcSimIonisationPoint(*point);
127  fNpoints++;
128 
129 }
130 
void AddPoint(TpcSimIonisationPoint *point)
Long64_t gHarpoDebug
Definition: HarpoDebug.cxx:9