Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4NeutronHPEnAngCorrelation.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 #ifndef G4NeutronHPEnAngCorrelation_h
29 #define G4NeutronHPEnAngCorrelation_h 1
30 
31 #include "globals.hh"
32 #include "G4NeutronHPVector.hh"
33 #include "Randomize.hh"
34 #include "G4ios.hh"
35 #include <fstream>
36 #include "globals.hh"
37 #include "G4NeutronHPProduct.hh"
38 #include "G4ReactionProduct.hh"
39 
41 {
42  public:
44  {
45  theProducts = 0;
46  inCharge = false;
47  theTotalMeanEnergy = -1.;
48  }
50  {
51  if(theProducts!=0) delete [] theProducts;
52  }
53 
54  inline void Init(std::istream & aDataFile)
55  {
56  inCharge = true;
57  aDataFile>>targetMass>>frameFlag>>nProducts;
58  theProducts = new G4NeutronHPProduct[nProducts];
59  for(G4int i=0; i<nProducts; i++)
60  {
61  theProducts[i].Init(aDataFile);
62  }
63  }
64 
66 
68 
69  inline void SetTarget(G4ReactionProduct & aTarget)
70  {
71  theTarget = aTarget;
72  for(G4int i=0;i<nProducts;i++)theProducts[i].SetTarget(&theTarget);
73  }
74 
75  inline void SetNeutron(G4ReactionProduct & aNeutron)
76  {
77  theNeutron = aNeutron;
78  for(G4int i=0;i<nProducts;i++)theProducts[i].SetNeutron(&theNeutron);
79  }
80 
81  inline G4bool InCharge()
82  {
83  return inCharge;
84  }
85 
86  inline G4double GetTargetMass() { return targetMass; }
87 
89  {
90  // cashed in 'sample' call
91  return theTotalMeanEnergy;
92  }
93 
94  private:
95 
96  // data members
97 
98  G4double targetMass;
99  G4int frameFlag; // =1: Target rest frame; =2: CMS system; incident always in lab
100  G4int nProducts;
101  G4NeutronHPProduct * theProducts;
102  G4bool inCharge;
103 
104  // Utility quantities
105 
106  G4ReactionProduct theTarget;
107  G4ReactionProduct theNeutron;
108 
109  // cashed values
110 
111  G4double theTotalMeanEnergy;
112 
113 };
114 
115 #endif
void SetTarget(G4ReactionProduct &aTarget)
G4ReactionProduct * SampleOne(G4double anEnergy)
int G4int
Definition: G4Types.hh:78
std::vector< G4ReactionProduct * > G4ReactionProductVector
void Init(std::istream &aDataFile)
bool G4bool
Definition: G4Types.hh:79
void SetNeutron(G4ReactionProduct &aNeutron)
G4ReactionProductVector * Sample(G4double anEnergy)
double G4double
Definition: G4Types.hh:76
void Init(std::istream &aDataFile)