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p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /processes/electromagnetic/highenergy/src/G4eeToHadronsMultiModel.cc (Version 11.3.0) and /processes/electromagnetic/highenergy/src/G4eeToHadronsMultiModel.cc (Version 10.1.p3)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                         3 // * License and Disclaimer                                           *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th      5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided      6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License      7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/      8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.           9 // * include a list of copyright holders.                             *
 10 // *                                               10 // *                                                                  *
 11 // * Neither the authors of this software syst     11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file      15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitatio     16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                               17 // *                                                                  *
 18 // * This  code  implementation is the result      18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboratio     19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distri     20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  ag     21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publicati     22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Sof     23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // *******************************************     24 // ********************************************************************
 25 //                                                 25 //
                                                   >>  26 // $Id: G4eeToHadronsMultiModel.cc 82961 2014-07-21 09:20:49Z gcosmo $
 26 //                                                 27 //
 27 // -------------------------------------------     28 // -------------------------------------------------------------------
 28 //                                                 29 //
 29 // GEANT4 Class file                               30 // GEANT4 Class file
 30 //                                                 31 //
 31 //                                                 32 //
 32 // File name:     G4eeToHadronsMultiModel          33 // File name:     G4eeToHadronsMultiModel
 33 //                                                 34 //
 34 // Author:        Vladimir Ivanchenko              35 // Author:        Vladimir Ivanchenko 
 35 //                                                 36 //
 36 // Creation date: 02.08.2004                       37 // Creation date: 02.08.2004
 37 //                                                 38 //
 38 // Modifications:                                  39 // Modifications:
 39 // 08-11-04 Migration to new interface of Stor     40 // 08-11-04 Migration to new interface of Store/Retrieve tables (V.Ivantchenko)
 40 // 08-04-05 Major optimisation of internal int     41 // 08-04-05 Major optimisation of internal interfaces (V.Ivantchenko)
 41 //                                                 42 //
 42                                                    43 
 43 //                                                 44 //
 44 // -------------------------------------------     45 // -------------------------------------------------------------------
 45 //                                                 46 //
 46 //....oooOO0OOooo........oooOO0OOooo........oo     47 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 47 //....oooOO0OOooo........oooOO0OOooo........oo     48 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 48                                                    49 
 49 #include "G4eeToHadronsMultiModel.hh"              50 #include "G4eeToHadronsMultiModel.hh"
 50 #include "G4PhysicalConstants.hh"                  51 #include "G4PhysicalConstants.hh"
 51 #include "G4SystemOfUnits.hh"                      52 #include "G4SystemOfUnits.hh"
 52 #include "G4eeToTwoPiModel.hh"                     53 #include "G4eeToTwoPiModel.hh"
 53 #include "G4eeTo3PiModel.hh"                       54 #include "G4eeTo3PiModel.hh"
 54 #include "G4eeToPGammaModel.hh"                    55 #include "G4eeToPGammaModel.hh"
 55 #include "G4ee2KNeutralModel.hh"                   56 #include "G4ee2KNeutralModel.hh"
 56 #include "G4ee2KChargedModel.hh"                   57 #include "G4ee2KChargedModel.hh"
 57 #include "G4eeCrossSections.hh"                    58 #include "G4eeCrossSections.hh"
 58 #include "G4Vee2hadrons.hh"                        59 #include "G4Vee2hadrons.hh"
 59 #include "G4Positron.hh"                           60 #include "G4Positron.hh"
 60                                                    61 
 61 //....oooOO0OOooo........oooOO0OOooo........oo     62 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 62                                                    63 
 63 using namespace std;                               64 using namespace std;
 64                                                    65 
 65 G4eeToHadronsMultiModel::G4eeToHadronsMultiMod     66 G4eeToHadronsMultiModel::G4eeToHadronsMultiModel(G4int ver, 
 66   const G4String& mname) : G4VEmModel(mname),  <<  67   const G4String& mname) : G4VEmModel(mname),
 67 {                                              <<  68     csFactor(1.0),
 68   maxKineticEnergy = 4.521*CLHEP::GeV;  //crre <<  69     nModels(0),
 69   delta = 1.0*CLHEP::MeV;  //for bin width     <<  70     verbose(ver),
                                                   >>  71     isInitialised(false)
                                                   >>  72 {
                                                   >>  73   thKineticEnergy  = DBL_MAX;
                                                   >>  74   maxKineticEnergy = 4.521*GeV;  //crresponding to 10TeV in lab
                                                   >>  75   fParticleChange  = 0;
                                                   >>  76   cross = 0;
                                                   >>  77   delta = 1.0*MeV;  //for bin width
 70 }                                                  78 }
 71                                                    79 
 72 //....oooOO0OOooo........oooOO0OOooo........oo     80 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 73                                                    81 
 74 G4eeToHadronsMultiModel::~G4eeToHadronsMultiMo     82 G4eeToHadronsMultiModel::~G4eeToHadronsMultiModel()
 75 {                                                  83 {
 76   delete cross;                                    84   delete cross;
 77 }                                                  85 }
 78                                                    86 
 79 //....oooOO0OOooo........oooOO0OOooo........oo     87 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
 80                                                    88 
 81 void G4eeToHadronsMultiModel::Initialise(const     89 void G4eeToHadronsMultiModel::Initialise(const G4ParticleDefinition*, 
 82            const G4DataVector& cuts)               90            const G4DataVector& cuts) 
 83 {                                                  91 {
 84   if(!isInitialised) {                             92   if(!isInitialised) {
 85     isInitialised = true;                          93     isInitialised = true;
 86                                                    94 
 87     //G4cout<<"###Initialise in HadronMultiMod     95     //G4cout<<"###Initialise in HadronMultiModel###"<<G4endl;
 88                                                    96 
 89     cross = new G4eeCrossSections();               97     cross = new G4eeCrossSections();
 90                                                    98 
 91     G4eeToTwoPiModel* m2pi =                       99     G4eeToTwoPiModel* m2pi = 
 92       new G4eeToTwoPiModel(cross,maxKineticEne    100       new G4eeToTwoPiModel(cross,maxKineticEnergy,delta);
 93     AddEEModel(m2pi,cuts);                        101     AddEEModel(m2pi,cuts);
 94                                                   102 
 95     G4eeTo3PiModel* m3pi =                        103     G4eeTo3PiModel* m3pi = 
 96       new G4eeTo3PiModel(cross,maxKineticEnerg    104       new G4eeTo3PiModel(cross,maxKineticEnergy,delta);
 97     AddEEModel(m3pi,cuts);                        105     AddEEModel(m3pi,cuts);
 98                                                   106 
 99     G4ee2KChargedModel* m2kc =                    107     G4ee2KChargedModel* m2kc = 
100       new G4ee2KChargedModel(cross,maxKineticE    108       new G4ee2KChargedModel(cross,maxKineticEnergy,delta);
101     AddEEModel(m2kc,cuts);                        109     AddEEModel(m2kc,cuts);
102                                                   110 
103     G4ee2KNeutralModel* m2kn =                    111     G4ee2KNeutralModel* m2kn = 
104       new G4ee2KNeutralModel(cross,maxKineticE    112       new G4ee2KNeutralModel(cross,maxKineticEnergy,delta);
105     AddEEModel(m2kn,cuts);                        113     AddEEModel(m2kn,cuts);
106                                                   114 
107     G4eeToPGammaModel* mpg1 =                     115     G4eeToPGammaModel* mpg1 = 
108       new G4eeToPGammaModel(cross,"pi0",maxKin    116       new G4eeToPGammaModel(cross,"pi0",maxKineticEnergy,delta);
109     AddEEModel(mpg1,cuts);                        117     AddEEModel(mpg1,cuts);
110                                                   118 
111     G4eeToPGammaModel* mpg2 =                     119     G4eeToPGammaModel* mpg2 = 
112       new G4eeToPGammaModel(cross,"eta",maxKin    120       new G4eeToPGammaModel(cross,"eta",maxKineticEnergy,delta);
113     AddEEModel(mpg2,cuts);                        121     AddEEModel(mpg2,cuts);
114                                                   122 
115     nModels = (G4int)models.size();            << 123     nModels = models.size();
116                                                   124 
117     fParticleChange = GetParticleChangeForGamm    125     fParticleChange = GetParticleChangeForGamma();
118   }                                               126   }
119 }                                                 127 }
120                                                   128 
121 //....oooOO0OOooo........oooOO0OOooo........oo    129 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
122                                                   130 
                                                   >> 131 
                                                   >> 132 
123 void G4eeToHadronsMultiModel::AddEEModel(G4Vee    133 void G4eeToHadronsMultiModel::AddEEModel(G4Vee2hadrons* mod,
124            const G4DataVector& cuts)              134            const G4DataVector& cuts)
125 {                                                 135 {
126   G4eeToHadronsModel* model = new G4eeToHadron    136   G4eeToHadronsModel* model = new G4eeToHadronsModel(mod, verbose);
127   models.push_back(model);                        137   models.push_back(model);
128   G4double elow = mod->LowEnergy();               138   G4double elow = mod->LowEnergy();   
129   ekinMin.push_back(elow);                        139   ekinMin.push_back(elow);
130   if(thKineticEnergy > elow) { thKineticEnergy    140   if(thKineticEnergy > elow) { thKineticEnergy = elow; }
131   ekinMax.push_back(mod->HighEnergy());           141   ekinMax.push_back(mod->HighEnergy()); 
132   ekinPeak.push_back(mod->PeakEnergy());          142   ekinPeak.push_back(mod->PeakEnergy());
133   cumSum.push_back(0.0);                          143   cumSum.push_back(0.0);
134                                                   144 
135   const G4ParticleDefinition* positron = G4Pos    145   const G4ParticleDefinition* positron = G4Positron::Positron();
136   model->Initialise(positron,cuts);               146   model->Initialise(positron,cuts);
137 }                                                 147 }
138                                                   148 
139 //....oooOO0OOooo........oooOO0OOooo........oo    149 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
140                                                   150 
141 G4double G4eeToHadronsMultiModel::CrossSection    151 G4double G4eeToHadronsMultiModel::CrossSectionPerVolume(
142               const G4Material* mat,              152               const G4Material* mat,
143               const G4ParticleDefinition* p,      153               const G4ParticleDefinition* p,
144               G4double kineticEnergy,             154               G4double kineticEnergy,
145               G4double, G4double)                 155               G4double, G4double)
146 {                                                 156 {
147   return mat->GetElectronDensity()*               157   return mat->GetElectronDensity()*
148     ComputeCrossSectionPerElectron(p, kineticE    158     ComputeCrossSectionPerElectron(p, kineticEnergy);
149 }                                                 159 }
150                                                   160 
151 //....oooOO0OOooo........oooOO0OOooo........oo    161 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
152                                                   162 
153 G4double G4eeToHadronsMultiModel::ComputeCross    163 G4double G4eeToHadronsMultiModel::ComputeCrossSectionPerAtom(
154                                       const G4    164                                       const G4ParticleDefinition* p,
155               G4double kineticEnergy,             165               G4double kineticEnergy,
156               G4double Z, G4double,               166               G4double Z, G4double,
157               G4double, G4double)                 167               G4double, G4double)
158 {                                                 168 {
159   return Z*ComputeCrossSectionPerElectron(p, k    169   return Z*ComputeCrossSectionPerElectron(p, kineticEnergy);
160 }                                                 170 }
161                                                   171 
162 //....oooOO0OOooo........oooOO0OOooo........oo << 
163                                                << 
164 G4double G4eeToHadronsMultiModel::ComputeCross << 
165                  G4double kineticEnergy,       << 
166                  G4double, G4double)           << 
167 {                                              << 
168   G4double res = 0.0;                          << 
169                                                << 
170   G4double energy = LabToCM(kineticEnergy);    << 
171                                                << 
172   if (energy > thKineticEnergy) {              << 
173     for(G4int i=0; i<nModels; i++) {           << 
174       if(energy >= ekinMin[i] && energy <= eki << 
175         res += (models[i])->ComputeCrossSectio << 
176       }                                        << 
177       cumSum[i] = res;                         << 
178     }                                          << 
179   }                                            << 
180   return res*csFactor;                         << 
181 }                                              << 
182                                                   172 
183 //....oooOO0OOooo........oooOO0OOooo........oo    173 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
184                                                   174 
185 void G4eeToHadronsMultiModel::SampleSecondarie    175 void G4eeToHadronsMultiModel::SampleSecondaries(
186            std::vector<G4DynamicParticle*>* ne    176            std::vector<G4DynamicParticle*>* newp,
187      const G4MaterialCutsCouple* couple,          177      const G4MaterialCutsCouple* couple,
188      const G4DynamicParticle* dp,                 178      const G4DynamicParticle* dp,
189      G4double, G4double)                          179      G4double, G4double)
190 {                                                 180 {
191   G4double kinEnergy = dp->GetKineticEnergy();    181   G4double kinEnergy = dp->GetKineticEnergy();
192   G4double energy = LabToCM(kinEnergy);           182   G4double energy = LabToCM(kinEnergy);
193   if (energy > thKineticEnergy) {                 183   if (energy > thKineticEnergy) {
194     G4double q = cumSum[nModels-1]*G4UniformRa    184     G4double q = cumSum[nModels-1]*G4UniformRand();
195     for(G4int i=0; i<nModels; ++i) {           << 185     for(G4int i=0; i<nModels; i++) {
196       if(q <= cumSum[i]) {                        186       if(q <= cumSum[i]) {
197         (models[i])->SampleSecondaries(newp, c    187         (models[i])->SampleSecondaries(newp, couple,dp);
198   if(newp->size() > 0) {                          188   if(newp->size() > 0) {
199     fParticleChange->ProposeTrackStatus(fStopA    189     fParticleChange->ProposeTrackStatus(fStopAndKill);
200   }                                               190   }
201   break;                                          191   break;
202       }                                           192       }
203     }                                             193     }
204   }                                               194   }
205 }                                                 195 }
206                                                   196 
207 //....oooOO0OOooo........oooOO0OOooo........oo    197 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
208                                                   198 
209 void G4eeToHadronsMultiModel::ModelDescription << 199 void G4eeToHadronsMultiModel::PrintInfo()
210 {                                                 200 {
211   if(verbose > 0) {                               201   if(verbose > 0) {
212     G4double e1 = 0.5*thKineticEnergy*thKineti    202     G4double e1 = 0.5*thKineticEnergy*thKineticEnergy/electron_mass_c2 
213       - 2.0*electron_mass_c2;                     203       - 2.0*electron_mass_c2; 
214     G4double e2 = 0.5*maxKineticEnergy*maxKine    204     G4double e2 = 0.5*maxKineticEnergy*maxKineticEnergy/electron_mass_c2 
215       - 2.0*electron_mass_c2;                     205       - 2.0*electron_mass_c2; 
216     outFile << "      e+ annihilation into had << 206     G4cout << "      e+ annihilation into hadrons active from "
217       << e1/GeV << " GeV to " << e2/GeV << " G << 207            << e1/GeV << " GeV to " << e2/GeV << " GeV"
                                                   >> 208            << G4endl;
218   }                                               209   }
219 }                                                 210 }
220                                                   211 
221 //....oooOO0OOooo........oooOO0OOooo........oo    212 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
222                                                   213 
223 void G4eeToHadronsMultiModel::SetCrossSecFacto    214 void G4eeToHadronsMultiModel::SetCrossSecFactor(G4double fac)
224 {                                                 215 {
225   if(fac > 1.0) {                                 216   if(fac > 1.0) {
226     csFactor = fac;                               217     csFactor = fac;
227     if(verbose > 0) {                             218     if(verbose > 0) {
228       G4cout << "### G4eeToHadronsMultiModel:     219       G4cout << "### G4eeToHadronsMultiModel: The cross section for "
229        << "G4eeToHadronsMultiModel is increase    220        << "G4eeToHadronsMultiModel is increased by " 
230        << csFactor << " times" << G4endl;         221        << csFactor << " times" << G4endl;
231     }                                             222     }
232   }                                               223   }
233 }                                                 224 }
234                                                   225 
235 //....oooOO0OOooo........oooOO0OOooo........oo    226 //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
236                                                   227