|
Geant4 examples
|
Stepping action class. More...
#include <Doxymodules_basic.h>
Public Member Functions | |
| B4aSteppingAction (const B4DetectorConstruction *detectorConstruction, B4aEventAction *eventAction) | |
| virtual | ~B4aSteppingAction () |
| virtual void | UserSteppingAction (const G4Step *step) |
Private Attributes | |
| const B4DetectorConstruction * | fDetConstruction |
| B4aEventAction * | fEventAction |
Stepping action class.
In UserSteppingAction() there are collected the energy deposit and track lengths of charged particles in Absober and Gap layers and updated in B4aEventAction.
Definition at line 101 of file Doxymodules_basic.h.
| B4aSteppingAction::B4aSteppingAction | ( | const B4DetectorConstruction * | detectorConstruction, |
| B4aEventAction * | eventAction | ||
| ) |
Definition at line 40 of file B4aSteppingAction.cc.
: G4UserSteppingAction(), fDetConstruction(detectorConstruction), fEventAction(eventAction) { }
| B4aSteppingAction::~B4aSteppingAction | ( | ) | [virtual] |
Definition at line 51 of file B4aSteppingAction.cc.
{
}
Reimplemented from G4UserSteppingAction.
Definition at line 57 of file B4aSteppingAction.cc.
{
// Collect energy and track length step by step
// get volume of the current step
G4VPhysicalVolume* volume
= step->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
// energy deposit
G4double edep = step->GetTotalEnergyDeposit();
// step length
G4double stepLength = 0.;
if ( step->GetTrack()->GetDefinition()->GetPDGCharge() != 0. ) {
stepLength = step->GetStepLength();
}
if ( volume == fDetConstruction->GetAbsorberPV() ) {
fEventAction->AddAbs(edep,stepLength);
}
if ( volume == fDetConstruction->GetGapPV() ) {
fEventAction->AddGap(edep,stepLength);
}
}
Definition at line 55 of file B4aSteppingAction.hh.
B4aEventAction* B4aSteppingAction::fEventAction [private] |
Definition at line 56 of file B4aSteppingAction.hh.
1.7.4