Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
B4b::SteppingAction Class Reference
basic » B4 » B4b

Stepping action class. More...

#include <Doxymodules_basic.h>

Inheritance diagram for B4b::SteppingAction:
G4UserSteppingAction

Public Member Functions

 SteppingAction (const B4::DetectorConstruction *detConstruction)
 
 ~SteppingAction () override=default
 
void UserSteppingAction (const G4Step *step) override
 

Private Attributes

const B4::DetectorConstructionfDetConstruction = nullptr
 

Detailed Description

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 RunData object.

Definition at line 144 of file Doxymodules_basic.h.

Constructor & Destructor Documentation

◆ SteppingAction()

B4b::SteppingAction::SteppingAction ( const B4::DetectorConstruction detConstruction)

Definition at line 44 of file SteppingAction.cc.

45 : fDetConstruction(detConstruction)
46{
47}
const B4::DetectorConstruction * fDetConstruction

◆ ~SteppingAction()

B4b::SteppingAction::~SteppingAction ( )
overridedefault

Member Function Documentation

◆ UserSteppingAction()

void B4b::SteppingAction::UserSteppingAction ( const G4Step step)
override

Definition at line 51 of file SteppingAction.cc.

52{
53// Collect energy and track length step by step
54
55 // get volume of the current step
56 auto volume = step->GetPreStepPoint()->GetTouchableHandle()->GetVolume();
57
58 // energy deposit
59 auto edep = step->GetTotalEnergyDeposit();
60
61 // step length
62 G4double stepLength = 0.;
63 if ( step->GetTrack()->GetDefinition()->GetPDGCharge() != 0. ) {
64 stepLength = step->GetStepLength();
65 }
66
67 auto runData = static_cast<RunData*>
68 (G4RunManager::GetRunManager()->GetNonConstCurrentRun());
69
70 if ( volume == fDetConstruction->GetAbsorberPV() ) {
71 runData->Add(kAbs, edep, stepLength);
72 }
73
74 if ( volume == fDetConstruction->GetGapPV() ) {
75 runData->Add(kGap, edep, stepLength);
76 }
77}
const G4VPhysicalVolume * GetAbsorberPV() const
const G4VPhysicalVolume * GetGapPV() const
const G4int kGap
Definition RunData.hh:44
const G4int kAbs
Definition RunData.hh:43

Member Data Documentation

◆ fDetConstruction

const B4::DetectorConstruction* B4b::SteppingAction::fDetConstruction = nullptr
private

Definition at line 58 of file SteppingAction.hh.


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

Applications | User Support | Publications | Collaboration