29#include <G4FastStep.hh>
30#include <G4FastTrack.hh>
32#include <G4VFastSimulationModel.hh>
33#include "G4Electron.hh"
34#include "G4FastHit.hh"
35#include "G4FastSimHitMaker.hh"
37#include "G4Positron.hh"
44Par04MLFastSimModel::Par04MLFastSimModel(
G4String aModelName,
G4Region* aEnvelope)
49 fParallelHitMaker->SetNameOfWorldWithSD(
"parallelWorldFastSim");
54Par04MLFastSimModel::Par04MLFastSimModel(
G4String aModelName)
59 fParallelHitMaker->SetNameOfWorldWithSD(
"parallelWorldFastSim");
64Par04MLFastSimModel::~Par04MLFastSimModel() {}
70 return &aParticleType == G4Electron::ElectronDefinition() ||
71 &aParticleType == G4Positron::PositronDefinition() ||
72 &aParticleType == G4Gamma::GammaDefinition();
77G4bool Par04MLFastSimModel::ModelTrigger(
const G4FastTrack& aFastTrack)
79 return fInference->IfTrigger(aFastTrack.GetPrimaryTrack()->GetKineticEnergy());
87 aFastStep.KillPrimaryTrack();
88 aFastStep.SetPrimaryTrackPathLength(0.0);
89 G4double energy = aFastTrack.GetPrimaryTrack()->GetKineticEnergy();
90 aFastStep.SetTotalEnergyDeposited(energy);
91 G4ThreeVector
position = aFastTrack.GetPrimaryTrack()->GetPosition();
92 G4ThreeVector direction = aFastTrack.GetPrimaryTrack()->GetMomentumDirection();
95 G4float angle = direction.theta();
99 fInference->GetEnergies(fEnergies, energy, angle);
100 fInference->GetPositions(fPositions,
position, direction);
104 for(
size_t iHit = 0; iHit < fPositions.size(); iHit++)
106 if (fEnergies[iHit] > 0.0005) {
108 fParallelHitMaker->make(
G4FastHit(fPositions[iHit], fEnergies[iHit]), aFastTrack);
110 fHitMaker->make(
G4FastHit(fPositions[iHit], fEnergies[iHit]), aFastTrack);