Changeset 1196 for trunk/source/tracking/src/G4RichTrajectory.cc
- Timestamp:
- Nov 25, 2009, 5:13:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/tracking/src/G4RichTrajectory.cc
r1011 r1196 25 25 // 26 26 // 27 // $Id: G4RichTrajectory.cc,v 1. 6 2006/10/16 13:43:43allison Exp $28 // GEANT4 tag $Name: geant4-09-0 2-ref-02$27 // $Id: G4RichTrajectory.cc,v 1.7 2009/11/12 09:09:56 allison Exp $ 28 // GEANT4 tag $Name: geant4-09-03-cand-01 $ 29 29 // 30 30 // --------------------------------------------------------------- … … 49 49 #include "G4AttDef.hh" 50 50 #include "G4AttValue.hh" 51 #include "G4UnitsTable.hh" 51 52 #include "G4VProcess.hh" 52 53 … … 62 63 fpInitialVolume(0), 63 64 fpInitialNextVolume(0), 64 fpCreatorProcess(0) 65 fpCreatorProcess(0), 66 fFinalKineticEnergy(0.) 65 67 {} 66 68 … … 81 83 // Insert the first rich trajectory point (see note above)... 82 84 fpRichPointsContainer->push_back(new G4RichTrajectoryPoint(aTrack)); 85 // On construction, set final KE to initial KE. 86 // Final KE is updated at the addition of every step - see AppendStep. 87 fFinalKineticEnergy = aTrack->GetKineticEnergy(); 83 88 } 84 89 … … 90 95 fpCreatorProcess = right.fpCreatorProcess; 91 96 fpRichPointsContainer = new RichTrajectoryPointsContainer; 97 fFinalKineticEnergy = right.fFinalKineticEnergy; 92 98 for(size_t i=0;i<right.fpRichPointsContainer->size();i++) 93 99 { … … 114 120 { 115 121 fpRichPointsContainer->push_back(new G4RichTrajectoryPoint(aStep)); 122 // Except for first step, which is a sort of virtual step to start 123 // the track, compute the final energy. 124 if (aStep->GetTrack()->GetCurrentStepNumber() > 0) { 125 fFinalKineticEnergy = 126 aStep->GetPreStepPoint()->GetKineticEnergy() - 127 aStep->GetTotalEnergyDeposit(); 128 } 116 129 } 117 130 … … 160 173 (*store)[ID] = G4AttDef(ID,"Creator Process Type Name", 161 174 "Physics","","G4String"); 175 176 ID = "FKE"; 177 (*store)[ID] = G4AttDef(ID,"Final kinetic energy", 178 "Physics","G4BestUnit","G4double"); 162 179 163 180 } … … 184 201 } 185 202 203 values->push_back 204 (G4AttValue("FKE",G4BestUnit(fFinalKineticEnergy,"Energy"),"")); 205 186 206 #ifdef G4ATTDEBUG 187 207 G4cout << G4AttCheck(values,GetAttDefs());
Note: See TracChangeset
for help on using the changeset viewer.