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