// $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)
{
// 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)
{
// 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();
}