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