Import Geant4 10.0.0 source tree
This commit is contained in:
@@ -26,22 +26,23 @@
|
||||
/// \file electromagnetic/TestEm1/src/TrackingAction.cc
|
||||
/// \brief Implementation of the TrackingAction class
|
||||
//
|
||||
// $Id$
|
||||
// $Id: TrackingAction.cc 76293 2013-11-08 13:11:23Z gcosmo $
|
||||
//
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
#include "TrackingAction.hh"
|
||||
#include "PrimaryGeneratorAction.hh"
|
||||
#include "RunAction.hh"
|
||||
#include "Run.hh"
|
||||
#include "HistoManager.hh"
|
||||
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Track.hh"
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
|
||||
TrackingAction::TrackingAction(PrimaryGeneratorAction* prim, RunAction* run)
|
||||
:fPrimary(prim), fRunAction(run)
|
||||
TrackingAction::TrackingAction(PrimaryGeneratorAction* prim)
|
||||
:G4UserTrackingAction(),fPrimary(prim)
|
||||
{ }
|
||||
|
||||
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
|
||||
@@ -58,28 +59,31 @@ void TrackingAction::PreUserTrackingAction(const G4Track*)
|
||||
|
||||
void TrackingAction::PostUserTrackingAction(const G4Track* aTrack)
|
||||
{
|
||||
//increase nb of processed tracks
|
||||
//increase nb of processed tracks
|
||||
//count nb of steps of this track
|
||||
G4int nbSteps = aTrack->GetCurrentStepNumber();
|
||||
G4double Trleng = aTrack->GetTrackLength();
|
||||
|
||||
Run* run = static_cast<Run*>(
|
||||
G4RunManager::GetRunManager()->GetNonConstCurrentRun());
|
||||
|
||||
if (aTrack->GetDefinition()->GetPDGCharge() == 0.) {
|
||||
fRunAction->CountTraks0(1);
|
||||
fRunAction->CountSteps0(nbSteps);
|
||||
run->CountTraks0(1);
|
||||
run->CountSteps0(nbSteps);
|
||||
|
||||
} else {
|
||||
fRunAction->CountTraks1(1);
|
||||
fRunAction->CountSteps1(nbSteps);
|
||||
run->CountTraks1(1);
|
||||
run->CountSteps1(nbSteps);
|
||||
}
|
||||
|
||||
//true and projected ranges for primary particle
|
||||
if (aTrack->GetTrackID() == 1) {
|
||||
fRunAction->AddTrueRange(Trleng);
|
||||
G4ThreeVector vertex = fPrimary->GetParticleGun()->GetParticlePosition();
|
||||
run->AddTrueRange(Trleng);
|
||||
G4ThreeVector vertex = fPrimary->GetParticleGun()->GetParticlePosition();
|
||||
G4ThreeVector position = aTrack->GetPosition() - vertex;
|
||||
fRunAction->AddProjRange(position.x());
|
||||
fRunAction->AddTransvDev(position.y());
|
||||
fRunAction->AddTransvDev(position.z());
|
||||
run->AddProjRange(position.x());
|
||||
run->AddTransvDev(position.y());
|
||||
run->AddTransvDev(position.z());
|
||||
|
||||
G4AnalysisManager* analysisManager = G4AnalysisManager::Instance();
|
||||
analysisManager->FillH1(1,Trleng);
|
||||
|
||||
Reference in New Issue
Block a user