Geant4  9.6.p02
 All Classes 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 // $Id$
28 //
29 #ifndef G4NeutronHPEnAngCorrelation_h
30 #define G4NeutronHPEnAngCorrelation_h 1
31 
32 #include "globals.hh"
33 #include "G4NeutronHPVector.hh"
34 #include "Randomize.hh"
35 #include "G4ios.hh"
36 #include <fstream>
37 #include "globals.hh"
38 #include "G4NeutronHPProduct.hh"
39 #include "G4ReactionProduct.hh"
40 
42 {
43  public:
45  {
46  theProducts = 0;
47  inCharge = false;
48  theTotalMeanEnergy = -1.;
49  }
51  {
52  if(theProducts!=0) delete [] theProducts;
53  }
54 
55  inline void Init(std::ifstream & aDataFile)
56  {
57  inCharge = true;
58  aDataFile>>targetMass>>frameFlag>>nProducts;
59  theProducts = new G4NeutronHPProduct[nProducts];
60  for(G4int i=0; i<nProducts; i++)
61  {
62  theProducts[i].Init(aDataFile);
63  }
64  }
65 
67 
69 
70  inline void SetTarget(G4ReactionProduct & aTarget)
71  {
72  theTarget = aTarget;
73  for(G4int i=0;i<nProducts;i++)theProducts[i].SetTarget(&theTarget);
74  }
75 
76  inline void SetNeutron(G4ReactionProduct & aNeutron)
77  {
78  theNeutron = aNeutron;
79  for(G4int i=0;i<nProducts;i++)theProducts[i].SetNeutron(&theNeutron);
80  }
81 
82  inline G4bool InCharge()
83  {
84  return inCharge;
85  }
86 
87  inline G4double GetTargetMass() { return targetMass; }
88 
90  {
91  // cashed in 'sample' call
92  return theTotalMeanEnergy;
93  }
94 
95  private:
96 
97  // data members
98 
99  G4double targetMass;
100  G4int frameFlag; // =1: Target rest frame; =2: CMS system; incident always in lab
101  G4int nProducts;
102  G4NeutronHPProduct * theProducts;
103  G4bool inCharge;
104 
105  // Utility quantities
106 
107  G4ReactionProduct theTarget;
108  G4ReactionProduct theNeutron;
109 
110  // cashed values
111 
112  G4double theTotalMeanEnergy;
113 
114 };
115 
116 #endif