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 // G4BOptnLeadingParticle
0031 //
0032 // Class Description:
0033 //       A G4VBiasingOperation that implements the so-called "Leading
0034 //   particle biasing scheme". It is of interest in the shield problem
0035 //   to estimate the flux leaking from the shield.
0036 //       It works as follows:
0037 //       - it is intented for hadronic inelastic interaction
0038 //       - at each interaction, are kept:
0039 //           - the most energetic particle (the leading particle)
0040 //               - with unmodified weight
0041 //           - randomly one particle of each species
0042 //               - with this particle weight = n * primary_weight where
0043 //                 n is the number of particles of this species
0044 //---------------------------------------------------------------------
0045 // Initial version                                 Nov. 2019 M. Verderi
0046 
0047 
0048 #ifndef G4BOptnLeadingParticle_hh
0049 #define G4BOptnLeadingParticle_hh 1
0050 
0051 #include "G4VBiasingOperation.hh"
0052 #include "G4ParticleChange.hh"
0053 
0054 class G4BOptnLeadingParticle : public G4VBiasingOperation {
0055 public:
0056   // -- Constructor :
0057   G4BOptnLeadingParticle(G4String name);
0058   // -- destructor:
0059   virtual ~G4BOptnLeadingParticle();
0060   
0061 public:
0062   // -- Methods from G4VBiasingOperation interface:
0063   // ----------------------------------------------
0064   // -- Unused:
0065   virtual const G4VBiasingInteractionLaw* ProvideOccurenceBiasingInteractionLaw( const G4BiasingProcessInterface*, G4ForceCondition& ) {return nullptr;}
0066   // -- Used:
0067   virtual G4VParticleChange*                             ApplyFinalStateBiasing( const G4BiasingProcessInterface*, // -- Method used for this biasing. The related biasing operator
0068                                          const G4Track*,                   // -- returns this biasing operation at the post step do it level
0069                                          const G4Step*,                    // -- when the wrapped process has won the interaction length race.
0070                                          G4bool& );                        // -- The wrapped process final state is then trimmed.
0071   // -- Unused:
0072   virtual G4double                                     DistanceToApplyOperation( const G4Track*,
0073                                          G4double,
0074                                          G4ForceCondition*)                                    {return 0;}
0075   virtual G4VParticleChange*                         GenerateBiasingFinalState( const G4Track*,
0076                                         const G4Step*  )                                       {return nullptr;}
0077 
0078 public:
0079   // -- The possibility is given to further apply a Russian roulette on tracks that are accompagnying the leading particle
0080   // -- after the classical leading particle biasing algorithm has been applied.
0081   // -- This is of interest when applying the technique to e+ -> gamma gamma for example. Given one gamma is leading,
0082   // -- the second one is alone in its category, hence selected. With the Russian roulette it is then possible to keep
0083   // -- this one randomly. This is also of interest for pi0 decays, or for brem. e- -> e- gamma where the e- or gamma
0084   // -- are alone in their category.
0085   void     SetFurtherKillingProbability( G4double p )       { fRussianRouletteKillingProbability = p;    }   // -- if p <= 0.0 the killing is ignored.
0086   G4double GetFurtherKillingProbability()             const { return fRussianRouletteKillingProbability; }
0087   
0088 private:
0089   // -- Particle change used to return the trimmed final state:
0090   G4ParticleChange fParticleChange;
0091   G4double         fRussianRouletteKillingProbability;
0092 
0093   
0094 };
0095 
0096 #endif