4 // See the class description in the header file.
6 #include "AliSensitiveDetector.h"
10 #include "TG4StepManager.h"
12 AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module)
13 : TG4VSensitiveDetector(sdName),
15 fStepManager(TG4StepManager::Instance())
20 AliSensitiveDetector::AliSensitiveDetector(G4String sdName, AliModule* module,
22 : TG4VSensitiveDetector(sdName, id),
24 fStepManager(TG4StepManager::Instance())
29 AliSensitiveDetector::AliSensitiveDetector(const AliSensitiveDetector& right)
30 : TG4VSensitiveDetector(right)
33 fModule = right.fModule;
34 fStepManager = right.fStepManager;
37 AliSensitiveDetector::AliSensitiveDetector(){
41 AliSensitiveDetector::~AliSensitiveDetector() {
48 AliSensitiveDetector::operator=(const AliSensitiveDetector& right)
50 // check assignement to self
51 if (this == &right) return *this;
53 // base class assignement
54 TG4VSensitiveDetector::operator=(right);
56 fModule = right.fModule;
57 fStepManager = right.fStepManager;
64 void AliSensitiveDetector::Initialize(G4HCofThisEvent* hc)
66 // This method is called at the beginning of event action
67 // before user defined BeginOfEventAction() method.
70 G4bool AliSensitiveDetector::ProcessHits(G4Step* step, G4TouchableHistory*)
72 // Calls StepManager of associated AliModules.
75 // add energy deposit of the current step
78 gAlice->AddEnergyDeposit(fID, step->GetTotalEnergyDeposit());
82 = step->GetTrack()->GetParentID();
84 if (parentID==0) shunt = 1;
85 fModule->SetIshunt(shunt);
87 if ((step->GetPreStepPoint()->GetStepStatus() == fGeomBoundary) ||
88 (step->GetTrack()->GetCurrentStepNumber() == 1) ){
90 // if first step or crossing boundary
91 // let AliModule process step in PreStepPoint
92 // (this ensures compatibility with G3 that
93 // makes additional step of zero length)
95 fStepManager->SetStep(step, kPreStepPoint);
96 fModule->StepManager();
99 // let AliModule process step
100 fStepManager->SetStep(step, kPostStepPoint);
101 fModule->StepManager();
106 void AliSensitiveDetector::EndOfEvent(G4HCofThisEvent* hce){
110 //void AliSensitiveDetector::clear()
113 void AliSensitiveDetector::PrintAll() {
117 void AliSensitiveDetector::DrawAll() {