Back to home page

EIC code displayed by LXR

 
 

    


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

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 // 080721 Create adjust_final_state method by T. Koi
0028 // 080801 Introduce theNDLDataA,Z which has A and Z of NDL data by T. Koi
0029 //
0030 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
0031 // V. Ivanchenko, July-2023 Basic revision of particle HP classes
0032 //
0033 
0034 #ifndef G4ParticleHPFinalState_h
0035 #define G4ParticleHPFinalState_h
0036 
0037 #include "G4Cache.hh"
0038 #include "G4HadFinalState.hh"
0039 #include "G4HadProjectile.hh"
0040 #include "G4Material.hh"
0041 #include "G4Neutron.hh"
0042 #include "G4IonTable.hh"
0043 #include "G4ParticleHPManager.hh"
0044 #include "G4ParticleHPNames.hh"
0045 #include "G4ParticleHPVector.hh"
0046 
0047 class G4ParticleDefinition;
0048 
0049 class G4ParticleHPFinalState
0050 {
0051   public:
0052     G4ParticleHPFinalState();
0053     virtual ~G4ParticleHPFinalState();
0054 
0055     void Init(G4double A, G4double Z, G4String& dirName, G4String& aFSType,
0056               G4ParticleDefinition* p)
0057     {
0058       theProjectile = p;
0059       Init(A, Z, 0, dirName, aFSType, p);
0060     }
0061     virtual void Init(G4double A, G4double Z, G4int M, G4String& dirName, G4String& aFSType,
0062                       G4ParticleDefinition*) = 0;
0063 
0064     virtual G4HadFinalState* ApplyYourself(const G4HadProjectile&)
0065     {
0066       throw G4HadronicException(
0067         __FILE__, __LINE__,
0068         "G4ParticleHPFinalState::ApplyYourself(..) needs implementation");
0069       return nullptr;
0070     }
0071 
0072     // this would better be done templating G4ParticleHPChannel...,
0073     //
0074     virtual G4ParticleHPFinalState* New() = 0;
0075 
0076     G4bool HasXsec() { return hasXsec; }
0077     G4bool HasFSData() { return hasFSData; }
0078     G4bool HasAnyData() { return hasAnyData; }
0079 
0080     virtual G4double GetXsec(G4double) { return 0; }
0081     virtual G4ParticleHPVector* GetXsec() { return nullptr; }
0082 
0083     void SetA_Z(G4double anA, G4double aZ, G4int aM = 0)
0084     {
0085       theBaseA = G4lrint(anA);
0086       theBaseZ = G4lrint(aZ);
0087       theBaseM = aM;
0088     }
0089     G4double GetZ() { return theBaseZ; }
0090     G4double GetN() { return theBaseA; }
0091     G4double GetA() { return theBaseA; }
0092     G4int GetM() { return theBaseM; }
0093 
0094     void SetAZMs(G4ParticleHPDataUsed used)
0095     {
0096       theNDLDataA = G4lrint(used.GetA());
0097       theNDLDataZ = G4lrint(used.GetZ());
0098       theNDLDataM = used.GetM();
0099     }
0100 
0101     void SetAZMs(G4double anA, G4double aZ, G4int aM, G4ParticleHPDataUsed used)
0102     {
0103       theBaseA = G4lrint(anA);
0104       theBaseZ = G4lrint(aZ);
0105       theBaseM = aM;
0106       theNDLDataA = G4lrint(used.GetA());
0107       theNDLDataZ = G4lrint(used.GetZ());
0108       theNDLDataM = used.GetM();
0109     }
0110 
0111     void SetProjectile(G4ParticleDefinition* projectile) { theProjectile = projectile; }
0112 
0113     G4ParticleHPFinalState& operator=
0114     (const G4ParticleHPFinalState& right) = delete;
0115     G4ParticleHPFinalState(const G4ParticleHPFinalState&) = delete;
0116 
0117   protected:
0118     void adjust_final_state(G4LorentzVector);
0119 
0120     G4ParticleDefinition* theProjectile{nullptr};
0121     G4ParticleHPManager* fManager;
0122     G4IonTable* ionTable;
0123 
0124     G4int theBaseA{0};
0125     G4int theBaseZ{0};
0126     G4int theBaseM{0};
0127     G4int theNDLDataZ{0};
0128     G4int theNDLDataA{0};
0129     G4int theNDLDataM{0};
0130 
0131     G4int secID{-1};
0132     // Creator model ID for the secondaries created by this class or derived ones
0133 
0134     G4bool hasXsec{true};
0135     G4bool hasFSData{true};
0136     G4bool hasAnyData{true};
0137     G4ParticleHPNames theNames;
0138 
0139     G4Cache<G4HadFinalState*> theResult;
0140 
0141 };
0142 #endif