Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4PAIPhotModel.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 //
0027 // -------------------------------------------------------------------
0028 //
0029 // GEANT4 Class header file
0030 //
0031 //
0032 // File name:     G4PAIPhotModel
0033 //
0034 // Author:        V. Grichine based on G4PAIModel  code for MT
0035 //
0036 // Creation date: 07.10.2013
0037 //
0038 //
0039 // Class Description:
0040 //
0041 // Implementation of PAI photon model of energy loss and
0042 // delta-electron or X-ray production by charged particles in MT framework
0043 //
0044 // -------------------------------------------------------------------
0045 //
0046 
0047 #ifndef G4PAIPhotModel_h
0048 #define G4PAIPhotModel_h 1
0049 
0050 #include <CLHEP/Units/PhysicalConstants.h>
0051 
0052 #include "G4VEmModel.hh"
0053 #include "G4VEmFluctuationModel.hh"
0054 #include "globals.hh"
0055 #include <vector>
0056 
0057 class G4Region;
0058 class G4MaterialCutsCouple;
0059 class G4ParticleChangeForLoss;
0060 
0061 class G4PAIPhotData;
0062 
0063 class G4PAIPhotModel final : public G4VEmModel, public G4VEmFluctuationModel
0064 {
0065 
0066 public:
0067 
0068   explicit G4PAIPhotModel(const G4ParticleDefinition* p = nullptr, 
0069               const G4String& nam = "PAI");
0070 
0071   ~G4PAIPhotModel() final;
0072 
0073   void Initialise(const G4ParticleDefinition*, const G4DataVector&) final;
0074 
0075   void InitialiseLocal(const G4ParticleDefinition*, 
0076                        G4VEmModel* masterModel) final;
0077 
0078   G4double MinEnergyCut(const G4ParticleDefinition*,
0079                         const G4MaterialCutsCouple* couple) final;
0080 
0081   G4double ComputeDEDXPerVolume(const G4Material*,
0082                         const G4ParticleDefinition*,
0083                     G4double kineticEnergy,
0084                     G4double cutEnergy) final;
0085 
0086   G4double CrossSectionPerVolume(const G4Material*,
0087                      const G4ParticleDefinition*,
0088                  G4double kineticEnergy,
0089                  G4double cutEnergy,
0090                  G4double maxEnergy) final;
0091 
0092   void SampleSecondaries(std::vector<G4DynamicParticle*>*,
0093                  const G4MaterialCutsCouple*,
0094                  const G4DynamicParticle*,
0095                  G4double tmin,
0096                  G4double maxEnergy) final;
0097 
0098   G4double SampleFluctuations(const G4MaterialCutsCouple*,
0099                   const G4DynamicParticle*,
0100                   const G4double, const G4double, 
0101                               const G4double, const G4double) final;
0102 
0103   G4double Dispersion(const G4Material*, const G4DynamicParticle*,
0104               const G4double, const G4double, const G4double) final;
0105 
0106   void DefineForRegion(const G4Region* r) final;
0107 
0108   inline G4PAIPhotData* GetPAIPhotData();
0109 
0110   inline const std::vector<const G4MaterialCutsCouple*>& GetVectorOfCouples();
0111 
0112   inline G4double ComputeMaxEnergy(G4double scaledEnergy);
0113 
0114   inline void SetVerboseLevel(G4int verbose);
0115 
0116   // hide assignment operator 
0117   G4PAIPhotModel & operator=(const  G4PAIPhotModel &right) = delete;
0118   G4PAIPhotModel(const  G4PAIPhotModel&) = delete;
0119 
0120 protected:
0121 
0122   G4double MaxSecondaryEnergy(const G4ParticleDefinition*,
0123                       G4double kinEnergy) final;
0124 
0125 private:
0126 
0127   inline G4int FindCoupleIndex(const G4MaterialCutsCouple*);
0128 
0129   inline void SetParticle(const G4ParticleDefinition* p);
0130 
0131   G4int                       fVerbose; 
0132 
0133   G4PAIPhotData*             fModelData; 
0134 
0135   std::vector<const G4MaterialCutsCouple*> fMaterialCutsCoupleVector;
0136   std::vector<const G4Region*>      fPAIRegionVector;
0137 
0138   const G4ParticleDefinition* fParticle;
0139   const G4ParticleDefinition* fElectron;
0140   const G4ParticleDefinition* fPositron;
0141   G4ParticleChangeForLoss*    fParticleChange;
0142 
0143   G4double fMass;
0144   G4double fRatio;
0145   G4double fChargeSquare;
0146   G4double fLowestTcut;
0147 };
0148 
0149 inline G4PAIPhotData* G4PAIPhotModel::GetPAIPhotData()
0150 {
0151   return fModelData;
0152 }
0153 
0154 inline const std::vector<const G4MaterialCutsCouple*>& 
0155 G4PAIPhotModel::GetVectorOfCouples()
0156 {
0157   return fMaterialCutsCoupleVector;
0158 }
0159 
0160 inline G4double G4PAIPhotModel::ComputeMaxEnergy(G4double scaledEnergy)
0161 {
0162   return MaxSecondaryEnergy(fParticle, scaledEnergy/fRatio);
0163 }
0164 
0165 inline void G4PAIPhotModel::SetVerboseLevel(G4int verbose) 
0166 { 
0167   fVerbose=verbose; 
0168 }
0169 
0170 inline G4int G4PAIPhotModel::FindCoupleIndex(const G4MaterialCutsCouple* couple)
0171 {
0172   G4int idx = -1;
0173   G4int jMatMax = (G4int)fMaterialCutsCoupleVector.size();
0174   for(G4int jMat = 0;jMat < jMatMax; ++jMat) { 
0175     if(couple == fMaterialCutsCoupleVector[jMat]) {
0176       idx = jMat; 
0177       break; 
0178     }
0179   }
0180   return idx;
0181 }
0182 
0183 inline void G4PAIPhotModel::SetParticle(const G4ParticleDefinition* p)
0184 {
0185   if(fParticle != p) {
0186     fParticle = p;
0187     fMass = fParticle->GetPDGMass();
0188     fRatio = CLHEP::proton_mass_c2/fMass;
0189     G4double q = fParticle->GetPDGCharge()/CLHEP::eplus;
0190     fChargeSquare = q*q;
0191   }
0192 }
0193 
0194 #endif