Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
PurgMagSteppingAction Class Reference

#include <PurgMagSteppingAction.hh>

Inheritance diagram for PurgMagSteppingAction:
G4UserSteppingAction

Public Member Functions

 PurgMagSteppingAction (PurgMagDetectorConstruction *)
 
 ~PurgMagSteppingAction ()
 
void UserSteppingAction (const G4Step *)
 
- Public Member Functions inherited from G4UserSteppingAction
 G4UserSteppingAction ()
 
virtual ~G4UserSteppingAction ()
 
void SetSteppingManagerPointer (G4SteppingManager *pValue)
 

Additional Inherited Members

- Protected Attributes inherited from G4UserSteppingAction
G4SteppingManagerfpSteppingManager
 

Detailed Description

Definition at line 52 of file PurgMagSteppingAction.hh.

Constructor & Destructor Documentation

PurgMagSteppingAction::PurgMagSteppingAction ( PurgMagDetectorConstruction det)

Definition at line 53 of file PurgMagSteppingAction.cc.

54 :Detector(det)
55 { }
PurgMagSteppingAction::~PurgMagSteppingAction ( )

Definition at line 59 of file PurgMagSteppingAction.cc.

60 { }

Member Function Documentation

void PurgMagSteppingAction::UserSteppingAction ( const G4Step aStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 64 of file PurgMagSteppingAction.cc.

References python.hepunit::cm, PurgMagAnalysisManager::fill_Tuple_Electrons(), PurgMagAnalysisManager::fill_Tuple_Gamma(), PurgMagAnalysisManager::fill_Tuple_Positrons(), G4DynamicParticle::GetDefinition(), G4Track::GetDynamicParticle(), PurgMagAnalysisManager::getInstance(), G4Track::GetKineticEnergy(), PurgMagDetectorConstruction::GetMeasureVolume(), G4Track::GetMomentum(), G4Track::GetNextVolume(), G4ParticleDefinition::GetParticleName(), G4StepPoint::GetPhysicalVolume(), G4Track::GetPosition(), G4Step::GetPostStepPoint(), G4Step::GetPreStepPoint(), G4StepPoint::GetProcessDefinedStep(), G4VProcess::GetProcessName(), G4Step::GetTrack(), PurgMagDetectorConstruction::GetWorld(), python.hepunit::MeV, CLHEP::Hep3Vector::x(), CLHEP::Hep3Vector::y(), and CLHEP::Hep3Vector::z().

66 {
67  //Collection at SSD in N-tuples. Electrons and photons separated
68  //Prestep point in World, next volume MeasureVolume, process transportation
70  if ((aStep->GetPreStepPoint()->GetPhysicalVolume() == Detector->GetWorld())&&
71  (aStep->GetTrack()->GetNextVolume() == Detector->GetMeasureVolume())&&
72  //(aStep->GetTrack()->GetMomentumDirection().z()>0.)&& // only particles with positive momentum
73  (aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName() == "Transportation"))
74  {
75  G4double gx, gy, gz, ge, gpx, gpy, gpz, ex, ey, ez, ee;
76  G4double epx, epy, epz, px, py, pz, pe, ppx, ppy, ppz;
77 
78 
79  // Electrons
81  == "e-")
82  {//Position
83  ex = (aStep->GetTrack()->GetPosition().x())/cm;
84  ey = (aStep->GetTrack()->GetPosition().y())/cm;
85  ez = (aStep->GetTrack()->GetPosition().z())/cm;
86  // Energy
87  ee = (aStep->GetTrack()->GetKineticEnergy())/MeV;
88  // Momentum
89  epx = aStep->GetTrack()->GetMomentum().x();
90  epy = aStep->GetTrack()->GetMomentum().y();
91  epz = aStep->GetTrack()->GetMomentum().z();
92 
93  // Fill N-tuple electrons
94  analysis->fill_Tuple_Electrons(ex, ey, ez, ee, epx, epy, epz);
95  }
96 
97  // Photons
98  if (aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->
99  GetParticleName() == "gamma")
100  {
101 
102  // Position
103  gx = (aStep->GetTrack()->GetPosition().x())/cm;
104  gy = (aStep->GetTrack()->GetPosition().y())/cm;
105  gz = (aStep->GetTrack()->GetPosition().z())/cm;
106 
107  // Energy
108  ge = (aStep->GetTrack()->GetKineticEnergy())/MeV;
109 
110  // Momentum
111  gpx = aStep->GetTrack()->GetMomentum().x();
112  gpy = aStep->GetTrack()->GetMomentum().y();
113  gpz = aStep->GetTrack()->GetMomentum().z();
114 
115  // Fill N-tuple photons
116  analysis->fill_Tuple_Gamma(gx, gy, gz, ge, gpx, gpy, gpz);
117  }
118 
119 
120  // Positrons
121  if (aStep->GetTrack()->GetDynamicParticle()->GetDefinition()->GetParticleName() == "e+")
122  {
123 
124  // Position
125  px = (aStep->GetTrack()->GetPosition().x())/cm;
126  py = (aStep->GetTrack()->GetPosition().y())/cm;
127  pz = (aStep->GetTrack()->GetPosition().z())/cm;
128 
129  // Energy
130  pe = (aStep->GetTrack()->GetKineticEnergy())/MeV;
131 
132  // Momentum
133  ppx = aStep->GetTrack()->GetMomentum().x();
134  ppy = aStep->GetTrack()->GetMomentum().y();
135  ppz = aStep->GetTrack()->GetMomentum().z();
136 
137  // Fill Ntuple positrons
138  analysis->fill_Tuple_Positrons(px, py, pz, pe, ppx, ppy, ppz);
139  }
140  }
141 }
double x() const
const G4DynamicParticle * GetDynamicParticle() const
const G4ThreeVector & GetPosition() const
void fill_Tuple_Gamma(G4double, G4double, G4double, G4double, G4double, G4double, G4double)
G4ParticleDefinition * GetDefinition() const
const G4String & GetParticleName() const
double z() const
G4VPhysicalVolume * GetNextVolume() const
G4StepPoint * GetPreStepPoint() const
G4double GetKineticEnergy() const
G4VPhysicalVolume * GetPhysicalVolume() const
const G4String & GetProcessName() const
Definition: G4VProcess.hh:408
G4ThreeVector GetMomentum() const
void fill_Tuple_Positrons(G4double, G4double, G4double, G4double, G4double, G4double, G4double)
const G4VProcess * GetProcessDefinedStep() const
G4StepPoint * GetPostStepPoint() const
double y() const
void fill_Tuple_Electrons(G4double, G4double, G4double, G4double, G4double, G4double, G4double)
double G4double
Definition: G4Types.hh:76
G4Track * GetTrack() const
const G4VPhysicalVolume * GetWorld()
const G4VPhysicalVolume * GetMeasureVolume()
static PurgMagAnalysisManager * getInstance()

The documentation for this class was generated from the following files: