Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/hadronic/cross_sections/src/G4ChipsAntiBaryonInelasticXS.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.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/cross_sections/src/G4ChipsAntiBaryonInelasticXS.cc (Version 11.3.0) and /processes/hadronic/cross_sections/src/G4ChipsAntiBaryonInelasticXS.cc (Version 11.2)


  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 //                                                 26 //
 27 // The lust update: M.V. Kossov, CERN/ITEP(Mos     27 // The lust update: M.V. Kossov, CERN/ITEP(Moscow) 17-June-02
 28 //                                                 28 //
 29 //                                                 29 //
 30 // G4 Physics class: G4ChipsAntiBaryonInelasti     30 // G4 Physics class: G4ChipsAntiBaryonInelasticXS for gamma+A cross sections
 31 // Created: M.V. Kossov, CERN/ITEP(Moscow), 20     31 // Created: M.V. Kossov, CERN/ITEP(Moscow), 20-Dec-03
 32 // The last update: M.V. Kossov, CERN/ITEP (Mo     32 // The last update: M.V. Kossov, CERN/ITEP (Moscow) 15-Feb-04
 33 //                                                 33 //
 34 // -------------------------------------------     34 // -------------------------------------------------------------------------------------
 35 // Short description: Cross-sections extracted     35 // Short description: Cross-sections extracted (by W.Pokorski) from the CHIPS package for 
 36 // anti-baryoninteractions. Original author: M     36 // anti-baryoninteractions. Original author: M. Kossov
 37 // -------------------------------------------     37 // -------------------------------------------------------------------------------------
 38 //                                                 38 //
 39                                                    39 
 40 #include "G4ChipsAntiBaryonInelasticXS.hh"         40 #include "G4ChipsAntiBaryonInelasticXS.hh"
 41 #include "G4SystemOfUnits.hh"                      41 #include "G4SystemOfUnits.hh"
 42 #include "G4DynamicParticle.hh"                    42 #include "G4DynamicParticle.hh"
 43 #include "G4ParticleDefinition.hh"                 43 #include "G4ParticleDefinition.hh"
 44 #include "G4AntiNeutron.hh"                        44 #include "G4AntiNeutron.hh"
 45 #include "G4AntiProton.hh"                         45 #include "G4AntiProton.hh"
 46 #include "G4AntiLambda.hh"                         46 #include "G4AntiLambda.hh"
 47 #include "G4AntiSigmaPlus.hh"                      47 #include "G4AntiSigmaPlus.hh"
 48 #include "G4AntiSigmaMinus.hh"                     48 #include "G4AntiSigmaMinus.hh"
 49 #include "G4AntiSigmaZero.hh"                      49 #include "G4AntiSigmaZero.hh"
 50 #include "G4AntiXiMinus.hh"                        50 #include "G4AntiXiMinus.hh"
 51 #include "G4AntiXiZero.hh"                         51 #include "G4AntiXiZero.hh"
 52 #include "G4AntiOmegaMinus.hh"                     52 #include "G4AntiOmegaMinus.hh"
 53 #include "G4Log.hh"                                53 #include "G4Log.hh"
 54 #include "G4Exp.hh"                                54 #include "G4Exp.hh"
 55 #include "G4Pow.hh"                                55 #include "G4Pow.hh"
 56                                                    56 
 57 // factory                                         57 // factory
 58 #include "G4CrossSectionFactory.hh"                58 #include "G4CrossSectionFactory.hh"
 59 //                                                 59 //
 60 G4_DECLARE_XS_FACTORY(G4ChipsAntiBaryonInelast     60 G4_DECLARE_XS_FACTORY(G4ChipsAntiBaryonInelasticXS);
 61                                                    61 
 62 G4ChipsAntiBaryonInelasticXS::G4ChipsAntiBaryo     62 G4ChipsAntiBaryonInelasticXS::G4ChipsAntiBaryonInelasticXS():G4VCrossSectionDataSet(Default_Name())
 63 {                                                  63 {
 64   lastLEN=0; // Pointer to lastArray of LowEn      64   lastLEN=0; // Pointer to lastArray of LowEn CS
 65   lastHEN=0; // Pointer to lastArray of HighEn     65   lastHEN=0; // Pointer to lastArray of HighEn CS
 66   lastN=0;   // The last N of calculated nucle     66   lastN=0;   // The last N of calculated nucleus
 67   lastZ=0;   // The last Z of calculated nucle     67   lastZ=0;   // The last Z of calculated nucleus
 68   lastP=0.;  // Last used Cross Section Moment     68   lastP=0.;  // Last used Cross Section Momentum
 69   lastTH=0.; // Last threshold momentum            69   lastTH=0.; // Last threshold momentum
 70   lastCS=0.; // Last value of the Cross Sectio     70   lastCS=0.; // Last value of the Cross Section
 71   lastI=0;   // The last position in the DAMDB     71   lastI=0;   // The last position in the DAMDB
 72   LEN = new std::vector<G4double*>;                72   LEN = new std::vector<G4double*>;
 73   HEN = new std::vector<G4double*>;                73   HEN = new std::vector<G4double*>;
 74 }                                                  74 }
 75                                                    75 
 76 G4ChipsAntiBaryonInelasticXS::~G4ChipsAntiBary     76 G4ChipsAntiBaryonInelasticXS::~G4ChipsAntiBaryonInelasticXS()
 77 {                                                  77 {
 78   std::size_t lens=LEN->size();                    78   std::size_t lens=LEN->size();
 79   for(std::size_t i=0; i<lens; ++i) delete[] (     79   for(std::size_t i=0; i<lens; ++i) delete[] (*LEN)[i];
 80   delete LEN;                                      80   delete LEN;
 81   std::size_t hens=HEN->size();                    81   std::size_t hens=HEN->size();
 82   for(std::size_t i=0; i<hens; ++i) delete[] (     82   for(std::size_t i=0; i<hens; ++i) delete[] (*HEN)[i];
 83   delete HEN;                                      83   delete HEN;
 84 }                                                  84 }
 85                                                    85 
 86 void G4ChipsAntiBaryonInelasticXS::CrossSectio     86 void G4ChipsAntiBaryonInelasticXS::CrossSectionDescription(std::ostream& outFile) const
 87 {                                                  87 {
 88   outFile << "G4ChipsAntiBaryonInelasticXS pro     88   outFile << "G4ChipsAntiBaryonInelasticXS provides the inelastic cross\n"
 89           << "section for anti-baryon nucleus      89           << "section for anti-baryon nucleus scattering as a function of incident\n"
 90           << "momentum. The cross section is c     90           << "momentum. The cross section is calculated using M. Kossov's\n"
 91           << "CHIPS parameterization of cross      91           << "CHIPS parameterization of cross section data.\n";
 92 }                                                  92 }
 93                                                    93 
 94                                                    94 
 95 G4bool G4ChipsAntiBaryonInelasticXS::IsIsoAppl     95 G4bool G4ChipsAntiBaryonInelasticXS::IsIsoApplicable(const G4DynamicParticle*, G4int, G4int,    
 96          const G4Element*,                         96          const G4Element*,
 97          const G4Material*)                        97          const G4Material*)
 98 {                                                  98 {
 99   /*                                               99   /*
100   const G4ParticleDefinition* particle = Pt->G    100   const G4ParticleDefinition* particle = Pt->GetDefinition();
101                                                   101 
102   if(particle == G4AntiNeutron::AntiNeutron())    102   if(particle == G4AntiNeutron::AntiNeutron())
103   {                                               103   {
104     return true;                                  104     return true;
105   }                                               105   }
106   else if(particle == G4AntiProton::AntiProton    106   else if(particle == G4AntiProton::AntiProton())
107   {                                               107   {
108     return true;                                  108     return true;
109   }                                               109   }
110   else if(particle == G4AntiLambda::AntiLambda    110   else if(particle == G4AntiLambda::AntiLambda())
111   {                                               111   {
112     return true;                                  112     return true;
113   }                                               113   }
114   else if(particle == G4AntiSigmaPlus::AntiSig    114   else if(particle == G4AntiSigmaPlus::AntiSigmaPlus())
115   {                                               115   {
116     return true;                                  116     return true;
117   }                                               117   }
118   else if(particle == G4AntiSigmaMinus::AntiSi    118   else if(particle == G4AntiSigmaMinus::AntiSigmaMinus())
119   {                                               119   {
120     return true;                                  120     return true;
121   }                                               121   }
122   else if(particle == G4AntiSigmaZero::AntiSig    122   else if(particle == G4AntiSigmaZero::AntiSigmaZero())
123   {                                               123   {
124     return true;                                  124     return true;
125   }                                               125   }
126   else if(particle == G4AntiXiMinus::AntiXiMin    126   else if(particle == G4AntiXiMinus::AntiXiMinus())
127   {                                               127   {
128     return true;                                  128     return true;
129   }                                               129   }
130   else if(particle == G4AntiXiZero::AntiXiZero    130   else if(particle == G4AntiXiZero::AntiXiZero())
131   {                                               131   {
132     return true;                                  132     return true;
133   }                                               133   }
134   else if(particle == G4AntiOmegaMinus::AntiOm    134   else if(particle == G4AntiOmegaMinus::AntiOmegaMinus())
135   {                                               135   {
136     return true;                                  136     return true;
137   }                                               137   }
138   */                                              138   */
139   return true;                                    139   return true;
140 }                                                 140 }
141                                                   141 
142 // The main member function giving the collisi    142 // The main member function giving the collision cross section (P is in IU, CS is in mb)
143 // Make pMom in independent units ! (Now it is    143 // Make pMom in independent units ! (Now it is MeV)
144 G4double G4ChipsAntiBaryonInelasticXS::GetIsoC    144 G4double G4ChipsAntiBaryonInelasticXS::GetIsoCrossSection(const G4DynamicParticle* Pt, G4int tgZ, G4int A,  
145               const G4Isotope*,                   145               const G4Isotope*,
146               const G4Element*,                   146               const G4Element*,
147               const G4Material*)                  147               const G4Material*)
148 {                                                 148 {
149   G4double pMom=Pt->GetTotalMomentum();           149   G4double pMom=Pt->GetTotalMomentum();
150   G4int tgN = A - tgZ;                            150   G4int tgN = A - tgZ;
151   G4int pdg = Pt->GetDefinition()->GetPDGEncod    151   G4int pdg = Pt->GetDefinition()->GetPDGEncoding();
152                                                   152   
153   return GetChipsCrossSection(pMom, tgZ, tgN,     153   return GetChipsCrossSection(pMom, tgZ, tgN, pdg);
154 }                                                 154 }
155                                                   155 
156 G4double G4ChipsAntiBaryonInelasticXS::GetChip    156 G4double G4ChipsAntiBaryonInelasticXS::GetChipsCrossSection(G4double pMom, G4int tgZ, G4int tgN, G4int cPDG)
157 {                                                 157 {
158                                                   158 
159   G4bool in=false;                     // By d    159   G4bool in=false;                     // By default the isotope must be found in the AMDB
160   if(tgN!=lastN || tgZ!=lastZ)         // The     160   if(tgN!=lastN || tgZ!=lastZ)         // The nucleus was not the last used isotope
161   {                                               161   {
162     in = false;                        // By d    162     in = false;                        // By default the isotope haven't be found in AMDB  
163     lastP   = 0.;                      // New     163     lastP   = 0.;                      // New momentum history (nothing to compare with)
164     lastN   = tgN;                     // The     164     lastN   = tgN;                     // The last N of the calculated nucleus
165     lastZ   = tgZ;                     // The     165     lastZ   = tgZ;                     // The last Z of the calculated nucleus
166     lastI   = (G4int)colN.size();      // Size    166     lastI   = (G4int)colN.size();      // Size of the Associative Memory DB in the heap
167     j  = 0;                            // A#0f    167     j  = 0;                            // A#0f records found in DB for this projectile
168     if(lastI) for(G4int i=0; i<lastI; i++) //     168     if(lastI) for(G4int i=0; i<lastI; i++) // AMDB exists, try to find the (Z,N) isotope
169     {                                             169     {
170       if(colN[i]==tgN && colZ[i]==tgZ) // Try     170       if(colN[i]==tgN && colZ[i]==tgZ) // Try the record "i" in the AMDB
171       {                                           171       {
172         lastI=i;                       // Reme    172         lastI=i;                       // Remember the index for future fast/last use
173         lastTH =colTH[i];              // The     173         lastTH =colTH[i];              // The last THreshold (A-dependent)
174         if(pMom<=lastTH)                          174         if(pMom<=lastTH)
175         {                                         175         {
176           return 0.;                   // Ener    176           return 0.;                   // Energy is below the Threshold value
177         }                                         177         }
178         lastP  =colP [i];              // Last    178         lastP  =colP [i];              // Last Momentum  (A-dependent)
179         lastCS =colCS[i];              // Last    179         lastCS =colCS[i];              // Last CrossSect (A-dependent)
180         in = true;                     // This    180         in = true;                     // This is the case when the isotop is found in DB
181         // Momentum pMom is in IU ! @@ Units      181         // Momentum pMom is in IU ! @@ Units
182         lastCS=CalculateCrossSection(-1,j,cPDG    182         lastCS=CalculateCrossSection(-1,j,cPDG,lastZ,lastN,pMom); // read & update
183         if(lastCS<=0. && pMom>lastTH)  // Corr    183         if(lastCS<=0. && pMom>lastTH)  // Correct the threshold (@@ No intermediate Zeros)
184         {                                         184         {
185           lastCS=0.;                              185           lastCS=0.;
186           lastTH=pMom;                            186           lastTH=pMom;
187         }                                         187         }
188         break;                         // Go o    188         break;                         // Go out of the LOOP
189       }                                           189       }
190       j++;                             // Incr    190       j++;                             // Increment a#0f records found in DB
191     }                                             191     }
192     if(!in)                            // This    192     if(!in)                            // This isotope has not been calculated previously
193     {                                             193     {
194       //!!The slave functions must provide cro    194       //!!The slave functions must provide cross-sections in millibarns (mb) !! (not in IU)
195       lastCS=CalculateCrossSection(0,j,cPDG,la    195       lastCS=CalculateCrossSection(0,j,cPDG,lastZ,lastN,pMom); //calculate & create
196       //if(lastCS>0.)                   // It     196       //if(lastCS>0.)                   // It means that the AMBD was initialized
197       //{                                         197       //{
198                                                   198 
199       lastTH = 0; //ThresholdEnergy(tgZ, tgN);    199       lastTH = 0; //ThresholdEnergy(tgZ, tgN); // The Threshold Energy which is now the last
200         colN.push_back(tgN);                      200         colN.push_back(tgN);
201         colZ.push_back(tgZ);                      201         colZ.push_back(tgZ);
202         colP.push_back(pMom);                     202         colP.push_back(pMom);
203         colTH.push_back(lastTH);                  203         colTH.push_back(lastTH);
204         colCS.push_back(lastCS);                  204         colCS.push_back(lastCS);
205       //} // M.K. Presence of H1 with high thr    205       //} // M.K. Presence of H1 with high threshold breaks the syncronization
206       return lastCS*millibarn;                    206       return lastCS*millibarn;
207     } // End of creation of the new set of par    207     } // End of creation of the new set of parameters
208     else                                          208     else
209     {                                             209     {
210       colP[lastI]=pMom;                           210       colP[lastI]=pMom;
211       colCS[lastI]=lastCS;                        211       colCS[lastI]=lastCS;
212     }                                             212     }
213   } // End of parameters udate                    213   } // End of parameters udate
214   else if(pMom<=lastTH)                           214   else if(pMom<=lastTH)
215   {                                               215   {
216     return 0.;                         // Mome    216     return 0.;                         // Momentum is below the Threshold Value -> CS=0
217   }                                               217   }
218   else                                 // It i    218   else                                 // It is the last used -> use the current tables
219   {                                               219   {
220     lastCS=CalculateCrossSection(1,j,cPDG,last    220     lastCS=CalculateCrossSection(1,j,cPDG,lastZ,lastN,pMom); // Only read and UpdateDB
221     lastP=pMom;                                   221     lastP=pMom;
222   }                                               222   }
223   return lastCS*millibarn;                        223   return lastCS*millibarn;
224 }                                                 224 }
225                                                   225 
226 // The main member function giving the gamma-A    226 // The main member function giving the gamma-A cross section (E in GeV, CS in mb)
227 G4double G4ChipsAntiBaryonInelasticXS::Calcula    227 G4double G4ChipsAntiBaryonInelasticXS::CalculateCrossSection(G4int F, G4int I,
228                                         G4int,    228                                         G4int, G4int targZ, G4int targN, G4double Momentum)
229 {                                                 229 {
230   static const G4double THmin=27.;     // defa    230   static const G4double THmin=27.;     // default minimum Momentum (MeV/c) Threshold
231   static const G4double THmiG=THmin*.001; // m    231   static const G4double THmiG=THmin*.001; // minimum Momentum (GeV/c) Threshold
232   static const G4double dP=10.;        // step    232   static const G4double dP=10.;        // step for the LEN (Low ENergy) table MeV/c
233   static const G4double dPG=dP*.001;   // step    233   static const G4double dPG=dP*.001;   // step for the LEN (Low ENergy) table GeV/c
234   static const G4int    nL=105;        // A#of    234   static const G4int    nL=105;        // A#of LEN points in E (step 10 MeV/c)
235   static const G4double Pmin=THmin+(nL-1)*dP;     235   static const G4double Pmin=THmin+(nL-1)*dP; // minP for the HighE part with safety
236   static const G4double Pmax=227000.;  // maxP    236   static const G4double Pmax=227000.;  // maxP for the HEN (High ENergy) part 227 GeV
237   static const G4int    nH=224;        // A#of    237   static const G4int    nH=224;        // A#of HEN points in lnE
238   static const G4double milP=G4Log(Pmin);// Lo    238   static const G4double milP=G4Log(Pmin);// Low logarithm energy for the HEN part
239   static const G4double malP=G4Log(Pmax);// Hi    239   static const G4double malP=G4Log(Pmax);// High logarithm energy (each 2.75 percent)
240   static const G4double dlP=(malP-milP)/(nH-1)    240   static const G4double dlP=(malP-milP)/(nH-1); // Step in log energy in the HEN part
241   static const G4double milPG=G4Log(.001*Pmin)    241   static const G4double milPG=G4Log(.001*Pmin);// Low logarithmEnergy for HEN part GeV/c
                                                   >> 242   G4double sigma=0.;
                                                   >> 243   if(F&&I) sigma=0.;                   // @@ *!* Fake line *!* to use F & I !!!Temporary!!!
                                                   >> 244   //G4double A=targN+targZ;              // A of the target
242   if(F<=0)                             // This    245   if(F<=0)                             // This isotope was not the last used isotop
243   {                                               246   {
244     if(F<0)                            // This    247     if(F<0)                            // This isotope was found in DAMDB =-----=> RETRIEVE
245     {                                             248     {
246       G4int sync=(G4int)LEN->size();              249       G4int sync=(G4int)LEN->size();
247       if(sync<=I) G4cerr<<"*!*G4QPiMinusNuclCS    250       if(sync<=I) G4cerr<<"*!*G4QPiMinusNuclCS::CalcCrosSect:Sync="<<sync<<"<="<<I<<G4endl;
248       lastLEN=(*LEN)[I];               // Poin    251       lastLEN=(*LEN)[I];               // Pointer to prepared LowEnergy cross sections
249       lastHEN=(*HEN)[I];               // Poin    252       lastHEN=(*HEN)[I];               // Pointer to prepared High Energy cross sections
250     }                                             253     }
251     else                               // This    254     else                               // This isotope wasn't calculated before => CREATE
252     {                                             255     {
253       lastLEN = new G4double[nL];      // Allo    256       lastLEN = new G4double[nL];      // Allocate memory for the new LEN cross sections
254       lastHEN = new G4double[nH];      // Allo    257       lastHEN = new G4double[nH];      // Allocate memory for the new HEN cross sections
255       // --- Instead of making a separate func    258       // --- Instead of making a separate function ---
256       G4double P=THmiG;                // Tabl    259       G4double P=THmiG;                // Table threshold in GeV/c
257       for(G4int k=0; k<nL; k++)                   260       for(G4int k=0; k<nL; k++)
258       {                                           261       {
259         lastLEN[k] = CrossSectionLin(targZ, ta    262         lastLEN[k] = CrossSectionLin(targZ, targN, P);
260         P+=dPG;                                   263         P+=dPG;
261       }                                           264       }
262       G4double lP=milPG;                          265       G4double lP=milPG;
263       for(G4int n=0; n<nH; n++)                   266       for(G4int n=0; n<nH; n++)
264       {                                           267       {
265         lastHEN[n] = CrossSectionLog(targZ, ta    268         lastHEN[n] = CrossSectionLog(targZ, targN, lP);
266         lP+=dlP;                                  269         lP+=dlP;
267       }                                           270       }
268       // --- End of possible separate function    271       // --- End of possible separate function
269       // *** The synchronization check ***        272       // *** The synchronization check ***
270       G4int sync=(G4int)LEN->size();              273       G4int sync=(G4int)LEN->size();
271       if(sync!=I)                                 274       if(sync!=I)
272       {                                           275       {
273         G4cerr<<"***G4QPiMinusNuclCS::CalcCros    276         G4cerr<<"***G4QPiMinusNuclCS::CalcCrossSect: Sinc="<<sync<<"#"<<I<<", Z=" <<targZ
274               <<", N="<<targN<<", F="<<F<<G4en    277               <<", N="<<targN<<", F="<<F<<G4endl;
275         //G4Exception("G4PiMinusNuclearCS::Cal    278         //G4Exception("G4PiMinusNuclearCS::CalculateCS:","39",FatalException,"DBoverflow");
276       }                                           279       }
277       LEN->push_back(lastLEN);         // reme    280       LEN->push_back(lastLEN);         // remember the Low Energy Table
278       HEN->push_back(lastHEN);         // reme    281       HEN->push_back(lastHEN);         // remember the High Energy Table
279     } // End of creation of the new set of par    282     } // End of creation of the new set of parameters
280   } // End of parameters udate                    283   } // End of parameters udate
281   // =-------------------= NOW the Magic Formu    284   // =-------------------= NOW the Magic Formula =--------------------=
282   G4double sigma;                              << 
283   if (Momentum<lastTH) return 0.;      // It m    285   if (Momentum<lastTH) return 0.;      // It must be already checked in the interface class
284   else if (Momentum<Pmin)              // High    286   else if (Momentum<Pmin)              // High Energy region
285   {                                               287   {
286     sigma=EquLinearFit(Momentum,nL,THmin,dP,la    288     sigma=EquLinearFit(Momentum,nL,THmin,dP,lastLEN);
287   }                                               289   }
288   else if (Momentum<Pmax)              // High    290   else if (Momentum<Pmax)              // High Energy region
289   {                                               291   {
290     G4double lP=G4Log(Momentum);                  292     G4double lP=G4Log(Momentum);
291     sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN)    293     sigma=EquLinearFit(lP,nH,milP,dlP,lastHEN);
292   }                                               294   }
293   else                                 // UHE     295   else                                 // UHE region (calculation, not frequent)
294   {                                               296   {
295     G4double P=0.001*Momentum;         // Appr    297     G4double P=0.001*Momentum;         // Approximation formula is for P in GeV/c
296     sigma=CrossSectionFormula(targZ, targN, P,    298     sigma=CrossSectionFormula(targZ, targN, P, G4Log(P));
297   }                                               299   }
298   if(sigma<0.) return 0.;                         300   if(sigma<0.) return 0.;
299   return sigma;                                   301   return sigma;
300 }                                                 302 }
301                                                   303 
302 // Calculation formula for piMinus-nuclear ine    304 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) (P in GeV/c)
303 G4double G4ChipsAntiBaryonInelasticXS::CrossSe    305 G4double G4ChipsAntiBaryonInelasticXS::CrossSectionLin(G4int tZ, G4int tN, G4double P)
304 {                                                 306 {
305   G4double lP=G4Log(P);                           307   G4double lP=G4Log(P);
306   return CrossSectionFormula(tZ, tN, P, lP);      308   return CrossSectionFormula(tZ, tN, P, lP);
307 }                                                 309 }
308                                                   310 
309 // Calculation formula for piMinus-nuclear ine    311 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
310 G4double G4ChipsAntiBaryonInelasticXS::CrossSe    312 G4double G4ChipsAntiBaryonInelasticXS::CrossSectionLog(G4int tZ, G4int tN, G4double lP)
311 {                                                 313 {
312   G4double P=G4Exp(lP);                           314   G4double P=G4Exp(lP);
313   return CrossSectionFormula(tZ, tN, P, lP);      315   return CrossSectionFormula(tZ, tN, P, lP);
314 }                                                 316 }
315 // Calculation formula for piMinus-nuclear ine    317 // Calculation formula for piMinus-nuclear inelastic cross-section (mb) log(P in GeV/c)
316 G4double G4ChipsAntiBaryonInelasticXS::CrossSe    318 G4double G4ChipsAntiBaryonInelasticXS::CrossSectionFormula(G4int tZ, G4int tN,
317                                                   319                                                               G4double P, G4double lP)
318 {                                                 320 {
319   G4double sigma=0.;                              321   G4double sigma=0.;
320   if(tZ==1 && !tN)                        // A    322   if(tZ==1 && !tN)                        // AntiBar-Prot interaction from G4QuasiElRatios
321   {                                               323   {
322     G4double ld=lP-3.5;                           324     G4double ld=lP-3.5;
323     G4double ld2=ld*ld;                           325     G4double ld2=ld*ld;
324     G4double ye=G4Exp(lP*1.25);                   326     G4double ye=G4Exp(lP*1.25);
325     G4double yt=G4Exp(lP*0.35);                   327     G4double yt=G4Exp(lP*0.35);
326     G4double El=80./(ye+1.);                      328     G4double El=80./(ye+1.);
327     G4double To=(80./yt+.3)/yt;                   329     G4double To=(80./yt+.3)/yt;
328     sigma=(To-El)+.2443*ld2+31.48;                330     sigma=(To-El)+.2443*ld2+31.48;
329   }                                               331   }
330   else if(tZ==1 && tN==1)                         332   else if(tZ==1 && tN==1)
331   {                                               333   {
332     G4double r=lP-3.7;                            334     G4double r=lP-3.7;
333     sigma=0.6*r*r+67.+90.*G4Exp(-lP*.666);        335     sigma=0.6*r*r+67.+90.*G4Exp(-lP*.666);
334   }                                               336   }
335   else if(tZ<97 && tN<152)                // G    337   else if(tZ<97 && tN<152)                // General solution
336   {                                               338   {
337     G4double d=lP-4.2;                            339     G4double d=lP-4.2;
338     G4double sp=std::sqrt(P);                     340     G4double sp=std::sqrt(P);
339     G4double a=tN+tZ;                      //     341     G4double a=tN+tZ;                      // A of the target
340     G4double sa=std::sqrt(a);                     342     G4double sa=std::sqrt(a);
341     G4double a2=a*a;                              343     G4double a2=a*a;
342     G4double a3=a2*a;                             344     G4double a3=a2*a;
343     G4double a2s=a2*sa;                           345     G4double a2s=a2*sa;
344     G4double c=(170.+3600./a2s)/(1.+65./a2s)+4    346     G4double c=(170.+3600./a2s)/(1.+65./a2s)+40.*G4Pow::GetInstance()->powA(a,0.712)/(1.+12.2/a)/(1.+34./a2);
345     G4double r=(170.+0.01*a3)/(1.+a3/28000.);     347     G4double r=(170.+0.01*a3)/(1.+a3/28000.);
346     sigma=c+d*d+r/sp;                             348     sigma=c+d*d+r/sp;
347   }                                               349   }
348   else                                            350   else
349   {                                               351   {
350     G4cerr<<"-Warning-G4QAntiBarNuclearCroSect    352     G4cerr<<"-Warning-G4QAntiBarNuclearCroSect::CSForm:*Bad A* Z="<<tZ<<", N="<<tN<<G4endl;
351     sigma=0.;                                     353     sigma=0.;
352   }                                               354   }
353   if(sigma<0.) return 0.;                         355   if(sigma<0.) return 0.;
354   return sigma;                                   356   return sigma;  
355 }                                                 357 }
356                                                   358 
357 G4double G4ChipsAntiBaryonInelasticXS::EquLine    359 G4double G4ChipsAntiBaryonInelasticXS::EquLinearFit(G4double X, G4int N, G4double X0, G4double DX, G4double* Y)
358 {                                                 360 {
359   if(DX<=0. || N<2)                               361   if(DX<=0. || N<2)
360     {                                             362     {
361       G4cerr<<"***G4ChipsAntiBaryonInelasticXS    363       G4cerr<<"***G4ChipsAntiBaryonInelasticXS::EquLinearFit: DX="<<DX<<", N="<<N<<G4endl;
362       return Y[0];                                364       return Y[0];
363     }                                             365     }
364                                                   366   
365   G4int    N2=N-2;                                367   G4int    N2=N-2;
366   G4double d=(X-X0)/DX;                           368   G4double d=(X-X0)/DX;
367   G4int    jj=static_cast<int>(d);                369   G4int    jj=static_cast<int>(d);
368   if     (jj<0)  jj=0;                            370   if     (jj<0)  jj=0;
369   else if(jj>N2) jj=N2;                           371   else if(jj>N2) jj=N2;
370   d-=jj; // excess                                372   d-=jj; // excess
371   G4double yi=Y[jj];                              373   G4double yi=Y[jj];
372   G4double sigma=yi+(Y[jj+1]-yi)*d;               374   G4double sigma=yi+(Y[jj+1]-yi)*d;
373                                                   375   
374   return sigma;                                   376   return sigma;
375 }                                                 377 }
376                                                   378