00001 // 00002 // ******************************************************************** 00003 // * License and Disclaimer * 00004 // * * 00005 // * The Geant4 software is copyright of the Copyright Holders of * 00006 // * the Geant4 Collaboration. It is provided under the terms and * 00007 // * conditions of the Geant4 Software License, included in the file * 00008 // * LICENSE and available at http://cern.ch/geant4/license . These * 00009 // * include a list of copyright holders. * 00010 // * * 00011 // * Neither the authors of this software system, nor their employing * 00012 // * institutes,nor the agencies providing financial support for this * 00013 // * work make any representation or warranty, express or implied, * 00014 // * regarding this software system or assume any liability for its * 00015 // * use. Please see the license in the file LICENSE and URL above * 00016 // * for the full disclaimer and the limitation of liability. * 00017 // * * 00018 // * This code implementation is the result of the scientific and * 00019 // * technical work of the GEANT4 collaboration. * 00020 // * By using, copying, modifying or distributing the software (or * 00021 // * any work based on the software) you agree to acknowledge its * 00022 // * use in resulting scientific publications, and indicate your * 00023 // * acceptance of all terms of the Geant4 Software license. * 00024 // ******************************************************************** 00025 // 00026 // 00027 // $Id: G4ParallelWorldProcess.hh 69885 2013-05-17 07:49:30Z gcosmo $ 00028 // GEANT4 tag $Name: geant4-09-04-ref-00 $ 00029 // 00030 // 00031 //--------------------------------------------------------------- 00032 // 00033 // G4ParallelWorldProcess.hh 00034 // 00035 // Description: 00036 // This procss takes a parallel world and limits a step 00037 // on the boundaries of volumes in the parallel world. 00038 // It invokes sensitive detectors assigned in the parallel 00039 // world. 00040 // It switches a material (and a region if defined) in the 00041 // assigned parallel world over the material (and the region) 00042 // in the mass world. 00043 // 00044 //--------------------------------------------------------------- 00045 00046 00047 #ifndef G4ParallelWorldProcess_h 00048 #define G4ParallelWorldProcess_h 1 00049 00050 #include "globals.hh" 00051 class G4Step; 00052 class G4StepPoint; 00053 class G4Navigator; 00054 class G4TransportationManager; 00055 class G4PathFinder; 00056 class G4VTouchable; 00057 class G4VPhysicalVolume; 00058 class G4ParticleChange; 00059 #include "G4VProcess.hh" 00060 #include "G4FieldTrack.hh" 00061 #include "G4TouchableHandle.hh" 00062 #include "G4MultiNavigator.hh" 00063 00064 //------------------------------------------ 00065 // 00066 // G4ParallelWorldProcess class 00067 // 00068 //------------------------------------------ 00069 00070 00071 // Class Description: 00072 00073 class G4ParallelWorldProcess : public G4VProcess 00074 { 00075 public: // with description 00076 00077 //------------------------ 00078 // Constructor/Destructor 00079 //------------------------ 00080 00081 G4ParallelWorldProcess(const G4String& processName = "ParaWorld", 00082 G4ProcessType theType = fParameterisation); 00083 virtual ~G4ParallelWorldProcess(); 00084 00085 //-------------------------------------------------------------- 00086 // Set Paralle World 00087 //-------------------------------------------------------------- 00088 00089 void SetParallelWorld(G4String parallelWorldName); 00090 void SetParallelWorld(G4VPhysicalVolume* parallelWorld); 00091 00092 //-------------------------------------------------------------- 00093 // Process interface 00094 //-------------------------------------------------------------- 00095 00096 void StartTracking(G4Track*); 00097 00098 //------------------------------------------------------------------------ 00099 // GetPhysicalInteractionLength() and DoIt() methods for AtRest 00100 //------------------------------------------------------------------------ 00101 00102 G4double AtRestGetPhysicalInteractionLength(const G4Track&,G4ForceCondition*); 00103 G4VParticleChange* AtRestDoIt(const G4Track&,const G4Step&); 00104 00105 //------------------------------------------------------------------------ 00106 // GetPhysicalInteractionLength() and DoIt() methods for AlongStep 00107 //------------------------------------------------------------------------ 00108 00109 G4double AlongStepGetPhysicalInteractionLength( 00110 const G4Track&,G4double,G4double,G4double&,G4GPILSelection*); 00111 G4VParticleChange* AlongStepDoIt(const G4Track&,const G4Step&); 00112 00113 //----------------------------------------------------------------------- 00114 // GetPhysicalInteractionLength() and DoIt() methods for PostStep 00115 //----------------------------------------------------------------------- 00116 00117 G4double PostStepGetPhysicalInteractionLength( 00118 const G4Track&,G4double,G4ForceCondition*); 00119 G4VParticleChange* PostStepDoIt(const G4Track&,const G4Step&); 00120 00121 //----------------------------------------------------------------------- 00122 // Flag for material switching 00123 //----------------------------------------------------------------------- 00124 00125 inline void SetLayeredMaterialFlag(G4bool flg=true) 00126 { layeredMaterialFlag = flg; } 00127 inline G4bool GetLayeredMaterialFlag() const 00128 { return layeredMaterialFlag; } 00129 00130 private: 00131 void CopyStep(const G4Step & step); 00132 void SwitchMaterial(G4StepPoint*); 00133 00134 public: // with description 00135 //-------------------------------------------------------------------- 00136 // Returns whether a particular particle type requires AtRest process 00137 //-------------------------------------------------------------------- 00138 G4bool IsAtRestRequired(G4ParticleDefinition*); 00139 00140 private: 00141 G4Step * fGhostStep; 00142 G4StepPoint * fGhostPreStepPoint; 00143 G4StepPoint * fGhostPostStepPoint; 00144 00145 G4VParticleChange aDummyParticleChange; 00146 G4ParticleChange xParticleChange; 00147 00148 G4TransportationManager* fTransportationManager; 00149 G4PathFinder* fPathFinder; 00150 00151 // ------------------------------- 00152 // Navigation in the Ghost World: 00153 // ------------------------------- 00154 G4String fGhostWorldName; 00155 G4VPhysicalVolume* fGhostWorld; 00156 G4Navigator* fGhostNavigator; 00157 G4int fNavigatorID; 00158 G4TouchableHandle fOldGhostTouchable; 00159 G4TouchableHandle fNewGhostTouchable; 00160 G4FieldTrack fFieldTrack; 00161 G4double fGhostSafety; 00162 G4bool fOnBoundary; 00163 00164 //----------------------------------------------------------------------- 00165 // Flag for material switching 00166 //----------------------------------------------------------------------- 00167 G4bool layeredMaterialFlag; 00168 00169 //----------------------------------------------------------------------- 00170 // Static G4Step object for "Hyper-step" 00171 //----------------------------------------------------------------------- 00172 public: 00173 static const G4Step* GetHyperStep(); 00174 static G4int GetHypNavigatorID(); 00175 private: 00176 static G4Step* fpHyperStep; 00177 static G4int nParallelWorlds; 00178 static G4int fNavIDHyp; 00179 G4int iParallelWorld; 00180 }; 00181 00182 #endif