Geant4  10.02.p01
G4ParticleChangeForTransport.icc
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 // $Id: G4ParticleChangeForTransport.icc 68795 2013-04-05 13:24:46Z gcosmo $
28 //
29 //
30 inline
31  void G4ParticleChangeForTransport::SetTouchableHandle(const G4TouchableHandle&
32 fTouchable)
33 {
34  theTouchableHandle = fTouchable;
35 }
36 
37 inline
38  const G4TouchableHandle& G4ParticleChangeForTransport::GetTouchableHandle() const
39 {
40  return theTouchableHandle;
41 }
42 
43 
44 inline
45  void G4ParticleChangeForTransport::SetMaterialInTouchable(G4Material* fMaterial)
46 {
47  theMaterialChange = fMaterial;
48 }
49 
50 inline
51  G4Material* G4ParticleChangeForTransport::GetMaterialInTouchable() const
52 {
53  return theMaterialChange;
54 }
55 
56 inline
57  void G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple* fMaterialCutsCouple)
58 {
59  theMaterialCutsCoupleChange = fMaterialCutsCouple;
60 }
61 
62 inline
63  const G4MaterialCutsCouple* G4ParticleChangeForTransport::GetMaterialCutsCoupleInTouchable() const
64 {
65  return theMaterialCutsCoupleChange;
66 }
67 
68 inline
69  void G4ParticleChangeForTransport::SetSensitiveDetectorInTouchable(G4VSensitiveDetector* fSensitiveDetector)
70 {
71  theSensitiveDetectorChange = fSensitiveDetector;
72 }
73 
74 inline
75  G4VSensitiveDetector* G4ParticleChangeForTransport::GetSensitiveDetectorInTouchable() const
76 {
77  return theSensitiveDetectorChange;
78 }
79 
80 inline
81 G4bool G4ParticleChangeForTransport::GetMomentumChanged() const
82 {
83  return isMomentumChanged;
84 }
85 
86 inline
87 void G4ParticleChangeForTransport::SetMomentumChanged(G4bool b)
88 {
89  isMomentumChanged= b;
90 }
91 
92 //----------------------------------------------------------------
93 // functions for Initialization
94 //
95 
96 inline void G4ParticleChangeForTransport::Initialize(const G4Track& track)
97 {
98  // use base class's method at first
99  InitializeStatusChange(track);
100 // InitializeLocalEnergyDeposit(track);
101  InitializeSteppingControl(track);
102 // InitializeTrueStepLength(track);
103 // InitializeSecondaries(track);
104 
105  // set Energy/Momentum etc. equal to those of the parent particle
106  const G4DynamicParticle* pParticle = track.GetDynamicParticle();
107 // theEnergyChange = pParticle->GetKineticEnergy();
108 // theMomentumChange = pParticle->GetMomentumDirection();
109  theVelocityChange = track.GetVelocity();
110  isVelocityChanged = false;
111  thePolarizationChange = pParticle->GetPolarization();
112 // theProperTimeChange = pParticle->GetProperTime();
113 
114  // set Position/Time etc. equal to those of the parent track
115  // thePositionChange = track.GetPosition();
116  // set TimeChange equal to local time of the parent track
117  theTimeChange = track.GetLocalTime();
118  // set initial Local/Global time of the parent track
119  theLocalTime0 = track.GetLocalTime();
120  theGlobalTime0 = track.GetGlobalTime();
121 
122  // set touchable equal to the next touchable of the parent track
123  // not set as for now
124  //theTouchableChange = track.GetNextTouchable();
125 
126 // So almost nothing is initialized here.
127 // theMomentumChange, theProperTimeChange, thePositionChange and theTimeChange
128 // are set by G4Transportation::AlongStepDoIt;
129 // the others are not needed.
130 // Take care when implementing the PostStep related things!
131 // (P. Urban)
132 }
133 
134 // Prototype implementation of smooth representation of curved trajectories.
135 
136 inline void
137 G4ParticleChangeForTransport::
138 SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>*
139  theNewVectorPointer )
140 {
141  fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
142 }
143 
144 inline std::vector<G4ThreeVector>*
145 G4ParticleChangeForTransport::GetPointerToVectorOfAuxiliaryPoints() const
146 {
147  return fpVectorOfAuxiliaryPointsPointer;
148 }
149 
150 
151 
152 
153 
154