source: trunk/source/processes/hadronic/models/neutron_hp/include/G4NeutronHPChannel.hh @ 846

Last change on this file since 846 was 819, checked in by garnier, 16 years ago

import all except CVS

File size: 5.3 KB
Line 
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: G4NeutronHPChannel.hh,v 1.14 2007/06/14 17:17:30 tkoi Exp $
28// GEANT4 tag $Name:  $
29//
30 // Hadronic Process: Very Low Energy Neutron X-Sections
31 // original by H.P. Wellisch, TRIUMF, 14-Feb-97
32 // Builds and has the Cross-section data for one element and channel.
33//
34// Bug fixes and workarounds in the destructor, F.W.Jones 06-Jul-1999
35// 070612 Fix memory leaking by T. Koi
36 
37#ifndef G4NeutronHPChannel_h
38#define G4NeutronHPChannel_h 1
39#include "globals.hh"
40#include "G4NeutronHPIsoData.hh"
41#include "G4NeutronHPVector.hh"
42#include "G4Material.hh"
43#include "G4HadProjectile.hh"
44#include "G4NeutronInelasticProcess.hh"
45#include "G4HadronFissionProcess.hh"
46#include "G4HadronElasticProcess.hh"
47#include "G4HadronCaptureProcess.hh"
48#include "G4StableIsotopes.hh"
49#include "G4NeutronHPCaptureFS.hh"
50#include "G4NeutronHPFinalState.hh"
51#include "G4Element.hh"
52
53class G4NeutronHPChannel
54{
55public:
56
57  G4NeutronHPChannel()
58  {
59    theChannelData = new G4NeutronHPVector; 
60    theBuffer = 0;
61    theIsotopeWiseData = 0;
62    theFinalStates = 0;
63    active = 0;
64    registerCount = -1;
65  }
66 
67  ~G4NeutronHPChannel()
68  {
69    delete theChannelData; 
70    // Following statement disabled to avoid SEGV
71    // theBuffer is also deleted as "theChannelData" in
72    // ~G4NeutronHPIsoData.  FWJ 06-Jul-1999
73    //if(theBuffer != 0) delete theBuffer;
74    if(theIsotopeWiseData != 0) delete [] theIsotopeWiseData;
75    // Deletion of FinalStates disabled to avoid endless looping
76    // in the destructor heirarchy.  FWJ 06-Jul-1999
77    //if(theFinalStates != 0)
78    //{
79    //  for(i=0; i<niso; i++)
80    //  {
81    //    delete theFinalStates[i];
82    //  }
83    //  delete [] theFinalStates;
84    //}
85    // FWJ experiment
86    //if(active!=0) delete [] active;
87// T.K.
88   if ( theFinalStates != 0 )
89   {
90      for ( G4int i = 0 ; i < niso ; i++ )
91      {
92         delete theFinalStates[i];
93      }
94      delete [] theFinalStates;
95   }
96   if ( active != 0 ) delete [] active;
97   
98  }
99 
100  G4double GetXsec(G4double energy);
101 
102  G4double GetWeightedXsec(G4double energy, G4int isoNumber);
103 
104  G4double GetFSCrossSection(G4double energy, G4int isoNumber);
105 
106  inline G4bool IsActive(G4int isoNumber) { return active[isoNumber]; }
107 
108  inline G4bool HasFSData(G4int isoNumber) { return theFinalStates[isoNumber]->HasFSData(); }
109 
110  inline G4bool HasAnyData(G4int isoNumber) { return theFinalStates[isoNumber]->HasAnyData(); }
111 
112  G4bool Register(G4NeutronHPFinalState *theFS);
113 
114  void Init(G4Element * theElement, const G4String dirName); 
115
116  void Init(G4Element * theElement, const G4String dirName, const G4String fsType); 
117 
118  void UpdateData(G4int A, G4int Z, G4int index, G4double abundance);
119 
120  void Harmonise(G4NeutronHPVector *& theStore, G4NeutronHPVector * theNew);
121
122  G4HadFinalState * ApplyYourself(const G4HadProjectile & theTrack, G4int isoNumber=-1);
123   
124  inline G4int GetNiso() {return niso;}
125 
126  inline G4double GetN(G4int i) {return theFinalStates[i]->GetN();}
127  inline G4double GetZ(G4int i) {return theFinalStates[i]->GetZ();}
128 
129  inline G4bool HasDataInAnyFinalState()
130  {
131    G4bool result = false;
132    G4int i;
133    for(i=0; i<niso; i++)
134    {
135      if(theFinalStates[i]->HasAnyData()) result = true;
136    }
137    return result;
138  }
139 
140private:
141  G4NeutronHPVector * theChannelData;  // total (element) cross-section for this channel
142  G4NeutronHPVector * theBuffer;
143 
144  G4NeutronHPIsoData * theIsotopeWiseData; // these are the isotope-wise cross-sections for each final state.
145  G4NeutronHPFinalState ** theFinalStates; // also these are isotope-wise pionters, parallel to the above.
146  G4bool * active;
147  G4int niso;
148
149  G4StableIsotopes theStableOnes;
150 
151  G4String theDir;
152  G4String theFSType;
153  G4Element * theElement;
154 
155  G4int registerCount;
156   
157};
158
159#endif
Note: See TracBrowser for help on using the repository browser.