Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4ParticleHPProduct.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 // 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"
47 #include "G4Cache.hh"
49 
51 
53 {
54 
55  struct toBeCached {
60  };
61 
62  public:
64  {
65  theDist = 0;
66  toBeCached val;
67  fCache.Put( val );
68 
69  char * method = getenv( "G4PHP_MULTIPLICITY_METHOD" );
70  if( method ) {
71  if( G4String(method) == "Poisson" ) {
73  } else if( G4String(method) == "BetweenInts" ) {
75  } else {
76  throw G4HadronicException(__FILE__, __LINE__, ("multiplicity method unknown to G4ParticleHPProduct" + G4String(method)).c_str());
77  }
78  } else {
80  }
81  theMassCode = 0.0;
82  theMass = 0.0;
83  theIsomerFlag = 0;
86  theDistLaw = -1;
87  }
89  {
90  if(theDist != 0) delete theDist;
91  }
92 
93  inline void Init(std::istream & aDataFile, G4ParticleDefinition* projectile)
94  {
97  if( getenv("G4PHPTEST") ) G4cout << " G4ParticleHPProduct :: Init MassCode " << theMassCode << " " << theMass << " theActualStateQValue " << theActualStateQValue << G4endl;// GDEB
98  if( getenv("G4PHPTEST") ) G4cout << " G4ParticleHPProduct :: Init theActualStateQValue " << theActualStateQValue << G4endl;// GDEB
100  theActualStateQValue*= CLHEP::eV;
101  theYield.Init(aDataFile, CLHEP::eV);
102  theYield.Hash();
103  if(theDistLaw==0)
104  {
105  // distribution not known, use E-independent, isotropic angular distribution
107  }
108  else if(theDistLaw == 1)
109  {
110  // Continuum energy-angular distribution
111  theDist = new G4ParticleHPContEnergyAngular(projectile);
112  }
113  else if(theDistLaw == 2)
114  {
115  // Discrete 2-body scattering
117  }
118  else if(theDistLaw == 3)
119  {
120  // Isotropic emission
122  }
123  else if(theDistLaw == 4)
124  {
125  // Discrete 2-body recoil modification
126  // not used for now. @@@@
128  // the above is only temporary;
129  // recoils need to be addressed
130  // properly
131  delete theDist;
132  theDist = 0;
133  }
134  // else if(theDistLaw == 5)
135  // {
136  // charged particles only, to be used in a later stage. @@@@
137  // }
138  else if(theDistLaw == 6)
139  {
140  // N-Body phase space
142  }
143  else if(theDistLaw == 7)
144  {
145  // Laboratory angular energy paraetrisation
147  }
148  else
149  {
150  throw G4HadronicException(__FILE__, __LINE__, "distribution law unknown to G4ParticleHPProduct");
151  }
152  if(theDist!=0)
153  {
154  theDist->SetQValue(theActualStateQValue);
155  theDist->Init(aDataFile);
156  }
157  }
158 
159  G4int GetMultiplicity(G4double anEnergy);
160  G4ReactionProductVector * Sample(G4double anEnergy, G4int nParticles);
161 
163  {
164  return theYield.GetY(anEnergy);
165  }
166 
167  void SetProjectileRP(G4ReactionProduct * aIncidentPart)
168  {
169  fCache.Get().theProjectileRP = aIncidentPart;
170  }
171 
172  void SetTarget(G4ReactionProduct * aTarget)
173  {
174  fCache.Get().theTarget = aTarget;
175  }
176 
177  inline G4ReactionProduct * GetTarget() { return fCache.Get().theTarget; }
178 
179  inline G4ReactionProduct * GetProjectileRP() { return fCache.Get().theProjectileRP; }
180 
182  {
184  if(theDist == 0)
185  {
186  result = 0;
187  }
188  else
189  {
191  result *= fCache.Get().theCurrentMultiplicity;
192  }
193  return result;
194  }
195 
197 
198  //TK120515 For migration of frameFlag (MF6 LCT) = 3 in
199  //G4ParticleHPEnAngCorrelation
202 
203  private:
204 
205  // data members
206 
212  G4int theDistLaw; // redundant
215 
216  // Utility quantities
217 
218  //G4ReactionProduct * theTarget;
219  //G4ReactionProduct * theProjectileRP;
220 
221  // cashed values
222 
223  //G4int theCurrentMultiplicity;
225 
227 };
228 
229 #endif
G4int GetMultiplicity(G4double anEnergy)
G4ParticleHPVector theYield
G4ReactionProductVector * Sample(G4double anEnergy, G4int nParticles)
#define G4endl
Definition: G4ios.hh:61
G4VParticleHPEnergyAngular * theDist
G4ReactionProduct * GetProjectileRP()
G4HPMultiMethod theMultiplicityMethod
G4ReactionProduct * GetTarget()
double G4double
Definition: G4Types.hh:76
virtual void Init(std::istream &aDataFile)=0
G4double GetY(G4double x)
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
virtual G4double MeanEnergyOfThisInteraction()=0
void Init(std::istream &aDataFile, G4ParticleDefinition *projectile)
static constexpr double eV
G4HPMultiMethod
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4double G4ParticleHPJENDLHEData::G4double result
int G4int
Definition: G4Types.hh:78
void SetProjectileRP(G4ReactionProduct *aIncidentPart)
void SetTarget(G4ReactionProduct *aTarget)
G4GLOB_DLL std::ostream G4cout
G4double MeanEnergyOfThisInteraction()
G4Cache< toBeCached > fCache
G4double GetMeanYield(G4double anEnergy)