10 #include "G4Electron.hh"
11 #include "G4EventManager.hh"
12 #include "G4FastSimulationManager.hh"
13 #include "G4LogicalVolume.hh"
14 #include "G4Positron.hh"
15 #include "G4TouchableHandle.hh"
16 #include "G4TransportationManager.hh"
17 #include "G4VPhysicalVolume.hh"
18 #include "G4VProcess.hh"
19 #include "G4VSensitiveDetector.hh"
21 using namespace CLHEP;
26 : G4VFastSimulationModel(modelName, envelope), theParSet(parSet) {
28 theRegion =
reinterpret_cast<G4Region *
>(envelope);
43 return (&particleType == G4Electron::ElectronDefinition() || &particleType == G4Positron::PositronDefinition());
49 if (fastTrack.GetPrimaryTrack()->GetKineticEnergy() < GeV) {
58 const G4VPhysicalVolume *pCurrentVolume = (fastTrack.GetPrimaryTrack()->GetTouchable())->
GetVolume();
59 if (pCurrentVolume ==
nullptr) {
63 const G4LogicalVolume *lv = pCurrentVolume->GetLogicalVolume();
73 fastStep.KillPrimaryTrack();
74 fastStep.ProposePrimaryTrackPathLength(0.0);
78 G4double
energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy() / GeV;
79 G4double globalTime = fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetGlobalTime();
80 G4double
charge = fastTrack.GetPrimaryTrack()->GetStep()->GetPreStepPoint()->GetCharge();
81 G4ThreeVector
position = fastTrack.GetPrimaryTrack()->GetPosition() / cm;
82 G4ThreeVector momentum = fastTrack.GetPrimaryTrack()->GetMomentum() / GeV;
96 theGflashStep->SetTrack(const_cast<G4Track *>(fastTrack.GetPrimaryTrack()));
99 const_cast<G4VProcess *>(fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()));
101 G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume());
103 std::vector<GflashHit>::const_iterator spotIter = gflashHitList.begin();
104 std::vector<GflashHit>::const_iterator spotIterEnd = gflashHitList.end();
106 for (; spotIter != spotIterEnd; spotIter++) {
116 G4VPhysicalVolume *aCurrentVolume =
theGflashStep->GetPreStepPoint()->GetPhysicalVolume();
117 if (aCurrentVolume ==
nullptr)
120 G4LogicalVolume *lv = aCurrentVolume->GetLogicalVolume();
124 theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector());
125 G4VSensitiveDetector *aSensitive =
theGflashStep->GetPreStepPoint()->GetSensitiveDetector();
127 if (aSensitive ==
nullptr)
136 theGflashStep->GetPostStepPoint()->SetGlobalTime(timeGlobal);
138 theGflashStep->GetPostStepPoint()->SetPosition(spotPosition);
146 G4double
eta = fastTrack.GetPrimaryTrack()->GetPosition().pseudoRapidity();
147 return (std::fabs(eta) > 1.392 && std::fabs(eta) < 1.566);
std::vector< GflashHit > & getGflashHitList()
G4bool excludeDetectorRegion(const G4FastTrack &fastTrack)
G4TouchableHandle theGflashTouchableHandle
~GflashEMShowerModel() override
G4bool IsApplicable(const G4ParticleDefinition &) override
GflashEMShowerProfile * theProfile
GflashEMShowerModel(const G4String &name, G4Envelope *env, const edm::ParameterSet &parSet)
void initialize(int showerType, double energy, double globalTime, double charge, Gflash3Vector &position, Gflash3Vector &momentum)
int findShowerType(const Gflash3Vector &position)
void updateGflashStep(const G4ThreeVector &position, G4double time)
static const G4LogicalVolume * GetVolume(const std::string &name)
void DoIt(const G4FastTrack &, G4FastStep &) override
static int position[264][3]
G4Navigator * theGflashNavigator
void makeHits(const G4FastTrack &fastTrack)
G4bool ModelTrigger(const G4FastTrack &) override