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=
"SciCollection");
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 Sci: " << G4endl;
void SetLocalPrePos(G4ThreeVector xyz)
void SetParticleCharge(G4double charge)
ActarSimSciSD(G4String)
Constructor, just naming the Hit collection.
G4THitsCollection< ActarSimSciGeantHit > ActarSimSciGeantHitsCollection
void EndOfEvent(G4HCofThisEvent *)
void SetPreDetName(G4String Name)
void SetToF(G4double Time)
void SetParentID(G4int id)
void SetPrePos(G4ThreeVector xyz)
void SetPos(G4ThreeVector xyz)
void SetTrackID(G4int track)
void SetParticleMass(G4double mass)
void SetDetName(G4String Name)
void SetLocalPos(G4ThreeVector xyz)
void SetParticleID(G4int ID)
G4bool ProcessHits(G4Step *, G4TouchableHistory *)
void SetEdep(G4double de)
void SetPostDetName(G4String Name)
ActarSimSciGeantHitsCollection * hitsCollection
Geant step-like hits collect.
void Initialize(G4HCofThisEvent *)
~ActarSimSciSD()
Destructor, nothing to do.