Loading...
Searching...
No Matches
F04TrajectoryPoint.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//
26//
27/// \file field/field04/src/F04TrajectoryPoint.cc
28/// \brief Implementation of the F04TrajectoryPoint class
29//
30
31#include "F04TrajectoryPoint.hh"
32
33#include "G4Step.hh"
34#include "G4Track.hh"
35#include "G4VProcess.hh"
36#include "G4StepStatus.hh"
37
38#include "G4AttDef.hh"
39#include "G4AttValue.hh"
40#include "G4AttDefStore.hh"
41
42#include "G4UnitsTable.hh"
43
44#include "G4UIcommand.hh"
45
46//#define G4ATTDEBUG
47#ifdef G4ATTDEBUG
48#include "G4AttCheck.hh"
49#endif
50
52
53//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
54
57
58//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
59
61 : G4TrajectoryPoint(aStep->GetPostStepPoint()->GetPosition())
62{
63 fTime = aStep->GetPostStepPoint()->GetGlobalTime();
64 fMomentum = aStep->GetPostStepPoint()->GetMomentum();
65 fStepStatus = aStep->GetPostStepPoint()->GetStepStatus();
66 if (aStep->GetPostStepPoint()->GetPhysicalVolume())
67 {
68 fVolumeName = aStep->GetPostStepPoint()->
69 GetPhysicalVolume()->GetName();
70 } else {
71 fVolumeName = G4String(" ");
72 }
73}
74
75//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
76
78 : G4TrajectoryPoint(aTrack->GetPosition())
79{
80 fTime = aTrack->GetGlobalTime();
81 fMomentum = aTrack->GetMomentum();
82 fStepStatus = fUndefined;
83 fVolumeName = aTrack->GetVolume()->GetName();
84}
85
86//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
87
90{
91 fTime = right.fTime;
92 fMomentum = right.fMomentum;
93 fStepStatus = right.fStepStatus;
94 fVolumeName = right.fVolumeName;
95}
96
97//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
98
99const std::map<G4String,G4AttDef>* F04TrajectoryPoint::GetAttDefs() const
100{
101 G4bool isNew;
102 std::map<G4String,G4AttDef>* store
103 = G4AttDefStore::GetInstance("TrajectoryPoint",isNew);
104 if (isNew) {
105 G4String Pos("Pos");
106 (*store)[Pos] =
107 G4AttDef(Pos, "Position", "Physics","G4BestUnit","G4ThreeVector");
108
109 G4String Time("Time");
110 (*store)[Time] =
111 G4AttDef(Time, "Time", "Physics","G4BestUnit","G4double");
112
113 G4String Momentum("Momentum");
114 (*store)[Momentum] =
115 G4AttDef(Momentum, "Momentum", "Physics","G4BestUnit","G4ThreeVector");
116
117 G4String StepStatus("StepStatus");
118 (*store)[StepStatus] =
119 G4AttDef(StepStatus, "StepStatus", "Physics", "", "G4StepStatus");
120
121 G4String VolumeName("VolumeName");
122 (*store)[VolumeName] =
123 G4AttDef(VolumeName, "VolumeName", "Physics", "", "G4String");
124
125 }
126 return store;
127}
128
129//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
130
131std::vector<G4AttValue>* F04TrajectoryPoint::CreateAttValues() const
132{
133 auto values = new std::vector<G4AttValue>;
134
135 values->push_back(G4AttValue("Time",G4BestUnit(fTime,"Time"),""));
136
137 values->push_back(G4AttValue("Momentum",G4BestUnit(fMomentum,"Momentum"),""));
138
139 values->push_back(G4AttValue("StepStatus",G4UIcommand::ConvertToString(fStepStatus),""));
140
141 values->push_back(G4AttValue("VolumeName",fVolumeName,""));
142
143#ifdef G4ATTDEBUG
144 G4cout << G4AttCheck(values,GetAttDefs());
145#endif
146
147 return values;
148}
G4ThreadLocal G4Allocator< F04TrajectoryPoint > * F04TrajPointAllocator
Definition of the F04TrajectoryPoint class.
const std::map< G4String, G4AttDef > * GetAttDefs() const override
std::vector< G4AttValue > * CreateAttValues() const override

Applications | User Support | Publications | Collaboration