Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:16

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 //
0029 //---------------------------------------------------------------
0030 //
0031 //  G4FastSimulationManagerProcess.hh
0032 //
0033 //  Description:
0034 //    The process that triggers parameterised simulations  if any.
0035 //
0036 //  History:
0037 //  Feb 98: Parallel geometry sensitivity. MoraDeFreitas.
0038 //  Oct 97: "Fast" replaces "Parameterisation" in class/method names.
0039 //          (release B.00 for parameterisation). MoraDeFreitas.
0040 //  Aug 97: First implementation. Verderi && MoraDeFreitas.
0041 //  Apr 98: modified for new particle change.  H.Kurashige
0042 //  Oct 06: Move to parallel geometry scheme. M. Verderi
0043 //  Nov 06: name xxx81 is given for this release. "81" will be
0044 //          removed @ next maj. rel. so that this process becomes
0045 //          the standard one.
0046 //  May 07: remove "81" tags, to migrate to 9.0.
0047 //
0048 //---------------------------------------------------------------
0049 
0050 #ifndef G4FastSimulationManagerProcess_hh
0051 #define G4FastSimulationManagerProcess_hh
0052 
0053 #include "G4FastSimulationManager.hh"
0054 #include "G4FastSimulationProcessType.hh"
0055 #include "G4FieldTrack.hh"
0056 #include "G4Navigator.hh"
0057 #include "G4Step.hh"
0058 #include "G4VParticleChange.hh"
0059 #include "G4VPhysicalVolume.hh"
0060 #include "G4VProcess.hh"
0061 #include "globals.hh"
0062 class G4PathFinder;
0063 class G4TransportationManager;
0064 
0065 // ---------------------------------------------------------------------
0066 //
0067 //        G4FastSimulationManagerProcess class
0068 //
0069 // ---------------------------------------------------------------------
0070 
0071 // Class Description:
0072 // -- G4VProcess providing the interface between the tracking and the fast simulation.
0073 //
0074 
0075 class G4FastSimulationManagerProcess : public G4VProcess
0076 {
0077   public:
0078     // Constructor for parameterisation in mass geometry
0079     G4FastSimulationManagerProcess(const G4String& processName = "G4FastSimulationManagerProcess",
0080                                    G4ProcessType theType = fParameterisation);
0081 
0082     // -- Contructors for parameterisation attached a parallel geometry.
0083     // -- Can also be used for the mass geometry, providing world volume name.
0084     // -- World volume specified by name or pointer.
0085     G4FastSimulationManagerProcess(const G4String& processName, const G4String& worldVolumeName,
0086                                    G4ProcessType theType = fParameterisation);
0087     G4FastSimulationManagerProcess(const G4String& processName, G4VPhysicalVolume* worldVolume,
0088                                    G4ProcessType theType = fParameterisation);
0089 
0090     ~G4FastSimulationManagerProcess() override;
0091 
0092     // -----------------------
0093     //   User access methods:
0094     // -----------------------
0095     G4VPhysicalVolume* GetWorldVolume() const { return fWorldVolume; }
0096 
0097     // -- Set new world volume to the process
0098     void SetWorldVolume(G4String);
0099     void SetWorldVolume(G4VPhysicalVolume*);
0100 
0101     // --------------------------------------------------------------
0102     //                      Process interface
0103     // --------------------------------------------------------------
0104 
0105     // -- Start/End tracking:
0106     void StartTracking(G4Track*) override;
0107     void EndTracking() override;
0108 
0109     // -- PostStep methods:
0110     G4double PostStepGetPhysicalInteractionLength(const G4Track& track, G4double previousStepSize,
0111                                                   G4ForceCondition* condition) override;
0112 
0113     G4VParticleChange* PostStepDoIt(const G4Track&, const G4Step&) override;
0114 
0115     // -- Responsible for limiting the step on ghost boundaries:
0116     G4double AlongStepGetPhysicalInteractionLength(const G4Track& track, G4double previousStepSize,
0117                                                    G4double currentMinimumStep,
0118                                                    G4double& proposedSafety,
0119                                                    G4GPILSelection* selection) override;
0120     G4VParticleChange* AlongStepDoIt(const G4Track& track, const G4Step& step) override;
0121 
0122     // -- AtRest methods (still there after many years of no use...):
0123     G4double AtRestGetPhysicalInteractionLength(const G4Track&, G4ForceCondition*) override;
0124 
0125     G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&) override;
0126 
0127     // -- debug:
0128     [[deprecated("obsolete: will be remove in next major release")]] void Verbose() const {}
0129 
0130   private:
0131     //-- would be better to my taste to have "const G4VPhysicalVolume* fWorldVolume;", but clashes
0132     // at compilation
0133     G4VPhysicalVolume* fWorldVolume;
0134 
0135     G4bool fIsTrackingTime;
0136     G4bool fIsFirstStep;
0137     G4Navigator* fGhostNavigator;
0138     G4int fGhostNavigatorIndex;
0139     G4bool fIsGhostGeometry;
0140     G4double fGhostSafety;
0141     G4FieldTrack fFieldTrack;
0142 
0143     G4FastSimulationManager* fFastSimulationManager;
0144     G4bool fFastSimulationTrigger;
0145     G4VParticleChange fDummyParticleChange;
0146     G4PathFinder* fPathFinder;
0147     G4TransportationManager* fTransportationManager;
0148 };
0149 
0150 #endif