Geant4 examples
Public Member Functions | Private Attributes
B4aSteppingAction Class Reference

Stepping action class. More...

#include <Doxymodules_basic.h>

Inheritance diagram for B4aSteppingAction:
G4UserSteppingAction

List of all members.

Public Member Functions

 B4aSteppingAction (const B4DetectorConstruction *detectorConstruction, B4aEventAction *eventAction)
virtual ~B4aSteppingAction ()
virtual void UserSteppingAction (const G4Step *step)

Private Attributes

const B4DetectorConstructionfDetConstruction
B4aEventActionfEventAction

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 B4aEventAction.

Definition at line 101 of file Doxymodules_basic.h.


Constructor & Destructor Documentation

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.

{ 
}

Member Function Documentation

void B4aSteppingAction::UserSteppingAction ( const G4Step step) [virtual]

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);
  }
}

Member Data Documentation

Definition at line 55 of file B4aSteppingAction.hh.

Definition at line 56 of file B4aSteppingAction.hh.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines