Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4ParticleHPParticleYield.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
0028 //
0029 #ifndef G4ParticleHPParticleYield_h
0030 #define G4ParticleHPParticleYield_h 1
0031 
0032 #include "G4ParticleHPList.hh"
0033 #include "G4ParticleHPPolynomExpansion.hh"
0034 #include "G4ParticleHPVector.hh"
0035 #include "globals.hh"
0036 
0037 #include <CLHEP/Units/SystemOfUnits.h>
0038 
0039 class G4ParticleHPParticleYield
0040 {
0041   public:
0042 
0043     G4ParticleHPParticleYield()
0044     {
0045       simpleMean = true;
0046       spontPrompt = true;
0047       hasPromptData = false;
0048       hasDelayedData = false;
0049 
0050       targetMass = 0.0;
0051       theSpontPrompt = 0.0;
0052       spontDelayed = true;
0053       theSpontDelayed = 0.0;
0054     }
0055 
0056     ~G4ParticleHPParticleYield() = default;
0057 
0058     inline G4double GetTargetMass() const { return targetMass; }
0059 
0060     inline void InitMean(std::istream& aDataFile)
0061     {
0062       G4int iflag;
0063       aDataFile >> targetMass >> iflag;
0064       if (iflag == 1) simpleMean = false;
0065       if (simpleMean) {
0066         theSimpleMean.Init(aDataFile, CLHEP::eV);
0067       }
0068       else {
0069         theMean.Init(aDataFile);
0070       }
0071     }
0072 
0073     inline void InitPrompt(std::istream& aDataFile)
0074     {
0075       hasPromptData = true;
0076       G4int iflag;
0077       aDataFile >> targetMass >> iflag;
0078       if (iflag == 2) spontPrompt = false;
0079       if (spontPrompt) {
0080         aDataFile >> theSpontPrompt;
0081       }
0082       else {
0083         thePrompt.Init(aDataFile, CLHEP::eV);
0084       }
0085     }
0086 
0087     inline void InitDelayed(std::istream& aDataFile)
0088     {
0089       hasDelayedData = true;
0090       G4int iflag;
0091       aDataFile >> targetMass >> iflag;
0092       thePrecursorDecayConstants.Init(aDataFile, 1. / CLHEP::s);  // s is the CLHEP unit second
0093       if (iflag == 2) spontDelayed = false;
0094       if (spontDelayed) {
0095         aDataFile >> theSpontDelayed;
0096       }
0097       else {
0098         theDelayed.Init(aDataFile, CLHEP::eV);
0099       }
0100     }
0101 
0102     inline G4double GetMean(G4double anEnergy) const
0103     {
0104       if (simpleMean) {
0105         return theSimpleMean.GetY(anEnergy);
0106       }
0107       return theMean.GetValue(anEnergy);
0108     }
0109 
0110     inline G4double GetPrompt(G4double anEnergy) const
0111     {
0112       if (!hasPromptData) return 0;
0113       if (spontPrompt) {
0114         return theSpontPrompt;
0115       }
0116       return thePrompt.GetY(anEnergy);
0117     }
0118 
0119     inline G4double GetDelayed(G4double anEnergy) const
0120     {
0121       if (!hasDelayedData) return 0;
0122       if (spontDelayed) {
0123         return theSpontDelayed;
0124       }
0125       return theDelayed.GetY(anEnergy);
0126     }
0127 
0128     inline G4double GetDecayConstant(G4int i) const
0129     {
0130       return thePrecursorDecayConstants.GetValue(i);
0131     }
0132 
0133   private:
0134 
0135     G4double targetMass;
0136     // total mean
0137     G4bool simpleMean;
0138     G4ParticleHPPolynomExpansion theMean;
0139     G4ParticleHPVector theSimpleMean;
0140 
0141     // Prompt neutrons
0142     G4bool hasPromptData;
0143     G4bool spontPrompt;
0144     G4ParticleHPVector thePrompt;
0145     G4double theSpontPrompt;
0146 
0147     // delayed neutrons
0148     G4bool hasDelayedData;
0149     G4bool spontDelayed;
0150     G4ParticleHPList thePrecursorDecayConstants;
0151     G4ParticleHPVector theDelayed;
0152     G4double theSpontDelayed;
0153 };
0154 
0155 #endif