20 :G4VSensitiveDetector(name)
22 collectionName.insert(
"PMTOnlyCollection");
54 if (aStep->GetPreStepPoint()->GetStepStatus() != fGeomBoundary )
return false;
56 G4TouchableHandle theTouchable = aStep->GetPreStepPoint()->GetTouchableHandle();
58 G4int motherCopyNo = theTouchable->GetVolume(1)->GetCopyNo();
61 G4double trackID = aStep->GetTrack()->GetTrackID();
63 G4ParticleDefinition* fpParticleDefinition = aStep->GetTrack()->GetDefinition();
64 G4String particleName = fpParticleDefinition->GetParticleName();
66 G4int pdgEncoding = fpParticleDefinition->GetPDGEncoding();
69 G4double globalTime = aStep->GetPreStepPoint()->GetGlobalTime();
71 G4ThreeVector worldPos = aStep->GetPreStepPoint()->GetPosition();
72 G4ThreeVector localPos = theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldPos);
75 G4ThreeVector originVertexPosition = aStep->GetTrack()->GetVertexPosition();
77 G4ThreeVector worldMomentum = aStep->GetPreStepPoint()->GetMomentum();
78 G4ThreeVector localMomentum = theTouchable->GetHistory()->GetTopTransform().TransformPoint(worldMomentum);
79 G4ThreeVector currentMomentumDirection = aStep->GetTrack()->GetMomentumDirection();
80 G4ThreeVector originVertexMomentumDirection = aStep->GetTrack()->GetVertexMomentumDirection();
82 G4double originVertexKineticEnergy = aStep->GetTrack()->GetVertexKineticEnergy();
83 G4double originVertexTotalEnergy = aStep->GetTrack()->GetVertexKineticEnergy();
85 G4double currentKineticEnergy = aStep->GetTrack()->GetKineticEnergy();
86 G4double currentTotalEnergy = aStep->GetTrack()->GetTotalEnergy();
89 G4double depositedEnergy = aStep->GetTotalEnergyDeposit();
96 aHit -> StoreTrackID(trackID);
98 aHit -> StoreParticleName(particleName);
99 aHit -> StoreParticleType(pdgEncoding);
101 aHit -> StoreGlobalTime(globalTime);
103 aHit -> StoreWorldPosition(worldPos);
104 aHit -> StoreLocalPosition(localPos);
105 aHit -> StoreOriginVertexPosition(originVertexPosition);
107 aHit -> StoreWorldMomentum(worldMomentum);
108 aHit -> StoreLocalMomentum(localMomentum);
109 aHit -> StoreMomentumDirection(currentMomentumDirection);
110 aHit -> StoreOriginVertexMomentumDirection(originVertexMomentumDirection);
112 aHit -> StoreOriginVertexKineticEnergy(originVertexKineticEnergy);
113 aHit -> StoreOriginVertexTotalEnergy(originVertexTotalEnergy);
115 aHit -> StoreKineticEnergy(currentKineticEnergy);
116 aHit -> StoreTotalEnergy(currentTotalEnergy);
119 aHit -> StoreDepositedEnergy(depositedEnergy);
124 if ( !(aHit -> GetLogVolume()) )
128 aHit -> StoreLogVolume(theTouchable->GetVolume()->GetLogicalVolume());
129 G4AffineTransform aTrans = theTouchable->GetHistory()->GetTopTransform();
131 aHit -> StoreCellRotation(aTrans.NetRotation());
132 aHit -> StoreCellPosition(aTrans.NetTranslation());
QweakSimPMTOnly_DetectorSD(G4String name)
void Initialize(G4HCofThisEvent *HCE)
~QweakSimPMTOnly_DetectorSD()
G4bool ProcessHits(G4Step *aStep, G4TouchableHistory *ROhist)
G4int PMTOnly_CollectionID
QweakSimPMTOnly_DetectorHitsCollection * PMTOnly_DetectorHitsCollection
void EndOfEvent(G4HCofThisEvent *HCE)
G4THitsCollection< QweakSimPMTOnly_DetectorHit > QweakSimPMTOnly_DetectorHitsCollection