Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer 3 // * License and Disclaimer * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th 5 // * The Geant4 software is copyright of the Copyright Holders of * 6 // * the Geant4 Collaboration. It is provided 6 // * the Geant4 Collaboration. It is provided under the terms and * 7 // * conditions of the Geant4 Software License 7 // * conditions of the Geant4 Software License, included in the file * 8 // * LICENSE and available at http://cern.ch/ 8 // * LICENSE and available at http://cern.ch/geant4/license . These * 9 // * include a list of copyright holders. 9 // * include a list of copyright holders. * 10 // * 10 // * * 11 // * Neither the authors of this software syst 11 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 12 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 13 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 14 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file 15 // * use. Please see the license in the file LICENSE and URL above * 16 // * for the full disclaimer and the limitatio 16 // * for the full disclaimer and the limitation of liability. * 17 // * 17 // * * 18 // * This code implementation is the result 18 // * This code implementation is the result of the scientific and * 19 // * technical work of the GEANT4 collaboratio 19 // * technical work of the GEANT4 collaboration. * 20 // * By using, copying, modifying or distri 20 // * By using, copying, modifying or distributing the software (or * 21 // * any work based on the software) you ag 21 // * any work based on the software) you agree to acknowledge its * 22 // * use in resulting scientific publicati 22 // * use in resulting scientific publications, and indicate your * 23 // * acceptance of all terms of the Geant4 Sof 23 // * acceptance of all terms of the Geant4 Software license. * 24 // ******************************************* 24 // ******************************************************************** 25 // 25 // 26 // G4ParallelWorldProcess << 27 // 26 // 28 // Class description: << 27 // $Id: G4ParallelWorldProcess.hh 95501 2016-02-12 11:01:30Z gcosmo $ >> 28 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 29 // 29 // 30 // This process takes a parallel world and lim << 30 // 31 // on the boundaries of volumes in the paralle << 31 //--------------------------------------------------------------- 32 // It invokes sensitive detectors assigned in << 33 // It switches a material (and a region if def << 34 // assigned parallel world over the material ( << 35 // in the mass world. << 36 // 32 // 37 // Author: M.Asai (SLAC), 2010. << 33 // G4ParallelWorldProcess.hh 38 //-------------------------------------------- << 34 // >> 35 // Description: >> 36 // This procss takes a parallel world and limits a step >> 37 // on the boundaries of volumes in the parallel world. >> 38 // It invokes sensitive detectors assigned in the parallel >> 39 // world. >> 40 // It switches a material (and a region if defined) in the >> 41 // assigned parallel world over the material (and the region) >> 42 // in the mass world. >> 43 // >> 44 //--------------------------------------------------------------- >> 45 >> 46 39 #ifndef G4ParallelWorldProcess_h 47 #ifndef G4ParallelWorldProcess_h 40 #define G4ParallelWorldProcess_h 1 48 #define G4ParallelWorldProcess_h 1 41 49 42 #include "G4FieldTrack.hh" << 43 #include "G4MultiNavigator.hh" << 44 #include "G4TouchableHandle.hh" << 45 #include "G4VProcess.hh" << 46 #include "globals.hh" 50 #include "globals.hh" 47 << 48 class G4Step; 51 class G4Step; 49 class G4StepPoint; 52 class G4StepPoint; 50 class G4Navigator; 53 class G4Navigator; 51 class G4TransportationManager; 54 class G4TransportationManager; 52 class G4PathFinder; 55 class G4PathFinder; >> 56 class G4VTouchable; 53 class G4VPhysicalVolume; 57 class G4VPhysicalVolume; 54 class G4ParticleChange; 58 class G4ParticleChange; >> 59 #include "G4VProcess.hh" >> 60 #include "G4FieldTrack.hh" >> 61 #include "G4TouchableHandle.hh" >> 62 #include "G4MultiNavigator.hh" >> 63 >> 64 //------------------------------------------ >> 65 // >> 66 // G4ParallelWorldProcess class >> 67 // >> 68 //------------------------------------------ >> 69 >> 70 >> 71 // Class Description: 55 72 56 class G4ParallelWorldProcess : public G4VProce 73 class G4ParallelWorldProcess : public G4VProcess 57 { 74 { 58 public: << 75 public: // with description 59 76 60 G4ParallelWorldProcess(const G4String& pro << 77 //------------------------ 61 G4ProcessType theTy << 78 // Constructor/Destructor 62 ~G4ParallelWorldProcess() override; << 79 //------------------------ 63 << 80 64 //---------------------------------------- << 81 G4ParallelWorldProcess(const G4String& processName = "ParaWorld", 65 // Set Paralle World << 82 G4ProcessType theType = fParallel); 66 //---------------------------------------- << 83 virtual ~G4ParallelWorldProcess(); 67 << 84 68 void SetParallelWorld(G4String parallelWor << 85 //-------------------------------------------------------------- 69 void SetParallelWorld(G4VPhysicalVolume* p << 86 // Set Paralle World 70 << 87 //-------------------------------------------------------------- 71 //---------------------------------------- << 88 72 // Process interface << 89 void SetParallelWorld(G4String parallelWorldName); 73 //---------------------------------------- << 90 void SetParallelWorld(G4VPhysicalVolume* parallelWorld); 74 << 91 75 void StartTracking(G4Track*) override; << 92 //-------------------------------------------------------------- 76 << 93 // Process interface 77 //---------------------------------------- << 94 //-------------------------------------------------------------- 78 // GetPhysicalInteractionLength() and DoIt << 95 79 //---------------------------------------- << 96 void StartTracking(G4Track*); 80 << 97 81 G4double AtRestGetPhysicalInteractionLengt << 98 //------------------------------------------------------------------------ 82 G4VParticleChange* AtRestDoIt(const G4Trac << 99 // GetPhysicalInteractionLength() and DoIt() methods for AtRest 83 << 100 //------------------------------------------------------------------------ 84 //---------------------------------------- << 101 85 // GetPhysicalInteractionLength() and DoIt << 102 G4double AtRestGetPhysicalInteractionLength(const G4Track&,G4ForceCondition*); 86 //---------------------------------------- << 103 G4VParticleChange* AtRestDoIt(const G4Track&,const G4Step&); 87 << 104 88 G4double AlongStepGetPhysicalInteractionLe << 105 //------------------------------------------------------------------------ 89 << 106 // GetPhysicalInteractionLength() and DoIt() methods for AlongStep 90 G4VParticleChange* AlongStepDoIt(const G4T << 107 //------------------------------------------------------------------------ 91 << 108 92 //---------------------------------------- << 109 G4double AlongStepGetPhysicalInteractionLength( 93 // GetPhysicalInteractionLength() and DoIt << 110 const G4Track&,G4double,G4double,G4double&,G4GPILSelection*); 94 //---------------------------------------- << 111 G4VParticleChange* AlongStepDoIt(const G4Track&,const G4Step&); 95 << 112 96 G4double PostStepGetPhysicalInteractionLen << 113 //----------------------------------------------------------------------- 97 << 114 // GetPhysicalInteractionLength() and DoIt() methods for PostStep 98 G4VParticleChange* PostStepDoIt(const G4Tr << 115 //----------------------------------------------------------------------- 99 << 116 100 //---------------------------------------- << 117 G4double PostStepGetPhysicalInteractionLength( 101 // Flag for material switching << 118 const G4Track&,G4double,G4ForceCondition*); 102 //---------------------------------------- << 119 G4VParticleChange* PostStepDoIt(const G4Track&,const G4Step&); 103 << 120 104 inline void SetLayeredMaterialFlag(G4bool << 121 //----------------------------------------------------------------------- 105 inline G4bool GetLayeredMaterialFlag() con << 122 // Flag for material switching 106 << 123 //----------------------------------------------------------------------- 107 //---------------------------------------- << 124 108 // Returns whether a particular particle t << 125 inline void SetLayeredMaterialFlag(G4bool flg=true) 109 //---------------------------------------- << 126 { layeredMaterialFlag = flg; } 110 G4bool IsAtRestRequired(G4ParticleDefiniti << 127 inline G4bool GetLayeredMaterialFlag() const 111 << 128 { return layeredMaterialFlag; } 112 //---------------------------------------- << 129 113 // Static G4Step object for "Hyper-step" << 130 private: 114 //---------------------------------------- << 131 void CopyStep(const G4Step & step); 115 static const G4Step* GetHyperStep(); << 132 void SwitchMaterial(G4StepPoint*); 116 static G4int GetHypNavigatorID(); << 133 117 << 134 public: // with description 118 protected: << 135 //-------------------------------------------------------------------- 119 << 136 // Returns whether a particular particle type requires AtRest process 120 void CopyStep(const G4Step& step); << 137 //-------------------------------------------------------------------- 121 void SwitchMaterial(G4StepPoint*); << 138 G4bool IsAtRestRequired(G4ParticleDefinition*); 122 << 139 123 protected: << 140 private: 124 << 141 G4Step * fGhostStep; 125 G4Step* fGhostStep; << 142 G4StepPoint * fGhostPreStepPoint; 126 G4StepPoint* fGhostPreStepPoint; << 143 G4StepPoint * fGhostPostStepPoint; 127 G4StepPoint* fGhostPostStepPoint; << 144 128 << 145 G4VParticleChange aDummyParticleChange; 129 G4VParticleChange aDummyParticleChange; << 146 G4ParticleChange xParticleChange; 130 G4ParticleChange xParticleChange; << 147 131 << 148 G4TransportationManager* fTransportationManager; 132 G4TransportationManager* fTransportationMa << 149 G4PathFinder* fPathFinder; 133 G4PathFinder* fPathFinder; << 150 134 << 151 // ------------------------------- 135 // ------------------------------- << 152 // Navigation in the Ghost World: 136 // Navigation in the Ghost World: << 153 // ------------------------------- 137 // ------------------------------- << 154 G4String fGhostWorldName; 138 G4String fGhostWorldName; << 155 G4VPhysicalVolume* fGhostWorld; 139 G4VPhysicalVolume* fGhostWorld{nullptr}; << 156 G4Navigator* fGhostNavigator; 140 G4Navigator* fGhostNavigator{nullptr}; << 157 G4int fNavigatorID; 141 G4int fNavigatorID{-1}; << 158 G4TouchableHandle fOldGhostTouchable; 142 G4TouchableHandle fOldGhostTouchable; << 159 G4TouchableHandle fNewGhostTouchable; 143 G4TouchableHandle fNewGhostTouchable; << 160 G4FieldTrack fFieldTrack; 144 G4FieldTrack fFieldTrack; << 161 G4double fGhostSafety; 145 G4double fGhostSafety{0.}; << 162 G4bool fOnBoundary; 146 G4bool fOnBoundary{false}; << 163 147 << 164 //----------------------------------------------------------------------- 148 //---------------------------------------- << 165 // Flag for material switching 149 // Flag for material switching << 166 //----------------------------------------------------------------------- 150 //---------------------------------------- << 167 G4bool layeredMaterialFlag; 151 G4bool layeredMaterialFlag{false}; << 168 152 << 169 //----------------------------------------------------------------------- 153 private: << 170 // Static G4Step object for "Hyper-step" 154 << 171 //----------------------------------------------------------------------- 155 static G4ThreadLocal G4Step* fpHyperStep; << 172 public: 156 static G4ThreadLocal G4int nParallelWorlds << 173 static const G4Step* GetHyperStep(); 157 static G4ThreadLocal G4int fNavIDHyp; << 174 static G4int GetHypNavigatorID(); 158 G4int iParallelWorld; << 175 private: >> 176 static G4ThreadLocal G4Step* fpHyperStep; >> 177 static G4ThreadLocal G4int nParallelWorlds; >> 178 static G4ThreadLocal G4int fNavIDHyp; >> 179 G4int iParallelWorld; 159 }; 180 }; 160 181 161 #endif 182 #endif 162 183