Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57: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 //  Class:    G4AdjointCSMatrix
0028 //  Author:         L. Desorgher
0029 //  Organisation:   SpaceIT GmbH
0030 //
0031 //  An adjoint CS matrix is used by the model of a reverse process to sample
0032 //  an adjoint secondary (being equivalent to a forward primary). It represents
0033 //  the integration over the energy of the adjoint secondary (therefore the
0034 //  forward primary) of the differential cross section of the equivalent forward
0035 //  discrete process (Ionisation, Brem, PE effect, Compton,..). Each reverse
0036 //  model has its own cross section matrix for a given cut, material couple. It
0037 //  is therefore recomputed after a modification of the cuts by the user.
0038 //
0039 ////////////////////////////////////////////////////////////////////////////////
0040 
0041 #ifndef G4AdjointCSMatrix_h
0042 #define G4AdjointCSMatrix_h 1
0043 
0044 #include "globals.hh"
0045 #include "G4ParticleDefinition.hh"
0046 
0047 #include <vector>
0048 
0049 class G4AdjointCSMatrix
0050 {
0051  public:
0052   G4AdjointCSMatrix(G4bool aBool);
0053   ~G4AdjointCSMatrix();
0054 
0055   void Clear();
0056 
0057   void AddData(G4double aPrimEnergy, G4double aCS,
0058                std::vector<double>* aLogSecondEnergyVector,
0059                std::vector<double>* aLogProbVector, size_t n_pro_decade = 0);
0060 
0061   G4bool GetData(unsigned int i, G4double& aPrimEnergy, G4double& aCS,
0062                  G4double& log0, std::vector<double>*& aLogSecondEnergyVector,
0063                  std::vector<double>*& aLogProbVector,
0064                  std::vector<size_t>*& aLogProbVectorIndex);
0065 
0066   inline std::vector<double>* GetLogPrimEnergyVector()
0067   {
0068     return &fLogPrimEnergyVector;
0069   }
0070 
0071   inline std::vector<double>* GetLogCrossSectionvector()
0072   {
0073     return &fLogCrossSectionVector;
0074   }
0075 
0076   inline G4bool IsScatProjToProj() { return fScatProjToProj; }
0077 
0078   void Write(G4String file_name);
0079 
0080   void Read(G4String file_name);
0081 
0082  private:
0083   std::vector<double> fLogPrimEnergyVector;
0084   // Adjoint Cross sections as functions of primary energy
0085   std::vector<double> fLogCrossSectionVector;
0086 
0087   std::vector<std::vector<double>*> fLogSecondEnergyMatrix;
0088   std::vector<std::vector<double>*> fLogProbMatrix;
0089   // Each column represents the integrated probability of
0090   // getting a secondary
0091 
0092   // index of equidistant LogProb
0093   std::vector<std::vector<size_t>*> fLogProbMatrixIndex;
0094   std::vector<double> fLog0Vector;
0095 
0096   size_t fNbPrimEnergy = 0;
0097 
0098   G4bool fScatProjToProj;
0099 };
0100 #endif