ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4GenericBiasingPhysics.hh
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file G4GenericBiasingPhysics.hh
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 //
28 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 
31 #ifndef G4GenericBiasingPhysics_h
32 #define G4GenericBiasingPhysics_h 1
33 
34 #include "G4VPhysicsConstructor.hh"
35 #include "globals.hh"
36 
37 #include <vector>
38 
39 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
40 
42 {
43 public:
44 
45  G4GenericBiasingPhysics(const G4String& name = "BiasingP");
46  virtual ~G4GenericBiasingPhysics();
47 
48 public:
49  // ------------------------------
50  // -- Biasing activation methods:
51  // ------------------------------
52  // -- Used to select particles and processes to be under biasing:
53  // ---- Put under biasing all physics processes of given particleName:
54  void PhysicsBias(const G4String& particleName);
55  // ---- Put under biasing processes in processToBiasNames of given particleName:
56  void PhysicsBias(const G4String& particleName, const std::vector< G4String >& processToBiasNames);
57  // ---- Allow for non physics biasing for particle:
58  void NonPhysicsBias(const G4String& particleName);
59  // ---- Put under biasing all physics processes and allow for non physics biasing:
60  void Bias(const G4String& particleName);
61  // ---- Put under biasing processes in processToBiasNames of given particleName:
62  void Bias(const G4String& particleName, const std::vector< G4String >& processToBiasNames);
63 
64  // -- Bias groups of particles:
65  // -- - particles which have been setup by names with above methods are not affected
66  // -- - particles can be specified by PDG range
67  // -- - particles can be specified by the charged ou neutral nature
68  // -- - particles specified by name and PDG range are unaffected
69  // -- Add a PDG range for particle to bias, anti-particles are included by default:
70  void PhysicsBiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
71  void NonPhysicsBiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
72  void BiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
73  // -- Will bias all charged particles:
74  void PhysicsBiasAllCharged( G4bool includeShortLived = false );
75  void NonPhysicsBiasAllCharged( G4bool includeShortLived = false );
76  void BiasAllCharged( G4bool includeShortLived = false );
77  // -- Will bias all neutral particles:
78  void PhysicsBiasAllNeutral( G4bool includeShortLived = false );
79  void NonPhysicsBiasAllNeutral( G4bool includeShortLived = false );
80  void BiasAllNeutral( G4bool includeShortLived = false );
81 
82 
83  // -------------------------------------------------------------
84  // -- Activation of parallel geometries used by generic biasing:
85  // -------------------------------------------------------------
86  // -- Each method can be called several times:
87  // -- - on a same particle type :
88  // -- myBiasingPhysics->AddParallelGeometry("neutron", "geometry1");
89  // -- myBiasingPhysics->AddParallelGeometry("neutron", "geometry2");
90  // -- - on a range of PDG particle:
91  // -- myBiasingPhysics->AddParallelGeometry(PDG1, PDG2, "geometryXX");
92  // -- myBiasingPhysics->AddParallelGeometry(PDG3, PDG4, vectorOfGeometries);
93  // -- etc.
94  void AddParallelGeometry( const G4String& particleName, const G4String& parallelGeometryName );
95  void AddParallelGeometry( const G4String& particleName, const std::vector< G4String >& parallelGeometryNames );
96  void AddParallelGeometry( G4int PDGlow, G4int PDGhigh, const G4String& parallelGeometryName , G4bool includeAntiParticle = true );
97  void AddParallelGeometry( G4int PDGlow, G4int PDGhigh, const std::vector< G4String >& parallelGeometryNames, G4bool includeAntiParticle = true );
98  void AddParallelGeometryAllCharged( const G4String& parallelGeometryName , G4bool includeShortLived = false );
99  void AddParallelGeometryAllCharged( const std::vector< G4String >& parallelGeometryNames, G4bool includeShortLived = false );
100  void AddParallelGeometryAllNeutral( const G4String& parallelGeometryName , G4bool includeShortLived = false );
101  void AddParallelGeometryAllNeutral( const std::vector< G4String >& parallelGeometryNames, G4bool includeShortLived = false );
102 
103 
104 
105  // -- Information about biased particles:
106  void BeVerbose() { fVerbose = true; }
107 
108 public:
109 
110  // This method is dummy for physics
111  virtual void ConstructParticle();
112 
113  // This method will be invoked in the Construct() method.
114  // each physics process will be instantiated and
115  // registered to the process manager of each particle type
116  virtual void ConstructProcess();
117 
118 private:
119 
120  // hide assignment operator
123 
124  // -- Particles under biasing:
125  std::vector< G4String > fBiasedParticles;
126  std::vector< G4bool > fBiasAllProcesses;
127  // -- Related biased processes:
128  std::vector< std::vector< G4String > > fBiasedProcesses;
129  // -- non physics biased particles:
130  std::vector< G4String > fNonPhysBiasedParticles;
131 
132  // -- Group of particles under biasing:
139 
140 
141  // -- Particles associated with parallel geometries:
142  std::vector< G4String > fParticlesWithParallelGeometries;
143  std::map< G4String, std::vector< G4String > > fParallelGeometriesForParticle;
145  std::map< G4int, std::vector< G4String > > fPDGrangeParallelGeometries;
148 
149 
151 
152 
153  // -- Report:
155 
156 
157 
158 };
159 
160 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
161 
162 #endif