Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4GenericBiasingPhysics.hh
Go to the documentation of this file.
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 // $Id: $
28 //
29 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
30 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
31 
32 #ifndef G4GenericBiasingPhysics_h
33 #define G4GenericBiasingPhysics_h 1
34 
35 #include "G4VPhysicsConstructor.hh"
36 #include "globals.hh"
37 
38 #include <vector>
39 
40 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41 
43 {
44 public:
45 
46  G4GenericBiasingPhysics(const G4String& name = "BiasingP");
47  virtual ~G4GenericBiasingPhysics();
48 
49 public:
50  // ------------------------------
51  // -- Biasing activation methods:
52  // ------------------------------
53  // -- Used to select particles and processes to be under biasing:
54  // ---- Put under biasing all physics processes of given particleName:
55  void PhysicsBias(const G4String& particleName);
56  // ---- Put under biasing processes in processToBiasNames of given particleName:
57  void PhysicsBias(const G4String& particleName, const std::vector< G4String >& processToBiasNames);
58  // ---- Allow for non physics biasing for particle:
59  void NonPhysicsBias(const G4String& particleName);
60  // ---- Put under biasing all physics processes and allow for non physics biasing:
61  void Bias(const G4String& particleName);
62  // ---- Put under biasing processes in processToBiasNames of given particleName:
63  void Bias(const G4String& particleName, const std::vector< G4String >& processToBiasNames);
64 
65  // -- Bias groups of particles:
66  // -- - particles which have been setup by names with above methods are not affected
67  // -- - particles can be specified by PDG range
68  // -- - particles can be specified by the charged ou neutral nature
69  // -- - particles specified by name and PDG range are unaffected
70  // -- Add a PDG range for particle to bias, anti-particles are included by default:
71  void PhysicsBiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
72  void NonPhysicsBiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
73  void BiasAddPDGRange( G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle = true );
74  // -- Will bias all charged particles:
75  void PhysicsBiasAllCharged( G4bool includeShortLived = false );
76  void NonPhysicsBiasAllCharged( G4bool includeShortLived = false );
77  void BiasAllCharged( G4bool includeShortLived = false );
78  // -- Will bias all neutral particles:
79  void PhysicsBiasAllNeutral( G4bool includeShortLived = false );
80  void NonPhysicsBiasAllNeutral( G4bool includeShortLived = false );
81  void BiasAllNeutral( G4bool includeShortLived = false );
82 
83 
84  // -------------------------------------------------------------
85  // -- Activation of parallel geometries used by generic biasing:
86  // -------------------------------------------------------------
87  // -- Each method can be called several times:
88  // -- - on a same particle type :
89  // -- myBiasingPhysics->AddParallelGeometry("neutron", "geometry1");
90  // -- myBiasingPhysics->AddParallelGeometry("neutron", "geometry2");
91  // -- - on a range of PDG particle:
92  // -- myBiasingPhysics->AddParallelGeometry(PDG1, PDG2, "geometryXX");
93  // -- myBiasingPhysics->AddParallelGeometry(PDG3, PDG4, vectorOfGeometries);
94  // -- etc.
95  void AddParallelGeometry( const G4String& particleName, const G4String& parallelGeometryName );
96  void AddParallelGeometry( const G4String& particleName, const std::vector< G4String >& parallelGeometryNames );
97  void AddParallelGeometry( G4int PDGlow, G4int PDGhigh, const G4String& parallelGeometryName , G4bool includeAntiParticle = true );
98  void AddParallelGeometry( G4int PDGlow, G4int PDGhigh, const std::vector< G4String >& parallelGeometryNames, G4bool includeAntiParticle = true );
99  void AddParallelGeometryAllCharged( const G4String& parallelGeometryName , G4bool includeShortLived = false );
100  void AddParallelGeometryAllCharged( const std::vector< G4String >& parallelGeometryNames, G4bool includeShortLived = false );
101  void AddParallelGeometryAllNeutral( const G4String& parallelGeometryName , G4bool includeShortLived = false );
102  void AddParallelGeometryAllNeutral( const std::vector< G4String >& parallelGeometryNames, G4bool includeShortLived = false );
103 
104 
105 
106  // -- Information about biased particles:
107  void BeVerbose() { fVerbose = true; }
108 
109 public:
110 
111  // This method is dummy for physics
112  virtual void ConstructParticle();
113 
114  // This method will be invoked in the Construct() method.
115  // each physics process will be instantiated and
116  // registered to the process manager of each particle type
117  virtual void ConstructProcess();
118 
119 private:
120 
121  // hide assignment operator
122  G4GenericBiasingPhysics & operator=(const G4GenericBiasingPhysics &right);
124 
125  // -- Particles under biasing:
126  std::vector< G4String > fBiasedParticles;
127  std::vector< G4bool > fBiasAllProcesses;
128  // -- Related biased processes:
129  std::vector< std::vector< G4String > > fBiasedProcesses;
130  // -- non physics biased particles:
131  std::vector< G4String > fNonPhysBiasedParticles;
132 
133  // -- Group of particles under biasing:
134  std::vector< G4int > fPhysBiasByPDGRangeLow, fPhysBiasByPDGRangeHigh;
135  std::vector< G4int > fNonPhysBiasByPDGRangeLow, fNonPhysBiasByPDGRangeHigh;
136  G4bool fPhysBiasAllCharged, fNonPhysBiasAllCharged;
137  G4bool fPhysBiasAllChargedISL, fNonPhysBiasAllChargedISL;
138  G4bool fPhysBiasAllNeutral, fNonPhysBiasAllNeutral;
139  G4bool fPhysBiasAllNeutralISL, fNonPhysBiasAllNeutralISL;
140 
141 
142  // -- Particles associated with parallel geometries:
143  std::vector< G4String > fParticlesWithParallelGeometries;
144  std::map< G4String, std::vector< G4String > > fParallelGeometriesForParticle;
145  std::vector< G4int > fPDGlowParallelGeometries, fPDGhighParallelGeometries;
146  std::map< G4int, std::vector< G4String > > fPDGrangeParallelGeometries;
147  std::vector< G4String > fParallelGeometriesForCharged, fParallelGeometriesForNeutral;
148  std::vector< G4bool > fAllChargedParallelGeometriesISL, fAllNeutralParallelGeometriesISL;
149 
150 
151  void AssociateParallelGeometries();
152 
153 
154  // -- Report:
155  G4bool fVerbose;
156 
157 
158 
159 };
160 
161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
162 
163 #endif
const XML_Char * name
Definition: expat.h:151
void BiasAllCharged(G4bool includeShortLived=false)
void PhysicsBiasAllNeutral(G4bool includeShortLived=false)
void NonPhysicsBiasAllCharged(G4bool includeShortLived=false)
void PhysicsBias(const G4String &particleName)
void AddParallelGeometry(const G4String &particleName, const G4String &parallelGeometryName)
int G4int
Definition: G4Types.hh:78
void NonPhysicsBiasAddPDGRange(G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle=true)
void PhysicsBiasAllCharged(G4bool includeShortLived=false)
G4GenericBiasingPhysics(const G4String &name="BiasingP")
bool G4bool
Definition: G4Types.hh:79
void PhysicsBiasAddPDGRange(G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle=true)
void AddParallelGeometryAllCharged(const G4String &parallelGeometryName, G4bool includeShortLived=false)
void BiasAddPDGRange(G4int PDGlow, G4int PDGhigh, G4bool includeAntiParticle=true)
void NonPhysicsBiasAllNeutral(G4bool includeShortLived=false)
void BiasAllNeutral(G4bool includeShortLived=false)
void NonPhysicsBias(const G4String &particleName)
void AddParallelGeometryAllNeutral(const G4String &parallelGeometryName, G4bool includeShortLived=false)
void Bias(const G4String &particleName)