Geant4  10.01.p02
G4ParticleHPProduct.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 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
28 //
29 #ifndef G4ParticleHPProduct_h
30 #define G4ParticleHPProduct_h 1
31 
32 #include "G4HadronicException.hh"
33 #include "globals.hh"
34 #include "G4ParticleHPVector.hh"
35 #include "Randomize.hh"
36 #include "G4ios.hh"
37 #include <fstream>
38 #include "globals.hh"
41 
44 #include "G4ParticleHPIsotropic.hh"
48 
50 
52 {
53  public:
55  {
56  theDist = 0;
57  char * method = getenv( "G4PHP_MULTIPLICITY_METHOD" );
58  if( method ) {
59  if( G4String(method) == "Poisson" ) {
61  } else if( G4String(method) == "BetweenInts" ) {
63  } else {
64  throw G4HadronicException(__FILE__, __LINE__, ("multiplicity method unknown to G4ParticleHPProduct" + G4String(method)).c_str());
65  }
66  } else {
68  }
69  }
71  {
72  if(theDist != 0) delete theDist;
73  }
74 
75  inline void Init(std::istream & aDataFile, G4ParticleDefinition* projectile)
76  {
79  if( getenv("G4PHPTEST") ) G4cout << " G4ParticleHPProduct :: Init MassCode " << theMassCode << " " << theMass << " theActualStateQValue " << theActualStateQValue << G4endl;// GDEB
80  if( getenv("G4PHPTEST") ) G4cout << " G4ParticleHPProduct :: Init theActualStateQValue " << theActualStateQValue << G4endl;// GDEB
82  theActualStateQValue*= CLHEP::eV;
83  theYield.Init(aDataFile, CLHEP::eV);
84  if(theDistLaw==0)
85  {
86  // distribution not known, use E-independent, isotropic angular distribution
88  }
89  else if(theDistLaw == 1)
90  {
91  // Continuum energy-angular distribution
92  theDist = new G4ParticleHPContEnergyAngular(projectile);
93  }
94  else if(theDistLaw == 2)
95  {
96  // Discrete 2-body scattering
98  }
99  else if(theDistLaw == 3)
100  {
101  // Isotropic emission
103  }
104  else if(theDistLaw == 4)
105  {
106  // Discrete 2-body recoil modification
107  // not used for now. @@@@
109  // the above is only temporary;
110  // recoils need to be addressed
111  // properly
112  delete theDist;
113  theDist = 0;
114  }
115  // else if(theDistLaw == 5)
116  // {
117  // charged particles only, to be used in a later stage. @@@@
118  // }
119  else if(theDistLaw == 6)
120  {
121  // N-Body phase space
123  }
124  else if(theDistLaw == 7)
125  {
126  // Laboratory angular energy paraetrisation
128  }
129  else
130  {
131  throw G4HadronicException(__FILE__, __LINE__, "distribution law unknown to G4ParticleHPProduct");
132  }
133  if(theDist!=0)
134  {
135  theDist->SetQValue(theActualStateQValue);
136  theDist->Init(aDataFile);
137  }
138  }
139 
140  G4int GetMultiplicity(G4double anEnergy);
141  G4ReactionProductVector * Sample(G4double anEnergy, G4int nParticles);
142 
144  {
145  return theYield.GetY(anEnergy);
146  }
147 
148  void SetProjectileRP(G4ReactionProduct * aIncidentPart)
149  {
150  theProjectileRP = aIncidentPart;
151  }
152 
153  void SetTarget(G4ReactionProduct * aTarget)
154  {
155  theTarget = aTarget;
156  }
157 
158  inline G4ReactionProduct * GetTarget() { return theTarget; }
159 
161 
163  {
164  G4double result;
165  if(theDist == 0)
166  {
167  result = 0;
168  }
169  else
170  {
172  result *= theCurrentMultiplicity;
173  }
174  return result;
175  }
176 
178 
179  //TK120515 For migration of frameFlag (MF6 LCT) = 3 in
180  //G4ParticleHPEnAngCorrelation
183 
184  private:
185 
186  // data members
187 
193  G4int theDistLaw; // redundant
196 
197  // Utility quantities
198 
201 
202  // cashed values
203 
205 
207 };
208 
209 #endif
void Init(std::istream &aDataFile, G4ParticleDefinition *projectile)
virtual void Init(std::istream &aDataFile)=0
G4ReactionProduct * GetTarget()
G4VParticleHPEnergyAngular * theDist
G4HPMultiMethod theMultiplicityMethod
void SetProjectileRP(G4ReactionProduct *aIncidentPart)
G4ReactionProduct * theProjectileRP
G4double MeanEnergyOfThisInteraction()
int G4int
Definition: G4Types.hh:78
G4ReactionProduct * theTarget
std::vector< G4ReactionProduct * > G4ReactionProductVector
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
G4GLOB_DLL std::ostream G4cout
G4ParticleHPVector theYield
G4double GetY(G4double x)
static const double eV
Definition: G4SIunits.hh:194
G4int GetMultiplicity(G4double anEnergy)
virtual G4double MeanEnergyOfThisInteraction()=0
G4ReactionProductVector * Sample(G4double anEnergy, G4int nParticles)
G4ReactionProduct * GetProjectileRP()
G4HPMultiMethod
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetTarget(G4ReactionProduct *aTarget)
G4double GetMeanYield(G4double anEnergy)