Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4ImportanceProcess
0027 //
0028 // Class description:
0029 //
0030 // Used internally by importance sampling in the "mass" geometry.
0031 // This process is a forced post step process. It will apply
0032 // importance sampling if the particle crosses a boundary in the 
0033 // "mass" geometry.
0034 
0035 // Author: Michael Dressel, 2002
0036 // --------------------------------------------------------------------
0037 #ifndef G4ImportanceProcess_hh
0038 #define G4ImportanceProcess_hh 1
0039 
0040 #include "G4VProcess.hh"
0041 #include "G4VTrackTerminator.hh"
0042 #include "G4VTouchable.hh"
0043 
0044 class G4SamplingPostStepAction;
0045 class G4VImportanceAlgorithm;
0046 class G4VIStore;
0047 
0048 class G4Step;
0049 class G4Navigator;
0050 class G4TransportationManager;
0051 class G4PathFinder;
0052 
0053 #include "G4FieldTrack.hh"
0054 #include "G4TouchableHandle.hh"
0055 #include "G4MultiNavigator.hh"   // For ELimited enum
0056 
0057 class G4ImportanceProcess : public G4VProcess, public G4VTrackTerminator
0058 {
0059 
0060 public:  // with description
0061 
0062   G4ImportanceProcess(const G4VImportanceAlgorithm &aImportanceAlgorithm,
0063                       const G4VIStore &aIstore,
0064                       const G4VTrackTerminator *TrackTerminator,
0065                       const G4String &aName = "ImportanceProcess",
0066                             G4bool para = false);
0067     // creates a G4ParticleChange
0068 
0069   virtual ~G4ImportanceProcess();
0070     // delete the G4ParticleChange
0071 
0072 
0073   //--------------------------------------------------------------
0074   // Set Parallel World
0075   //--------------------------------------------------------------
0076 
0077   void SetParallelWorld(const G4String &parallelWorldName);
0078   //  void SetParallelWorld(const G4VPhysicalVolume* parallelWorld);
0079 
0080   //--------------------------------------------------------------
0081   //     Process interface
0082   //--------------------------------------------------------------
0083 
0084   void StartTracking(G4Track*);
0085   
0086 
0087   virtual G4double 
0088   PostStepGetPhysicalInteractionLength(const G4Track& aTrack,
0089                                        G4double   previousStepSize,
0090                                        G4ForceCondition* condition);
0091     // make process beeing forced
0092   virtual G4VParticleChange *PostStepDoIt(const G4Track&, const G4Step&);
0093     // manage the importance sampling in the "mass" geometry
0094 
0095   virtual void KillTrack() const;
0096     // used in case no scoring process follows that does the killing
0097 
0098   virtual const G4String &GetName() const;
0099 
0100 
0101 public:  // without description
0102 
0103   //  no operation in  AtRestDoIt and  AlongStepDoIt
0104 
0105   virtual G4double 
0106   AlongStepGetPhysicalInteractionLength(const G4Track&,
0107                                         G4double  ,
0108                                         G4double  ,
0109                                         G4double& ,
0110                                         G4GPILSelection*);
0111   virtual G4double 
0112   AtRestGetPhysicalInteractionLength(const G4Track& ,
0113                                      G4ForceCondition*);
0114   
0115   virtual G4VParticleChange* 
0116   AtRestDoIt(const G4Track&, const G4Step&);
0117 
0118 
0119   virtual G4VParticleChange* 
0120   AlongStepDoIt(const G4Track&, const G4Step&);
0121   
0122 private:
0123   
0124   G4ImportanceProcess(const G4ImportanceProcess &);
0125   G4ImportanceProcess &operator=(const G4ImportanceProcess &);
0126   
0127 private:
0128 
0129   void CopyStep(const G4Step & step);
0130 
0131   G4Step* fGhostStep = nullptr;
0132   G4StepPoint* fGhostPreStepPoint = nullptr;
0133   G4StepPoint* fGhostPostStepPoint = nullptr;
0134 
0135   G4ParticleChange* fParticleChange = nullptr;
0136   const G4VImportanceAlgorithm &fImportanceAlgorithm;
0137   const G4VIStore& fIStore;
0138   G4SamplingPostStepAction* fPostStepAction = nullptr;
0139 
0140   G4TransportationManager* fTransportationManager = nullptr;
0141   G4PathFinder*        fPathFinder = nullptr;
0142 
0143   // -------------------------------
0144   // Navigation in the Ghost World:
0145   // -------------------------------
0146   G4String             fGhostWorldName = "NoParallelWorld";
0147   G4VPhysicalVolume*   fGhostWorld = nullptr;
0148   G4Navigator*         fGhostNavigator = nullptr;
0149   G4int                fNavigatorID = -1;
0150   G4TouchableHandle    fOldGhostTouchable;
0151   G4TouchableHandle    fNewGhostTouchable;
0152   G4FieldTrack         fFieldTrack = '0';
0153   G4double             fGhostSafety = -1;
0154   G4bool               fOnBoundary = false;
0155 
0156   G4bool               fParaflag = false;
0157   G4FieldTrack         fEndTrack = '0';
0158   ELimited             feLimited = kDoNot;
0159 
0160 };
0161 
0162 #endif