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