Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:53

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 // V. Ivanchenko, July-2023 Basic revision of particle HP classes
0029 //
0030 #ifndef G4ParticleHPProduct_h
0031 #define G4ParticleHPProduct_h 1
0032 
0033 #include "G4Cache.hh"
0034 #include "G4ReactionProductVector.hh"
0035 #include "G4VParticleHPEnergyAngular.hh"
0036 #include "G4ParticleHPVector.hh"
0037 #include "G4ios.hh"
0038 #include "globals.hh"
0039 
0040 #include <fstream>
0041 
0042 class G4ParticleDefinition;
0043 
0044 enum G4HPMultiMethod
0045 {
0046   G4HPMultiPoisson,
0047   G4HPMultiBetweenInts
0048 };
0049 
0050 class G4ParticleHPProduct
0051 {
0052     struct toBeCached
0053     {
0054         G4ReactionProduct* theProjectileRP{nullptr};
0055         G4ReactionProduct* theTarget{nullptr};
0056         G4int theCurrentMultiplicity{-1};
0057         toBeCached() = default;
0058     };
0059 
0060   public:
0061     G4ParticleHPProduct();
0062     ~G4ParticleHPProduct();
0063 
0064     void Init(std::istream& aDataFile, const G4ParticleDefinition* projectile);
0065 
0066     G4int GetMultiplicity(G4double anEnergy);
0067     G4ReactionProductVector* Sample(G4double anEnergy, G4int nParticles);
0068 
0069     G4double GetMeanYield(G4double anEnergy) { return theYield.GetY(anEnergy); }
0070 
0071     void SetProjectileRP(G4ReactionProduct* aIncidentPart)
0072     {
0073       fCache.Get().theProjectileRP = aIncidentPart;
0074     }
0075 
0076     void SetTarget(G4ReactionProduct* aTarget) { fCache.Get().theTarget = aTarget; }
0077 
0078     inline G4ReactionProduct* GetTarget() { return fCache.Get().theTarget; }
0079 
0080     inline G4ReactionProduct* GetProjectileRP() { return fCache.Get().theProjectileRP; }
0081 
0082     inline G4double MeanEnergyOfThisInteraction()
0083     {
0084       G4double result = 0.0;
0085       if (theDist != nullptr) {
0086         result = theDist->MeanEnergyOfThisInteraction();
0087         result *= fCache.Get().theCurrentMultiplicity;
0088       }
0089       return result;
0090     }
0091 
0092     inline G4double GetQValue() { return theActualStateQValue; }
0093 
0094     // TK120515 For migration of frameFlag (MF6 LCT) = 3 in
0095     // G4ParticleHPEnAngCorrelation
0096     G4double GetMassCode() { return theMassCode; }
0097     G4double GetMass() { return theMass; }
0098 
0099   private:
0100     G4double theMassCode{0.0};
0101     G4double theMass{0.0};
0102     G4double theGroundStateQValue{0.0};
0103     G4double theActualStateQValue{0.0};
0104     G4int theIsomerFlag{0};
0105     G4int theDistLaw{-1};  // redundant
0106     G4VParticleHPEnergyAngular* theDist{nullptr};
0107 
0108     // cashed values
0109     //
0110     G4Cache<toBeCached> fCache;
0111 
0112     G4HPMultiMethod theMultiplicityMethod;
0113     G4ParticleHPVector theYield;
0114 };
0115 
0116 #endif