Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-18 09:16:10

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:
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   G4WeightWindowProcess(const G4WeightWindowProcess &) = delete;
0076   G4WeightWindowProcess &operator=(const G4WeightWindowProcess &) = delete;
0077 
0078   //--------------------------------------------------------------
0079   // Set Parallel World
0080   //--------------------------------------------------------------
0081 
0082   void SetParallelWorld(const G4String& parallelWorldName);
0083   void SetParallelWorld(G4VPhysicalVolume* parallelWorld);
0084 
0085   //--------------------------------------------------------------
0086   //     Process interface
0087   //--------------------------------------------------------------
0088 
0089   void StartTracking(G4Track*);
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   //  no operation in  AtRestDoIt and  AlongStepDoIt
0105 
0106   virtual G4double 
0107   AlongStepGetPhysicalInteractionLength(const G4Track&, G4double, G4double,
0108                                         G4double&, G4GPILSelection*);
0109   virtual G4double 
0110   AtRestGetPhysicalInteractionLength(const G4Track&, G4ForceCondition*);
0111   
0112   virtual G4VParticleChange* AtRestDoIt(const G4Track&, const G4Step&);
0113   virtual G4VParticleChange* AlongStepDoIt(const G4Track&, const G4Step&);
0114   
0115  private:
0116 
0117   void CopyStep(const G4Step& step);
0118 
0119   G4Step* fGhostStep = nullptr;
0120   G4StepPoint* fGhostPreStepPoint = nullptr;
0121   G4StepPoint* fGhostPostStepPoint = nullptr;
0122 
0123   G4ParticleChange* fParticleChange = nullptr;
0124   const G4VWeightWindowAlgorithm& fWeightWindowAlgorithm;
0125   const G4VWeightWindowStore& fWeightWindowStore;
0126   G4SamplingPostStepAction* fPostStepAction = nullptr;
0127   G4PlaceOfAction fPlaceOfAction;
0128 
0129   G4TransportationManager* fTransportationManager = nullptr;
0130   G4PathFinder* fPathFinder = nullptr;
0131 
0132   // -------------------------------
0133   // Navigation in the Ghost World:
0134   // -------------------------------
0135   G4String             fGhostWorldName = "NoParallelWorld";
0136   G4VPhysicalVolume*   fGhostWorld = nullptr;
0137   G4Navigator*         fGhostNavigator = nullptr;
0138   G4int                fNavigatorID = -1;
0139   G4TouchableHandle    fOldGhostTouchable;
0140   G4TouchableHandle    fNewGhostTouchable;
0141   G4FieldTrack         fFieldTrack = '0';
0142   G4double             fGhostSafety = -1;
0143   G4bool               fOnBoundary = false;
0144 
0145   G4bool               fParaflag = false;
0146   G4FieldTrack         fEndTrack = '0';
0147   ELimited             feLimited = kDoNot;
0148 };
0149 
0150 #endif