OMSim
Geant4 for IceCube optical module studies
Loading...
Searching...
No Matches
OMSimG4ParticleChangeForRadDecay.hh
1
2#pragma once
3
4#include "globals.hh"
5#include "G4ios.hh"
6#include "G4ThreeVector.hh"
7#include "G4VParticleChange.hh"
8
9class G4DynamicParticle;
10
11class G4ParticleChangeForRadDecay final : public G4VParticleChange
12{
13 public:
14
16
17 ~G4ParticleChangeForRadDecay() override = default;
18
20 G4ParticleChangeForRadDecay& operator=(const G4ParticleChangeForRadDecay& right) = delete;
21
22 // --- the following methods are for updating G4Step -----
23 // Return the pointer to the G4Step after updating the step information
24 // by using final state information of the track given by a physics process
25 // !!! No effect for AlongSteyp
26
27 G4Step* UpdateStepForAtRest(G4Step* Step) final;
28 G4Step* UpdateStepForPostStep(G4Step* Step) final;
29
30 void Initialize(const G4Track&) final;
31 // Initialize all properties by using G4Track information
32
33 void ProposeGlobalTime(G4double t);
34 void ProposeLocalTime(G4double t);
35 // Get/Propose the final global/local time
36 // NOTE: DO NOT INVOKE both methods in a step
37 // Each method affects both local and global time
38
39 G4double GetGlobalTime(G4double timeDelay = 0.0) const;
40 G4double GetLocalTime(G4double timeDelay = 0.0) const;
41 // Convert the time delay to the glocbal/local time.
42 // Can get the final global/local time without argument
43
44 const G4ThreeVector* GetPolarization() const;
45 void ProposePolarization(G4double Px, G4double Py, G4double Pz);
46 void ProposePolarization(const G4ThreeVector& finalPoralization);
47 void AddSecondary(G4Track* aTrack);
48 // Get/Propose the final Polarization vector
49
50 // --- Dump and debug methods ---
51
52 void DumpInfo() const final;
53
54 G4bool CheckIt(const G4Track&) final;
55
56
57 private:
58
59 G4double theGlobalTime0 = 0.0;
60 // The global time at Initial
61 G4double theLocalTime0 = 0.0;
62 // The local time at Initial
63
64 G4double theTimeChange = 0.0;
65 // The change of local time of a given particle
66
67 G4ThreeVector thePolarizationChange;
68 // The changed (final) polarization of a given track
69
70 G4bool CheckSecondary(G4Track&);
71
72};
73
74// ----------------------
75// Inline methods
76// ----------------------
77
78inline
79void G4ParticleChangeForRadDecay::ProposeGlobalTime(G4double t)
80{
81 theTimeChange = (t - theGlobalTime0) + theLocalTime0;
82}
83
84inline
85G4double G4ParticleChangeForRadDecay::GetGlobalTime(G4double timeDelay) const
86{
87 // Convert the time delay to the global time.
88 return theGlobalTime0 + (theTimeChange - theLocalTime0) + timeDelay;
89}
90
91inline
92void G4ParticleChangeForRadDecay::ProposeLocalTime(G4double t)
93{
94 theTimeChange = t;
95}
96
97inline
98G4double G4ParticleChangeForRadDecay::GetLocalTime(G4double timeDelay) const
99{
100 // Convert the time delay to the local time.
101 return theTimeChange + timeDelay;
102}
103
104inline
105const G4ThreeVector* G4ParticleChangeForRadDecay::GetPolarization() const
106{
107 return &thePolarizationChange;
108}
109
110inline
111void G4ParticleChangeForRadDecay::ProposePolarization(
112 const G4ThreeVector& finalPoralization)
113{
114 thePolarizationChange = finalPoralization;
115}
116
117inline
118void G4ParticleChangeForRadDecay::ProposePolarization(G4double Px,
119 G4double Py,
120 G4double Pz)
121{
122 thePolarizationChange.setX(Px);
123 thePolarizationChange.setY(Py);
124 thePolarizationChange.setZ(Pz);
125}
Definition OMSimG4ParticleChangeForRadDecay.hh:12