11 #include "G4Electron.hh" 12 #include "G4Positron.hh" 13 #include "G4VProcess.hh" 14 #include "G4VPhysicalVolume.hh" 15 #include "G4LogicalVolume.hh" 16 #include "G4TransportationManager.hh" 17 #include "G4EventManager.hh" 18 #include "G4FastSimulationManager.hh" 19 #include "G4TouchableHandle.hh" 20 #include "G4VSensitiveDetector.hh" 22 using namespace CLHEP;
27 : G4VFastSimulationModel(modelName, envelope), theParSet(parSet) {
30 theRegion =
const_cast<const G4Region*
>(envelope);
48 return ( &particleType == G4Electron::ElectronDefinition() ||
49 &particleType == G4Positron::PositronDefinition() );
57 if(fastTrack.GetPrimaryTrack()->GetKineticEnergy() <
GeV) {
return false; }
62 G4TouchableHistory* touch =
63 (G4TouchableHistory*)(fastTrack.GetPrimaryTrack()->GetTouchable());
64 G4VPhysicalVolume* pCurrentVolume = touch->GetVolume();
65 if( pCurrentVolume ==
nullptr) {
return false; }
67 G4LogicalVolume* lv = pCurrentVolume->GetLogicalVolume();
68 if(lv->GetRegion() !=
theRegion) {
return false; }
76 fastStep.KillPrimaryTrack();
77 fastStep.ProposePrimaryTrackPathLength(0.0);
80 G4double energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy()/
GeV;
81 G4double globalTime = fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetGlobalTime();
82 G4double
charge = fastTrack.GetPrimaryTrack()->GetStep()->GetPreStepPoint()->GetCharge();
83 G4ThreeVector
position = fastTrack.GetPrimaryTrack()->GetPosition() / cm;
84 G4ThreeVector momentum = fastTrack.GetPrimaryTrack()->GetMomentum()/
GeV;
99 theGflashStep->SetTrack(const_cast<G4Track*>(fastTrack.GetPrimaryTrack()));
101 theGflashStep->GetPostStepPoint()->SetProcessDefinedStep(const_cast<G4VProcess*>
102 (fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()));
103 theGflashNavigator->SetWorldVolume(G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume());
105 std::vector<GflashHit>::const_iterator spotIter = gflashHitList.begin();
106 std::vector<GflashHit>::const_iterator spotIterEnd = gflashHitList.end();
108 for( ; spotIter != spotIterEnd; spotIter++){
111 theGflashNavigator->LocateGlobalPointAndUpdateTouchableHandle(spotIter->getPosition(),G4ThreeVector(0,0,0),
118 G4VPhysicalVolume* aCurrentVolume =
theGflashStep->GetPreStepPoint()->GetPhysicalVolume();
119 if( aCurrentVolume ==
nullptr )
continue;
121 G4LogicalVolume* lv = aCurrentVolume->GetLogicalVolume();
122 if(lv->GetRegion() !=
theRegion)
continue;
124 theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector());
125 G4VSensitiveDetector* aSensitive =
theGflashStep->GetPreStepPoint()->GetSensitiveDetector();
127 if( aSensitive ==
nullptr )
continue;
138 theGflashStep->GetPostStepPoint()->SetGlobalTime(timeGlobal);
140 theGflashStep->GetPostStepPoint()->SetPosition(spotPosition);
147 G4bool isExcluded=
false;
151 G4double
eta = fastTrack.GetPrimaryTrack()->GetPosition().pseudoRapidity() ;
152 if(std::fabs(eta) > 1.392 && std::fabs(eta) < 1.566) {
return true; }
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)
void DoIt(const G4FastTrack &, G4FastStep &) override
static int position[264][3]
G4Navigator * theGflashNavigator
void makeHits(const G4FastTrack &fastTrack)
G4bool ModelTrigger(const G4FastTrack &) override