]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - AliGeant4/AliSensitiveDetector.cxx
CreateHall() removed
[u/mrichter/AliRoot.git] / AliGeant4 / AliSensitiveDetector.cxx
index 903918d951d875ac48316ed579540c3532c5d38e..6c0313c3fe908dcf8910ac11a887f89f1d122aa7 100644 (file)
@@ -1,46 +1,62 @@
 // $Id$ //
-// Category: geometry
+// Category: digits+hits
 //
+// Author: I. Hrivnacova
+//
+// Class AliSensitiveDetector
+// --------------------------
 // See the class description in the header file.
 
 #include "AliSensitiveDetector.h"
 #include "AliModule.h" 
 #include "AliRun.h"
+#include "AliMCQA.h"
 
-#include "TG3Units.h"
+#include "TG4G3Units.h"
 
+//_____________________________________________________________________________
 AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module)
   : TG4VSensitiveDetector(sdName),
-    fModule(module)
+    fModule(module),
+    fModuleID(0),
+    fMCQA(0)
 {
 //
 }
 
+//_____________________________________________________________________________
 AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module, 
                                            G4int id)
   : TG4VSensitiveDetector(sdName, id),
-    fModule(module)
+    fModule(module),
+    fModuleID(0),
+    fMCQA(0)
 {
 //
 }
 
+//_____________________________________________________________________________
 AliSensitiveDetector::AliSensitiveDetector(const AliSensitiveDetector& right)
   : TG4VSensitiveDetector(right)
 {
 //
-  fModule = right.fModule;
+  // copy stuff
+  *this = right;
 }  
   
+//_____________________________________________________________________________
 AliSensitiveDetector::AliSensitiveDetector(){
 //
 }
 
+//_____________________________________________________________________________
 AliSensitiveDetector::~AliSensitiveDetector() {
 //
 }
 
 // operators
 
+//_____________________________________________________________________________
 AliSensitiveDetector& 
 AliSensitiveDetector::operator=(const AliSensitiveDetector& right)
 {
@@ -57,6 +73,19 @@ AliSensitiveDetector::operator=(const AliSensitiveDetector& right)
           
 // public methods
 
+//_____________________________________________________________________________
+void AliSensitiveDetector::Initialize(G4HCofThisEvent*HCE) 
+{
+// This method is called by G4 kernel at the beginning of event action
+// before user defined BeginOfEventAction() method.
+// ---
+
+  fModuleID = gAlice->GetModuleID(fModule->GetName());
+  fMCQA = gAlice->GetMCQA();
+}  
+  
+  
+//_____________________________________________________________________________
 void AliSensitiveDetector::UserProcessHits(const G4Track* track, 
                                            const G4Step* step)
 {
@@ -67,14 +96,11 @@ void AliSensitiveDetector::UserProcessHits(const G4Track* track,
   // directly to AliRun
   if (step) 
     gAlice->AddEnergyDeposit(
-      fID, step->GetTotalEnergyDeposit()/TG3Units::Energy());
-
-  // parent ID -> shunt
-  G4int parentID = track->GetParentID();
-  Int_t shunt = 0;
-  if (parentID==0) shunt = 1;
-  fModule->SetIshunt(shunt);
+      fID, step->GetTotalEnergyDeposit()/TG4G3Units::Energy());
+      
+  fMCQA->StepManager(fModuleID);   
 
+  // let AliModule process the step
   fModule->StepManager();
 }