Geant4 Cross Reference |
1 // 1 2 // ******************************************* 3 // * License and Disclaimer 4 // * 5 // * The Geant4 software is copyright of th 6 // * the Geant4 Collaboration. It is provided 7 // * conditions of the Geant4 Software License 8 // * LICENSE and available at http://cern.ch/ 9 // * include a list of copyright holders. 10 // * 11 // * Neither the authors of this software syst 12 // * institutes,nor the agencies providing fin 13 // * work make any representation or warran 14 // * regarding this software system or assum 15 // * use. Please see the license in the file 16 // * for the full disclaimer and the limitatio 17 // * 18 // * This code implementation is the result 19 // * technical work of the GEANT4 collaboratio 20 // * By using, copying, modifying or distri 21 // * any work based on the software) you ag 22 // * use in resulting scientific publicati 23 // * acceptance of all terms of the Geant4 Sof 24 // ******************************************* 25 // 26 #include "Par04DefineMeshModel.hh" 27 28 #include "Par04EventInformation.hh" // for Pa 29 30 #include "G4Event.hh" // for G4Event 31 #include "G4EventManager.hh" // for G4EventMa 32 33 #include <G4FastTrack.hh> // for G4FastTrack 34 #include <G4Track.hh> // for G4Track 35 #include <G4VFastSimulationModel.hh> // for G 36 #include <G4VUserEventInformation.hh> // for 37 class G4FastStep; 38 class G4ParticleDefinition; 39 class G4Region; 40 41 //....oooOO0OOooo........oooOO0OOooo........oo 42 43 Par04DefineMeshModel::Par04DefineMeshModel(G4S 44 : G4VFastSimulationModel(aModelName, aEnvelo 45 {} 46 47 //....oooOO0OOooo........oooOO0OOooo........oo 48 49 Par04DefineMeshModel::Par04DefineMeshModel(G4S 50 {} 51 52 //....oooOO0OOooo........oooOO0OOooo........oo 53 54 Par04DefineMeshModel::~Par04DefineMeshModel() 55 56 //....oooOO0OOooo........oooOO0OOooo........oo 57 58 G4bool Par04DefineMeshModel::IsApplicable(cons 59 { 60 return true; 61 } 62 63 //....oooOO0OOooo........oooOO0OOooo........oo 64 65 G4bool Par04DefineMeshModel::ModelTrigger(cons 66 { 67 auto info = dynamic_cast<Par04EventInformati 68 G4EventManager::GetEventManager()->GetCons 69 // check if particle direction and position 70 if (info != nullptr) 71 return !info->GetFlag(); 72 else 73 return true; 74 } 75 76 //....oooOO0OOooo........oooOO0OOooo........oo 77 78 void Par04DefineMeshModel::DoIt(const G4FastTr 79 { 80 auto info = dynamic_cast<Par04EventInformati 81 G4EventManager::GetEventManager()->GetCons 82 if (info == nullptr) { 83 info = new Par04EventInformation(); 84 G4EventManager::GetEventManager()->GetNonc 85 } 86 info->SetPosition(aFastTrack.GetPrimaryTrack 87 info->SetDirection(aFastTrack.GetPrimaryTrac 88 info->SetFlag(true); 89 } 90