QwGeant4
QweakSimTrackInformation.hh
Go to the documentation of this file.
1 //=============================================================================
2 //
3 // ---------------------------
4 // | Doxygen File Information |
5 // ---------------------------
6 /**
7 
8  \file QweakSimTrackInformation.hh
9  $Revision: 1.2 $
10  $Date: 2005/12/27 19:27:20 $
11  \author Klaus Hans Grimm
12 
13 */
14 //=============================================================================
15 //
16 //=============================================================================
17 //
18 // ---------------------------
19 // | Doxygen Class Information |
20 // ---------------------------
21 /**
22  \class QweakSimTrackInformation
23 
24  \brief Class with additional track information like Q2
25 
26  Placeholder for a long explaination
27 
28  */
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 #ifndef QweakSimTrackInformation_h
31 #define QweakSimTrackInformation_h 1
32 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33 
34 // system includes
35 #include <vector>
36 
37 // geant4 includes
38 #include "G4Allocator.hh"
39 #include "G4ThreeVector.hh"
40 #include "G4VUserTrackInformation.hh"
41 
42 // user includes
43 #include "QweakSimSystemOfUnits.hh"
44 
45 // geant4 classes
46 class G4Track;
47 class G4ParticleDefinition;
48 
49 // user classes
51 
52 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53 class QweakSimTrackInformation : public G4VUserTrackInformation
54 {
55 
56 public:
57 
59  QweakSimTrackInformation(const G4Track* aTrack);
61  virtual ~QweakSimTrackInformation();
62 
63  inline void *operator new(size_t);
64  inline void operator delete(void *aTrackInfo);
65  inline int operator ==(const QweakSimTrackInformation& right) const
66  {return (this==&right);}
67 
68 private:
69 
70  // TrackInfo which can derived from G4Track
72  G4ParticleDefinition* particleDefinition;
73  G4ThreeVector primaryPosition;
74  G4ThreeVector primaryMomentum;
75  G4double primaryEnergy;
77  G4double primaryTime;
78 
79  std::vector <QweakSimTrackHistory*> theCerenkovTrackHistory;
80 
81  std::vector <G4ThreeVector> OriginVertex;
82  std::vector <G4double> CerenkovHitEnergy;
83  std::vector <G4ParticleDefinition*> ParticleHistory;
84  std::vector <G4String> ParticleCreatorProcess;
85  std::vector <G4double> ParentEnergy; //Energy of parent at creation of
86  //secondary.
87  //For the primary particle this is
88  //Set to the beam energy
89  /*
90  History Parent Eenergy
91  Vector Vector
92 
93  e- Beam Energy
94  gamma E_{e-}
95  e+ E_{gamma}
96  opt phot E_{e+}
97  */
98 
101 
102  // trackingStatus = 1 : primary or secondary track which has not yet reached to calorimeter
103  // = 0 : track which or ancester of which has reached to calorimeter
104  // = 2 : track or its ancester had once reached to calorimeter and
105  // then escaped from it
106  // Information of the track which reached to the calorimeter boundary at the boundary surface
107  // This information is valid only for trackingStatus = 0 or 2
108 
110  G4ParticleDefinition* sourceDefinition;
111  G4ThreeVector sourcePosition;
112  G4ThreeVector sourceMomentum;
113  G4double sourceEnergy;
114  G4double sourceTime;
115  G4ThreeVector sourceOriginPosition;
117 
119  G4ParticleDefinition* cerenkovImpactDefinition;
120  G4ThreeVector cerenkovImpactPosition;
121  G4ThreeVector cerenkovImpactMomentum;
126 
127 public:
128 
129  void Initialize();
130  void Print() const {;}
131  void PrintPrimaryTrackInfo() const;
132  void PrintSourceTrackInfo() const;
133  void PrintCerenkovImpactTrackInfo() const;
134 
135  //---------------------------------------------------------------------------
136 
137  void StoreParticleDefinition(G4ParticleDefinition* pdef){ParticleHistory.push_back(pdef);};
138  G4ParticleDefinition* GetParticleDefinitionAtIndex(G4int ind);
139  G4int GetParticleHistoryLength() {return ParticleHistory.size();};
140 
141  void StoreParentEnergy(G4double eng) {ParentEnergy.push_back(eng);};
142  G4double GetParentEnergyAtIndex(G4int ind);
143 
144  void StoreCerenkovHitEnergy(G4int ind, G4double eng);
145  G4double GetCerenkovHitEnergyAtIndex(G4int ind);
146 
147  void StoreCreatorProcess(G4String proc){ParticleCreatorProcess.push_back(proc);};
148  G4String GetCreatorProcessAtIndex(G4int ind);
149 
150  void StoreOriginVertex(G4ThreeVector vert){OriginVertex.push_back(vert);};
151  G4ThreeVector GetOriginVertex(G4int ind);
152 
153  //---------------------------------------------------------------------------
154 
155  void StorePrimaryTrackID(G4int trackid) {primaryTrackID = trackid;}
156  G4int GetPrimaryTrackID() const {return primaryTrackID;}
157 
158  void StorePrimaryParticle(G4ParticleDefinition* pdef) {particleDefinition = pdef;}
159  G4ParticleDefinition* GetPrimaryParticle() const {return particleDefinition;}
160 
161  void StorePrimaryPosition(G4ThreeVector xyz) {primaryPosition = xyz;}
162  G4ThreeVector GetPrimaryPosition() const {return primaryPosition;}
163 
164  void StorePrimaryMomentum(G4ThreeVector pxyz) {primaryMomentum = pxyz;}
165  G4ThreeVector GetPrimaryMomentum() const {return primaryMomentum;}
166 
167  void StorePrimaryEnergy(G4double ekin) {primaryEnergy = ekin;}
168  G4double GetPrimaryEnergy() const {return primaryEnergy;}
169 
170  void StorePrimaryKineticEnergy(G4double ekin) {primaryKineticEnergy = ekin;}
172 
173  void StorePrimaryTime(G4double otime) {primaryTime = otime;}
174  G4double GetPrimaryTime() const {return primaryTime;}
175 
176 // void StorePrimaryQ2(G4double q2) {primaryQ2 = q2;}
177 // G4double GetPrimaryQ2() const {return primaryQ2;}
178 //
179 // void StoreCrossSection(G4double cs) {crossSection = cs;}
180 // G4double GetCrossSection() const {return crossSection;}
181 //
182 // void StoreCrossSectionWeight(G4double csw) {crossSectionWeight = csw;}
183 // G4double GetCrossSectionWeight() const {return crossSectionWeight;}
184 //
185 // void StorePrimaryEventNumber(G4int en) {primaryEventNumber = en;}
186 // G4int GetPrimaryEventNumber() const {return primaryEventNumber;}
187 
188  //---------------------------------------------------------------------------
189 
190  inline void SetTrackingStatus(G4int i) {trackingStatus = i;}
191  inline G4int GetTrackingStatus() const {return trackingStatus;}
192 
193  inline void SetTrackIsPrimaryStatus(G4int i) {trackIsPrimaryStatus = i;}
194  inline G4int GetTrackIsPrimaryStatus() const {return trackIsPrimaryStatus;}
195 
196  //---------------------------------------------------------------------------
197  void SetSourceTrackInformation(const G4Track* aTrack);
198 
199  inline G4int GetSourceTrackID() const {return sourceTrackID;}
200  inline G4ParticleDefinition* GetSourceParticle() const {return sourceDefinition;}
201  inline G4ThreeVector GetSourcePosition() const {return sourcePosition;}
202  inline G4ThreeVector GetSourceMomentum() const {return sourceMomentum;}
203  inline G4double GetSourceEnergy() const {return sourceEnergy;}
204  inline G4double GetSourceTime() const {return sourceTime;}
205  inline G4ThreeVector GetSourceOriginPosition() const {return sourceOriginPosition;}
206  inline G4double GetSourceOriginEnergy() const {return sourceOriginEnergy;}
207  //---------------------------------------------------------------------------
208 
209  void SetImpactTrackInformationForCerenkov(const G4Track* aTrack);
210 
211  inline G4int GetImpactTrackID() const {return cerenkovImpactTrackID;}
212  inline G4ParticleDefinition* GetImpactParticle() const {return cerenkovImpactDefinition;}
213  inline G4ThreeVector GetImpactPosition() const {return cerenkovImpactPosition;}
214  inline G4ThreeVector GetImpactMomentum() const {return cerenkovImpactMomentum;}
215  inline G4double GetImpactEnergy() const {return cerenkovImpactEnergy;}
216  inline G4double GetImpactTime() const {return cerenkovImpactTime;}
217  inline G4ThreeVector GetImpactOriginPosition() const {return cerenkovImpactOriginPosition;}
218  inline G4double GetImpactOriginEnergy() const {return cerenkovImpactOriginEnergy;}
219  //---------------------------------------------------------------------------
220 
221  void AddTrackInfoToCerenkovTrackHistory(const G4Track* aTrack);
222 
223 };
224 
225 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
226 
227 extern G4Allocator<QweakSimTrackInformation> aTrackInformationAllocator;
228 
229 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
230 
231 inline void* QweakSimTrackInformation::operator new(size_t)
232 {
233  void* aTrackInfo;
234  aTrackInfo = (void*) aTrackInformationAllocator.MallocSingle();
235  return aTrackInfo;
236 }
237 
238 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
239 
240 inline void QweakSimTrackInformation::operator delete(void *aTrackInfo)
241 { aTrackInformationAllocator.FreeSingle((QweakSimTrackInformation*)aTrackInfo);}
242 
243 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
244 
245 #endif
std::vector< G4ThreeVector > OriginVertex
G4double GetParentEnergyAtIndex(G4int ind)
G4ParticleDefinition * cerenkovImpactDefinition
void StorePrimaryParticle(G4ParticleDefinition *pdef)
G4ParticleDefinition * GetParticleDefinitionAtIndex(G4int ind)
G4ParticleDefinition * particleDefinition
void StorePrimaryMomentum(G4ThreeVector pxyz)
G4ParticleDefinition * GetImpactParticle() const
void StoreCerenkovHitEnergy(G4int ind, G4double eng)
std::vector< G4ParticleDefinition * > ParticleHistory
G4ParticleDefinition * sourceDefinition
void StorePrimaryTime(G4double otime)
std::vector< G4String > ParticleCreatorProcess
void AddTrackInfoToCerenkovTrackHistory(const G4Track *aTrack)
void StorePrimaryTrackID(G4int trackid)
void SetSourceTrackInformation(const G4Track *aTrack)
G4ThreeVector GetPrimaryPosition() const
void StorePrimaryPosition(G4ThreeVector xyz)
std::vector< G4double > CerenkovHitEnergy
std::vector< QweakSimTrackHistory * > theCerenkovTrackHistory
G4ParticleDefinition * GetPrimaryParticle() const
G4double GetCerenkovHitEnergyAtIndex(G4int ind)
G4ThreeVector GetImpactOriginPosition() const
Class with additional track information like Q2.
G4ThreeVector GetImpactPosition() const
void SetImpactTrackInformationForCerenkov(const G4Track *aTrack)
G4ThreeVector GetOriginVertex(G4int ind)
G4Allocator< QweakSimTrackInformation > aTrackInformationAllocator
G4ThreeVector GetSourceOriginPosition() const
G4ParticleDefinition * GetSourceParticle() const
std::vector< G4double > ParentEnergy
void StoreCreatorProcess(G4String proc)
int operator==(const QweakSimTrackInformation &right) const
G4ThreeVector GetSourceMomentum() const
void StoreOriginVertex(G4ThreeVector vert)
G4ThreeVector GetPrimaryMomentum() const
void StorePrimaryEnergy(G4double ekin)
G4String GetCreatorProcessAtIndex(G4int ind)
G4ThreeVector GetImpactMomentum() const
G4ThreeVector GetSourcePosition() const
void StorePrimaryKineticEnergy(G4double ekin)
void StoreParticleDefinition(G4ParticleDefinition *pdef)