]>
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 | ||
10 | #include "TG4StepManager.h" | |
11 | ||
12 | AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module) | |
13 | : TG4VSensitiveDetector(sdName), | |
14 | fModule(module), | |
15 | fStepManager(TG4StepManager::Instance()) | |
16 | { | |
17 | // | |
18 | } | |
19 | ||
20 | AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module, | |
21 | G4int id) | |
22 | : TG4VSensitiveDetector(sdName, id), | |
23 | fModule(module), | |
24 | fStepManager(TG4StepManager::Instance()) | |
25 | { | |
26 | // | |
27 | } | |
28 | ||
29 | AliSensitiveDetector::AliSensitiveDetector(const AliSensitiveDetector& right) | |
30 | : TG4VSensitiveDetector(right) | |
31 | { | |
32 | // | |
33 | fModule = right.fModule; | |
34 | fStepManager = right.fStepManager; | |
35 | } | |
36 | ||
37 | AliSensitiveDetector::AliSensitiveDetector(){ | |
38 | // | |
39 | } | |
40 | ||
41 | AliSensitiveDetector::~AliSensitiveDetector() { | |
42 | // | |
43 | } | |
44 | ||
45 | // operators | |
46 | ||
47 | AliSensitiveDetector& | |
48 | AliSensitiveDetector::operator=(const AliSensitiveDetector& right) | |
49 | { | |
50 | // check assignement to self | |
51 | if (this == &right) return *this; | |
52 | ||
53 | // base class assignement | |
54 | TG4VSensitiveDetector::operator=(right); | |
55 | ||
56 | fModule = right.fModule; | |
57 | fStepManager = right.fStepManager; | |
58 | ||
59 | return *this; | |
60 | } | |
61 | ||
62 | // public methods | |
63 | ||
64 | void AliSensitiveDetector::Initialize(G4HCofThisEvent* hc) | |
65 | { | |
66 | // This method is called at the beginning of event action | |
67 | // before user defined BeginOfEventAction() method. | |
68 | } | |
69 | ||
70 | G4bool AliSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*) | |
71 | { | |
72 | // Calls StepManager of associated AliModules. | |
73 | // --- | |
74 | ||
75 | // add energy deposit of the current step | |
76 | // directly to AliRun | |
77 | G4int copy; | |
78 | gAlice->AddEnergyDeposit(fID, step->GetTotalEnergyDeposit()); | |
79 | ||
80 | // parent ID -> shunt | |
81 | G4int parentID | |
82 | = step->GetTrack()->GetParentID(); | |
83 | Int_t shunt = 0; | |
84 | if (parentID==0) shunt = 1; | |
85 | fModule->SetIshunt(shunt); | |
86 | ||
87 | // let AliModule process step | |
88 | fStepManager->SetStep(step); | |
89 | fModule->StepManager(); | |
90 | ||
91 | return true; | |
92 | } | |
93 | ||
94 | void AliSensitiveDetector::EndOfEvent(G4HCofThisEvent* hce){ | |
95 | // | |
96 | } | |
97 | ||
98 | //void AliSensitiveDetector::clear() | |
99 | //{} | |
100 | ||
101 | void AliSensitiveDetector::PrintAll() { | |
102 | // | |
103 | } | |
104 | ||
105 | void AliSensitiveDetector::DrawAll() { | |
106 | // | |
107 | } |