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