Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4ParticleHPChannel.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 // Hadronic Process: Very Low Energy Neutron X-Sections
0027 // original by H.P. Wellisch, TRIUMF, 14-Feb-97
0028 // Builds and has the Cross-section data for one element and channel.
0029 //
0030 // Bug fixes and workarounds in the destructor, F.W.Jones 06-Jul-1999
0031 // 070612 Fix memory leaking by T. Koi
0032 //
0033 // 080520 Delete unnecessary dependencies by T. Koi
0034 
0035 // P. Arce, June-2014 Conversion neutron_hp to particle_hp
0036 // V. Ivanchenko, July-2023 Basic revision of particle HP classes
0037 //
0038 
0039 #ifndef G4ParticleHPChannel_h
0040 #define G4ParticleHPChannel_h 1
0041 
0042 #include "G4Element.hh"
0043 #include "G4HadProjectile.hh"
0044 #include "G4Material.hh"
0045 #include "G4ParticleHPCaptureFS.hh"
0046 #include "G4ParticleHPFinalState.hh"
0047 #include "G4ParticleHPIsoData.hh"
0048 #include "G4ParticleHPManager.hh"
0049 #include "G4ParticleHPVector.hh"
0050 #include "G4StableIsotopes.hh"
0051 #include "G4WendtFissionFragmentGenerator.hh"
0052 #include "globals.hh"
0053 
0054 class G4ParticleDefinition;
0055 
0056 class G4ParticleHPChannel
0057 {
0058 public:
0059   G4ParticleHPChannel(G4ParticleDefinition* projectile = nullptr);
0060 
0061   ~G4ParticleHPChannel();
0062 
0063   G4double GetXsec(G4double energy);
0064 
0065   G4double GetWeightedXsec(G4double energy, G4int isoNumber);
0066 
0067   G4double GetFSCrossSection(G4double energy, G4int isoNumber);
0068 
0069   G4bool IsActive(G4int isoNumber) const
0070   {
0071     return active[isoNumber];
0072   }
0073 
0074   G4bool HasFSData(G4int isoNumber)
0075   { 
0076     return theFinalStates[isoNumber]->HasFSData();
0077   }
0078 
0079   G4bool HasAnyData(G4int isoNumber)
0080   {
0081     return theFinalStates[isoNumber]->HasAnyData();
0082   }
0083 
0084   G4bool Register(G4ParticleHPFinalState* theFS);
0085 
0086   void Init(G4Element* theElement, const G4String& dirName);
0087 
0088   void Init(G4Element* theElement, const G4String& dirName,
0089         const G4String& fsType);
0090 
0091   void UpdateData(G4int A, G4int Z, G4int index, G4double abundance,
0092           G4ParticleDefinition* projectile)
0093   {
0094     UpdateData(A, Z, 0, index, abundance, projectile);
0095   }
0096 
0097   void UpdateData(G4int A, G4int Z, G4int M, G4int index, G4double abundance,
0098           G4ParticleDefinition* projectile);
0099 
0100   void Harmonise(G4ParticleHPVector*& theStore, G4ParticleHPVector* theNew);
0101 
0102   G4HadFinalState* ApplyYourself(const G4HadProjectile& theTrack,
0103                  G4int isoNumber = -1,
0104                  G4bool isElastic = false);
0105 
0106   G4int GetNiso() const { return niso; }
0107 
0108   G4double GetN(G4int i) const { return theFinalStates[i]->GetN(); }
0109   G4double GetZ(G4int i) const { return theFinalStates[i]->GetZ(); }
0110   G4double GetM(G4int i) const { return theFinalStates[i]->GetM(); }
0111 
0112   G4bool HasDataInAnyFinalState()
0113   {
0114     G4bool result = false;
0115     for (G4int i = 0; i < niso; ++i) {
0116       if (theFinalStates[i]->HasAnyData()) {
0117     result = true;
0118     break;
0119       }
0120     }
0121     return result;
0122   }
0123 
0124   void DumpInfo();
0125 
0126   G4String& GetFSType() { return theFSType; }
0127 
0128   G4ParticleHPFinalState** GetFinalStates() const { return theFinalStates; }
0129 
0130   G4ParticleHPChannel(G4ParticleHPChannel &) = delete;
0131   G4ParticleHPChannel & operator=
0132   (const G4ParticleHPChannel &right) = delete;
0133 
0134 protected:
0135   G4ParticleHPManager* fManager;
0136 
0137 private:
0138   G4ParticleDefinition* theProjectile;
0139 
0140   G4ParticleHPVector* theChannelData;
0141   G4Element* theElement{nullptr};
0142 
0143   // total (element) cross-section for this channel
0144   G4ParticleHPVector* theBuffer{nullptr};
0145 
0146   G4ParticleHPIsoData* theIsotopeWiseData{nullptr};
0147   // these are the isotope-wise cross-sections for each final state.
0148   G4ParticleHPFinalState** theFinalStates{nullptr};
0149   // also these are isotope-wise pionters, parallel to the above.
0150 
0151   G4WendtFissionFragmentGenerator* wendtFissionGenerator{nullptr};
0152   G4bool* active{nullptr};
0153   G4int niso{-1};
0154   G4int registerCount{-1};
0155 
0156   G4String theDir{""};
0157   G4String theFSType{""};
0158 };
0159 
0160 #endif