]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliSensitiveDetector.cxx
removed old commented lines only
[u/mrichter/AliRoot.git] / AliGeant4 / AliSensitiveDetector.cxx
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 AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module)
11   : TG4VSensitiveDetector(sdName),
12     fModule(module)
13 {
14 //
15 }
16
17 AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module, 
18                                            G4int id)
19   : TG4VSensitiveDetector(sdName, id),
20     fModule(module)
21 {
22 //
23 }
24
25 AliSensitiveDetector::AliSensitiveDetector(const AliSensitiveDetector& right)
26   : TG4VSensitiveDetector(right)
27 {
28 //
29   fModule = right.fModule;
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;
52
53   return *this;  
54 }    
55           
56 // public methods
57
58 void AliSensitiveDetector::UserProcessHits(const G4Track* track, 
59                                            const G4Step* step)
60 {
61 // Calls StepManager of associated AliModule.
62 // ---
63
64   // add energy deposit of the current step
65   // directly to AliRun
66   if (step) gAlice->AddEnergyDeposit(fID, step->GetTotalEnergyDeposit());
67
68   // parent ID -> shunt
69   G4int parentID = track->GetParentID();
70   Int_t shunt = 0;
71   if (parentID==0) shunt = 1;
72   fModule->SetIshunt(shunt);
73
74   fModule->StepManager();
75 }
76