]>
Commit | Line | Data |
---|---|---|
676fb573 | 1 | // $Id$ // |
2 | // Category: geometry | |
3 | // | |
4 | // See the class description in the header file. | |
5 | ||
6 | #include "AliSensitiveDetector.h" | |
7 | #include "AliModule.h" | |
8 | #include "AliRun.h" | |
9 | ||
51fecabd | 10 | #include "TG3Units.h" |
11 | ||
676fb573 | 12 | AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module) |
13 | : TG4VSensitiveDetector(sdName), | |
9bcb6317 | 14 | fModule(module) |
676fb573 | 15 | { |
16 | // | |
17 | } | |
18 | ||
19 | AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module, | |
20 | G4int id) | |
21 | : TG4VSensitiveDetector(sdName, id), | |
9bcb6317 | 22 | fModule(module) |
676fb573 | 23 | { |
24 | // | |
25 | } | |
26 | ||
27 | AliSensitiveDetector::AliSensitiveDetector(const AliSensitiveDetector& right) | |
28 | : TG4VSensitiveDetector(right) | |
29 | { | |
30 | // | |
31 | fModule = right.fModule; | |
676fb573 | 32 | } |
33 | ||
34 | AliSensitiveDetector::AliSensitiveDetector(){ | |
35 | // | |
36 | } | |
37 | ||
38 | AliSensitiveDetector::~AliSensitiveDetector() { | |
39 | // | |
40 | } | |
41 | ||
42 | // operators | |
43 | ||
44 | AliSensitiveDetector& | |
45 | AliSensitiveDetector::operator=(const AliSensitiveDetector& right) | |
46 | { | |
47 | // check assignement to self | |
48 | if (this == &right) return *this; | |
49 | ||
50 | // base class assignement | |
51 | TG4VSensitiveDetector::operator=(right); | |
52 | ||
53 | fModule = right.fModule; | |
676fb573 | 54 | |
55 | return *this; | |
56 | } | |
57 | ||
58 | // public methods | |
59 | ||
9bcb6317 | 60 | void AliSensitiveDetector::UserProcessHits(const G4Track* track, |
61 | const G4Step* step) | |
676fb573 | 62 | { |
9bcb6317 | 63 | // Calls StepManager of associated AliModule. |
676fb573 | 64 | // --- |
65 | ||
66 | // add energy deposit of the current step | |
67 | // directly to AliRun | |
51fecabd | 68 | if (step) |
69 | gAlice->AddEnergyDeposit( | |
70 | fID, step->GetTotalEnergyDeposit()/TG3Units::Energy()); | |
676fb573 | 71 | |
72 | // parent ID -> shunt | |
9bcb6317 | 73 | G4int parentID = track->GetParentID(); |
676fb573 | 74 | Int_t shunt = 0; |
75 | if (parentID==0) shunt = 1; | |
76 | fModule->SetIshunt(shunt); | |
77 | ||
676fb573 | 78 | fModule->StepManager(); |
676fb573 | 79 | } |
80 |