Back to home page

EIC code displayed by LXR

 
 

    


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

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 // -------------------------------------------------------------------
0028 //
0029 // GEANT4 Class header file
0030 //
0031 //
0032 // File name:     G4eeToHadronsMultiModel
0033 //
0034 // Author:        Vladimir Ivanchenko
0035 //
0036 // Creation date: 18.05.2005
0037 //
0038 // Modifications:
0039 //
0040 
0041 //
0042 // Class Description: vector of e+e- -> hadrons models
0043 //
0044 
0045 // -------------------------------------------------------------------
0046 //
0047 
0048 #ifndef G4eeToHadronsMultiModel_h
0049 #define G4eeToHadronsMultiModel_h 1
0050 
0051 #include "G4VEmModel.hh"
0052 #include "G4eeToHadronsModel.hh"
0053 #include "G4ParticleChangeForGamma.hh"
0054 #include "G4TrackStatus.hh"
0055 #include "Randomize.hh"
0056 #include <CLHEP/Units/SystemOfUnits.h>
0057 #include <CLHEP/Units/PhysicalConstants.h>
0058 #include <vector>
0059 
0060 class G4eeCrossSections;
0061 class G4Vee2hadrons;
0062 
0063 class G4eeToHadronsMultiModel : public G4VEmModel
0064 {
0065 
0066 public:
0067 
0068   explicit G4eeToHadronsMultiModel(G4int ver=0, 
0069                                    const G4String& nam = "eeToHadrons");
0070 
0071   ~G4eeToHadronsMultiModel() override;
0072 
0073   void Initialise(const G4ParticleDefinition*, const G4DataVector&) override;
0074 
0075   G4double CrossSectionPerVolume(const G4Material*,
0076                  const G4ParticleDefinition*,
0077                  G4double kineticEnergy,
0078                  G4double cutEnergy,
0079                  G4double maxEnergy) override;
0080 
0081   G4double ComputeCrossSectionPerAtom(
0082                                  const G4ParticleDefinition*,
0083                                  G4double kineticEnergy,
0084                                  G4double Z, G4double A,
0085                                  G4double cutEnergy = 0.0,
0086                                  G4double maxEnergy = DBL_MAX) override;
0087 
0088   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0089              const G4MaterialCutsCouple*,
0090              const G4DynamicParticle*,
0091              G4double tmin = 0.0,
0092              G4double maxEnergy = DBL_MAX) override;
0093 
0094   void ModelDescription(std::ostream& outFile) const override;
0095   
0096   // Set the factor to artificially increase the crossSection (default 1)
0097   void SetCrossSecFactor(G4double fac);
0098 
0099   G4double ComputeCrossSectionPerElectron(const G4ParticleDefinition*,
0100                                           G4double kineticEnergy,
0101                                           G4double cutEnergy = 0.0,
0102                                           G4double maxEnergy = DBL_MAX);
0103 
0104   // hide assignment operator
0105   G4eeToHadronsMultiModel & operator=(const  G4eeToHadronsMultiModel &right) = delete;
0106   G4eeToHadronsMultiModel(const  G4eeToHadronsMultiModel&) = delete;
0107 
0108 private:
0109 
0110   void AddEEModel(G4Vee2hadrons*, const G4DataVector&);
0111 
0112   //change incident e+ kinetic energy into CM total energy(sum of e+ and e-)  
0113   inline G4double LabToCM(G4double);
0114 
0115   G4eeCrossSections*               cross = nullptr;
0116   G4ParticleChangeForGamma*        fParticleChange = nullptr;
0117 
0118   std::vector<G4eeToHadronsModel*> models;
0119 
0120   std::vector<G4double>            ekinMin;
0121   std::vector<G4double>            ekinPeak;
0122   std::vector<G4double>            ekinMax;
0123   std::vector<G4double>            cumSum;
0124 
0125   G4double             delta;  
0126   G4double                         thKineticEnergy = DBL_MAX;
0127   G4double                         maxKineticEnergy;
0128   G4double                         csFactor = 1.0;
0129 
0130   G4int                            nModels = 0;
0131   G4int                            verbose;
0132   G4bool                           isInitialised = false;
0133 };
0134 
0135 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0136 
0137 //change incident e+ kinetic energy into CM total energy(sum of e+ and e-)  
0138 inline G4double G4eeToHadronsMultiModel::LabToCM(G4double kinE_lab)
0139 {
0140   G4double totE_CM = 0.0;
0141   G4double mass = CLHEP::electron_mass_c2;
0142   G4double totE_lab = kinE_lab + mass;
0143   totE_CM = std::sqrt(2*mass*(mass+totE_lab));
0144 
0145   return totE_CM;
0146 }
0147 
0148 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0149 
0150 #endif