moved from geometry to digits+hits; added comment lines separating methods
[u/mrichter/AliRoot.git] / TGeant4 / TG4VSensitiveDetector.cxx
CommitLineData
2817d3e2 1// $Id$ //
f44942a8 2// Category: digits+hits
2817d3e2 3//
4// See the class description in the header file.
5
6#include "TG4VSensitiveDetector.h"
2817d3e2 7#include "TG4StepManager.h"
8
9G4int TG4VSensitiveDetector::fgSDCounter = 0;
10
f44942a8 11//_____________________________________________________________________________
2817d3e2 12TG4VSensitiveDetector::TG4VSensitiveDetector(G4String sdName)
9bcb6317 13 : G4VSensitiveDetector(sdName),
14 fStepManager(TG4StepManager::Instance())
2817d3e2 15{
16//
1519e260 17 fID = ++fgSDCounter;
2817d3e2 18}
19
f44942a8 20//_____________________________________________________________________________
2817d3e2 21TG4VSensitiveDetector::TG4VSensitiveDetector(G4String sdName, G4int id)
22 : G4VSensitiveDetector(sdName),
9bcb6317 23 fID(id),
24 fStepManager(TG4StepManager::Instance())
25
2817d3e2 26{
27//
1519e260 28 ++fgSDCounter;
2817d3e2 29}
30
f44942a8 31//_____________________________________________________________________________
2817d3e2 32TG4VSensitiveDetector::TG4VSensitiveDetector(
33 const TG4VSensitiveDetector& right)
34 : G4VSensitiveDetector(right)
35{
36//
af454a82 37 // copy stuff
38 *this = right;
2817d3e2 39
1519e260 40 ++fgSDCounter;;
2817d3e2 41}
42
f44942a8 43//_____________________________________________________________________________
2817d3e2 44TG4VSensitiveDetector::TG4VSensitiveDetector()
45 : G4VSensitiveDetector("")
46{
47//
48}
49
f44942a8 50//_____________________________________________________________________________
2817d3e2 51TG4VSensitiveDetector::~TG4VSensitiveDetector() {
52//
53}
54
55// operators
56
f44942a8 57//_____________________________________________________________________________
2817d3e2 58TG4VSensitiveDetector& TG4VSensitiveDetector::operator=(
59 const TG4VSensitiveDetector &right)
60{
61 // check assignement to self
62 if (this == &right) return *this;
63
64 // base class assignement
65 TG4VSensitiveDetector::operator=(right);
66
67 fID = right.fID;
9bcb6317 68 fStepManager = right.fStepManager;
2817d3e2 69
70 return *this;
71}
9bcb6317 72
73// public methods
74
f44942a8 75//_____________________________________________________________________________
9bcb6317 76G4bool TG4VSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*)
77{
78// Calls StepManager of associated AliModule.
79// ---
80
f5a5ec35 81 // let user sensitive detector process normal step
9bcb6317 82 fStepManager->SetStep(step, kNormalStep);
83 UserProcessHits(step->GetTrack(), step);
84
85 return true;
86}
87
f44942a8 88//_____________________________________________________________________________
9bcb6317 89G4bool TG4VSensitiveDetector::ProcessHitsOnBoundary(G4Step* step)
90{
91// Calls StepManager of associated AliModule
92// when crossing a geometrical boundary.
93// ---
94
f5a5ec35 95 // let user sensitive detector process boundary step
9bcb6317 96 fStepManager->SetStep(step, kBoundary);
97 UserProcessHits(step->GetTrack(), step);
98
99 return true;
100}
101