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" 31 :G4VSensitiveDetector(name){
33 collectionName.insert(HCname=
"SciRingCollection");
46 (SensitiveDetectorName,collectionName[0]);
47 static G4int HCID = -1;
49 HCID = G4SDManager::GetSDMpointer()->GetCollectionID(collectionName[0]);
58 G4double edep = aStep->GetTotalEnergyDeposit();
60 if(edep==0.)
return false;
66 newHit->
SetPos(aStep->GetPostStepPoint()->GetPosition());
69 newHit->
SetPrePos(aStep->GetPreStepPoint()->GetPosition());
72 G4ThreeVector theLocalPos =
73 (aStep->GetPostStepPoint()->GetPhysicalVolume()->GetObjectRotationValue().inverse()) *
74 (aStep->GetPostStepPoint()->GetPosition()-aStep->GetPostStepPoint()->GetPhysicalVolume()->GetObjectTranslation());
78 (aStep->GetPreStepPoint()->GetPhysicalVolume()->GetObjectRotationValue().inverse())*
79 (aStep->GetPreStepPoint()->GetPosition()-aStep->GetPreStepPoint()->GetPhysicalVolume()->GetObjectTranslation());
82 newHit->
SetDetName(aStep->GetTrack()->GetVolume()->GetName());
83 newHit->
SetPreDetName(aStep->GetPreStepPoint()->GetPhysicalVolume()->GetName());
84 newHit->
SetPostDetName(aStep->GetPostStepPoint()->GetPhysicalVolume()->GetName());
85 newHit->
SetDetID(aStep->GetTrack()->GetVolume()->GetCopyNo());
87 newHit->
SetToF(aStep->GetPostStepPoint()->GetGlobalTime());
89 newHit->
SetTrackID(aStep->GetTrack()->GetTrackID());
90 newHit->
SetParentID(aStep->GetTrack()->GetParentID());
91 newHit->
SetParticleID(aStep->GetTrack()->GetDefinition()->GetPDGEncoding());
93 newHit->
SetParticleMass(aStep->GetTrack()->GetDefinition()->GetPDGMass());
109 if (verboseLevel>0) {
110 G4cout <<
"Hits Collection: in this event they are " << NbHits
111 <<
" (GEANT-like) hits in the SciRing: " << G4endl;
void SetLocalPrePos(G4ThreeVector xyz)
void SetPrePos(G4ThreeVector xyz)
void EndOfEvent(G4HCofThisEvent *)
~ActarSimSciRingSD()
Destructor, nothing to do.
ActarSimSciRingSD(G4String)
Constructor, just naming the Hit collection.
void SetPos(G4ThreeVector xyz)
ActarSimSciRingGeantHitsCollection * hitsCollection
Geant step-like hits collect.
void SetParticleCharge(G4double charge)
void SetPostDetName(G4String Name)
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
G4THitsCollection< ActarSimSciRingGeantHit > ActarSimSciRingGeantHitsCollection
void SetDetName(G4String Name)
void SetEdep(G4double de)
void SetLocalPos(G4ThreeVector xyz)
void SetParticleMass(G4double mass)
void SetPreDetName(G4String Name)
void SetParticleID(G4int ID)
void SetToF(G4double Time)
void SetParentID(G4int id)
void SetTrackID(G4int track)
void Initialize(G4HCofThisEvent *)