Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RE01TrackInformation.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
28 //
29 //
30 // $Id: RE01TrackInformation.cc 97671 2016-06-07 08:25:00Z gcosmo $
31 //
32 
33 #include "RE01TrackInformation.hh"
34 #include "G4ios.hh"
35 #include "G4SystemOfUnits.hh"
36 
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
43 {
44  fOriginalTrackID = 0;
45  fParticleDefinition = 0;
46  fOriginalPosition = G4ThreeVector(0.,0.,0.);
47  fOriginalMomentum = G4ThreeVector(0.,0.,0.);
48  fOriginalEnergy = 0.;
49  fOriginalTime = 0.;
50  fTrackingStatus = 1;
51  fSourceTrackID = -1;
52  fSourceDefinition = 0;
53  fSourcePosition = G4ThreeVector(0.,0.,0.);
54  fSourceMomentum = G4ThreeVector(0.,0.,0.);
55  fSourceEnergy = 0.;
56  fSourceTime = 0.;
57  fSuspendedStepID = -1;
58 }
59 
60 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
63 {
64  fOriginalTrackID = aTrack->GetTrackID();
65  fParticleDefinition = aTrack->GetDefinition();
66  fOriginalPosition = aTrack->GetPosition();
67  fOriginalMomentum = aTrack->GetMomentum();
68  fOriginalEnergy = aTrack->GetTotalEnergy();
69  fOriginalTime = aTrack->GetGlobalTime();
70  fTrackingStatus = 1;
71  fSourceTrackID = -1;
72  fSourceDefinition = 0;
73  fSourcePosition = G4ThreeVector(0.,0.,0.);
74  fSourceMomentum = G4ThreeVector(0.,0.,0.);
75  fSourceEnergy = 0.;
76  fSourceTime = 0.;
77  fSuspendedStepID = -1;
78 }
79 
80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
84 {
85  fOriginalTrackID = aTrackInfo->fOriginalTrackID;
86  fParticleDefinition = aTrackInfo->fParticleDefinition;
87  fOriginalPosition = aTrackInfo->fOriginalPosition;
88  fOriginalMomentum = aTrackInfo->fOriginalMomentum;
89  fOriginalEnergy = aTrackInfo->fOriginalEnergy;
90  fOriginalTime = aTrackInfo->fOriginalTime;
91  fTrackingStatus = aTrackInfo->fTrackingStatus;
92  fSourceTrackID = aTrackInfo->fSourceTrackID;
93  fSourceDefinition = aTrackInfo->fSourceDefinition;
94  fSourcePosition = aTrackInfo->fSourcePosition;
95  fSourceMomentum = aTrackInfo->fSourceMomentum;
96  fSourceEnergy = aTrackInfo->fSourceEnergy;
97  fSourceTime = aTrackInfo->fSourceTime;
98  fSuspendedStepID = -1;
99 }
100 
101 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
103 {;}
104 
105 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
108 {
109  fOriginalTrackID = aTrackInfo.fOriginalTrackID;
110  fParticleDefinition = aTrackInfo.fParticleDefinition;
111  fOriginalPosition = aTrackInfo.fOriginalPosition;
112  fOriginalMomentum = aTrackInfo.fOriginalMomentum;
113  fOriginalEnergy = aTrackInfo.fOriginalEnergy;
114  fOriginalTime = aTrackInfo.fOriginalTime;
115  fTrackingStatus = aTrackInfo.fTrackingStatus;
116  fSourceTrackID = aTrackInfo.fSourceTrackID;
117  fSourceDefinition = aTrackInfo.fSourceDefinition;
118  fSourcePosition = aTrackInfo.fSourcePosition;
119  fSourceMomentum = aTrackInfo.fSourceMomentum;
120  fSourceEnergy = aTrackInfo.fSourceEnergy;
121  fSourceTime = aTrackInfo.fSourceTime;
122  fSuspendedStepID = -1;
123 
124  return *this;
125 }
126 
127 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
129 {
130  fSourceTrackID = aTrack->GetTrackID();
131  fSourceDefinition = aTrack->GetDefinition();
132  fSourcePosition = aTrack->GetPosition();
133  fSourceMomentum = aTrack->GetMomentum();
134  fSourceEnergy = aTrack->GetTotalEnergy();
135  fSourceTime = aTrack->GetGlobalTime();
136 }
137 
138 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
140 {
141  G4cout
142  << "Source track ID " << fSourceTrackID << " ("
143  << fSourceDefinition->GetParticleName() << ","
144  << fSourceEnergy/GeV << "[GeV]) at " << fSourcePosition << G4endl;
145  G4cout
146  << "Original primary track ID " << fOriginalTrackID << " ("
147  << fParticleDefinition->GetParticleName() << ","
148  << fOriginalEnergy/GeV << "[GeV])" << G4endl;
149 }
150 
G4ParticleDefinition * GetDefinition() const
CLHEP::Hep3Vector G4ThreeVector
Definition of the RE01TrackInformation class.
const G4ThreeVector & GetPosition() const
#define G4ThreadLocal
Definition: tls.hh:89
const G4String & GetParticleName() const
void SetSourceTrackInformation(const G4Track *aTrack)
G4GLOB_DLL std::ostream G4cout
G4int GetTrackID() const
G4double GetGlobalTime() const
G4ThreeVector GetMomentum() const
RE01TrackInformation & operator=(const RE01TrackInformation &right)
G4ThreadLocal G4Allocator< RE01TrackInformation > * aTrackInformationAllocator
static constexpr double GeV
Definition: G4SIunits.hh:217
G4double GetTotalEnergy() const
#define G4endl
Definition: G4ios.hh:61
virtual void Print() const