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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/G4INCLNuclearDensity.cc (Version 11.3.0) and /processes/hadronic/models/inclxx/incl_physics/src/G4INCLNuclearDensity.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 "G4INCLNuclearDensity.hh"                
 39 #include "G4INCLParticleTable.hh"                 
 40 #include "G4INCLGlobals.hh"                       
 41 #include <algorithm>                              
 42                                                   
 43 namespace G4INCL {                                
 44                                                   
 45   NuclearDensity::NuclearDensity(const G4int A    
 46     theA(A),                                      
 47     theZ(Z),                                      
 48     theS(S),                                      
 49     theMaximumRadius(std::min((*rpCorrelationT    
 50     theProtonNuclearRadius(ParticleTable::getN    
 51   {                                               
 52     std::fill(rFromP, rFromP + UnknownParticle    
 53     rFromP[Proton] = rpCorrelationTableProton;    
 54     rFromP[Neutron] = rpCorrelationTableNeutro    
 55     rFromP[Lambda] = rpCorrelationTableLambda;    
 56     rFromP[DeltaPlusPlus] = rpCorrelationTable    
 57     rFromP[DeltaPlus] = rpCorrelationTableProt    
 58     rFromP[DeltaZero] = rpCorrelationTableNeut    
 59     rFromP[DeltaMinus] = rpCorrelationTableNeu    
 60     // The interpolation table for local-energ    
 61     // inverting the r-p correlation table.       
 62     std::fill(pFromR, pFromR + UnknownParticle    
 63     pFromR[Proton] = new InterpolationTable(rF    
 64     pFromR[Neutron] = new InterpolationTable(r    
 65     pFromR[Lambda] = new InterpolationTable(rF    
 66     pFromR[DeltaPlusPlus] = new InterpolationT    
 67     pFromR[DeltaPlus] = new InterpolationTable    
 68     pFromR[DeltaZero] = new InterpolationTable    
 69     pFromR[DeltaMinus] = new InterpolationTabl    
 70     INCL_DEBUG("Interpolation table for proton    
 71           << '\n'                                 
 72           << pFromR[Proton]->print()              
 73           << '\n'                                 
 74           << "Interpolation table for neutron     
 75           << '\n'                                 
 76           << pFromR[Neutron]->print()             
 77           << '\n'                                 
 78           << "Interpolation table for lambda l    
 79           << '\n'                                 
 80           << pFromR[Lambda]->print()              
 81           << '\n'                                 
 82           << "Interpolation table for delta++     
 83           << '\n'                                 
 84           << pFromR[DeltaPlusPlus]->print()       
 85           << '\n'                                 
 86           << "Interpolation table for delta+ l    
 87           << '\n'                                 
 88           << pFromR[DeltaPlus]->print()           
 89           << '\n'                                 
 90           << "Interpolation table for delta0 l    
 91           << '\n'                                 
 92           << pFromR[DeltaZero]->print()           
 93           << '\n'                                 
 94           << "Interpolation table for delta- l    
 95           << '\n'                                 
 96           << pFromR[DeltaMinus]->print()          
 97           << '\n');                               
 98     initializeTransmissionRadii();                
 99   }                                               
100                                                   
101   NuclearDensity::~NuclearDensity() {             
102     // We don't delete the rFromP tables, whic    
103     // NuclearDensityFactory                      
104     delete pFromR[Proton];                        
105     delete pFromR[Neutron];                       
106     delete pFromR[Lambda];                        
107     delete pFromR[DeltaPlusPlus];                 
108     delete pFromR[DeltaPlus];                     
109     delete pFromR[DeltaZero];                     
110     delete pFromR[DeltaMinus];                    
111   }                                               
112                                                   
113   NuclearDensity::NuclearDensity(const Nuclear    
114     theA(rhs.theA),                               
115     theZ(rhs.theZ),                               
116     theS(rhs.theS),                               
117     theMaximumRadius(rhs.theMaximumRadius),       
118     theProtonNuclearRadius(rhs.theProtonNuclea    
119   {                                               
120     // rFromP is owned by NuclearDensityFactor    
121     std::fill(rFromP, rFromP + UnknownParticle    
122     rFromP[Proton] = rhs.rFromP[Proton];          
123     rFromP[Neutron] = rhs.rFromP[Neutron];        
124     rFromP[Lambda] = rhs.rFromP[Lambda];          
125     rFromP[DeltaPlusPlus] = rhs.rFromP[DeltaPl    
126     rFromP[DeltaPlus] = rhs.rFromP[DeltaPlus];    
127     rFromP[DeltaZero] = rhs.rFromP[DeltaZero];    
128     rFromP[DeltaMinus] = rhs.rFromP[DeltaMinus    
129     // deep copy for pFromR                       
130     std::fill(pFromR, pFromR + UnknownParticle    
131     pFromR[Proton] = new InterpolationTable(*(    
132     pFromR[Neutron] = new InterpolationTable(*    
133     pFromR[Lambda] = new InterpolationTable(*(    
134     pFromR[DeltaPlusPlus] = new InterpolationT    
135     pFromR[DeltaPlus] = new InterpolationTable    
136     pFromR[DeltaZero] = new InterpolationTable    
137     pFromR[DeltaMinus] = new InterpolationTabl    
138     std::copy(rhs.transmissionRadius, rhs.tran    
139   }                                               
140                                                   
141   NuclearDensity &NuclearDensity::operator=(co    
142     NuclearDensity temporaryDensity(rhs);         
143     swap(temporaryDensity);                       
144     return *this;                                 
145   }                                               
146                                                   
147   void NuclearDensity::swap(NuclearDensity &rh    
148     std::swap(theA, rhs.theA);                    
149     std::swap(theZ, rhs.theZ);                    
150     std::swap(theS, rhs.theS);                    
151     std::swap(theMaximumRadius, rhs.theMaximum    
152     std::swap(theProtonNuclearRadius, rhs.theP    
153     std::swap_ranges(transmissionRadius, trans    
154     std::swap(rFromP[Proton], rhs.rFromP[Proto    
155     std::swap(rFromP[Neutron], rhs.rFromP[Neut    
156     std::swap(rFromP[Lambda], rhs.rFromP[Lambd    
157     std::swap(rFromP[DeltaPlusPlus], rhs.rFrom    
158     std::swap(rFromP[DeltaPlus], rhs.rFromP[De    
159     std::swap(rFromP[DeltaZero], rhs.rFromP[De    
160     std::swap(rFromP[DeltaMinus], rhs.rFromP[D    
161     std::swap(pFromR[Proton], rhs.pFromR[Proto    
162     std::swap(pFromR[Neutron], rhs.pFromR[Neut    
163     std::swap(pFromR[DeltaPlusPlus], rhs.pFrom    
164     std::swap(pFromR[DeltaPlus], rhs.pFromR[De    
165     std::swap(pFromR[DeltaZero], rhs.pFromR[De    
166     std::swap(pFromR[DeltaMinus], rhs.pFromR[D    
167  }                                                
168                                                   
169   void NuclearDensity::initializeTransmissionR    
170     const G4double theProtonRadius = 0.88; //     
171     const G4double theProtonTransmissionRadius    
172                                                   
173     transmissionRadius[Proton] = theProtonTran    
174     transmissionRadius[PiPlus] = theProtonNucl    
175     transmissionRadius[PiMinus] = theProtonNuc    
176     transmissionRadius[DeltaPlusPlus] = thePro    
177     transmissionRadius[DeltaPlus] = theProtonT    
178     transmissionRadius[DeltaMinus] = theProton    
179     transmissionRadius[Composite] = theProtonN    
180     transmissionRadius[SigmaPlus] = theProtonT    
181     transmissionRadius[SigmaMinus] = theProton    
182     transmissionRadius[KPlus] = theProtonNucle    
183     transmissionRadius[KMinus] = theProtonNucl    
184     transmissionRadius[antiProton] = theProton    
185     transmissionRadius[antiSigmaPlus] = thePro    
186     transmissionRadius[antiSigmaMinus] = thePr    
187     transmissionRadius[XiMinus] = theProtonTra    
188     transmissionRadius[antiXiMinus] = theProto    
189                                                   
190     // transmission radii for neutral particle    
191   }                                               
192                                                   
193   G4double NuclearDensity::getMaxRFromP(Partic    
194 // assert(t==Proton || t==Neutron || t==Lambda    
195     return (*(rFromP[t]))(p);                     
196   }                                               
197                                                   
198   G4double NuclearDensity::getMinPFromR(Partic    
199 // assert(t==Proton || t==Neutron || t==Lambda    
200     return (*(pFromR[t]))(r);                     
201   }                                               
202                                                   
203 }                                                 
204