]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AliGeant4/AliSensitiveDetector.cxx
Remove compilation of grndmq
[u/mrichter/AliRoot.git] / AliGeant4 / AliSensitiveDetector.cxx
1 // $Id$ //
2 // Category: digits+hits
3 //
4 // Author: I. Hrivnacova
5 //
6 // Class AliSensitiveDetector
7 // --------------------------
8 // See the class description in the header file.
9
10 #include "AliSensitiveDetector.h"
11 #include "AliModule.h" 
12 #include "AliRun.h"
13 #include "AliMCQA.h"
14
15 #include "TG4G3Units.h"
16
17 //_____________________________________________________________________________
18 AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module)
19   : TG4VSensitiveDetector(sdName),
20     fModule(module),
21     fModuleID(0),
22     fMCQA(0)
23 {
24 //
25 }
26
27 //_____________________________________________________________________________
28 AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module, 
29                                            G4int id)
30   : TG4VSensitiveDetector(sdName, id),
31     fModule(module),
32     fModuleID(0),
33     fMCQA(0)
34 {
35 //
36 }
37
38 //_____________________________________________________________________________
39 AliSensitiveDetector::AliSensitiveDetector(const AliSensitiveDetector& right)
40   : TG4VSensitiveDetector(right)
41 {
42 //
43   // copy stuff
44   *this = right;
45 }  
46   
47 //_____________________________________________________________________________
48 AliSensitiveDetector::AliSensitiveDetector(){
49 //
50 }
51
52 //_____________________________________________________________________________
53 AliSensitiveDetector::~AliSensitiveDetector() {
54 //
55 }
56
57 // operators
58
59 //_____________________________________________________________________________
60 AliSensitiveDetector& 
61 AliSensitiveDetector::operator=(const AliSensitiveDetector& right)
62 {
63   // check assignement to self
64   if (this == &right) return *this;
65
66   // base class assignement
67   TG4VSensitiveDetector::operator=(right);
68
69   fModule = right.fModule;
70
71   return *this;  
72 }    
73           
74 // public methods
75
76 //_____________________________________________________________________________
77 void AliSensitiveDetector::Initialize(G4HCofThisEvent*HCE) 
78 {
79 // This method is called by G4 kernel at the beginning of event action
80 // before user defined BeginOfEventAction() method.
81 // ---
82
83   fModuleID = gAlice->GetModuleID(fModule->GetName());
84   fMCQA = gAlice->GetMCQA();
85 }  
86   
87   
88 //_____________________________________________________________________________
89 void AliSensitiveDetector::UserProcessHits(const G4Track* track, 
90                                            const G4Step* step)
91 {
92 // Calls StepManager of associated AliModule.
93 // ---
94
95   // add energy deposit of the current step
96   // directly to AliRun
97   if (step) 
98     gAlice->AddEnergyDeposit(
99       fID, step->GetTotalEnergyDeposit()/TG4G3Units::Energy());
100       
101   fMCQA->StepManager(fModuleID);   
102
103   // let AliModule process the step
104   fModule->StepManager();
105 }
106