2 // ********************************************************************
3 // * License and Disclaimer *
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. *
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. *
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 // ********************************************************************
27 // $Id: G4ParticleChangeForTransport.icc 68795 2013-04-05 13:24:46Z gcosmo $
31 void G4ParticleChangeForTransport::SetTouchableHandle(const G4TouchableHandle&
34 theTouchableHandle = fTouchable;
38 const G4TouchableHandle& G4ParticleChangeForTransport::GetTouchableHandle() const
40 return theTouchableHandle;
45 void G4ParticleChangeForTransport::SetMaterialInTouchable(G4Material* fMaterial)
47 theMaterialChange = fMaterial;
51 G4Material* G4ParticleChangeForTransport::GetMaterialInTouchable() const
53 return theMaterialChange;
57 void G4ParticleChangeForTransport::SetMaterialCutsCoupleInTouchable(const G4MaterialCutsCouple* fMaterialCutsCouple)
59 theMaterialCutsCoupleChange = fMaterialCutsCouple;
63 const G4MaterialCutsCouple* G4ParticleChangeForTransport::GetMaterialCutsCoupleInTouchable() const
65 return theMaterialCutsCoupleChange;
69 void G4ParticleChangeForTransport::SetSensitiveDetectorInTouchable(G4VSensitiveDetector* fSensitiveDetector)
71 theSensitiveDetectorChange = fSensitiveDetector;
75 G4VSensitiveDetector* G4ParticleChangeForTransport::GetSensitiveDetectorInTouchable() const
77 return theSensitiveDetectorChange;
81 G4bool G4ParticleChangeForTransport::GetMomentumChanged() const
83 return isMomentumChanged;
87 void G4ParticleChangeForTransport::SetMomentumChanged(G4bool b)
92 //----------------------------------------------------------------
93 // functions for Initialization
96 inline void G4ParticleChangeForTransport::Initialize(const G4Track& track)
98 // use base class's method at first
99 InitializeStatusChange(track);
100 // InitializeLocalEnergyDeposit(track);
101 InitializeSteppingControl(track);
102 // InitializeTrueStepLength(track);
103 // InitializeSecondaries(track);
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();
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();
122 // set touchable equal to the next touchable of the parent track
123 // not set as for now
124 //theTouchableChange = track.GetNextTouchable();
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!
134 // Prototype implementation of smooth representation of curved trajectories.
137 G4ParticleChangeForTransport::
138 SetPointerToVectorOfAuxiliaryPoints( std::vector<G4ThreeVector>*
139 theNewVectorPointer )
141 fpVectorOfAuxiliaryPointsPointer = theNewVectorPointer;
144 inline std::vector<G4ThreeVector>*
145 G4ParticleChangeForTransport::GetPointerToVectorOfAuxiliaryPoints() const
147 return fpVectorOfAuxiliaryPointsPointer;