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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/hadronic/models/im_r_matrix/src/G4VCrossSectionSource.cc (Version 11.3.0) and /processes/hadronic/models/im_r_matrix/src/G4VCrossSectionSource.cc (Version 6.0.p1)


  1 //                                                  1 //
  2 // *******************************************      2 // ********************************************************************
  3 // * License and Disclaimer                    <<   3 // * DISCLAIMER                                                       *
  4 // *                                                4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of th <<   5 // * The following disclaimer summarizes all the specific disclaimers *
  6 // * the Geant4 Collaboration.  It is provided <<   6 // * of contributors to this software. The specific disclaimers,which *
  7 // * conditions of the Geant4 Software License <<   7 // * govern, are listed with their locations in:                      *
  8 // * LICENSE and available at  http://cern.ch/ <<   8 // *   http://cern.ch/geant4/license                                  *
  9 // * include a list of copyright holders.      << 
 10 // *                                                9 // *                                                                  *
 11 // * Neither the authors of this software syst     10 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing fin     11 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warran     12 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assum     13 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  <<  14 // * use.                                                             *
 16 // * for the full disclaimer and the limitatio << 
 17 // *                                               15 // *                                                                  *
 18 // * This  code  implementation is the result  <<  16 // * This  code  implementation is the  intellectual property  of the *
 19 // * technical work of the GEANT4 collaboratio <<  17 // * GEANT4 collaboration.                                            *
 20 // * By using,  copying,  modifying or  distri <<  18 // * By copying,  distributing  or modifying the Program (or any work *
 21 // * any work based  on the software)  you  ag <<  19 // * based  on  the Program)  you indicate  your  acceptance of  this *
 22 // * use  in  resulting  scientific  publicati <<  20 // * statement, and all its terms.                                    *
 23 // * acceptance of all terms of the Geant4 Sof << 
 24 // *******************************************     21 // ********************************************************************
 25 //                                                 22 //
                                                   >>  23 // $Id: G4VCrossSectionSource.cc,v 1.2 2003/11/03 17:53:28 hpw Exp $ //
 26 //                                                 24 //
 27                                                    25 
 28 #include "globals.hh"                              26 #include "globals.hh"
 29 #include "G4SystemOfUnits.hh"                  << 
 30 #include "G4HadronicException.hh"                  27 #include "G4HadronicException.hh"
 31 #include "G4ios.hh"                                28 #include "G4ios.hh"
 32 #include "G4Pow.hh"                            << 
 33 #include "G4VCrossSectionSource.hh"                29 #include "G4VCrossSectionSource.hh"
 34 #include "G4ParticleDefinition.hh"                 30 #include "G4ParticleDefinition.hh"
 35 #include "G4KineticTrack.hh"                       31 #include "G4KineticTrack.hh"
 36 #include "G4CrossSectionVector.hh"                 32 #include "G4CrossSectionVector.hh"
 37 #include "G4CrossSectionSourcePtr.hh"              33 #include "G4CrossSectionSourcePtr.hh"
 38 #include "G4Proton.hh"                             34 #include "G4Proton.hh"
 39 #include "G4Neutron.hh"                            35 #include "G4Neutron.hh"
 40                                                    36 
 41 G4VCrossSectionSource::G4VCrossSectionSource()     37 G4VCrossSectionSource::G4VCrossSectionSource()
 42 { }                                                38 { }
 43                                                    39 
 44                                                    40 
 45 G4VCrossSectionSource::~G4VCrossSectionSource(     41 G4VCrossSectionSource::~G4VCrossSectionSource()
 46 { }                                                42 { }
 47                                                    43 
 48                                                    44 
 49 const G4ParticleDefinition * G4VCrossSectionSo <<  45 G4String G4VCrossSectionSource::
 50 FindKeyParticle(const G4KineticTrack& trk1,con     46 FindKeyParticle(const G4KineticTrack& trk1,const G4KineticTrack& trk2) const
 51 {                                                  47 {
 52   const G4ParticleDefinition * result;         <<  48   G4String result;
 53                                                    49   
 54   const G4ParticleDefinition * p1 = trk1.GetDe <<  50   G4ParticleDefinition * p1 = trk1.GetDefinition();
 55   const G4ParticleDefinition * p2 = trk2.GetDe <<  51   G4ParticleDefinition * p2 = trk2.GetDefinition();
 56                                                    52   
 57   if( (p1==G4Proton::Proton() && p2==G4Proton:     53   if( (p1==G4Proton::Proton() && p2==G4Proton::Proton() ) ||
 58       (p1==G4Neutron::Neutron() && p2==G4Neutr     54       (p1==G4Neutron::Neutron() && p2==G4Neutron::Neutron()) )
 59   {                                                55   {
 60     result = G4Proton::Proton();               <<  56     result = G4Proton::Proton()->GetParticleName();
 61   }                                                57   }
 62   else if( (p1==G4Neutron::Neutron() && p2==G4     58   else if( (p1==G4Neutron::Neutron() && p2==G4Proton::Proton()) ||
 63            (p2==G4Neutron::Neutron() && p1==G4     59            (p2==G4Neutron::Neutron() && p1==G4Proton::Proton()) )
 64   {                                                60   {
 65     result = G4Neutron::Neutron();             <<  61     result = G4Neutron::Neutron()->GetParticleName();
 66   }                                                62   }
 67   else                                             63   else
 68   {                                                64   {
 69     throw G4HadronicException(__FILE__, __LINE     65     throw G4HadronicException(__FILE__, __LINE__, "G4VCrossSectionSource: unklnown particles in FindKeyParticle");
 70   }                                                66   }
 71   return result;                                   67   return result;
 72 }                                                  68 }
 73                                                    69 
 74 G4bool G4VCrossSectionSource::operator==(const     70 G4bool G4VCrossSectionSource::operator==(const G4VCrossSectionSource &right) const
 75 {                                                  71 {
 76   return (this == (G4VCrossSectionSource *) &r     72   return (this == (G4VCrossSectionSource *) &right);
 77 }                                                  73 }
 78                                                    74 
 79                                                    75 
 80 G4bool G4VCrossSectionSource::operator!=(const     76 G4bool G4VCrossSectionSource::operator!=(const G4VCrossSectionSource &right) const
 81 {                                                  77 {
 82   return (this != (G4VCrossSectionSource *) &r     78   return (this != (G4VCrossSectionSource *) &right);
 83 }                                                  79 }
 84                                                    80 
 85                                                    81 
 86 void G4VCrossSectionSource::Print() const          82 void G4VCrossSectionSource::Print() const
 87 {                                                  83 {
 88   std::size_t nComponents = 0;                 <<  84   G4int nComponents = 0;
 89   const G4CrossSectionVector* components = Get     85   const G4CrossSectionVector* components = GetComponents();
 90   if (components)                                  86   if (components)
 91     {                                              87     {
 92       nComponents = components->size();            88       nComponents = components->size();
 93     }                                              89     }
 94   G4cout << "---- " << this->Name() << " ----      90   G4cout << "---- " << this->Name() << " ---- has " << nComponents << " components" <<G4endl;
 95   for (std::size_t i=0; i<nComponents; ++i)    <<  91   G4int i;
                                                   >>  92   for (i=0; i<nComponents; i++)
 96     {                                              93     {
 97       G4cout << "-" <<  this->Name() << " - Co     94       G4cout << "-" <<  this->Name() << " - Component " << i << ": " <<G4endl;
 98                                                    95 
 99       G4CrossSectionSourcePtr componentPtr = (     96       G4CrossSectionSourcePtr componentPtr = (*components)[i];
100       G4VCrossSectionSource* component = compo     97       G4VCrossSectionSource* component = componentPtr();
101       component->Print();                          98       component->Print();
102     }                                              99     }
103 }                                                 100 }
104                                                   101 
105                                                   102 
106 void G4VCrossSectionSource::PrintAll(const G4K    103 void G4VCrossSectionSource::PrintAll(const G4KineticTrack& trk1, const G4KineticTrack& trk2) const
107 {                                                 104 {
108   G4double sqrtS = (trk1.Get4Momentum() + trk2    105   G4double sqrtS = (trk1.Get4Momentum() + trk2.Get4Momentum()).mag();
109   G4double sigma = CrossSection(trk1,trk2) / m    106   G4double sigma = CrossSection(trk1,trk2) / millibarn;
110   G4cout << "---- " << Name() << ": "             107   G4cout << "---- " << Name() << ": "
111    << "Ecm = " << sqrtS / GeV << " GeV -  "       108    << "Ecm = " << sqrtS / GeV << " GeV -  " 
112    << " Cross section = " << sigma << " mb "      109    << " Cross section = " << sigma << " mb "
113    << G4endl;                                     110    << G4endl;
114                                                   111 
115   std::size_t nComponents = 0;                 << 112   G4int nComponents = 0;
116   const G4CrossSectionVector* components = Get    113   const G4CrossSectionVector* components = GetComponents();
117   if (components != 0)                            114   if (components != 0)
118     {                                             115     {
119       nComponents = components->size();           116       nComponents = components->size();
120     }                                             117     }
121   for (std::size_t i=0; i<nComponents; ++i)    << 118   G4int i;
                                                   >> 119   for (i=0; i<nComponents; i++)
122     {                                             120     {
123       G4cout << "* Component " << i << ": ";      121       G4cout << "* Component " << i << ": ";
124       G4CrossSectionSourcePtr componentPtr = (    122       G4CrossSectionSourcePtr componentPtr = (*components)[i];
125       G4VCrossSectionSource* component = compo    123       G4VCrossSectionSource* component = componentPtr();
126       component->PrintAll(trk1,trk2);             124       component->PrintAll(trk1,trk2);
127     }                                             125     }
128 }                                                 126 }
129                                                   127 
130                                                   128 
131 G4bool G4VCrossSectionSource::InLimits(G4doubl    129 G4bool G4VCrossSectionSource::InLimits(G4double e, G4double eLow, G4double eHigh) const
132 {                                                 130 {
133   G4bool answer = false;                          131   G4bool answer = false;
134   if (e >= eLow && e <= eHigh) answer = true;     132   if (e >= eLow && e <= eHigh) answer = true;
135   return answer;                                  133   return answer;
136 }                                                 134 }
137                                                   135 
138 G4double G4VCrossSectionSource::LowLimit() con    136 G4double G4VCrossSectionSource::LowLimit() const
139 {                                                 137 {
140   return 0.;                                      138   return 0.; 
141 }                                                 139 }
142                                                   140 
143                                                   141 
144 G4double G4VCrossSectionSource::HighLimit() co    142 G4double G4VCrossSectionSource::HighLimit() const
145 {                                                 143 {
146   return DBL_MAX;                                 144   return DBL_MAX; 
147 }                                                 145 }
148                                                   146 
149 G4bool G4VCrossSectionSource::IsValid(G4double    147 G4bool G4VCrossSectionSource::IsValid(G4double e) const
150 {                                                 148 {
151   G4bool answer = false;                          149   G4bool answer = false;
152   if (e >= LowLimit() && e <= HighLimit()) ans    150   if (e >= LowLimit() && e <= HighLimit()) answer = true;
153   return answer;                                  151   return answer;
154 }                                                 152 }
155                                                   153 
156 const G4ParticleDefinition* G4VCrossSectionSou    154 const G4ParticleDefinition* G4VCrossSectionSource::FindLightParticle(const G4KineticTrack& trk1, 
157                      const G4KineticTrack& trk    155                      const G4KineticTrack& trk2) const
158 {                                                 156 {
159   G4double mass1 = trk1.GetDefinition()->GetPD    157   G4double mass1 = trk1.GetDefinition()->GetPDGMass();
160   G4double mass2 = trk2.GetDefinition()->GetPD    158   G4double mass2 = trk2.GetDefinition()->GetPDGMass();
161   if (mass1 < mass2)                              159   if (mass1 < mass2)
162     {                                             160     {
163       return trk1.GetDefinition();                161       return trk1.GetDefinition();
164     }                                             162     }
165   else                                            163   else
166     {                                             164     {
167       return trk2.GetDefinition();                165       return trk2.GetDefinition();
168     }                                             166     }
169 }                                                 167 }
170                                                   168 
171                                                   169 
172 G4double G4VCrossSectionSource::FcrossX(G4doub << 170 const G4double G4VCrossSectionSource::FcrossX(G4double e, G4double e0, G4double sigma, 
173                      G4double sigma, G4double  << 171                 G4double eParam, G4double power) const
174 {                                                 172 {
175   G4double result = 0.;                           173   G4double result = 0.;
176                                                   174 
177   G4double denom = eParam*eParam + (e-e0)*(e-e    175   G4double denom = eParam*eParam + (e-e0)*(e-e0);
178   if (denom > 0.)                                 176   if (denom > 0.) 
179   {                                               177   {
180     G4double value = (2.* eParam * sigma * (e- << 178     G4double value = (2.* eParam * sigma * (e-e0) / denom) * pow(((e0 + eParam) / e), power);
181     result = std::max(0., value);                 179     result = std::max(0., value);
182   }                                               180   }
183   return result;                                  181   return result;
184 }                                                 182 }     
                                                   >> 183     
                                                   >> 184 const G4double G4VCrossSectionSource::GetTransversePionMass() const
                                                   >> 185 {
                                                   >> 186   // Parameter from UrQMD
                                                   >> 187   const G4double transversePionMass = 0.3 * GeV;
                                                   >> 188   return transversePionMass;
                                                   >> 189 }
                                                   >> 190 
185                                                   191 
                                                   >> 192 const G4double G4VCrossSectionSource::GetMinStringMass() const
                                                   >> 193 {
                                                   >> 194   // Parameter from UrQMD
                                                   >> 195   const G4double minStringMass = 0.52 * GeV;
                                                   >> 196   return minStringMass;
                                                   >> 197 }
186                                                   198 
187                                                   199 
188                                                   200 
189                                                   201