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,v 1.4 2007/05/30 17:47:10 ahoward Exp $ >> 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 >> 63 //------------------------------------------ >> 64 // >> 65 // G4ParallelWorldProcess class >> 66 // >> 67 //------------------------------------------ >> 68 >> 69 >> 70 // Class Description: 55 71 56 class G4ParallelWorldProcess : public G4VProce 72 class G4ParallelWorldProcess : public G4VProcess 57 { 73 { 58 public: << 74 public: // with description 59 75 60 G4ParallelWorldProcess(const G4String& pro << 76 //------------------------ 61 G4ProcessType theTy << 77 // Constructor/Destructor 62 ~G4ParallelWorldProcess() override; << 78 //------------------------ 63 << 79 64 //---------------------------------------- << 80 G4ParallelWorldProcess(const G4String& processName = "ParaWorld", 65 // Set Paralle World << 81 G4ProcessType theType = fParameterisation); 66 //---------------------------------------- << 82 virtual ~G4ParallelWorldProcess(); 67 << 83 68 void SetParallelWorld(G4String parallelWor << 84 //-------------------------------------------------------------- 69 void SetParallelWorld(G4VPhysicalVolume* p << 85 // Set Paralle World 70 << 86 //-------------------------------------------------------------- 71 //---------------------------------------- << 87 72 // Process interface << 88 void SetParallelWorld(G4String parallelWorldName); 73 //---------------------------------------- << 89 void SetParallelWorld(G4VPhysicalVolume* parallelWorld); 74 << 90 75 void StartTracking(G4Track*) override; << 91 //-------------------------------------------------------------- 76 << 92 // Process interface 77 //---------------------------------------- << 93 //-------------------------------------------------------------- 78 // GetPhysicalInteractionLength() and DoIt << 94 79 //---------------------------------------- << 95 void StartTracking(G4Track*); 80 << 96 81 G4double AtRestGetPhysicalInteractionLengt << 97 //------------------------------------------------------------------------ 82 G4VParticleChange* AtRestDoIt(const G4Trac << 98 // GetPhysicalInteractionLength() and DoIt() methods for AtRest 83 << 99 //------------------------------------------------------------------------ 84 //---------------------------------------- << 100 85 // GetPhysicalInteractionLength() and DoIt << 101 G4double AtRestGetPhysicalInteractionLength(const G4Track&,G4ForceCondition*); 86 //---------------------------------------- << 102 G4VParticleChange* AtRestDoIt(const G4Track&,const G4Step&); 87 << 103 88 G4double AlongStepGetPhysicalInteractionLe << 104 //------------------------------------------------------------------------ 89 << 105 // GetPhysicalInteractionLength() and DoIt() methods for AlongStep 90 G4VParticleChange* AlongStepDoIt(const G4T << 106 //------------------------------------------------------------------------ 91 << 107 92 //---------------------------------------- << 108 G4double AlongStepGetPhysicalInteractionLength( 93 // GetPhysicalInteractionLength() and DoIt << 109 const G4Track&,G4double,G4double,G4double&,G4GPILSelection*); 94 //---------------------------------------- << 110 G4VParticleChange* AlongStepDoIt(const G4Track&,const G4Step&); 95 << 111 96 G4double PostStepGetPhysicalInteractionLen << 112 //----------------------------------------------------------------------- 97 << 113 // GetPhysicalInteractionLength() and DoIt() methods for PostStep 98 G4VParticleChange* PostStepDoIt(const G4Tr << 114 //----------------------------------------------------------------------- 99 << 115 100 //---------------------------------------- << 116 G4double PostStepGetPhysicalInteractionLength( 101 // Flag for material switching << 117 const G4Track&,G4double,G4ForceCondition*); 102 //---------------------------------------- << 118 G4VParticleChange* PostStepDoIt(const G4Track&,const G4Step&); 103 << 119 104 inline void SetLayeredMaterialFlag(G4bool << 120 //----------------------------------------------------------------------- 105 inline G4bool GetLayeredMaterialFlag() con << 121 // Flag for material switching 106 << 122 //----------------------------------------------------------------------- 107 //---------------------------------------- << 123 108 // Returns whether a particular particle t << 124 inline void SetLayeredMaterialFlag(G4bool flg=true) 109 //---------------------------------------- << 125 { layeredMaterialFlag = flg; } 110 G4bool IsAtRestRequired(G4ParticleDefiniti << 126 inline G4bool GetLayeredMaterialFlag() const 111 << 127 { return layeredMaterialFlag; } 112 //---------------------------------------- << 128 113 // Static G4Step object for "Hyper-step" << 129 private: 114 //---------------------------------------- << 130 void CopyStep(const G4Step & step); 115 static const G4Step* GetHyperStep(); << 131 void SwitchMaterial(G4StepPoint*); 116 static G4int GetHypNavigatorID(); << 132 117 << 133 public: // with description 118 protected: << 134 //-------------------------------------------------------------------- 119 << 135 // Returns whether a particular particle type requires AtRest process 120 void CopyStep(const G4Step& step); << 136 //-------------------------------------------------------------------- 121 void SwitchMaterial(G4StepPoint*); << 137 G4bool IsAtRestRequired(G4ParticleDefinition*); 122 << 138 123 protected: << 139 private: 124 << 140 G4Step * fGhostStep; 125 G4Step* fGhostStep; << 141 G4StepPoint * fGhostPreStepPoint; 126 G4StepPoint* fGhostPreStepPoint; << 142 G4StepPoint * fGhostPostStepPoint; 127 G4StepPoint* fGhostPostStepPoint; << 143 128 << 144 G4VParticleChange aDummyParticleChange; 129 G4VParticleChange aDummyParticleChange; << 145 G4ParticleChange xParticleChange; 130 G4ParticleChange xParticleChange; << 146 131 << 147 G4TransportationManager* fTransportationManager; 132 G4TransportationManager* fTransportationMa << 148 G4PathFinder* fPathFinder; 133 G4PathFinder* fPathFinder; << 149 134 << 150 // ------------------------------- 135 // ------------------------------- << 151 // Navigation in the Ghost World: 136 // Navigation in the Ghost World: << 152 // ------------------------------- 137 // ------------------------------- << 153 G4String fGhostWorldName; 138 G4String fGhostWorldName; << 154 G4VPhysicalVolume* fGhostWorld; 139 G4VPhysicalVolume* fGhostWorld{nullptr}; << 155 G4Navigator* fGhostNavigator; 140 G4Navigator* fGhostNavigator{nullptr}; << 156 G4int fNavigatorID; 141 G4int fNavigatorID{-1}; << 157 G4TouchableHandle fOldGhostTouchable; 142 G4TouchableHandle fOldGhostTouchable; << 158 G4TouchableHandle fNewGhostTouchable; 143 G4TouchableHandle fNewGhostTouchable; << 159 G4FieldTrack fFieldTrack; 144 G4FieldTrack fFieldTrack; << 160 G4double fGhostSafety; 145 G4double fGhostSafety{0.}; << 161 G4bool fOnBoundary; 146 G4bool fOnBoundary{false}; << 162 147 << 163 //----------------------------------------------------------------------- 148 //---------------------------------------- << 164 // Flag for material switching 149 // Flag for material switching << 165 //----------------------------------------------------------------------- 150 //---------------------------------------- << 166 G4bool layeredMaterialFlag; 151 G4bool layeredMaterialFlag{false}; << 152 << 153 private: << 154 << 155 static G4ThreadLocal G4Step* fpHyperStep; << 156 static G4ThreadLocal G4int nParallelWorlds << 157 static G4ThreadLocal G4int fNavIDHyp; << 158 G4int iParallelWorld; << 159 }; 167 }; 160 168 161 #endif 169 #endif 162 170