-
Notifications
You must be signed in to change notification settings - Fork 39
Expand file tree
/
Copy pathstepping.cc
More file actions
24 lines (17 loc) · 742 Bytes
/
stepping.cc
File metadata and controls
24 lines (17 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "stepping.hh"
MySteppingAction::MySteppingAction(MyEventAction *eventAction)
{
fEventAction = eventAction;
}
MySteppingAction::~MySteppingAction()
{}
void MySteppingAction::UserSteppingAction(const G4Step *step)
{
G4LogicalVolume *volume = step->GetPreStepPoint()->GetTouchableHandle()->GetVolume()->GetLogicalVolume();
const MyDetectorConstruction *detectorConstruction = static_cast<const MyDetectorConstruction*> (G4RunManager::GetRunManager()->GetUserDetectorConstruction());
G4LogicalVolume *fScoringVolume = detectorConstruction->GetScoringVolume();
if(volume != fScoringVolume)
return;
G4double edep = step->GetTotalEnergyDeposit();
fEventAction->AddEdep(edep);
}