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=
"SilRingCollection");
49 (SensitiveDetectorName,collectionName[0]);
50 static G4int HCID = -1;
52 HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
61 G4double edep = aStep->GetTotalEnergyDeposit();
63 if(edep==0.)
return false;
68 newHit->
SetEBeforeSil(aStep->GetPreStepPoint()->GetKineticEnergy()/MeV);
69 newHit->
SetEAfterSil(aStep->GetPostStepPoint()->GetKineticEnergy()/MeV);
71 newHit->
SetPos(aStep->GetPostStepPoint()->GetPosition());
74 newHit->
SetPrePos(aStep->GetPreStepPoint()->GetPosition());
77 G4ThreeVector theLocalPos =
78 (aStep->GetPostStepPoint()->GetPhysicalVolume()->GetObjectRotationValue().inverse()) *
79 (aStep->GetPostStepPoint()->GetPosition()-aStep->GetPostStepPoint()->GetPhysicalVolume()->GetObjectTranslation());
83 (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetObjectRotationValue().inverse())*
84 (aStep->GetPreStepPoint()->GetPosition()-aStep->GetPreStepPoint()->GetPhysicalVolume()->GetObjectTranslation());
87 newHit->
SetDetName(aStep->GetTrack()->GetVolume()->GetName());
88 newHit->
SetPreDetName(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName());
89 newHit->
SetPostDetName(aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName());
90 newHit->
SetDetID(aStep->GetTrack()->GetVolume()->GetCopyNo());
92 newHit->
SetToF(aStep->GetPostStepPoint()->GetGlobalTime());
94 newHit->
SetTrackID(aStep->GetTrack()->GetTrackID());
95 newHit->
SetParentID(aStep->GetTrack()->GetParentID());
96 newHit->
SetParticleID(aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
98 newHit->
SetParticleMass(aStep->GetTrack()->GetDefinition()->GetPDGMass());
114 if (verboseLevel>0) {
115 G4cout <<
"Hits Collection: in this event they are " << NbHits
116 <<
" (GEANT-like) hits in the Sil: " << G4endl;
void SetTrackID(G4int track)
void SetDetName(G4String Name)
G4THitsCollection< ActarSimSilRingGeantHit > ActarSimSilRingGeantHitsCollection
void SetPrePos(G4ThreeVector xyz)
void Initialize(G4HCofThisEvent *)
void SetPos(G4ThreeVector xyz)
void SetParentID(G4int id)
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
void SetLocalPrePos(G4ThreeVector xyz)
void SetParticleCharge(G4double charge)
void SetEAfterSil(G4double ea)
~ActarSimSilRingSD()
Destructor, nothing to do.
ActarSimSilRingGeantHitsCollection * hitsCollection
Geant step-like hits collect.
void SetLocalPos(G4ThreeVector xyz)
ActarSimSilRingSD(G4String)
Constructor, just naming the Hit collection.
void SetPreDetName(G4String Name)
void SetParticleMass(G4double mass)
void SetPostDetName(G4String Name)
void SetToF(G4double Time)
void SetEdep(G4double de)
void SetParticleID(G4int ID)
void SetEBeforeSil(G4double eb)
void EndOfEvent(G4HCofThisEvent *)