Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PurgMagSteppingAction Class Reference

#include <PurgMagSteppingAction.hh>

Inheritance diagram for PurgMagSteppingAction:
Collaboration diagram for PurgMagSteppingAction:

Public Member Functions

 PurgMagSteppingAction (const PurgMagDetectorConstruction *)
 
 ~PurgMagSteppingAction ()
 
void UserSteppingAction (const G4Step *)
 
- Public Member Functions inherited from G4UserSteppingAction
 G4UserSteppingAction ()
 
virtual ~G4UserSteppingAction ()
 
virtual 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 ( const PurgMagDetectorConstruction det)

Definition at line 53 of file PurgMagSteppingAction.cc.

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

Definition at line 60 of file PurgMagSteppingAction.cc.

61 { }

Member Function Documentation

void PurgMagSteppingAction::UserSteppingAction ( const G4Step aStep)
virtual

Reimplemented from G4UserSteppingAction.

Definition at line 65 of file PurgMagSteppingAction.cc.

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

Here is the call graph for this function:


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