Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:28

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