32 #include "G4HCofThisEvent.hh"
33 #include "G4TouchableHistory.hh"
34 #include "G4VProcess.hh"
36 #include "G4OpticalPhoton.hh"
40 G4String HCname =
"TrackerHits";
41 collectionName.insert(HCname);
55 HCID = GetCollectionID(0);
56 HCE->AddHitsCollection(HCID,trackerCollection);
64 G4String tmp; G4int temp_code;
67 G4Track* theTrack = aStep->GetTrack();
68 if ( theTrack && theTrack->GetParticleDefinition() == G4OpticalPhoton::OpticalPhotonDefinition() )
72 G4double edep = aStep->GetTotalEnergyDeposit();
91 newHit->
SetPos( aStep->GetPostStepPoint()->GetPosition() );
92 newHit->
SetToF ( aStep->GetPostStepPoint()->GetGlobalTime() );
94 newHit->
SetDetName (aStep->GetTrack()->GetVolume()->GetName());
96 const G4VTouchable *touchable = aStep->GetPreStepPoint()->GetTouchable();
97 G4int depth = touchable->GetHistoryDepth();
99 G4int detector_number = touchable->GetCopyNumber(0);
101 detector_number += touchable->GetCopyNumber(depth-1);
113 newHit->
SetMotherID(aStep->GetPreStepPoint()->GetTouchableHandle()->GetReplicaNumber(1));
115 tmp = aStep->GetTrack()->GetDefinition()->GetParticleName();
118 temp_code = aStep->GetTrack()->GetDefinition()->GetPDGEncoding ();
121 tmp = aStep->GetPostStepPoint()->GetProcessDefinedStep()->GetProcessName();
125 trackerCollection->insert( newHit );
G4THitsCollection< TrackerHit > TrackerHitsCollection
void SetParticleName(G4String name)
void EndOfEvent(G4HCofThisEvent *HCE)
void SetPos(G4ThreeVector xyz)
void SetMotherID(G4int id)
void SetEdep(G4double de)
void SetPDGcode(G4int code)
void SetTrackID(G4int id)
void SetParentID(G4int id)
void SetDetName(G4String name)
Informations to be kept at each step if a positive energy is deposited in a sensitive detector...
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
void SetPrimaryID(G4int id)
void Initialize(G4HCofThisEvent *HCE)
void SetProcessName(G4String name)