-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstepping.cpp
More file actions
29 lines (22 loc) · 774 Bytes
/
Copy pathstepping.cpp
File metadata and controls
29 lines (22 loc) · 774 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
25
26
27
28
29
#include "stepping.hh"
SteppingAction::SteppingAction(EventAction* eventAction)
{
fEventAction = eventAction;
}
SteppingAction::~SteppingAction()
{}
void SteppingAction::UserSteppingAction(const G4Step *step)
{
G4LogicalVolume *volume = step -> GetPreStepPoint() -> GetTouchableHandle() -> GetVolume() -> GetLogicalVolume();
const MuonDetectorConstruction *detectorConstruction = static_cast<const MuonDetectorConstruction*> (G4RunManager::GetRunManager() -> GetUserDetectorConstruction());
G4LogicalVolume *fScoringVolume = detectorConstruction -> GetScoringVolume();
if(volume != fScoringVolume)
return;
G4double edep = step -> GetTotalEnergyDeposit();
/*
if (edep != 0) {
G4cout << "step: " << edep << G4endl;
}
*/
fEventAction -> AddEdep(edep);
}