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 "G4SystemOfUnits.hh"
28 : G4VFastSimulationModel(modelName, envelope), theParSet(parSet)
33 theRegion =
const_cast<const G4Region*
>(envelope);
53 &particleType == G4Positron::Positron() );
66 G4TouchableHistory* touch =
67 (G4TouchableHistory*)(fastTrack.GetPrimaryTrack()->GetTouchable());
68 G4VPhysicalVolume* pCurrentVolume = touch->GetVolume();
69 if( pCurrentVolume == 0) {
return false; }
71 G4LogicalVolume* lv = pCurrentVolume->GetLogicalVolume();
72 if(lv->GetRegion() !=
theRegion) {
return false; }
94 fastStep.KillPrimaryTrack();
95 fastStep.ProposePrimaryTrackPathLength(0.0);
99 G4double
energy = fastTrack.GetPrimaryTrack()->GetKineticEnergy()/
GeV;
100 G4double globalTime =
101 fastTrack.GetPrimaryTrack()->GetStep()->GetPostStepPoint()->GetGlobalTime();
103 fastTrack.GetPrimaryTrack()->GetStep()->GetPreStepPoint()->GetCharge();
104 G4ThreeVector
position = fastTrack.GetPrimaryTrack()->GetPosition()/cm;
105 G4ThreeVector momentum = fastTrack.GetPrimaryTrack()->GetMomentum()/
GeV;
123 theGflashStep->SetTrack(const_cast<G4Track*>(fastTrack.GetPrimaryTrack()));
126 ->SetProcessDefinedStep(const_cast<G4VProcess*>(fastTrack.GetPrimaryTrack()
127 ->GetStep()->GetPostStepPoint()->GetProcessDefinedStep()));
128 theGflashNavigator->SetWorldVolume(G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume());
130 std::vector<GflashHit>::const_iterator spotIter = gflashHitList.begin();
131 std::vector<GflashHit>::const_iterator spotIterEnd = gflashHitList.end();
133 for(; spotIter != spotIterEnd; spotIter++){
137 theGflashNavigator->LocateGlobalPointAndUpdateTouchableHandle(spotIter->getPosition(),
138 G4ThreeVector(0,0,0),
145 (
SteppingAction*) G4EventManager::GetEventManager()->GetUserSteppingAction();
152 G4VPhysicalVolume* aCurrentVolume =
154 if( aCurrentVolume == 0 ) {
continue; }
156 G4LogicalVolume* lv = aCurrentVolume->GetLogicalVolume();
157 if(lv->GetRegion() !=
theRegion) {
continue; }
159 theGflashStep->GetPreStepPoint()->SetSensitiveDetector(aCurrentVolume->GetLogicalVolume()->GetSensitiveDetector());
160 G4VSensitiveDetector* aSensitive =
theGflashStep->GetPreStepPoint()->GetSensitiveDetector();
162 if( aSensitive == 0 ) {
continue; }
173 theGflashStep->GetPostStepPoint()->SetGlobalTime(timeGlobal);
175 theGflashStep->GetPostStepPoint()->SetPosition(spotPosition);
182 G4bool isExcluded=
false;
186 G4double
eta = fastTrack.GetPrimaryTrack()->GetPosition().pseudoRapidity();
187 if(std::fabs(eta) > 1.392 && std::fabs(eta) < 1.566) {
return true; }
G4bool IsApplicable(const G4ParticleDefinition &)
T getParameter(std::string const &) const
G4bool ModelTrigger(const G4FastTrack &)
void makeHits(const G4FastTrack &fastTrack)
std::vector< GflashHit > & getGflashHitList()
G4TouchableHandle theGflashTouchableHandle
SimActivityRegistry::G4StepSignal m_g4StepSignal
void DoIt(const G4FastTrack &, G4FastStep &)
GflashEMShowerProfile * theProfile
const G4Region * theRegion
void initialize(int showerType, double energy, double globalTime, double charge, Gflash3Vector &position, Gflash3Vector &momentum)
const double energyCutOff
int findShowerType(const Gflash3Vector &position)
GFlashEMShowerModel(const G4String &name, G4Envelope *env, const edm::ParameterSet &parSet)
static int position[264][3]
void updateGflashStep(const G4ThreeVector &position, G4double time)
G4bool excludeDetectorRegion(const G4FastTrack &fastTrack)
G4Navigator * theGflashNavigator
virtual ~GFlashEMShowerModel()