Geant4  10.01.p03
G4ParticleHPEnAngCorrelation.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 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
28 //
29 #ifndef G4ParticleHPEnAngCorrelation_h
30 #define G4ParticleHPEnAngCorrelation_h 1
31 
32 #include "globals.hh"
33 #include "G4ParticleHPVector.hh"
34 #include "Randomize.hh"
35 #include "G4ios.hh"
36 #include <fstream>
37 #include "globals.hh"
38 #include "G4ParticleHPProduct.hh"
39 #include "G4ReactionProduct.hh"
41 
43 {
44  public:
45  G4ParticleHPEnAngCorrelation() // for G4ParticleHPCaptureFS::theMF6FinalState
46  {
48  theProducts = 0;
49  inCharge = false;
50  theTotalMeanEnergy = -1.;
51  }
53  : theProjectile(proj)
54  {
55  theProducts = 0;
56  inCharge = false;
57  theTotalMeanEnergy = -1.;
58  }
59 
61  {
62  if(theProducts!=0) delete [] theProducts;
63  }
64 
65  inline void Init(std::istream & aDataFile)
66  {
67  bAdjustFinalState = true;
68  const char* ctmp = getenv("G4PHP_DO_NOT_ADJUST_FINAL_STATE");
69  if( ctmp && G4String(ctmp) == "1" ) {
70  bAdjustFinalState = false;
71  }
72 
73  inCharge = true;
74  aDataFile>>targetMass>>frameFlag>>nProducts;
76  for(G4int i=0; i<nProducts; i++)
77  {
78  theProducts[i].Init(aDataFile,theProjectile);
79  }
80 
81  }
82 
84 
86 
87  inline void SetTarget(G4ReactionProduct & aTarget)
88  {
89  theTarget = aTarget;
90  for(G4int i=0;i<nProducts;i++)theProducts[i].SetTarget(&theTarget);
91  }
92 
93  inline void SetProjectileRP(G4ReactionProduct & aIncidentPart)
94  {
95  theProjectileRP = aIncidentPart;
97  }
98 
99  inline G4bool InCharge()
100  {
101  return inCharge;
102  }
103 
104  inline G4double GetTargetMass() { return targetMass; }
105 
107  {
108  // cashed in 'sample' call
109  return theTotalMeanEnergy;
110  }
111 private:
112 
113  // data members
114 
116  G4int frameFlag; // =1: Target rest frame; =2: CMS system; incident always in lab
120 
121  // Utility quantities
122 
125 
126  // cashed values
127 
129 
131 
133 
134 };
135 
136 #endif
void Init(std::istream &aDataFile, G4ParticleDefinition *projectile)
void SetProjectileRP(G4ReactionProduct &aIncidentPart)
int G4int
Definition: G4Types.hh:78
G4ReactionProductVector * Sample(G4double anEnergy)
G4ParticleHPEnAngCorrelation(G4ParticleDefinition *proj)
std::vector< G4ReactionProduct * > G4ReactionProductVector
bool G4bool
Definition: G4Types.hh:79
static G4Neutron * Neutron()
Definition: G4Neutron.cc:104
G4ReactionProduct * SampleOne(G4double anEnergy)
void SetTarget(G4ReactionProduct &aTarget)
double G4double
Definition: G4Types.hh:76
void Init(std::istream &aDataFile)