[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4FastSimulationManagerProcess.hh,v 1.16 2007/11/30 18:05:14 mverderi Exp $ |
---|
[1007] | 28 | // GEANT4 tag $Name: geant4-09-02 $ |
---|
[819] | 29 | // |
---|
| 30 | // |
---|
| 31 | //--------------------------------------------------------------- |
---|
| 32 | // |
---|
| 33 | // G4FastSimulationManagerProcess.hh |
---|
| 34 | // |
---|
| 35 | // Description: |
---|
| 36 | // The process that triggers parameterised simulations if any. |
---|
| 37 | // |
---|
| 38 | // History: |
---|
| 39 | // Feb 98: Parallel geometry sensitivity. MoraDeFreitas. |
---|
| 40 | // Oct 97: "Fast" replaces "Parameterisation" in class/method names. |
---|
| 41 | // (release B.00 for parameterisation). MoraDeFreitas. |
---|
| 42 | // Aug 97: First implementation. Verderi && MoraDeFreitas. |
---|
| 43 | // Apr 98: modified for new particle change. H.Kurashige |
---|
| 44 | // Oct 06: Move to parallel geometry scheme. M. Verderi |
---|
| 45 | // Nov 06: name xxx81 is given for this release. "81" will be |
---|
| 46 | // removed @ next maj. rel. so that this process becomes |
---|
| 47 | // the standard one. |
---|
| 48 | // May 07: remove "81" tags, to migrate to 9.0. |
---|
| 49 | // |
---|
| 50 | //--------------------------------------------------------------- |
---|
| 51 | |
---|
| 52 | |
---|
| 53 | #ifndef G4FastSimulationManagerProcess_hh |
---|
| 54 | #define G4FastSimulationManagerProcess_hh |
---|
| 55 | |
---|
| 56 | #include "globals.hh" |
---|
| 57 | #include "G4VProcess.hh" |
---|
| 58 | #include "G4FastSimulationManager.hh" |
---|
| 59 | #include "G4Step.hh" |
---|
| 60 | #include "G4Navigator.hh" |
---|
| 61 | #include "G4VPhysicalVolume.hh" |
---|
| 62 | #include "G4VParticleChange.hh" |
---|
| 63 | #include "G4FieldTrack.hh" |
---|
| 64 | class G4PathFinder; |
---|
| 65 | class G4TransportationManager; |
---|
| 66 | |
---|
| 67 | // --------------------------------------------------------------------- |
---|
| 68 | // |
---|
| 69 | // G4FastSimulationManagerProcess class |
---|
| 70 | // |
---|
| 71 | // --------------------------------------------------------------------- |
---|
| 72 | |
---|
| 73 | |
---|
| 74 | // Class Description: |
---|
| 75 | // -- G4VProcess providing the interface between the tracking and the fast simulation. |
---|
| 76 | // |
---|
| 77 | |
---|
| 78 | class G4FastSimulationManagerProcess : public G4VProcess |
---|
| 79 | { |
---|
| 80 | public: |
---|
| 81 | |
---|
| 82 | // ------------------------- |
---|
| 83 | // Constructor/Destructor: |
---|
| 84 | // ------------------------- |
---|
| 85 | // -- Constructor for parameterisation in mass geometry |
---|
| 86 | G4FastSimulationManagerProcess(const G4String& processName = "G4FastSimulationManagerProcess", |
---|
| 87 | G4ProcessType theType = fParameterisation); |
---|
| 88 | |
---|
| 89 | // -- Contructors for parameterisation attached a parallel geometry. |
---|
| 90 | // -- Can also be used for the mass geometry, providing world volume name. |
---|
| 91 | // -- World volume specified by name or pointer. |
---|
| 92 | G4FastSimulationManagerProcess(const G4String& processName, |
---|
| 93 | const G4String& worldVolumeName, |
---|
| 94 | G4ProcessType theType = fParameterisation); |
---|
| 95 | G4FastSimulationManagerProcess(const G4String& processName, |
---|
| 96 | G4VPhysicalVolume* worldVolume, |
---|
| 97 | G4ProcessType theType = fParameterisation); |
---|
| 98 | |
---|
| 99 | virtual ~G4FastSimulationManagerProcess(); |
---|
| 100 | |
---|
| 101 | // ----------------------- |
---|
| 102 | // User access methods: |
---|
| 103 | // ----------------------- |
---|
| 104 | G4VPhysicalVolume* GetWorldVolume() const {return fWorldVolume;} |
---|
| 105 | |
---|
| 106 | // -- Set new world volume to the process |
---|
| 107 | void SetWorldVolume(G4String ); |
---|
| 108 | void SetWorldVolume(G4VPhysicalVolume*); |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | // -------------------------------------------------------------- |
---|
| 112 | // Process interface |
---|
| 113 | // -------------------------------------------------------------- |
---|
| 114 | |
---|
| 115 | // -- Start/End tracking: |
---|
| 116 | void StartTracking(G4Track*); |
---|
| 117 | void EndTracking(); |
---|
| 118 | |
---|
| 119 | |
---|
| 120 | // -- PostStep methods: |
---|
| 121 | G4double PostStepGetPhysicalInteractionLength(const G4Track& track, |
---|
| 122 | G4double previousStepSize, |
---|
| 123 | G4ForceCondition* condition); |
---|
| 124 | |
---|
| 125 | G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step& ); |
---|
| 126 | |
---|
| 127 | // -- Responsible for limiting the step on ghost boundaries: |
---|
| 128 | G4double AlongStepGetPhysicalInteractionLength(const G4Track& track, |
---|
| 129 | G4double previousStepSize, |
---|
| 130 | G4double currentMinimumStep, |
---|
| 131 | G4double& proposedSafety, |
---|
| 132 | G4GPILSelection* selection); |
---|
| 133 | G4VParticleChange* AlongStepDoIt(const G4Track& track, |
---|
| 134 | const G4Step& step); |
---|
| 135 | |
---|
| 136 | |
---|
| 137 | |
---|
| 138 | // -- AtRest methods (still there after many years of no use...): |
---|
| 139 | G4double AtRestGetPhysicalInteractionLength(const G4Track&, |
---|
| 140 | G4ForceCondition*); |
---|
| 141 | |
---|
| 142 | G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&); |
---|
| 143 | |
---|
| 144 | |
---|
| 145 | |
---|
| 146 | |
---|
| 147 | |
---|
| 148 | // -- debug: |
---|
| 149 | void Verbose() const; |
---|
| 150 | |
---|
| 151 | |
---|
| 152 | private: |
---|
| 153 | //-- would be better to my taste to have "const G4VPhysicalVolume* fWorldVolume;", but clashes at compilation |
---|
| 154 | G4VPhysicalVolume* fWorldVolume; |
---|
| 155 | |
---|
| 156 | G4bool fIsTrackingTime; |
---|
| 157 | G4bool fIsFirstStep; |
---|
| 158 | G4Navigator* fGhostNavigator; |
---|
| 159 | G4int fGhostNavigatorIndex; |
---|
| 160 | G4bool fIsGhostGeometry; |
---|
| 161 | G4double fGhostSafety; |
---|
| 162 | G4bool fOnBoundary; |
---|
| 163 | G4FieldTrack fFieldTrack; |
---|
| 164 | |
---|
| 165 | |
---|
| 166 | G4FastSimulationManager* fFastSimulationManager; |
---|
| 167 | G4bool fFastSimulationTrigger; |
---|
| 168 | G4VParticleChange fDummyParticleChange; |
---|
| 169 | G4PathFinder* fPathFinder; |
---|
| 170 | G4TransportationManager* fTransportationManager; |
---|
| 171 | }; |
---|
| 172 | |
---|
| 173 | #endif |
---|