Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:20

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 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0029 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0030 
0031 #ifndef G4GenericBiasingPhysics_h
0032 #define G4GenericBiasingPhysics_h 1
0033 
0034 #include "G4VPhysicsConstructor.hh"
0035 #include "globals.hh"
0036 
0037 #include <vector>
0038 
0039 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0040 
0041 class G4GenericBiasingPhysics : public G4VPhysicsConstructor
0042 {
0043 public:
0044   
0045   G4GenericBiasingPhysics(const G4String& name = "BiasingP");
0046   virtual ~G4GenericBiasingPhysics();
0047 
0048 public:
0049   // ------------------------------
0050   // -- Biasing activation methods:
0051   // ------------------------------
0052   // -- Used to select particles and processes to be under biasing:
0053   // ---- Put under biasing all physics processes of given particleName:
0054   void PhysicsBias(const G4String& particleName);
0055   // ---- Put under biasing processes in processToBiasNames of given particleName:
0056   void PhysicsBias(const G4String& particleName, const std::vector< G4String >& processToBiasNames);
0057   // ---- Allow for non physics biasing for particle:
0058   void NonPhysicsBias(const G4String& particleName);
0059   // ---- Put under biasing all physics processes and allow for non physics biasing:
0060   void Bias(const G4String& particleName);
0061   // ---- Put under biasing processes in processToBiasNames of given particleName:
0062   void Bias(const G4String& particleName, const std::vector< G4String >& processToBiasNames);
0063 
0064   // -- Bias groups of particles:
0065   // --  - particles which have been setup by names with above methods are not affected
0066   // --  - particles can be specified by PDG range
0067   // --  - particles can be specified by the charged ou neutral nature
0068   // --     - particles specified by name and PDG range are unaffected
0069   // -- Add a PDG range for particle to bias, anti-particles are included by default:
0070   void    PhysicsBiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
0071   void NonPhysicsBiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
0072   void           BiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
0073   // -- Will bias all charged particles:
0074   void    PhysicsBiasAllCharged( G4bool includeShortLived = false );
0075   void NonPhysicsBiasAllCharged( G4bool includeShortLived = false );
0076   void           BiasAllCharged( G4bool includeShortLived = false );
0077   // -- Will bias all neutral particles:
0078   void    PhysicsBiasAllNeutral( G4bool includeShortLived = false );
0079   void NonPhysicsBiasAllNeutral( G4bool includeShortLived = false );
0080   void           BiasAllNeutral( G4bool includeShortLived = false );
0081 
0082   
0083   // -------------------------------------------------------------
0084   // -- Activation of parallel geometries used by generic biasing:
0085   // -------------------------------------------------------------
0086   // -- Each method can be called several times:
0087   // --    - on a same particle type :
0088   // --        myBiasingPhysics->AddParallelGeometry("neutron", "geometry1");
0089   // --        myBiasingPhysics->AddParallelGeometry("neutron", "geometry2");
0090   // --    - on a range of PDG particle:
0091   // --        myBiasingPhysics->AddParallelGeometry(PDG1, PDG2, "geometryXX");
0092   // --        myBiasingPhysics->AddParallelGeometry(PDG3, PDG4, vectorOfGeometries);
0093   // -- etc.
0094   void AddParallelGeometry( const G4String& particleName, const G4String&                parallelGeometryName  );
0095   void AddParallelGeometry( const G4String& particleName, const std::vector< G4String >& parallelGeometryNames );
0096   void AddParallelGeometry( G4int PDGlow, G4int PDGhigh,  const G4String&                parallelGeometryName , G4bool includeAntiParticle = true );
0097   void AddParallelGeometry( G4int PDGlow, G4int PDGhigh,  const std::vector< G4String >& parallelGeometryNames, G4bool includeAntiParticle = true );
0098   void AddParallelGeometryAllCharged(                     const G4String&                parallelGeometryName , G4bool includeShortLived = false );
0099   void AddParallelGeometryAllCharged(                     const std::vector< G4String >& parallelGeometryNames, G4bool includeShortLived = false );
0100   void AddParallelGeometryAllNeutral(                     const G4String&                parallelGeometryName , G4bool includeShortLived = false );
0101   void AddParallelGeometryAllNeutral(                     const std::vector< G4String >& parallelGeometryNames, G4bool includeShortLived = false );
0102   
0103 
0104 
0105   // -- Information about biased particles:
0106   void BeVerbose() { fVerbose = true; }
0107   
0108 public:
0109   
0110   // This method is dummy for physics
0111   virtual void ConstructParticle();
0112   
0113   // This method will be invoked in the Construct() method.
0114   // each physics process will be instantiated and
0115   // registered to the process manager of each particle type
0116   virtual void ConstructProcess();
0117   
0118 private:
0119   
0120   // hide assignment operator
0121   G4GenericBiasingPhysics & operator=(const G4GenericBiasingPhysics &right);
0122   G4GenericBiasingPhysics(const G4GenericBiasingPhysics&);
0123 
0124   // -- Particles under biasing:
0125   std::vector< G4String >  fBiasedParticles;
0126   std::vector< G4bool >   fBiasAllProcesses;
0127   // -- Related biased processes:
0128   std::vector< std::vector< G4String > > fBiasedProcesses;
0129   // -- non physics biased particles:
0130   std::vector< G4String > fNonPhysBiasedParticles;
0131 
0132   // -- Group of particles under biasing:
0133   std::vector< G4int >    fPhysBiasByPDGRangeLow,    fPhysBiasByPDGRangeHigh;
0134   std::vector< G4int > fNonPhysBiasByPDGRangeLow, fNonPhysBiasByPDGRangeHigh;
0135   G4bool fPhysBiasAllCharged, fNonPhysBiasAllCharged;
0136   G4bool fPhysBiasAllChargedISL, fNonPhysBiasAllChargedISL;
0137   G4bool fPhysBiasAllNeutral,    fNonPhysBiasAllNeutral;
0138   G4bool fPhysBiasAllNeutralISL, fNonPhysBiasAllNeutralISL;
0139 
0140   
0141   // -- Particles associated with parallel geometries:
0142   std::vector< G4String >                       fParticlesWithParallelGeometries;
0143   std::map< G4String, std::vector< G4String > > fParallelGeometriesForParticle;
0144   std::vector< G4int >                          fPDGlowParallelGeometries, fPDGhighParallelGeometries;
0145   std::map< G4int,    std::vector< G4String > > fPDGrangeParallelGeometries;
0146   std::vector< G4String >                       fParallelGeometriesForCharged,    fParallelGeometriesForNeutral;
0147   std::vector< G4bool >                         fAllChargedParallelGeometriesISL, fAllNeutralParallelGeometriesISL;
0148 
0149   
0150   void AssociateParallelGeometries();
0151 
0152   
0153   // -- Report:
0154   G4bool fVerbose;
0155 
0156 
0157   
0158 };
0159 
0160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
0161 
0162 #endif