]> git.uio.no Git - u/mrichter/AliRoot.git/blame - TGeant4/TG4SteppingAction.cxx
updated to AliMC changes - added StepProcesses() method (not yet implemented); update...
[u/mrichter/AliRoot.git] / TGeant4 / TG4SteppingAction.cxx
CommitLineData
6fc5df41 1// $Id$
2// Category: event
3//
4// See the class description in the header file.
5
6#include "TG4SteppingAction.h"
6fc5df41 7#include "TG4VSensitiveDetector.h"
8#include "TG4Globals.h"
9
10TG4SteppingAction::TG4SteppingAction() {
11//
12}
13
14TG4SteppingAction::TG4SteppingAction(const TG4SteppingAction& right) {
15//
16 TG4Globals::Exception("TG4SteppingAction is protected from copying.");
17}
18
19TG4SteppingAction::~TG4SteppingAction() {
20//
21}
22
23// operators
24
25TG4SteppingAction&
26TG4SteppingAction::operator=(const TG4SteppingAction &right)
27{
28 // check assignement to self
29 if (this == &right) return *this;
30
31 TG4Globals::Exception("TG4SteppingAction is protected from assigning.");
32
33 return *this;
34}
35
36// public methods
37
38void TG4SteppingAction::UserSteppingAction(const G4Step* step)
39{
40// Called by G4 kernel at the end of each step.
41// ---
42
43 // call stepping action of derived class
44 SteppingAction(step);
45
46 // let sensitive detector process boundary step
47 // if crossing geometry border
48 // (this ensures compatibility with G3 that
49 // makes boundary step of zero length)
50
51 if (step->GetPostStepPoint()->GetStepStatus() == fGeomBoundary &&
c2c02aa6 52 step->GetTrack()->GetTrackStatus() == fAlive &&
6fc5df41 53 step->GetTrack()->GetNextVolume() != 0) {
54
55 G4VSensitiveDetector* sd
56 = step->GetPostStepPoint()->GetPhysicalVolume()
57 ->GetLogicalVolume()->GetSensitiveDetector();
58
59 if (sd) {
60 TG4VSensitiveDetector* tsd = dynamic_cast<TG4VSensitiveDetector*>(sd);
61 if (tsd)
62 tsd->ProcessHitsOnBoundary((G4Step*)step);
63 else {
64 G4String text = "TG4SteppingAction:::UserSteppingAction: \n";
65 text = text + " Unknown sensitive detector type";
66 TG4Globals::Exception(text);
67 }
68 }
69 }
70}
71