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" 28 #include "G4PhysicalConstants.hh" 29 #include "G4SystemOfUnits.hh" 34 :G4VSensitiveDetector(name){
36 collectionName.insert(HCname=
"SilCollection");
49 (SensitiveDetectorName,collectionName[0]);
50 static G4int HCID = -1;
52 HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
62 G4double edep = -aStep->GetDeltaEnergy()/MeV;
64 if(edep==0.)
return false;
69 newHit->
SetEBeforeSil(aStep->GetPreStepPoint()->GetKineticEnergy()/MeV);
70 newHit->
SetEAfterSil(aStep->GetPostStepPoint()->GetKineticEnergy()/MeV);
72 newHit->
SetPos(aStep->GetPostStepPoint()->GetPosition());
75 newHit->
SetPrePos(aStep->GetPreStepPoint()->GetPosition());
78 G4ThreeVector theLocalPos =
79 (aStep->GetPostStepPoint()->GetPhysicalVolume()->GetObjectRotationValue().inverse()) *
80 (aStep->GetPostStepPoint()->GetPosition()-aStep->GetPostStepPoint()->GetPhysicalVolume()->GetObjectTranslation());
84 (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetObjectRotationValue().inverse())*
85 (aStep->GetPreStepPoint()->GetPosition()-aStep->GetPreStepPoint()->GetPhysicalVolume()->GetObjectTranslation());
88 newHit->
SetDetName(aStep->GetTrack()->GetVolume()->GetName());
89 newHit->
SetPreDetName(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName());
90 newHit->
SetPostDetName(aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName());
91 newHit->
SetDetID(aStep->GetTrack()->GetVolume()->GetCopyNo());
93 newHit->
SetToF(aStep->GetPostStepPoint()->GetGlobalTime());
95 newHit->
SetTrackID(aStep->GetTrack()->GetTrackID());
96 newHit->
SetParentID(aStep->GetTrack()->GetParentID());
97 newHit->
SetParticleID(aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
99 newHit->
SetParticleMass(aStep->GetTrack()->GetDefinition()->GetPDGMass());
115 if (verboseLevel>0) {
116 G4cout <<
"Hits Collection: in this event they are " << NbHits
117 <<
" (GEANT-like) hits in the Sil: " << G4endl;
void SetPrePos(G4ThreeVector xyz)
void SetPostDetName(G4String Name)
void SetParticleID(G4int ID)
ActarSimSilSD(G4String)
Constructor, just naming the Hit collection.
void SetDetName(G4String Name)
void SetLocalPos(G4ThreeVector xyz)
void SetLocalPrePos(G4ThreeVector xyz)
void SetEBeforeSil(G4double eb)
void SetEAfterSil(G4double ea)
void SetParticleMass(G4double mass)
void SetPreDetName(G4String Name)
void SetParticleCharge(G4double charge)
void EndOfEvent(G4HCofThisEvent *)
void SetToF(G4double Time)
G4THitsCollection< ActarSimSilGeantHit > ActarSimSilGeantHitsCollection
void Initialize(G4HCofThisEvent *)
void SetParentID(G4int id)
void SetPos(G4ThreeVector xyz)
~ActarSimSilSD()
Destructor, nothing to do.
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
void SetEdep(G4double de)
ActarSimSilGeantHitsCollection * hitsCollection
Geant step-like hits collect.
void SetTrackID(G4int track)