Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4PAIPhotModel.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4PAIPhotonModel.hh 73607 2013-09-02 10:04:03Z gcosmo $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 Class header file
31 //
32 //
33 // File name: G4PAIPhotModel
34 //
35 // Author: V. Grichine based on G4PAIModel code for MT
36 //
37 // Creation date: 07.10.2013
38 //
39 //
40 // Class Description:
41 //
42 // Implementation of PAI photon model of energy loss and
43 // delta-electron or X-ray production by charged particles in MT framework
44 //
45 // -------------------------------------------------------------------
46 //
47 
48 #ifndef G4PAIPhotModel_h
49 #define G4PAIPhotModel_h 1
50 
52 
53 #include "G4VEmModel.hh"
54 #include "G4VEmFluctuationModel.hh"
55 #include "globals.hh"
56 #include <vector>
57 
58 class G4Region;
61 
62 class G4PAIPhotData;
63 
65 {
66 
67 public:
68 
69  explicit G4PAIPhotModel(const G4ParticleDefinition* p = nullptr,
70  const G4String& nam = "PAI");
71 
72  virtual ~G4PAIPhotModel();
73 
74  virtual void Initialise(const G4ParticleDefinition*,
75  const G4DataVector&) final;
76 
77  virtual void InitialiseLocal(const G4ParticleDefinition*,
78  G4VEmModel* masterModel) final;
79 
81  const G4ParticleDefinition*,
82  G4double kineticEnergy,
83  G4double cutEnergy) final;
84 
86  const G4ParticleDefinition*,
87  G4double kineticEnergy,
88  G4double cutEnergy,
89  G4double maxEnergy) final;
90 
91  virtual void SampleSecondaries(std::vector<G4DynamicParticle*>*,
92  const G4MaterialCutsCouple*,
93  const G4DynamicParticle*,
94  G4double tmin,
95  G4double maxEnergy) final;
96 
98  const G4DynamicParticle*,
99  G4double,
100  G4double,
101  G4double) final;
102 
103  virtual G4double Dispersion( const G4Material*,
104  const G4DynamicParticle*,
105  G4double,
106  G4double) final;
107 
108  virtual void DefineForRegion(const G4Region* r) final;
109 
110  inline G4PAIPhotData* GetPAIPhotData();
111 
112  inline const std::vector<const G4MaterialCutsCouple*>& GetVectorOfCouples();
113 
114  inline G4double ComputeMaxEnergy(G4double scaledEnergy);
115 
116  inline void SetVerboseLevel(G4int verbose);
117 
118 protected:
119 
121  G4double kinEnergy) final;
122 
123 private:
124 
125  inline G4int FindCoupleIndex(const G4MaterialCutsCouple*);
126 
127  inline void SetParticle(const G4ParticleDefinition* p);
128 
129  // hide assignment operator
130  G4PAIPhotModel & operator=(const G4PAIPhotModel &right) = delete;
131  G4PAIPhotModel(const G4PAIPhotModel&) = delete;
132 
133  G4int fVerbose;
134 
135  G4PAIPhotData* fModelData;
136 
137  std::vector<const G4MaterialCutsCouple*> fMaterialCutsCoupleVector;
138  std::vector<const G4Region*> fPAIRegionVector;
139 
140  const G4ParticleDefinition* fParticle;
141  const G4ParticleDefinition* fElectron;
142  const G4ParticleDefinition* fPositron;
143  G4ParticleChangeForLoss* fParticleChange;
144 
145  G4double fMass;
146  G4double fRatio;
147  G4double fChargeSquare;
148 };
149 
151 {
152  return fModelData;
153 }
154 
155 inline const std::vector<const G4MaterialCutsCouple*>&
157 {
158  return fMaterialCutsCoupleVector;
159 }
160 
162 {
163  return MaxSecondaryEnergy(fParticle, scaledEnergy/fRatio);
164 }
165 
167 {
168  fVerbose=verbose;
169 }
170 
171 inline G4int G4PAIPhotModel::FindCoupleIndex(const G4MaterialCutsCouple* couple)
172 {
173  G4int idx = -1;
174  size_t jMatMax = fMaterialCutsCoupleVector.size();
175  for(size_t jMat = 0;jMat < jMatMax; ++jMat) {
176  if(couple == fMaterialCutsCoupleVector[jMat]) {
177  idx = jMat;
178  break;
179  }
180  }
181  return idx;
182 }
183 
184 inline void G4PAIPhotModel::SetParticle(const G4ParticleDefinition* p)
185 {
186  if(fParticle != p) {
187  fParticle = p;
188  fMass = fParticle->GetPDGMass();
189  fRatio = CLHEP::proton_mass_c2/fMass;
190  G4double q = fParticle->GetPDGCharge()/CLHEP::eplus;
191  fChargeSquare = q*q;
192  }
193 }
194 
195 #endif
196 
197 
198 
199 
200 
201 
202 
virtual G4double SampleFluctuations(const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double, G4double, G4double) final
virtual ~G4PAIPhotModel()
static constexpr double proton_mass_c2
virtual void DefineForRegion(const G4Region *r) final
virtual void InitialiseLocal(const G4ParticleDefinition *, G4VEmModel *masterModel) final
virtual void SampleSecondaries(std::vector< G4DynamicParticle * > *, const G4MaterialCutsCouple *, const G4DynamicParticle *, G4double tmin, G4double maxEnergy) final
G4PAIPhotData * GetPAIPhotData()
const char * p
Definition: xmltok.h:285
virtual void Initialise(const G4ParticleDefinition *, const G4DataVector &) final
const std::vector< const G4MaterialCutsCouple * > & GetVectorOfCouples()
virtual G4double Dispersion(const G4Material *, const G4DynamicParticle *, G4double, G4double) final
int G4int
Definition: G4Types.hh:78
virtual G4double MaxSecondaryEnergy(const G4ParticleDefinition *, G4double kinEnergy) final
virtual G4double ComputeDEDXPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy) final
virtual G4double CrossSectionPerVolume(const G4Material *, const G4ParticleDefinition *, G4double kineticEnergy, G4double cutEnergy, G4double maxEnergy) final
G4double ComputeMaxEnergy(G4double scaledEnergy)
G4PAIPhotModel(const G4ParticleDefinition *p=nullptr, const G4String &nam="PAI")
static constexpr double eplus
void SetVerboseLevel(G4int verbose)
G4double GetPDGMass() const
double G4double
Definition: G4Types.hh:76
G4double GetPDGCharge() const