Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:46

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 GB06/include/GB06BOptrSplitAndKillByImportance.hh
0027 /// \brief Definition of the GB06BOptrSplitAndKillByImportance class
0028 //
0029 //---------------------------------------------------------------
0030 //
0031 // GB06BOptrSplitAndKillByImportance
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 G4BOptnChangeImportance 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 GB06BOptrSplitAndKillByImportance_hh
0047 #define GB06BOptrSplitAndKillByImportance_hh 1
0048 
0049 #include "G4VBiasingOperator.hh"
0050 
0051 class GB06BOptnSplitAndKillByImportance;
0052 class G4BiasingProcessSharedData;
0053 class G4ParallelGeometriesLimiterProcess;
0054 class G4ParticleDefinition;
0055 class G4VPhysicalVolume;
0056 #include <map>
0057 
0058 class GB06BOptrSplitAndKillByImportance : public G4VBiasingOperator
0059 {
0060   public:
0061     // ------------------------------------------------------------
0062     // -- Constructor: takes the name of the particle type to bias:
0063     // ------------------------------------------------------------
0064     GB06BOptrSplitAndKillByImportance(G4String particleToBias,
0065                                       G4String name = "SplitAndKillByImportance");
0066     virtual ~GB06BOptrSplitAndKillByImportance();
0067 
0068     // -- method called at beginning of run:
0069     virtual void StartRun();
0070 
0071   private:
0072     // -----------------------------
0073     // -- Mandatory from base class:
0074     // -----------------------------
0075     // -- Not used:
0076     virtual G4VBiasingOperation*
0077     ProposeOccurenceBiasingOperation(const G4Track*, const G4BiasingProcessInterface*) final
0078     {
0079       return 0;
0080     }
0081 
0082     // -- Not used:
0083     virtual G4VBiasingOperation*
0084     ProposeFinalStateBiasingOperation(const G4Track*, const G4BiasingProcessInterface*) final
0085     {
0086       return 0;
0087     }
0088 
0089     // -- Used method : it will return the biasing operation that will split particles
0090     // -- with a probabilty depending on the total absorption cross-section.
0091     virtual G4VBiasingOperation*
0092     ProposeNonPhysicsBiasingOperation(const G4Track*, const G4BiasingProcessInterface*) final;
0093 
0094     // ---------------------------------------
0095     // -- Method specific to this application:
0096     // ---------------------------------------
0097   public:
0098     void SetParallelWorld(G4VPhysicalVolume* parallelWorld) { fParallelWorld = parallelWorld; }
0099 
0100     // -- The importance map, linking a replica number to an volume importance:
0101     std::map<G4int, G4int>& GetImportanceMap() { return fImportanceMap; }
0102 
0103   private:
0104     GB06BOptnSplitAndKillByImportance* fSplitAndKillByImportance;
0105     const G4ParticleDefinition* fParticleToBias;
0106     G4VPhysicalVolume* fParallelWorld;
0107     G4int fParallelWorldIndex;
0108     const G4BiasingProcessSharedData* fBiasingSharedData;
0109     const G4ParallelGeometriesLimiterProcess* fBiasingLimiterProcess;
0110     std::map<G4int, G4int> fImportanceMap;
0111 };
0112 
0113 #endif