Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-18 09:32:26

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 /// \file GB05BOptrSplitAndKillByCrossSection.hh
0027 /// \brief Definition of the GB05BOptrSplitAndKillByCrossSection class
0028 //
0029 //---------------------------------------------------------------
0030 //
0031 // GB05BOptrSplitAndKillByCrossSection
0032 //
0033 // Class Description:
0034 //        A G4VBiasingOperator concrete implementation example to
0035 //    illustrate how to bias physics processes cross-section for
0036 //    one particle type.
0037 //        The G4VBiasingOperation G4BOptnChangeCrossSection is
0038 //    selected by this operator, and is sent to each process
0039 //    calling the operator.
0040 //        A simple constant bias to the cross-section is applied,
0041 //    but more sophisticated changes can be applied.
0042 //
0043 //---------------------------------------------------------------
0044 //
0045 
0046 #ifndef GB05BOptrSplitAndKillByCrossSection_hh
0047 #define GB05BOptrSplitAndKillByCrossSection_hh 1
0048 
0049 #include "G4VBiasingOperator.hh"
0050 class G4BOptnChangeCrossSection;
0051 class G4ParticleDefinition;
0052 class G4VProcess;
0053 class GB05BOptnSplitAndKillByCrossSection;
0054 #include <map>
0055 
0056 class GB05BOptrSplitAndKillByCrossSection : public G4VBiasingOperator
0057 {
0058   public:
0059     // ------------------------------------------------------------
0060     // -- Constructor: takes the name of the particle type to bias:
0061     // ------------------------------------------------------------
0062     GB05BOptrSplitAndKillByCrossSection(G4String particleToBias,
0063                                         G4String name = "SplitAndKillByXS");
0064     ~GB05BOptrSplitAndKillByCrossSection() override;
0065 
0066     // -- method called at beginning of run:
0067     void StartRun() override;
0068 
0069   private:
0070     // -----------------------------
0071     // -- Mandatory from base class:
0072     // -----------------------------
0073     // -- Not used:
0074     G4VBiasingOperation* ProposeOccurenceBiasingOperation(const G4Track*,
0075                                                           const G4BiasingProcessInterface*) final
0076     {
0077       return nullptr;
0078     }
0079 
0080     // -- Not used:
0081     G4VBiasingOperation* ProposeFinalStateBiasingOperation(const G4Track*,
0082                                                            const G4BiasingProcessInterface*) final
0083     {
0084       return nullptr;
0085     }
0086 
0087     // -- Used method : it will return the biasing operation that will split particles
0088     // -- with a probabilty depending on the total absorption cross-section.
0089     G4VBiasingOperation* ProposeNonPhysicsBiasingOperation(const G4Track*,
0090                                                            const G4BiasingProcessInterface*) final;
0091 
0092     // ---------------------------------------
0093     // -- Method specific to this application:
0094     // ---------------------------------------
0095     // -- Each "absorbing" process that the biasing has to counterbalance
0096     // -- its action for has to be passed to the biasing operator
0097   public:
0098     void AddProcessToEquipoise(G4String processName);
0099 
0100   private:
0101     GB05BOptnSplitAndKillByCrossSection* fSplitAndKillByCrossSection;
0102     const G4ParticleDefinition* fParticleToBias;
0103     std::vector<G4String> fProcessesToEquipoise;
0104     G4bool fSetup;
0105     std::vector<const G4VProcess*> fProcesses;
0106 };
0107 
0108 #endif