13 #include "G4Electron.hh" 14 #include "G4Positron.hh" 15 #include "G4VProcess.hh" 16 #include "G4VPhysicalVolume.hh" 17 #include "G4LogicalVolume.hh" 18 #include "G4TransportationManager.hh" 19 #include "G4EventManager.hh" 20 #include "G4FastSimulationManager.hh" 21 #include "G4TouchableHandle.hh" 22 #include "G4VSensitiveDetector.hh" 23 #include <CLHEP/Units/SystemOfUnits.h> 30 : G4VFastSimulationModel(
modelName, envelope), theParSet(parSet) {
34 theRegion =
reinterpret_cast<G4Region*
>(envelope);
64 const G4TouchableHistory* touch =
static_cast<const G4TouchableHistory*
>(fastTrack.GetPrimaryTrack()->GetTouchable());
65 const G4VPhysicalVolume* pCurrentVolume = touch->GetVolume();
66 if (pCurrentVolume ==
nullptr) {
70 const G4LogicalVolume* lv = pCurrentVolume->GetLogicalVolume();
80 fastStep.KillPrimaryTrack();
81 fastStep.ProposePrimaryTrackPathLength(0.0);
85 G4double
energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy() / GeV;
86 G4double globalTime = fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetGlobalTime();
87 G4double
charge = fastTrack.GetPrimaryTrack()->GetStep()->GetPreStepPoint()->GetCharge();
88 G4ThreeVector
position = fastTrack.GetPrimaryTrack()->GetPosition() / cm;
89 G4ThreeVector momentum = fastTrack.GetPrimaryTrack()->GetMomentum() / GeV;
105 theGflashStep->SetTrack(const_cast<G4Track*>(fastTrack.GetPrimaryTrack()));
108 const_cast<G4VProcess*>(fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()));
110 G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume());
112 std::vector<GflashHit>::const_iterator spotIter = gflashHitList.begin();
113 std::vector<GflashHit>::const_iterator spotIterEnd = gflashHitList.end();
115 for (; spotIter != spotIterEnd; ++spotIter) {
131 G4VPhysicalVolume* aCurrentVolume =
theGflashStep->GetPreStepPoint()->GetPhysicalVolume();
132 if (aCurrentVolume ==
nullptr) {
136 G4LogicalVolume* lv = aCurrentVolume->GetLogicalVolume();
141 theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector());
142 G4VSensitiveDetector* aSensitive =
theGflashStep->GetPreStepPoint()->GetSensitiveDetector();
144 if (aSensitive ==
nullptr) {
155 theGflashStep->GetPostStepPoint()->SetGlobalTime(timeGlobal);
157 theGflashStep->GetPostStepPoint()->SetPosition(spotPosition);
165 G4double
eta = fastTrack.GetPrimaryTrack()->GetPosition().pseudoRapidity();
166 return (std::fabs(
eta) > 1.392 && std::fabs(
eta) < 1.566);
T getParameter(std::string const &) const
void makeHits(const G4FastTrack &fastTrack)
std::vector< GflashHit > & getGflashHitList()
G4TouchableHandle theGflashTouchableHandle
SimActivityRegistry::G4StepSignal m_g4StepSignal
void DoIt(const G4FastTrack &, G4FastStep &) override
~GFlashEMShowerModel() override
GflashEMShowerProfile * theProfile
void initialize(int showerType, double energy, double globalTime, double charge, Gflash3Vector &position, Gflash3Vector &momentum)
const double energyCutOff
G4bool IsApplicable(const G4ParticleDefinition &) override
int findShowerType(const Gflash3Vector &position)
GFlashEMShowerModel(const G4String &name, G4Envelope *env, const edm::ParameterSet &parSet)
G4bool ModelTrigger(const G4FastTrack &) override
static int position[264][3]
void updateGflashStep(const G4ThreeVector &position, G4double time)
G4bool excludeDetectorRegion(const G4FastTrack &fastTrack)
G4Navigator * theGflashNavigator