Ignore:
Timestamp:
Nov 25, 2009, 5:13:58 PM (15 years ago)
Author:
garnier
Message:

update CVS release candidate geant4.9.3.01

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/tracking/src/G4RichTrajectory.cc

    r1011 r1196  
    2525//
    2626//
    27 // $Id: G4RichTrajectory.cc,v 1.6 2006/10/16 13:43:43 allison Exp $
    28 // GEANT4 tag $Name: geant4-09-02-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 $
    2929//
    3030// ---------------------------------------------------------------
     
    4949#include "G4AttDef.hh"
    5050#include "G4AttValue.hh"
     51#include "G4UnitsTable.hh"
    5152#include "G4VProcess.hh"
    5253
     
    6263  fpInitialVolume(0),
    6364  fpInitialNextVolume(0),
    64   fpCreatorProcess(0)
     65  fpCreatorProcess(0),
     66  fFinalKineticEnergy(0.)
    6567{}
    6668
     
    8183  // Insert the first rich trajectory point (see note above)...
    8284  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();
    8388}
    8489
     
    9095  fpCreatorProcess = right.fpCreatorProcess;
    9196  fpRichPointsContainer = new RichTrajectoryPointsContainer;
     97  fFinalKineticEnergy = right.fFinalKineticEnergy;
    9298  for(size_t i=0;i<right.fpRichPointsContainer->size();i++)
    9399  {
     
    114120{
    115121  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  }
    116129}
    117130 
     
    160173    (*store)[ID] = G4AttDef(ID,"Creator Process Type Name",
    161174                            "Physics","","G4String");
     175
     176    ID = "FKE";
     177    (*store)[ID] = G4AttDef(ID,"Final kinetic energy",
     178                            "Physics","G4BestUnit","G4double");
    162179
    163180  }
     
    184201  }
    185202
     203  values->push_back
     204    (G4AttValue("FKE",G4BestUnit(fFinalKineticEnergy,"Energy"),""));
     205
    186206#ifdef G4ATTDEBUG
    187207  G4cout << G4AttCheck(values,GetAttDefs());
Note: See TracChangeset for help on using the changeset viewer.