31 #include "G4HCofThisEvent.hh"
32 #include "G4TouchableHistory.hh"
33 #include "G4VProcess.hh"
38 G4String HCname =
"CopClusterHits";
39 collectionName.insert(HCname);
52 HCID = GetCollectionID(0);
54 HCE->AddHitsCollection(HCID,caloCollection);
62 G4double edep = aStep->GetTotalEnergyDeposit();
67 const G4VTouchable *touchable = aStep->GetPreStepPoint()->GetTouchable();
68 G4String tmp; G4int depth = touchable->GetHistoryDepth(), detector_number = touchable->GetCopyNumber(0);
70 detector_number += touchable->GetCopyNumber(depth-1);
81 for(
unsigned int i = 0; i < caloCollection->GetSize(); i++ ){
83 if ( detector_number == newHit->
GetDetID() )
94 newHit->
SetPos( edep, aStep->GetPostStepPoint()->GetPosition() );
95 newHit->
SetToF( edep, aStep->GetPostStepPoint()->GetGlobalTime() );
97 newHit->
SetDetName (aStep->GetTrack()->GetVolume()->GetName());
101 newHit->
SetMotherID(aStep->GetPreStepPoint()->GetTouchableHandle()->GetReplicaNumber(1));
104 caloCollection->insert( newHit );
109 newHit->
AddPos ( edep, aStep->GetPostStepPoint()->GetPosition() );
110 newHit->
AddToF ( edep, aStep->GetPostStepPoint()->GetGlobalTime() );
118 for(
unsigned int i = 0; i < caloCollection->GetSize(); i++ ){
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
void SetDetName(G4String name)
void EndOfEvent()
to be applied at the end of an event to calculate properly the mean values
void SetMotherID(G4int id)
CopClusterSD(G4String name)
void AddEdep(G4double de)
G4THitsCollection< CopClusterHit > CopClusterHitsCollection
void SetNbHits(G4int nb=0)
void AddToF(G4double de, G4double t)
void SetToF(G4double de, G4double tf=0.0)
void Initialize(G4HCofThisEvent *HCE)
void AddPos(G4double de, G4ThreeVector xyz)
void SetEdep(G4double de=0.0)
Informations to keep the energy is in a sensitive detector.
void SetPos(G4double de, G4ThreeVector xyz=G4ThreeVector(0., 0., 0.))
void EndOfEvent(G4HCofThisEvent *HCE)