Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/processes/hadronic/models/inclxx/incl_physics/src/G4INCLNpiToSKChannel.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/models/inclxx/incl_physics/src/G4INCLNpiToSKChannel.cc (Version 11.3.0) and /processes/hadronic/models/inclxx/incl_physics/src/G4INCLNpiToSKChannel.cc (Version 3.1)


  1 //                                                  1 
  2 // *******************************************    
  3 // * License and Disclaimer                       
  4 // *                                              
  5 // * The  Geant4 software  is  copyright of th    
  6 // * the Geant4 Collaboration.  It is provided    
  7 // * conditions of the Geant4 Software License    
  8 // * LICENSE and available at  http://cern.ch/    
  9 // * include a list of copyright holders.         
 10 // *                                              
 11 // * Neither the authors of this software syst    
 12 // * institutes,nor the agencies providing fin    
 13 // * work  make  any representation or  warran    
 14 // * regarding  this  software system or assum    
 15 // * use.  Please see the license in the file     
 16 // * for the full disclaimer and the limitatio    
 17 // *                                              
 18 // * This  code  implementation is the result     
 19 // * technical work of the GEANT4 collaboratio    
 20 // * By using,  copying,  modifying or  distri    
 21 // * any work based  on the software)  you  ag    
 22 // * use  in  resulting  scientific  publicati    
 23 // * acceptance of all terms of the Geant4 Sof    
 24 // *******************************************    
 25 //                                                
 26 // INCL++ intra-nuclear cascade model             
 27 // Alain Boudard, CEA-Saclay, France              
 28 // Joseph Cugnon, University of Liege, Belgium    
 29 // Jean-Christophe David, CEA-Saclay, France      
 30 // Pekka Kaitaniemi, CEA-Saclay, France, and H    
 31 // Sylvie Leray, CEA-Saclay, France               
 32 // Davide Mancusi, CEA-Saclay, France             
 33 //                                                
 34 #define INCLXX_IN_GEANT4_MODE 1                   
 35                                                   
 36 #include "globals.hh"                             
 37                                                   
 38 #include "G4INCLNpiToSKChannel.hh"                
 39 #include "G4INCLKinematicsUtils.hh"               
 40 #include "G4INCLBinaryCollisionAvatar.hh"         
 41 #include "G4INCLCrossSections.hh"                 
 42 #include "G4INCLRandom.hh"                        
 43 #include "G4INCLGlobals.hh"                       
 44 #include "G4INCLLogger.hh"                        
 45 #include <algorithm>                              
 46 #include "G4INCLPhaseSpaceGenerator.hh"           
 47                                                   
 48 namespace G4INCL {                                
 49                                                   
 50   NpiToSKChannel::NpiToSKChannel(Particle *p1,    
 51     : particle1(p1), particle2(p2)                
 52     {}                                            
 53                                                   
 54   NpiToSKChannel::~NpiToSKChannel(){}             
 55                                                   
 56   void NpiToSKChannel::fillFinalState(FinalSta    
 57                                                   
 58     Particle *nucleon;                            
 59     Particle *pion;                               
 60                                                   
 61     if(particle1->isNucleon()){                   
 62       nucleon = particle1;                        
 63       pion = particle2;                           
 64     }                                             
 65     else{                                         
 66       nucleon = particle2;                        
 67       pion = particle1;                           
 68     }                                             
 69                                                   
 70     const G4int iso = ParticleTable::getIsospi    
 71                                                   
 72     G4double SmKpCX = CrossSections::p_pimToSm    
 73     G4double SzKzCX = CrossSections::p_pimToSz    
 74     G4double SzKpCX = CrossSections::p_pizToSz    
 75     G4double rdm = Random::shoot();               
 76                                                   
 77     ParticleType SigmaType, KaonType;             
 78                                                   
 79     G4int Channel = 99;                           
 80                                                   
 81     if(iso == 3 || iso == -3){                    
 82       SigmaType = ParticleTable::getSigmaType(    
 83       KaonType = ParticleTable::getKaonType(is    
 84       Channel = 1; // "3/2" // Measured           
 85     }                                             
 86     else if(pion->getType() == PiZero){           
 87       if(rdm*(SzKpCX+SzKzCX) < SzKzCX){           
 88         SigmaType = ParticleTable::getSigmaTyp    
 89         KaonType = ParticleTable::getKaonType(    
 90           Channel = 0; // sqrt(1/2)*"3/2"+sqrt    
 91       }                                           
 92       else{                                       
 93         SigmaType = SigmaZero;                    
 94         KaonType = ParticleTable::getKaonType(    
 95           Channel = 0; // sqrt(2/3)*"3/2"+sqrt    
 96       }                                           
 97     }                                             
 98     else{                                         
 99       if(rdm*(SmKpCX+SzKzCX) < SzKzCX){           
100         SigmaType = SigmaZero;                    
101         KaonType = ParticleTable::getKaonType(    
102           Channel = 0; // sqrt(1/2)*"3/2"+sqrt    
103       }                                           
104       else{                                       
105         SigmaType = ParticleTable::getSigmaTyp    
106         KaonType = ParticleTable::getKaonType(    
107           Channel = 0; // sqrt(1/3)*"3/2"+sqrt    
108       }                                           
109     }                                             
110                                                   
111                                                   
112     ThreeVector mom_hyperon = KaonMomentum(pio    
113                                                   
114     nucleon->setType(SigmaType);                  
115     pion->setType(KaonType);                      
116                                                   
117     G4double norm = KinematicsUtils::momentumI    
118                                                   
119     nucleon->setMomentum(mom_hyperon*norm);       
120     pion->setMomentum(-mom_hyperon*norm);         
121                                                   
122     nucleon->adjustEnergyFromMomentum();          
123     pion->adjustEnergyFromMomentum();             
124                                                   
125 #ifdef INCLXX_IN_GEANT4_MODE                      
126     // Erase the parent resonance information     
127     nucleon->setParentResonancePDGCode(0);        
128     nucleon->setParentResonanceID(0);             
129     pion->setParentResonancePDGCode(0);           
130     pion->setParentResonanceID(0);                
131 #endif                                            
132                                                   
133     fs->addModifiedParticle(nucleon);             
134     fs->addModifiedParticle(pion);                
135                                                   
136   }                                               
137                                                   
138   ThreeVector NpiToSKChannel::KaonMomentum(Par    
139                                                   
140     const G4double pLab = KinematicsUtils::mom    
141                                                   
142     G4double min = 1040., max = 2375;             
143     if(WhichChannel == 1){                        
144       min = 1105.;                                
145       max = 2475;                                 
146     }                                             
147                                                   
148     if(pLab < min) return Random::normVector()    
149                                                   
150     G4double cos_theta = 1.;                      
151     G4double sin_theta = 0.;                      
152     const G4double cos_phi = std::cos(Random::    
153     const G4double sin_phi = std::sqrt(1-cos_p    
154                                                   
155     const G4double x = pion->getMomentum().get    
156     const G4double y = pion->getMomentum().get    
157     const G4double z = pion->getMomentum().get    
158                                                   
159     const G4double r = std::sqrt(x*x+y*y+z*z);    
160     const G4double rho = std::sqrt(x*x+y*y);      
161                                                   
162     if(pLab >= max){                              
163       const G4double b = 12. * pLab/2375.; //     
164       cos_theta = std::log(Random::shoot()*(st    
165       sin_theta = std::sqrt(1-cos_theta*cos_th    
166                                                   
167     }                                             
168     else{                                         
169       const G4double Legendre_coef[2][275][9]     
170         {// pi- p -> Sigma0 K0                    
171         {1040,0.18188,-0.04656,-0.07595,0.0151    
172         {1045,0.16386,-0.02812,-0.07075,0.0141    
173         {1050,0.14587,-0.00965,-0.06554,0.0132    
174         {1055,0.12793,0.00891,-0.0603,0.01228,    
175         {1060,0.11008,0.02758,-0.05502,0.01132    
176         {1065,0.09234,0.0464,-0.0497,0.01034,-    
177         {1070,0.07475,0.06543,-0.04431,0.00936    
178         {1075,0.05733,0.08469,-0.03886,0.00836    
179         {1080,0.04011,0.10423,-0.03331,0.00735    
180         {1085,0.02312,0.12408,-0.02767,0.00631    
181         {1090,0.00638,0.14429,-0.02192,0.00525    
182         {1095,-0.01007,0.1649,-0.01605,0.00417    
183         {1100,-0.02621,0.18591,-0.01004,0.0030    
184         {1105,-0.04203,0.20727,-0.00389,0.0019    
185         {1110,-0.05753,0.22885,0.00243,0.00076    
186         {1115,-0.0727,0.25057,0.00893,-0.00045    
187         {1120,-0.08753,0.27232,0.01561,-0.0017    
188         {1125,-0.10203,0.29401,0.02251,-0.0029    
189         {1130,-0.11619,0.31553,0.02963,-0.0043    
190         {1135,-0.13,0.33678,0.03699,-0.0057,-0    
191         {1140,-0.14346,0.35766,0.0446,-0.00713    
192         {1145,-0.15657,0.37808,0.05247,-0.0086    
193         {1150,-0.16932,0.39792,0.06063,-0.0101    
194         {1155,-0.1817,0.4171,0.06909,-0.01177,    
195         {1160,-0.19372,0.43551,0.07785,-0.0134    
196         {1165,-0.20536,0.45308,0.08694,-0.0151    
197         {1170,-0.2166,0.4698,0.09635,-0.01698,    
198         {1175,-0.22743,0.48566,0.10609,-0.0188    
199         {1180,-0.23783,0.50068,0.11617,-0.0207    
200         {1185,-0.24777,0.51485,0.12657,-0.0228    
201         {1190,-0.25724,0.52817,0.13732,-0.0248    
202         {1195,-0.26622,0.54063,0.1484,-0.02705    
203         {1200,-0.27469,0.55225,0.15982,-0.0292    
204         {1205,-0.28263,0.56301,0.17159,-0.0315    
205         {1210,-0.29002,0.57292,0.1837,-0.03396    
206         {1215,-0.29685,0.58199,0.19617,-0.0364    
207         {1220,-0.30309,0.5902,0.20898,-0.03895    
208         {1225,-0.30872,0.59755,0.22215,-0.0415    
209         {1230,-0.31373,0.60409,0.23567,-0.0442    
210         {1235,-0.31816,0.60992,0.2495,-0.04702    
211         {1240,-0.32203,0.61513,0.26362,-0.0498    
212         {1245,-0.32535,0.61986,0.27799,-0.0527    
213         {1250,-0.32816,0.62422,0.29257,-0.0556    
214         {1255,-0.33049,0.62831,0.30735,-0.0586    
215         {1260,-0.33236,0.63225,0.32228,-0.0617    
216         {1265,-0.3338,0.63615,0.33733,-0.0648,    
217         {1270,-0.33482,0.64013,0.35246,-0.0679    
218         {1275,-0.33547,0.6443,0.36766,-0.07106    
219         {1280,-0.33576,0.64877,0.38287,-0.0742    
220         {1285,-0.33573,0.65366,0.39808,-0.0774    
221         {1290,-0.33539,0.65907,0.41324,-0.0806    
222         {1295,-0.33477,0.6651,0.42834,-0.08379    
223         {1300,-0.33388,0.67178,0.44333,-0.0869    
224         {1305,-0.33274,0.67915,0.4582,-0.0901,    
225         {1310,-0.33138,0.68725,0.47292,-0.0931    
226         {1315,-0.32979,0.69613,0.48747,-0.0962    
227         {1320,-0.328,0.70582,0.50181,-0.09912,    
228         {1325,-0.32602,0.71635,0.51593,-0.1019    
229         {1330,-0.32387,0.72778,0.52979,-0.1046    
230         {1335,-0.32157,0.74013,0.54338,-0.1071    
231         {1340,-0.31911,0.75329,0.5567,-0.10955    
232         {1345,-0.31652,0.76713,0.56975,-0.1118    
233         {1350,-0.31379,0.78149,0.58256,-0.1140    
234         {1355,-0.31094,0.79624,0.59512,-0.1160    
235         {1360,-0.30797,0.81121,0.60747,-0.1181    
236         {1365,-0.30488,0.82628,0.6196,-0.12007    
237         {1370,-0.30169,0.84128,0.63153,-0.1219    
238         {1375,-0.29841,0.85607,0.64327,-0.1238    
239         {1380,-0.29503,0.87051,0.65484,-0.1257    
240         {1385,-0.29157,0.88445,0.66625,-0.1276    
241         {1390,-0.28803,0.89774,0.6775,-0.12959    
242         {1395,-0.28442,0.91023,0.68862,-0.1315    
243         {1400,-0.28074,0.9218,0.69961,-0.13357    
244         {1405,-0.27699,0.9324,0.71048,-0.13564    
245         {1410,-0.27316,0.94199,0.72125,-0.1377    
246         {1415,-0.26923,0.95056,0.73193,-0.1399    
247         {1420,-0.26519,0.95808,0.74253,-0.1421    
248         {1425,-0.26103,0.96451,0.75305,-0.1443    
249         {1430,-0.25674,0.96982,0.76351,-0.1466    
250         {1435,-0.25231,0.97399,0.77393,-0.1488    
251         {1440,-0.24772,0.97699,0.7843,-0.15118    
252         {1445,-0.24297,0.9788,0.79465,-0.15349    
253         {1450,-0.23805,0.97937,0.80498,-0.1558    
254         {1455,-0.23293,0.9787,0.81531,-0.15813    
255         {1460,-0.22762,0.97675,0.82564,-0.1604    
256         {1465,-0.22209,0.97364,0.83596,-0.1627    
257         {1470,-0.21634,0.96945,0.84628,-0.1649    
258         {1475,-0.21034,0.96431,0.85659,-0.1670    
259         {1480,-0.20408,0.95831,0.86688,-0.1690    
260         {1485,-0.19755,0.95157,0.87714,-0.1709    
261         {1490,-0.19073,0.9442,0.88738,-0.17258    
262         {1495,-0.18361,0.9363,0.89758,-0.17403    
263         {1500,-0.17616,0.92798,0.90773,-0.1752    
264         {1505,-0.16839,0.91935,0.91784,-0.1761    
265         {1510,-0.16026,0.91051,0.92789,-0.1767    
266         {1515,-0.15177,0.90158,0.93788,-0.1770    
267         {1520,-0.14291,0.89266,0.9478,-0.177,0    
268         {1525,-0.13368,0.88383,0.95762,-0.1765    
269         {1530,-0.1241,0.87515,0.9673,-0.17551,    
270         {1535,-0.11418,0.86671,0.9768,-0.17398    
271         {1540,-0.10394,0.85857,0.98609,-0.1718    
272         {1545,-0.09338,0.85081,0.99514,-0.1690    
273         {1550,-0.08253,0.84351,1.0039,-0.16555    
274         {1555,-0.0714,0.83672,1.01235,-0.16127    
275         {1560,-0.05999,0.83054,1.02044,-0.1561    
276         {1565,-0.04833,0.82502,1.02813,-0.1501    
277         {1570,-0.03643,0.82025,1.0354,-0.14316    
278         {1575,-0.02429,0.81629,1.04221,-0.1351    
279         {1580,-0.01194,0.8132,1.04852,-0.12614    
280         {1585,6e-04,0.81094,1.05435,-0.11607,0    
281         {1590,0.01333,0.80944,1.0597,-0.10499,    
282         {1595,0.02622,0.80866,1.06461,-0.09294    
283         {1600,0.03926,0.80853,1.06907,-0.07995    
284         {1605,0.05242,0.80899,1.0731,-0.06606,    
285         {1610,0.06569,0.80999,1.07673,-0.0513,    
286         {1615,0.07905,0.81145,1.07996,-0.03571    
287         {1620,0.09249,0.81333,1.08281,-0.01931    
288         {1625,0.10598,0.81556,1.08529,-0.00214    
289         {1630,0.11951,0.81809,1.08742,0.01576,    
290         {1635,0.13306,0.82085,1.08922,0.03437,    
291         {1640,0.14662,0.82378,1.09069,0.05364,    
292         {1645,0.16016,0.82683,1.09186,0.07355,    
293         {1650,0.17367,0.82994,1.09274,0.09406,    
294         {1655,0.18715,0.83306,1.09333,0.11511,    
295         {1660,0.20061,0.83616,1.09366,0.13665,    
296         {1665,0.21404,0.8392,1.09373,0.15861,0    
297         {1670,0.22745,0.84213,1.09356,0.18094,    
298         {1675,0.24084,0.84492,1.09315,0.20358,    
299         {1680,0.25423,0.84753,1.09251,0.22648,    
300         {1685,0.2676,0.84991,1.09167,0.24957,0    
301         {1690,0.28096,0.85203,1.09062,0.2728,0    
302         {1695,0.29432,0.85385,1.08938,0.29611,    
303         {1700,0.30768,0.85532,1.08797,0.31943,    
304         {1705,0.32104,0.85641,1.08639,0.34272,    
305         {1710,0.33441,0.85709,1.08465,0.36592,    
306         {1715,0.34774,0.8574,1.08275,0.389,0.9    
307         {1720,0.36102,0.85739,1.08069,0.41194,    
308         {1725,0.3742,0.85709,1.07845,0.43471,0    
309         {1730,0.38726,0.85657,1.07604,0.45729,    
310         {1735,0.40016,0.85586,1.07344,0.47966,    
311         {1740,0.41288,0.85501,1.07065,0.5018,0    
312         {1745,0.42537,0.85408,1.06767,0.52368,    
313         {1750,0.43761,0.85312,1.06448,0.54527,    
314         {1755,0.44956,0.85216,1.06109,0.56656,    
315         {1760,0.4612,0.85126,1.05749,0.58752,1    
316         {1765,0.47248,0.85047,1.05367,0.60813,    
317         {1770,0.48338,0.84982,1.04962,0.62836,    
318         {1775,0.49387,0.84939,1.04535,0.6482,1    
319         {1780,0.50391,0.84919,1.04084,0.66762,    
320         {1785,0.51352,0.84924,1.0361,0.68662,1    
321         {1790,0.52271,0.84953,1.03113,0.70521,    
322         {1795,0.53149,0.85007,1.02593,0.72339,    
323         {1800,0.53988,0.85085,1.02049,0.74116,    
324         {1805,0.54788,0.85186,1.01483,0.75854,    
325         {1810,0.55553,0.85311,1.00895,0.77552,    
326         {1815,0.56281,0.85459,1.00284,0.79211,    
327         {1820,0.56976,0.8563,0.9965,0.80831,1.    
328         {1825,0.57638,0.85823,0.98994,0.82413,    
329         {1830,0.58269,0.86039,0.98317,0.83957,    
330         {1835,0.58871,0.86277,0.97617,0.85463,    
331         {1840,0.59443,0.86538,0.96896,0.86933,    
332         {1845,0.59989,0.86819,0.96153,0.88366,    
333         {1850,0.60508,0.87122,0.95388,0.89763,    
334         {1855,0.61003,0.87447,0.94602,0.91124,    
335         {1860,0.61475,0.87792,0.93795,0.9245,1    
336         {1865,0.61926,0.88158,0.92967,0.93741,    
337         {1870,0.62356,0.88544,0.92118,0.94998,    
338         {1875,0.62767,0.88951,0.91248,0.9622,1    
339         {1880,0.6316,0.89378,0.90358,0.97409,1    
340         {1885,0.63537,0.89833,0.89449,0.98565,    
341         {1890,0.63898,0.90323,0.88523,0.99687,    
342         {1895,0.64246,0.90855,0.87582,1.00776,    
343         {1900,0.64581,0.91436,0.86626,1.01832,    
344         {1905,0.64904,0.92075,0.85659,1.02854,    
345         {1910,0.65217,0.92778,0.84681,1.03844,    
346         {1915,0.65522,0.93553,0.83694,1.048,1.    
347         {1920,0.65818,0.94407,0.82701,1.05723,    
348         {1925,0.66108,0.95349,0.81703,1.06614,    
349         {1930,0.66392,0.96384,0.80701,1.07471,    
350         {1935,0.66673,0.97522,0.79697,1.08296,    
351         {1940,0.6695,0.98768,0.78693,1.09088,1    
352         {1945,0.67226,1.00132,0.77691,1.09848,    
353         {1950,0.67502,1.01619,0.76692,1.10575,    
354         {1955,0.67778,1.03238,0.75698,1.11269,    
355         {1960,0.68056,1.04995,0.74712,1.11931,    
356         {1965,0.68338,1.06899,0.73733,1.12561,    
357         {1970,0.68624,1.08957,0.72765,1.13158,    
358         {1975,0.68916,1.11176,0.71809,1.13724,    
359         {1980,0.69215,1.13564,0.70866,1.14257,    
360         {1985,0.69523,1.16128,0.69939,1.14758,    
361         {1990,0.6984,1.18876,0.69029,1.15227,1    
362         {1995,0.70167,1.21815,0.68138,1.15664,    
363         {2000,0.70507,1.24952,0.67267,1.1607,1    
364         {2005,0.70859,1.2829,0.66418,1.16444,1    
365         {2010,0.71222,1.31813,0.6559,1.16793,1    
366         {2015,0.71594,1.35499,0.64783,1.17122,    
367         {2020,0.71974,1.39327,0.63995,1.17438,    
368         {2025,0.72358,1.43275,0.63226,1.17745,    
369         {2030,0.72745,1.47323,0.62475,1.18051,    
370         {2035,0.73133,1.51448,0.6174,1.18361,1    
371         {2040,0.73519,1.5563,0.61021,1.18681,1    
372         {2045,0.73903,1.59846,0.60318,1.19018,    
373         {2050,0.74281,1.64077,0.59628,1.19377,    
374         {2055,0.74651,1.683,0.58951,1.19764,1.    
375         {2060,0.75013,1.72495,0.58287,1.20184,    
376         {2065,0.75367,1.76647,0.57638,1.20635,    
377         {2070,0.75714,1.80742,0.57004,1.21116,    
378         {2075,0.76056,1.84767,0.56388,1.21622,    
379         {2080,0.76395,1.88707,0.55791,1.22151,    
380         {2085,0.76732,1.92548,0.55216,1.227,0.    
381         {2090,0.77069,1.96276,0.54665,1.23267,    
382         {2095,0.77407,1.99878,0.54138,1.23849,    
383         {2100,0.77748,2.03339,0.53639,1.24443,    
384         {2105,0.78093,2.06646,0.53168,1.25046,    
385         {2110,0.78443,2.09785,0.52728,1.25655,    
386         {2115,0.78801,2.12741,0.5232,1.26267,0    
387         {2120,0.79168,2.15503,0.51946,1.26881,    
388         {2125,0.79544,2.18067,0.51607,1.27496,    
389         {2130,0.79929,2.20434,0.51302,1.28111,    
390         {2135,0.80323,2.226,0.51031,1.28726,0.    
391         {2140,0.80726,2.24567,0.50795,1.29342,    
392         {2145,0.81139,2.26332,0.50593,1.29958,    
393         {2150,0.81561,2.27894,0.50426,1.30575,    
394         {2155,0.81994,2.29253,0.50293,1.31191,    
395         {2160,0.82435,2.30407,0.50195,1.31807,    
396         {2165,0.82887,2.31355,0.50131,1.32423,    
397         {2170,0.83349,2.32096,0.50102,1.33039,    
398         {2175,0.83821,2.3263,0.50107,1.33654,0    
399         {2180,0.84303,2.32955,0.50147,1.34269,    
400         {2185,0.84796,2.33069,0.50221,1.34883,    
401         {2190,0.85299,2.32973,0.5033,1.35497,0    
402         {2195,0.85813,2.32665,0.50473,1.3611,0    
403         {2200,0.86337,2.32144,0.50652,1.36722,    
404         {2205,0.86873,2.31409,0.50865,1.37333,    
405         {2210,0.87419,2.30458,0.51112,1.37943,    
406         {2215,0.87976,2.29291,0.51395,1.38551,    
407         {2220,0.88545,2.27907,0.51712,1.39159,    
408         {2225,0.89125,2.26305,0.52063,1.39765,    
409         {2230,0.89716,2.24483,0.5245,1.40369,0    
410         {2235,0.90319,2.22441,0.52871,1.40972,    
411         {2240,0.90933,2.20179,0.53328,1.41573,    
412         {2245,0.91559,2.17703,0.53817,1.42173,    
413         {2250,0.92195,2.15022,0.54339,1.42771,    
414         {2255,0.92842,2.12143,0.54892,1.43367,    
415         {2260,0.93499,2.09074,0.55475,1.43962,    
416         {2265,0.94165,2.05824,0.56086,1.44556,    
417         {2270,0.94841,2.02399,0.56725,1.45148,    
418         {2275,0.95525,1.98809,0.5739,1.45739,0    
419         {2280,0.96218,1.9506,0.5808,1.46328,0.    
420         {2285,0.96919,1.91161,0.58793,1.46917,    
421         {2290,0.97627,1.8712,0.59529,1.47504,0    
422         {2295,0.98342,1.82945,0.60286,1.48091,    
423         {2300,0.99064,1.78643,0.61063,1.48676,    
424         {2305,0.99792,1.74223,0.61858,1.49261,    
425         {2310,1.00526,1.69692,0.62671,1.49844,    
426         {2315,1.01265,1.65058,0.635,1.50427,1.    
427         {2320,1.02009,1.6033,0.64344,1.51009,1    
428         {2325,1.02758,1.55515,0.65201,1.51591,    
429         {2330,1.03511,1.50621,0.66071,1.52172,    
430         {2335,1.04268,1.45656,0.66952,1.52752,    
431         {2340,1.05028,1.40628,0.67843,1.53332,    
432         {2345,1.05791,1.35545,0.68743,1.53911,    
433         {2350,1.06556,1.30415,0.6965,1.5449,1.    
434         {2355,1.07323,1.25246,0.70563,1.55069,    
435         {2360,1.08093,1.20045,0.71481,1.55647,    
436         {2365,1.08863,1.14821,0.72403,1.56225,    
437         {2370,1.09634,1.09581,0.73327,1.56804,    
438         {2375,1.10406,1.04334,0.74253,1.57382,    
439         {0.,0.,0.,0.,0.,0.,0.,0.,0.},             
440         {0.,0.,0.,0.,0.,0.,0.,0.,0.},             
441         {0.,0.,0.,0.,0.,0.,0.,0.,0.},             
442         {0.,0.,0.,0.,0.,0.,0.,0.,0.},             
443         {0.,0.,0.,0.,0.,0.,0.,0.,0.},             
444         {0.,0.,0.,0.,0.,0.,0.,0.,0.},             
445         {0.,0.,0.,0.,0.,0.,0.,0.,0.}              
446         },                                        
447         {// pi+ p -> Sigma+ pi+                   
448         {1105,-0.94614,0.13062,0.15332,-0.3819    
449         {1110,-0.92514,0.10676,0.19258,-0.3858    
450         {1115,-0.90417,0.08301,0.23175,-0.3895    
451         {1120,-0.88327,0.05949,0.27072,-0.3931    
452         {1125,-0.86247,0.03632,0.30939,-0.3964    
453         {1130,-0.8418,0.01362,0.34765,-0.39941    
454         {1135,-0.82129,-0.00851,0.38541,-0.401    
455         {1140,-0.80099,-0.02993,0.42257,-0.403    
456         {1145,-0.78091,-0.05054,0.45902,-0.405    
457         {1150,-0.7611,-0.07022,0.49467,-0.4058    
458         {1155,-0.74159,-0.08885,0.52941,-0.405    
459         {1160,-0.7224,-0.10632,0.56314,-0.4045    
460         {1165,-0.70354,-0.12258,0.59581,-0.402    
461         {1170,-0.68498,-0.13762,0.62737,-0.399    
462         {1175,-0.66669,-0.15144,0.65779,-0.395    
463         {1180,-0.64863,-0.16402,0.68704,-0.390    
464         {1185,-0.63078,-0.17537,0.71507,-0.384    
465         {1190,-0.61311,-0.18548,0.74186,-0.377    
466         {1195,-0.5956,-0.19435,0.76737,-0.3696    
467         {1200,-0.5782,-0.20196,0.79156,-0.3606    
468         {1205,-0.56089,-0.20832,0.8144,-0.3504    
469         {1210,-0.54365,-0.21341,0.83585,-0.339    
470         {1215,-0.52644,-0.21724,0.85588,-0.326    
471         {1220,-0.50923,-0.2198,0.87445,-0.3132    
472         {1225,-0.49204,-0.22113,0.89156,-0.298    
473         {1230,-0.4749,-0.22129,0.90727,-0.2831    
474         {1235,-0.45787,-0.22038,0.92164,-0.266    
475         {1240,-0.44101,-0.21848,0.93471,-0.249    
476         {1245,-0.42437,-0.21567,0.94654,-0.231    
477         {1250,-0.40799,-0.21204,0.95719,-0.213    
478         {1255,-0.39194,-0.20767,0.96672,-0.194    
479         {1260,-0.37626,-0.20265,0.97517,-0.176    
480         {1265,-0.36101,-0.19705,0.9826,-0.1571    
481         {1270,-0.34624,-0.19097,0.98907,-0.138    
482         {1275,-0.33201,-0.18448,0.99464,-0.119    
483         {1280,-0.31836,-0.17767,0.99935,-0.100    
484         {1285,-0.30534,-0.17062,1.00326,-0.082    
485         {1290,-0.29298,-0.16337,1.00644,-0.064    
486         {1295,-0.28127,-0.15592,1.00894,-0.047    
487         {1300,-0.27019,-0.14829,1.01082,-0.030    
488         {1305,-0.25975,-0.14048,1.01214,-0.014    
489         {1310,-0.24992,-0.13249,1.01296,0.0014    
490         {1315,-0.24071,-0.12434,1.01334,0.0163    
491         {1320,-0.23211,-0.11602,1.01334,0.0306    
492         {1325,-0.22411,-0.10755,1.01302,0.0441    
493         {1330,-0.21669,-0.09894,1.01244,0.0568    
494         {1335,-0.20985,-0.09018,1.01164,0.0687    
495         {1340,-0.20356,-0.08129,1.01058,0.0798    
496         {1345,-0.1978,-0.07227,1.00928,0.0902,    
497         {1350,-0.19254,-0.06312,1.00772,0.0998    
498         {1355,-0.18776,-0.05386,1.00587,0.1087    
499         {1360,-0.18344,-0.04449,1.00374,0.1170    
500         {1365,-0.17954,-0.03502,1.00131,0.1246    
501         {1370,-0.17605,-0.02545,0.99856,0.1316    
502         {1375,-0.17294,-0.01579,0.9955,0.13811    
503         {1380,-0.1702,-0.00605,0.99209,0.14399    
504         {1385,-0.16779,0.00381,0.98832,0.14938    
505         {1390,-0.16573,0.0138,0.98412,0.15434,    
506         {1395,-0.164,0.02398,0.97947,0.15895,0    
507         {1400,-0.1626,0.03439,0.9743,0.16329,0    
508         {1405,-0.16152,0.04506,0.96858,0.16742    
509         {1410,-0.16076,0.05603,0.96225,0.17143    
510         {1415,-0.16032,0.06735,0.95526,0.17539    
511         {1420,-0.16018,0.07904,0.94758,0.17937    
512         {1425,-0.16032,0.09115,0.93916,0.18348    
513         {1430,-0.16072,0.10365,0.93,0.18788,0.    
514         {1435,-0.16131,0.11654,0.92008,0.19276    
515         {1440,-0.16205,0.1298,0.90941,0.1983,0    
516         {1445,-0.16288,0.14342,0.89797,0.20467    
517         {1450,-0.16377,0.15738,0.88576,0.21207    
518         {1455,-0.16466,0.17168,0.87277,0.22066    
519         {1460,-0.16551,0.18629,0.85905,0.23052    
520         {1465,-0.16627,0.20112,0.84472,0.2415,    
521         {1470,-0.16693,0.2161,0.82995,0.25341,    
522         {1475,-0.16745,0.23114,0.81489,0.26605    
523         {1480,-0.16779,0.24618,0.7997,0.27923,    
524         {1485,-0.16791,0.26112,0.78452,0.29277    
525         {1490,-0.1678,0.27589,0.76952,0.30647,    
526         {1495,-0.1674,0.29043,0.75483,0.3202,0    
527         {1500,-0.1667,0.30482,0.74056,0.33397,    
528         {1505,-0.16566,0.31913,0.7268,0.34786,    
529         {1510,-0.16426,0.33345,0.71365,0.36195    
530         {1515,-0.16248,0.34775,0.70117,0.37616    
531         {1520,-0.16029,0.36189,0.68942,0.39033    
532         {1525,-0.15769,0.37579,0.67848,0.40443    
533         {1530,-0.15466,0.38951,0.66844,0.41854    
534         {1535,-0.1512,0.40308,0.65936,0.43276,    
535         {1540,-0.1473,0.41655,0.65133,0.44722,    
536         {1545,-0.14295,0.42994,0.64444,0.46201    
537         {1550,-0.13812,0.44331,0.63877,0.47723    
538         {1555,-0.13285,0.45667,0.63433,0.49295    
539         {1560,-0.12715,0.46998,0.63098,0.50907    
540         {1565,-0.1211,0.48319,0.62859,0.52549,    
541         {1570,-0.11473,0.49626,0.62699,0.5421,    
542         {1575,-0.10809,0.50913,0.62604,0.55881    
543         {1580,-0.10123,0.52176,0.62558,0.57551    
544         {1585,-0.09421,0.53411,0.62545,0.5921,    
545         {1590,-0.08706,0.54614,0.62557,0.60853    
546         {1595,-0.07979,0.55784,0.62586,0.62474    
547         {1600,-0.07245,0.56918,0.62625,0.6407,    
548         {1605,-0.06505,0.58016,0.62668,0.65638    
549         {1610,-0.05762,0.59074,0.62707,0.67175    
550         {1615,-0.05018,0.60091,0.62737,0.68675    
551         {1620,-0.04276,0.61068,0.62751,0.70139    
552         {1625,-0.03535,0.62007,0.62748,0.71565    
553         {1630,-0.02796,0.62911,0.62727,0.72955    
554         {1635,-0.02059,0.63784,0.62686,0.74311    
555         {1640,-0.01324,0.6463,0.62623,0.75633,    
556         {1645,-0.00591,0.65451,0.62538,0.76923    
557         {1650,0.00139,0.66253,0.62428,0.78182,    
558         {1655,0.00868,0.67037,0.62293,0.7941,0    
559         {1660,0.01593,0.67807,0.62131,0.8061,0    
560         {1665,0.02316,0.68568,0.6194,0.81783,0    
561         {1670,0.03036,0.69322,0.61719,0.82929,    
562         {1675,0.03754,0.70073,0.61467,0.84049,    
563         {1680,0.04468,0.70824,0.61182,0.85146,    
564         {1685,0.05179,0.7158,0.60863,0.8622,0.    
565         {1690,0.05886,0.72342,0.60508,0.87271,    
566         {1695,0.06591,0.73112,0.60118,0.88299,    
567         {1700,0.07293,0.73887,0.59694,0.893,0.    
568         {1705,0.07993,0.74664,0.59238,0.90269,    
569         {1710,0.08691,0.75441,0.58751,0.91203,    
570         {1715,0.09388,0.76215,0.58234,0.92098,    
571         {1720,0.10084,0.76985,0.5769,0.92954,0    
572         {1725,0.10779,0.77748,0.57123,0.93769,    
573         {1730,0.11473,0.78502,0.56535,0.94547,    
574         {1735,0.12166,0.79245,0.5593,0.95286,0    
575         {1740,0.12857,0.79975,0.55311,0.95988,    
576         {1745,0.13547,0.80689,0.54682,0.96655,    
577         {1750,0.14236,0.81386,0.54046,0.97285,    
578         {1755,0.14923,0.82063,0.53405,0.97881,    
579         {1760,0.15609,0.82719,0.52764,0.98443,    
580         {1765,0.16293,0.83351,0.52126,0.98972,    
581         {1770,0.16976,0.83957,0.51493,0.99469,    
582         {1775,0.17657,0.84536,0.5087,0.99933,0    
583         {1780,0.18336,0.85084,0.50258,1.00367,    
584         {1785,0.19009,0.856,0.49662,1.00768,0.    
585         {1790,0.19674,0.86081,0.49082,1.01134,    
586         {1795,0.20326,0.86526,0.48522,1.01465,    
587         {1800,0.20962,0.86932,0.47982,1.01757,    
588         {1805,0.21579,0.87298,0.47467,1.02009,    
589         {1810,0.22172,0.8762,0.46977,1.0222,0.    
590         {1815,0.22742,0.87899,0.46514,1.02388,    
591         {1820,0.23286,0.88135,0.46074,1.02515,    
592         {1825,0.23807,0.88327,0.45655,1.02601,    
593         {1830,0.24305,0.88477,0.45254,1.02648,    
594         {1835,0.2478,0.88586,0.4487,1.02655,0.    
595         {1840,0.25232,0.88654,0.445,1.02625,0.    
596         {1845,0.25663,0.88681,0.4414,1.02558,0    
597         {1850,0.26072,0.88668,0.43789,1.02454,    
598         {1855,0.26461,0.88616,0.43444,1.02315,    
599         {1860,0.2683,0.88526,0.43103,1.02142,0    
600         {1865,0.27179,0.88397,0.42763,1.01936,    
601         {1870,0.27509,0.88231,0.42421,1.01697,    
602         {1875,0.2782,0.88028,0.42075,1.01426,0    
603         {1880,0.28114,0.87788,0.41722,1.01124,    
604         {1885,0.28391,0.87515,0.41361,1.00795,    
605         {1890,0.28657,0.87216,0.40992,1.00444,    
606         {1895,0.28917,0.86899,0.40614,1.0008,0    
607         {1900,0.29176,0.86572,0.40227,0.99711,    
608         {1905,0.2944,0.86244,0.39831,0.99344,0    
609         {1910,0.29714,0.85921,0.39426,0.98985,    
610         {1915,0.3,0.85606,0.39014,0.98635,0.37    
611         {1920,0.30299,0.85298,0.38597,0.98292,    
612         {1925,0.30612,0.84996,0.38177,0.97952,    
613         {1930,0.3094,0.84699,0.37755,0.97614,0    
614         {1935,0.31283,0.84406,0.37334,0.97273,    
615         {1940,0.31643,0.84117,0.36916,0.96929,    
616         {1945,0.32021,0.83831,0.36503,0.96577,    
617         {1950,0.32418,0.83547,0.36097,0.96215,    
618         {1955,0.32835,0.83264,0.357,0.95841,0.    
619         {1960,0.33272,0.82981,0.35313,0.95452,    
620         {1965,0.3373,0.82698,0.3494,0.95046,0.    
621         {1970,0.34212,0.82414,0.34581,0.94618,    
622         {1975,0.34716,0.82128,0.3424,0.94168,0    
623         {1980,0.35244,0.81839,0.33921,0.93696,    
624         {1985,0.35793,0.81546,0.33628,0.93204,    
625         {1990,0.36362,0.81249,0.33367,0.92693,    
626         {1995,0.3695,0.80947,0.33142,0.92167,0    
627         {2000,0.37557,0.80638,0.3296,0.91626,0    
628         {2005,0.38179,0.80326,0.32819,0.91074,    
629         {2010,0.38815,0.80015,0.32716,0.90515,    
630         {2015,0.39462,0.7971,0.32646,0.89952,0    
631         {2020,0.40118,0.79416,0.32605,0.8939,0    
632         {2025,0.40779,0.79138,0.32589,0.88831,    
633         {2030,0.41443,0.78881,0.32593,0.8828,0    
634         {2035,0.42108,0.78649,0.32614,0.87741,    
635         {2040,0.42771,0.78448,0.32648,0.87217,    
636         {2045,0.4343,0.78283,0.32689,0.86712,0    
637         {2050,0.44082,0.78157,0.32734,0.8623,0    
638         {2055,0.44724,0.78077,0.32779,0.85775,    
639         {2060,0.45354,0.78047,0.3282,0.8535,0.    
640         {2065,0.4597,0.78072,0.32851,0.84959,0    
641         {2070,0.46568,0.78157,0.3287,0.84607,0    
642         {2075,0.47143,0.78303,0.32871,0.84292,    
643         {2080,0.47686,0.78509,0.32848,0.84013,    
644         {2085,0.48188,0.78773,0.32797,0.83768,    
645         {2090,0.48641,0.79094,0.32711,0.83553,    
646         {2095,0.49037,0.79472,0.32585,0.83367,    
647         {2100,0.49366,0.79904,0.32414,0.83207,    
648         {2105,0.49624,0.80389,0.32195,0.83071,    
649         {2110,0.49816,0.80918,0.31935,0.82953,    
650         {2115,0.49948,0.81487,0.31641,0.82851,    
651         {2120,0.50026,0.82088,0.31321,0.82758,    
652         {2125,0.50056,0.82715,0.30981,0.82672,    
653         {2130,0.50044,0.8336,0.3063,0.82587,0.    
654         {2135,0.49996,0.84017,0.30274,0.82499,    
655         {2140,0.49918,0.84679,0.29921,0.82405,    
656         {2145,0.49816,0.8534,0.29578,0.82298,0    
657         {2150,0.49696,0.85993,0.29252,0.82176,    
658         {2155,0.49565,0.86631,0.2895,0.82034,0    
659         {2160,0.49428,0.87251,0.28679,0.81869,    
660         {2165,0.49291,0.87852,0.28443,0.81682,    
661         {2170,0.49162,0.88433,0.28247,0.81472,    
662         {2175,0.49046,0.88995,0.28095,0.81239,    
663         {2180,0.48949,0.89536,0.27992,0.80982,    
664         {2185,0.48879,0.90056,0.27942,0.807,0.    
665         {2190,0.48842,0.90554,0.27951,0.80394,    
666         {2195,0.48843,0.9103,0.28022,0.80063,0    
667         {2200,0.48889,0.91482,0.28161,0.79707,    
668         {2205,0.48982,0.91912,0.28367,0.7933,0    
669         {2210,0.4912,0.9232,0.28639,0.7894,0.8    
670         {2215,0.49301,0.92707,0.28974,0.78543,    
671         {2220,0.49524,0.93074,0.29369,0.78147,    
672         {2225,0.49787,0.93422,0.29822,0.7776,0    
673         {2230,0.50089,0.93753,0.30331,0.77388,    
674         {2235,0.50427,0.94067,0.30894,0.7704,0    
675         {2240,0.508,0.94365,0.31507,0.76723,0.    
676         {2245,0.51205,0.94648,0.32167,0.76443,    
677         {2250,0.51641,0.9492,0.32868,0.76206,0    
678         {2255,0.52101,0.95185,0.336,0.76017,0.    
679         {2260,0.52581,0.95446,0.34353,0.75879,    
680         {2265,0.53077,0.95707,0.35118,0.75797,    
681         {2270,0.53584,0.95972,0.35885,0.75775,    
682         {2275,0.54099,0.96245,0.36644,0.75818,    
683         {2280,0.54615,0.96531,0.37387,0.7593,0    
684         {2285,0.5513,0.96832,0.38104,0.76114,0    
685         {2290,0.55637,0.97153,0.38784,0.76377,    
686         {2295,0.56134,0.97498,0.3942,0.7672,0.    
687         {2300,0.56619,0.97866,0.4001,0.77142,0    
688         {2305,0.57092,0.98258,0.40554,0.77638,    
689         {2310,0.57554,0.98672,0.41053,0.78203,    
690         {2315,0.58005,0.99108,0.41507,0.78832,    
691         {2320,0.58445,0.99565,0.41919,0.79521,    
692         {2325,0.58875,1.00043,0.42288,0.80265,    
693         {2330,0.59294,1.0054,0.42615,0.81059,1    
694         {2335,0.59702,1.01057,0.42902,0.81897,    
695         {2340,0.60101,1.01591,0.43149,0.82776,    
696         {2345,0.60491,1.02144,0.43357,0.83691,    
697         {2350,0.60869,1.02714,0.43525,0.84638,    
698         {2355,0.61231,1.03305,0.43655,0.85621,    
699         {2360,0.61572,1.03919,0.43744,0.86642,    
700         {2365,0.61886,1.04558,0.43793,0.87705,    
701         {2370,0.62167,1.05226,0.438,0.88814,1.    
702         {2375,0.6241,1.05925,0.43764,0.8997,1.    
703         {2380,0.62609,1.06658,0.43686,0.91178,    
704         {2385,0.62761,1.07425,0.43564,0.92439,    
705         {2390,0.62867,1.08225,0.43401,0.9375,1    
706         {2395,0.62929,1.09054,0.43198,0.95108,    
707         {2400,0.6295,1.09908,0.4296,0.9651,1.0    
708         {2405,0.6293,1.10785,0.42686,0.97951,0    
709         {2410,0.62872,1.11682,0.4238,0.9943,0.    
710         {2415,0.62778,1.12594,0.42043,1.00942,    
711         {2420,0.6265,1.1352,0.41678,1.02485,0.    
712         {2425,0.6249,1.14456,0.41287,1.04055,0    
713         {2430,0.62298,1.15399,0.40873,1.05648,    
714         {2435,0.62079,1.16345,0.40436,1.07263,    
715         {2440,0.61833,1.17291,0.3998,1.08894,0    
716         {2445,0.61563,1.18237,0.39507,1.1054,0    
717         {2450,0.61273,1.19182,0.39019,1.12199,    
718         {2455,0.60967,1.20126,0.3852,1.13867,0    
719         {2460,0.60647,1.2107,0.38011,1.15544,0    
720         {2465,0.60319,1.22014,0.37495,1.17226,    
721         {2470,0.59984,1.22958,0.36976,1.18912,    
722         {2475,0.59648,1.23901,0.36454,1.20599,    
723         };                                        
724                                                   
725       const G4int coef_ener = G4int((pLab-Lege    
726       const G4double sup_ener = pLab/5. - coef    
727                                                   
728 // assert(pLab >= Legendre_coef[WhichChannel][    
729                                                   
730       // Legendre coefficient normalized          
731       const G4double A0 = 1.;                     
732       const G4double A1 = (1-sup_ener)*Legendr    
733       const G4double A2 = (1-sup_ener)*Legendr    
734       const G4double A3 = (1-sup_ener)*Legendr    
735       const G4double A4 = (1-sup_ener)*Legendr    
736       const G4double A5 = (1-sup_ener)*Legendr    
737       const G4double A6 = (1-sup_ener)*Legendr    
738       const G4double A7 = (1-sup_ener)*Legendr    
739       const G4double A8 = (1-sup_ener)*Legendr    
740                                                   
741       // Theoritical max if all Ai > 0 (often     
742       const G4double A = std::fabs(A0) + std::    
743                                                   
744       G4bool success = false;                     
745       G4int maxloop = 0;                          
746                                                   
747       while(!success && maxloop < 1000){          
748                                                   
749         cos_theta = Random::shoot()*2-1.; // n    
750                                                   
751         // Legendre Polynomial                    
752         G4double P0 = A0;                         
753         G4double P1 = A1*cos_theta;               
754         G4double P2 = A2/2.*(3*std::pow(cos_th    
755         G4double P3 = A3/2.*(5*std::pow(cos_th    
756         G4double P4 = A4/8.*(35*std::pow(cos_t    
757         G4double P5 = A5/8.*(63*std::pow(cos_t    
758         G4double P6 = A6/16.*(231*std::pow(cos    
759         G4double P7 = A7/16.*(429*std::pow(cos    
760         G4double P8 = A8/128.*(6435*std::pow(c    
761                                                   
762         G4double P = (P0 + P1 + P2 + P3 + P4 +    
763                                                   
764         if(Random::shoot()*A < P) success = tr    
765         maxloop +=1 ;                             
766         if(maxloop==1000) cos_theta = std::log    
767       }                                           
768       sin_theta = std::sqrt(1-cos_theta*cos_th    
769     }                                             
770                                                   
771     if(rho == 0) return ThreeVector(sin_theta*    
772     // Rotation in the direction of the incide    
773     const G4double px = x/r*cos_theta - y/rho*    
774     const G4double py = y/r*cos_theta + x/rho*    
775     const G4double pz = z/r*cos_theta - rho/r*    
776                                                   
777     return ThreeVector(px,py,pz);                 
778   }                                               
779 }                                                 
780