16 #include "G4HCofThisEvent.hh" 18 #include "G4ThreeVector.hh" 19 #include "G4SDManager.hh" 21 #include "G4UnitsTable.hh" 23 #include "G4VProcess.hh" 24 #include "G4VPhysicalVolume.hh" 25 #include "G4TouchableHistory.hh" 26 #include "G4VTouchable.hh" 32 collectionName.insert(HCname=
"PlaCollection");
45 (SensitiveDetectorName,collectionName[0]);
46 static G4int HCID = -1;
48 HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
57 G4double edep = aStep->GetTotalEnergyDeposit();
59 if(edep==0.)
return false;
65 newHit->
SetPos(aStep->GetPostStepPoint()->GetPosition());
68 newHit->
SetPrePos(aStep->GetPreStepPoint()->GetPosition());
71 G4ThreeVector theLocalPos =
72 (aStep->GetPostStepPoint()->GetPhysicalVolume()->GetObjectRotationValue().inverse()) *
73 (aStep->GetPostStepPoint()->GetPosition()-aStep->GetPostStepPoint()->GetPhysicalVolume()->GetObjectTranslation());
77 (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetObjectRotationValue().inverse())*
78 (aStep->GetPreStepPoint()->GetPosition()-aStep->GetPreStepPoint()->GetPhysicalVolume()->GetObjectTranslation());
81 newHit->
SetDetName(aStep->GetTrack()->GetVolume()->GetName());
82 newHit->
SetPreDetName(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName());
83 newHit->
SetPostDetName(aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName());
84 newHit->
SetDetID(aStep->GetTrack()->GetVolume()->GetCopyNo());
86 newHit->
SetToF(aStep->GetPostStepPoint()->GetGlobalTime());
88 newHit->
SetTrackID(aStep->GetTrack()->GetTrackID());
89 newHit->
SetParentID(aStep->GetTrack()->GetParentID());
90 newHit->
SetParticleID(aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
92 newHit->
SetParticleMass(aStep->GetTrack()->GetDefinition()->GetPDGMass());
107 if (verboseLevel>0) {
108 G4cout <<
"Hits Collection: in this event they are " << NbHits
109 <<
" (GEANT-like) hits in the Sci: " << G4endl;
G4THitsCollection< ActarSimPlaGeantHit > ActarSimPlaGeantHitsCollection
void SetPrePos(G4ThreeVector xyz)
void SetLocalPrePos(G4ThreeVector xyz)
void SetToF(G4double Time)
void SetPostDetName(G4String Name)
ActarSimPlaGeantHitsCollection * hitsCollection
Geant step-like hits collect.
void SetLocalPos(G4ThreeVector xyz)
void SetDetName(G4String Name)
void SetPos(G4ThreeVector xyz)
void EndOfEvent(G4HCofThisEvent *)
void Initialize(G4HCofThisEvent *)
void SetEdep(G4double de)
ActarSimPlaSD(G4String)
Constructor, just naming the Hit collection.
~ActarSimPlaSD()
Destructor, nothing to do.
void SetParentID(G4int id)
void SetParticleID(G4int ID)
void SetParticleMass(G4double mass)
void SetPreDetName(G4String Name)
void SetParticleCharge(G4double charge)
void SetTrackID(G4int track)
G4bool ProcessHits(G4Step *, G4TouchableHistory *)