Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4BOptnForceCommonTruncatedExp
0031 //
0032 // Class Description:
0033 //    A G4VBiasingOperation physics-based biasing operation. It
0034 //    handles several processes together, biasing on the total
0035 //    cross-section of these processes (instead of biasing them
0036 //    individually).
0037 //    The biasing interaction law is a truncated exponential
0038 //    one, driven by the total cross-section and which extends
0039 //    in the range [0,L].
0040 //    Process are registered with the AddCrossSection method.
0041 //    As cross-sections are all known at the end of the
0042 //    PostStepGPIL loop, the step limitation is made at the
0043 //    AlongStepGPIL level.
0044 //
0045 //---------------------------------------------------------------
0046 //   Initial version                         Nov. 2013 M. Verderi
0047 
0048 
0049 #ifndef G4BOptnForceCommonTruncatedExp_hh
0050 #define G4BOptnForceCommonTruncatedExp_hh 1
0051 
0052 #include "G4VBiasingOperation.hh"
0053 #include "G4ThreeVector.hh"
0054 #include "G4ParticleChangeForNothing.hh"
0055 class G4ILawCommonTruncatedExp;
0056 class G4ILawForceFreeFlight;
0057 #include <map>
0058 
0059 class G4BOptnForceCommonTruncatedExp : public G4VBiasingOperation {
0060 public:
0061   // -- Constructor :
0062   G4BOptnForceCommonTruncatedExp(G4String name);
0063   // -- destructor:
0064   virtual ~G4BOptnForceCommonTruncatedExp();
0065   
0066 public:
0067   // -- Methods from G4VBiasingOperation interface:
0068   // -------------------------------------------
0069   // -- Used:
0070   virtual const G4VBiasingInteractionLaw* ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface*, G4ForceCondition& );
0071   virtual G4double                                        ProposeAlongStepLimit( const G4BiasingProcessInterface* ) { return DBL_MAX; }
0072   virtual G4GPILSelection                                  ProposeGPILSelection( const G4GPILSelection  processSelection );
0073   virtual G4VParticleChange*                             ApplyFinalStateBiasing( const G4BiasingProcessInterface*,
0074                                          const G4Track*,
0075                                          const G4Step*,
0076                                          G4bool& );
0077   // -- Unused:
0078   virtual G4double                               DistanceToApplyOperation( const G4Track*,
0079                                        G4double,
0080                                        G4ForceCondition*)  {return DBL_MAX;}
0081   virtual G4VParticleChange*                    GenerateBiasingFinalState( const G4Track*,
0082                                        const G4Step*    )  {return 0;}
0083   
0084 public:
0085   // -- Additional methods, specific to this class:
0086   // ----------------------------------------------
0087   // -- return concrete type of interaction laws:
0088   G4ILawCommonTruncatedExp* GetCommonTruncatedExpLaw()
0089   {
0090     return fCommonTruncatedExpLaw;
0091   }
0092   G4ILawForceFreeFlight* GetForceFreeFlightLaw()
0093   {
0094     return fForceFreeFlightLaw;
0095   }
0096   
0097   void                           Initialize( const G4Track* );
0098   void                        UpdateForStep( const G4Step*  );
0099   void                               Sample();
0100   const G4ThreeVector&   GetInitialMomentum() const { return fInitialMomentum; }
0101   G4double               GetMaximumDistance() const { return fMaximumDistance; }
0102   void                 ChooseProcessToApply();
0103   const G4VProcess*       GetProcessToApply() const { return fProcessToApply; }
0104   void                      AddCrossSection( const G4VProcess*, G4double );
0105   size_t                 GetNumberOfSharing() const { return fNumberOfSharing;}
0106   void                SetInteractionOccured( G4bool b )       { fInteractionOccured = b;    }
0107   G4bool              GetInteractionOccured()           const { return fInteractionOccured; }
0108   
0109 private:
0110   G4ILawCommonTruncatedExp*                fCommonTruncatedExpLaw;
0111   G4ILawForceFreeFlight*                      fForceFreeFlightLaw;
0112   G4double                                     fTotalCrossSection;
0113   std::map < const G4VProcess*, G4double >         fCrossSections;
0114   size_t                                         fNumberOfSharing;
0115   const G4VProcess*                               fProcessToApply;
0116   G4bool                                      fInteractionOccured;
0117   G4ThreeVector                                  fInitialMomentum;
0118   G4double                                       fMaximumDistance;
0119   G4ParticleChangeForNothing                 fDummyParticleChange;
0120 };
0121 
0122 #endif