Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4NeutronHPChannelList.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  // Hadronic Process: Very Low Energy Neutron X-Sections
30  // original by H.P. Wellisch, TRIUMF, 14-Feb-97
31  // Builds and has the Cross-section data for one material.
32 
33 #ifndef G4NeutronHPChannelList_h
34 #define G4NeutronHPChannelList_h 1
35 
36 #include "globals.hh"
37 #include "G4NeutronHPChannel.hh"
38 #include "G4StableIsotopes.hh"
39 
40 class G4Element;
41 class G4HadFinalState;
42 class G4HadProjectile;
44 
46 {
47 
48  public:
49 
51 
53 
54  void Init(G4int n);
55 
57 
58  G4HadFinalState * ApplyYourself(const G4Element * theElement, const G4HadProjectile & aTrack);
59 
60  void Init(G4Element * anElement, const G4String & dirName);
61 
62  void Register(G4NeutronHPFinalState *theFS, const G4String &aName);
63 
64  inline G4double GetXsec(G4double anEnergy)
65  {
66  G4double result=0;
67  G4int i;
68  for(i=0; i<nChannels; i++)
69  {
70  result+=std::max(0., theChannels[i]->GetXsec(anEnergy));
71  }
72  return result;
73  }
74 
75  inline G4int GetNumberOfChannels() { return nChannels; }
76 
78  {
79  G4bool result = false;
80  G4int i;
81  for(i=0; i<nChannels; i++)
82  {
83  if(theChannels[i]->HasDataInAnyFinalState()) result = true;
84  }
85  return result;
86  }
87  inline void RestartRegistration()
88  {
89  allChannelsCreated = true;
90  theInitCount = 0;
91  }
92  private:
93 
94  static G4int trycounter;
95  G4NeutronHPChannel ** theChannels;
96  G4int nChannels;
97  G4String theDir;
98  G4Element * theElement;
99 
100  G4bool allChannelsCreated;
101  G4int theInitCount;
102 
103  G4StableIsotopes theStableOnes;
104 
105  G4HadFinalState unChanged;
106 };
107 
108 #endif