Geant4  10.01.p01
G4ParticleHPChannel.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 //
28  // Hadronic Process: Very Low Energy Neutron X-Sections
29  // original by H.P. Wellisch, TRIUMF, 14-Feb-97
30  // Builds and has the Cross-section data for one element and channel.
31 //
32 // Bug fixes and workarounds in the destructor, F.W.Jones 06-Jul-1999
33 // 070612 Fix memory leaking by T. Koi
34 //
35 // 080520 Delete unnecessary dependencies by T. Koi
36 
37 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
38 //
39 #ifndef G4ParticleHPChannel_h
40 #define G4ParticleHPChannel_h 1
41 #include "globals.hh"
42 #include "G4ParticleHPIsoData.hh"
43 #include "G4ParticleHPVector.hh"
44 #include "G4Material.hh"
45 #include "G4HadProjectile.hh"
46 //#include "G4NeutronInelasticProcess.hh"
47 //#include "G4HadronFissionProcess.hh"
48 //#include "G4HadronElasticProcess.hh"
49 //#include "G4HadronCaptureProcess.hh"
50 #include "G4StableIsotopes.hh"
51 #include "G4ParticleHPCaptureFS.hh"
53 #include "G4Element.hh"
56 
58 {
59 public:
60 
62  : wendtFissionGenerator(getenv("G4NEUTRON_HP_USE_WENDT_FISSION_MODEL") == NULL ? NULL : G4WendtFissionFragmentGenerator::GetInstance())
63  {
64  theProjectile = const_cast<G4ParticleDefinition*>(projectile);
66  theBuffer = 0;
68  theFinalStates = 0;
69  active = 0;
70  registerCount = -1;
71  }
72 
74  : wendtFissionGenerator(getenv("G4NEUTRON_HP_USE_WENDT_FISSION_MODEL") == NULL ? NULL : G4WendtFissionFragmentGenerator::GetInstance())
75  {
78  theBuffer = 0;
80  theFinalStates = 0;
81  active = 0;
82  registerCount = -1;
83  }
84 
86  {
87  delete theChannelData;
88  // Following statement disabled to avoid SEGV
89  // theBuffer is also deleted as "theChannelData" in
90  // ~G4ParticleHPIsoData. FWJ 06-Jul-1999
91  //if(theBuffer != 0) delete theBuffer;
92  if(theIsotopeWiseData != 0) delete [] theIsotopeWiseData;
93  // Deletion of FinalStates disabled to avoid endless looping
94  // in the destructor heirarchy. FWJ 06-Jul-1999
95  //if(theFinalStates != 0)
96  //{
97  // for(i=0; i<niso; i++)
98  // {
99  // delete theFinalStates[i];
100  // }
101  // delete [] theFinalStates;
102  //}
103  // FWJ experiment
104  //if(active!=0) delete [] active;
105 // T.K.
106  if ( theFinalStates != 0 )
107  {
108  for ( G4int i = 0 ; i < niso ; i++ )
109  {
110  delete theFinalStates[i];
111  }
112  delete [] theFinalStates;
113  }
114  if ( active != 0 ) delete [] active;
115 
116  }
117 
119 
121 
123 
124  inline G4bool IsActive(G4int isoNumber) { return active[isoNumber]; }
125 
126  inline G4bool HasFSData(G4int isoNumber) { return theFinalStates[isoNumber]->HasFSData(); }
127 
128  inline G4bool HasAnyData(G4int isoNumber) { return theFinalStates[isoNumber]->HasAnyData(); }
129 
131 
132  void Init(G4Element * theElement, const G4String dirName);
133 
134  void Init(G4Element * theElement, const G4String dirName, const G4String fsType);
135 
136  //void UpdateData(G4int A, G4int Z, G4int index, G4double abundance);
137  void UpdateData(G4int A, G4int Z, G4int index, G4double abundance, G4ParticleDefinition* projectile) { G4int M = 0; UpdateData( A, Z, M, index, abundance, projectile); };
138  void UpdateData(G4int A, G4int Z, G4int M, G4int index, G4double abundance, G4ParticleDefinition* projectile);
139 
140  void Harmonise(G4ParticleHPVector *& theStore, G4ParticleHPVector * theNew);
141 
142  G4HadFinalState * ApplyYourself(const G4HadProjectile & theTrack, G4int isoNumber=-1);
143 
144  inline G4int GetNiso() {return niso;}
145 
146  inline G4double GetN(G4int i) {return theFinalStates[i]->GetN();}
147  inline G4double GetZ(G4int i) {return theFinalStates[i]->GetZ();}
148  inline G4double GetM(G4int i) {return theFinalStates[i]->GetM();}
149 
151  {
152  G4bool result = false;
153  G4int i;
154  for(i=0; i<niso; i++)
155  {
156  if(theFinalStates[i]->HasAnyData()) result = true;
157  }
158  return result;
159  }
160 
161  void DumpInfo();
162 
163  G4String GetFSType() const {
164  return theFSType;
165  }
166 
168  return theFinalStates;
169  }
170 
171 private:
173 
174  G4ParticleHPVector * theChannelData; // total (element) cross-section for this channel
176 
177  G4ParticleHPIsoData * theIsotopeWiseData; // these are the isotope-wise cross-sections for each final state.
178  G4ParticleHPFinalState ** theFinalStates; // also these are isotope-wise pionters, parallel to the above.
181 
183 
187 
189 
191 
192 };
193 
194 #endif
void UpdateData(G4int A, G4int Z, G4int index, G4double abundance, G4ParticleDefinition *projectile)
G4double GetM(G4int i)
G4ParticleHPFinalState ** theFinalStates
G4double GetN(G4int i)
int G4int
Definition: G4Types.hh:78
G4bool Register(G4ParticleHPFinalState *theFS)
G4ParticleHPFinalState ** GetFinalStates() const
G4ParticleHPIsoData * theIsotopeWiseData
G4String GetFSType() const
void Harmonise(G4ParticleHPVector *&theStore, G4ParticleHPVector *theNew)
bool G4bool
Definition: G4Types.hh:79
G4double GetZ(G4int i)
void Init(G4Element *theElement, const G4String dirName)
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4StableIsotopes theStableOnes
static const G4double A[nN]
G4ParticleDefinition * theProjectile
G4bool IsActive(G4int isoNumber)
G4bool HasAnyData(G4int isoNumber)
G4ParticleHPChannel(G4ParticleDefinition *projectile)
G4ParticleHPVector * theChannelData
G4double GetFSCrossSection(G4double energy, G4int isoNumber)
G4double energy(const ThreeVector &p, const G4double m)
G4ParticleHPVector * theBuffer
G4double GetWeightedXsec(G4double energy, G4int isoNumber)
G4bool HasFSData(G4int isoNumber)
std::map< G4String, G4AttDef > * GetInstance(const G4String &storeKey, G4bool &isNew)
double G4double
Definition: G4Types.hh:76
G4WendtFissionFragmentGenerator *const wendtFissionGenerator
G4double GetXsec(G4double energy)
G4HadFinalState * ApplyYourself(const G4HadProjectile &theTrack, G4int isoNumber=-1)