11 #include "G4Electron.hh" 12 #include "G4EventManager.hh" 13 #include "G4FastSimulationManager.hh" 14 #include "G4LogicalVolume.hh" 15 #include "G4Positron.hh" 16 #include "G4TouchableHandle.hh" 17 #include "G4TransportationManager.hh" 18 #include "G4VPhysicalVolume.hh" 19 #include "G4VProcess.hh" 20 #include "G4VSensitiveDetector.hh" 22 using namespace CLHEP;
27 : G4VFastSimulationModel(modelName, envelope), theParSet(parSet) {
29 theRegion =
const_cast<const G4Region *
>(envelope);
44 return (&particleType == G4Electron::ElectronDefinition() || &particleType == G4Positron::PositronDefinition());
50 if (fastTrack.GetPrimaryTrack()->GetKineticEnergy() <
GeV) {
59 G4VPhysicalVolume *pCurrentVolume = (fastTrack.GetPrimaryTrack()->GetTouchable())->
GetVolume();
60 if (pCurrentVolume ==
nullptr) {
64 G4LogicalVolume *lv = pCurrentVolume->GetLogicalVolume();
74 fastStep.KillPrimaryTrack();
75 fastStep.ProposePrimaryTrackPathLength(0.0);
79 G4double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy() /
GeV;
80 G4double globalTime = fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetGlobalTime();
81 G4double
charge = fastTrack.GetPrimaryTrack()->GetStep()->GetPreStepPoint()->GetCharge();
82 G4ThreeVector
position = fastTrack.GetPrimaryTrack()->GetPosition() / cm;
83 G4ThreeVector momentum = fastTrack.GetPrimaryTrack()->GetMomentum() /
GeV;
97 theGflashStep->SetTrack(const_cast<G4Track *>(fastTrack.GetPrimaryTrack()));
100 const_cast<G4VProcess *>(fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()));
102 G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume());
104 std::vector<GflashHit>::const_iterator spotIter = gflashHitList.begin();
105 std::vector<GflashHit>::const_iterator spotIterEnd = gflashHitList.end();
107 for (; spotIter != spotIterEnd; spotIter++) {
117 G4VPhysicalVolume *aCurrentVolume =
theGflashStep->GetPreStepPoint()->GetPhysicalVolume();
118 if (aCurrentVolume ==
nullptr)
121 G4LogicalVolume *lv = aCurrentVolume->GetLogicalVolume();
125 theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector());
126 G4VSensitiveDetector *aSensitive =
theGflashStep->GetPreStepPoint()->GetSensitiveDetector();
128 if (aSensitive ==
nullptr)
137 theGflashStep->GetPostStepPoint()->SetGlobalTime(timeGlobal);
139 theGflashStep->GetPostStepPoint()->SetPosition(spotPosition);
145 G4bool isExcluded =
false;
149 G4double
eta = fastTrack.GetPrimaryTrack()->GetPosition().pseudoRapidity();
150 if (std::fabs(eta) > 1.392 && std::fabs(eta) < 1.566) {
std::vector< GflashHit > & getGflashHitList()
G4bool excludeDetectorRegion(const G4FastTrack &fastTrack)
G4TouchableHandle theGflashTouchableHandle
const G4Region * theRegion
~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