Geant4 Cross Reference |
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 // INCL++ intra-nuclear cascade model 26 // INCL++ intra-nuclear cascade model 27 // Alain Boudard, CEA-Saclay, France 27 // Alain Boudard, CEA-Saclay, France 28 // Joseph Cugnon, University of Liege, Belgium 28 // Joseph Cugnon, University of Liege, Belgium 29 // Jean-Christophe David, CEA-Saclay, France 29 // Jean-Christophe David, CEA-Saclay, France 30 // Pekka Kaitaniemi, CEA-Saclay, France, and H 30 // Pekka Kaitaniemi, CEA-Saclay, France, and Helsinki Institute of Physics, Finland 31 // Sylvie Leray, CEA-Saclay, France 31 // Sylvie Leray, CEA-Saclay, France 32 // Davide Mancusi, CEA-Saclay, France 32 // Davide Mancusi, CEA-Saclay, France 33 // 33 // 34 #define INCLXX_IN_GEANT4_MODE 1 34 #define INCLXX_IN_GEANT4_MODE 1 35 35 36 #include "globals.hh" 36 #include "globals.hh" 37 37 38 #include "G4INCLPiNToMultiPionsChannel.hh" 38 #include "G4INCLPiNToMultiPionsChannel.hh" 39 #include "G4INCLKinematicsUtils.hh" 39 #include "G4INCLKinematicsUtils.hh" 40 #include "G4INCLBinaryCollisionAvatar.hh" 40 #include "G4INCLBinaryCollisionAvatar.hh" 41 #include "G4INCLRandom.hh" 41 #include "G4INCLRandom.hh" 42 #include "G4INCLGlobals.hh" 42 #include "G4INCLGlobals.hh" 43 #include "G4INCLLogger.hh" 43 #include "G4INCLLogger.hh" 44 #include <algorithm> 44 #include <algorithm> 45 #include "G4INCLPhaseSpaceGenerator.hh" 45 #include "G4INCLPhaseSpaceGenerator.hh" 46 46 47 namespace G4INCL { 47 namespace G4INCL { 48 48 49 const G4double PiNToMultiPionsChannel::angul 49 const G4double PiNToMultiPionsChannel::angularSlope = 15.; 50 50 51 PiNToMultiPionsChannel::PiNToMultiPionsChann 51 PiNToMultiPionsChannel::PiNToMultiPionsChannel(const G4int npi, Particle *p1, Particle *p2) 52 : npion(npi), 52 : npion(npi), 53 ind2(0), 53 ind2(0), 54 particle1(p1), 54 particle1(p1), 55 particle2(p2) 55 particle2(p2) 56 { 56 { 57 std::fill(isosp, isosp+4, 0); 57 std::fill(isosp, isosp+4, 0); 58 } 58 } 59 59 60 PiNToMultiPionsChannel::~PiNToMultiPionsChan 60 PiNToMultiPionsChannel::~PiNToMultiPionsChannel(){ 61 61 62 } 62 } 63 63 64 void PiNToMultiPionsChannel::fillFinalState( 64 void PiNToMultiPionsChannel::fillFinalState(FinalState *fs) { 65 65 66 // assert(npion > 1 && npion < 5); 66 // assert(npion > 1 && npion < 5); 67 67 68 Particle * nucleon; 68 Particle * nucleon; 69 Particle * pion; 69 Particle * pion; 70 if(particle1->isNucleon()) { 70 if(particle1->isNucleon()) { 71 nucleon = particle1; 71 nucleon = particle1; 72 pion = particle2; 72 pion = particle2; 73 } else { 73 } else { 74 nucleon = particle2; 74 nucleon = particle2; 75 pion = particle1; 75 pion = particle1; 76 } 76 } 77 #ifdef INCLXX_IN_GEANT4_MODE << 78 // Erase the parent resonance information << 79 nucleon->setParentResonancePDGCode(0); << 80 nucleon->setParentResonanceID(0); << 81 pion->setParentResonancePDGCode(0); << 82 pion->setParentResonanceID(0); << 83 #endif << 84 G4int ipi=ParticleTable::getIsospin(pion 77 G4int ipi=ParticleTable::getIsospin(pion->getType()); 85 ind2=ParticleTable::getIsospin(nucleon-> 78 ind2=ParticleTable::getIsospin(nucleon->getType()); 86 79 87 ParticleList list; 80 ParticleList list; 88 list.push_back(nucleon); 81 list.push_back(nucleon); 89 list.push_back(pion); 82 list.push_back(pion); 90 fs->addModifiedParticle(nucleon); 83 fs->addModifiedParticle(nucleon); 91 fs->addModifiedParticle(pion); 84 fs->addModifiedParticle(pion); 92 85 93 isospinRepartition(ipi); 86 isospinRepartition(ipi); 94 87 95 const ParticleType tn=ParticleTable::get 88 const ParticleType tn=ParticleTable::getNucleonType(ind2); 96 nucleon->setType(tn); 89 nucleon->setType(tn); 97 ParticleType pionType=ParticleTable::get 90 ParticleType pionType=ParticleTable::getPionType(isosp[0]); 98 pion->setType(pionType); 91 pion->setType(pionType); 99 const ThreeVector &rcolpion = pion->getP 92 const ThreeVector &rcolpion = pion->getPosition(); 100 const ThreeVector zero; 93 const ThreeVector zero; 101 for(G4int i=1; i<npion; ++i) { 94 for(G4int i=1; i<npion; ++i) { 102 pionType=ParticleTable::getPionType(is 95 pionType=ParticleTable::getPionType(isosp[i]); 103 Particle *newPion = new Particle(pionT 96 Particle *newPion = new Particle(pionType,zero,rcolpion); 104 newPion->setType(pionType); 97 newPion->setType(pionType); 105 list.push_back(newPion); 98 list.push_back(newPion); 106 fs->addCreatedParticle(newPion); 99 fs->addCreatedParticle(newPion); 107 } 100 } 108 101 109 const G4double sqrtS = KinematicsUtils:: 102 const G4double sqrtS = KinematicsUtils::totalEnergyInCM(nucleon, pion); 110 PhaseSpaceGenerator::generateBiased(sqrt 103 PhaseSpaceGenerator::generateBiased(sqrtS, list, 0, angularSlope); 111 104 112 } 105 } 113 106 114 void PiNToMultiPionsChannel::isospinRepart 107 void PiNToMultiPionsChannel::isospinRepartition(G4int ipi) { 115 G4double rjcd=Random::shoot(); 108 G4double rjcd=Random::shoot(); 116 const G4int itot=ipi*ind2; 109 const G4int itot=ipi*ind2; 117 110 118 isosp[1]=ipi; 111 isosp[1]=ipi; 119 if (npion != 3) { 112 if (npion != 3) { 120 if (npion == 4){ 113 if (npion == 4){ 121 const G4double r2 = Random::shoo 114 const G4double r2 = Random::shoot(); 122 if (r2*3. > 2.) { 115 if (r2*3. > 2.) { 123 isosp[2]= 0; 116 isosp[2]= 0; 124 isosp[3]= 0; 117 isosp[3]= 0; 125 } 118 } 126 else { 119 else { 127 isosp[2]= 2; 120 isosp[2]= 2; 128 isosp[3]= -2; 121 isosp[3]= -2; 129 } 122 } 130 } 123 } 131 124 132 if (itot == 2) { 125 if (itot == 2) { 133 // CAS PI+ P ET PI- n 126 // CAS PI+ P ET PI- n 134 rjcd *= 5.; 127 rjcd *= 5.; 135 if (rjcd > 3.) { 128 if (rjcd > 3.) { 136 // PI+ PI+ N ET PI- P 129 // PI+ PI+ N ET PI- PI- P 137 isosp[0]=2*ind2; 130 isosp[0]=2*ind2; 138 isosp[1]=ipi; 131 isosp[1]=ipi; 139 ind2=-ind2; 132 ind2=-ind2; 140 } 133 } 141 else { 134 else { 142 // PI+ PI0 P ET PI- P 135 // PI+ PI0 P ET PI- PI0 N 143 isosp[0]=0; 136 isosp[0]=0; 144 isosp[1]=ipi; 137 isosp[1]=ipi; 145 } 138 } 146 } 139 } 147 else if (itot == 0) { 140 else if (itot == 0) { 148 // CAS PI0 P ET PI0 N 141 // CAS PI0 P ET PI0 N 149 rjcd *= 90.; 142 rjcd *= 90.; 150 if (rjcd > 13.) { 143 if (rjcd > 13.) { 151 if (rjcd > 52.) { 144 if (rjcd > 52.) { 152 // PI+ PI0 N ET PI 145 // PI+ PI0 N ET PI- PI0 P 153 isosp[0]=2*ind2; 146 isosp[0]=2*ind2; 154 isosp[1]=0; 147 isosp[1]=0; 155 ind2=-ind2; 148 ind2=-ind2; 156 } 149 } 157 else { 150 else { 158 // PI+ PI- P ET PI 151 // PI+ PI- P ET PI+ PI- N 159 isosp[1]=-2; 152 isosp[1]=-2; 160 isosp[0]=2; 153 isosp[0]=2; 161 } 154 } 162 } 155 } 163 else { 156 else { 164 // PI0 PI0 P ET PI0 PI 157 // PI0 PI0 P ET PI0 PI0 N 165 isosp[0]=0; 158 isosp[0]=0; 166 isosp[1]=0; 159 isosp[1]=0; 167 } 160 } 168 } 161 } 169 else if (itot == -2) { 162 else if (itot == -2) { 170 // CAS PI- P ET PI+ N 163 // CAS PI- P ET PI+ N 171 rjcd *= 45.; 164 rjcd *= 45.; 172 if (rjcd > 17.) { 165 if (rjcd > 17.) { 173 if (rjcd > 24.) { 166 if (rjcd > 24.) { 174 // PI+ PI- N ET PI 167 // PI+ PI- N ET PI+ PI- P 175 isosp[0]=2*ind2; 168 isosp[0]=2*ind2; 176 ind2=-ind2; 169 ind2=-ind2; 177 } 170 } 178 else { 171 else { 179 // PI0 PI0 N ET PI 172 // PI0 PI0 N ET PI0 PI0 P 180 isosp[0]=0; 173 isosp[0]=0; 181 isosp[1]=0; 174 isosp[1]=0; 182 ind2=-ind2; 175 ind2=-ind2; 183 } 176 } 184 } 177 } 185 else 178 else 186 // PI- PI0 P ET PI+ PI 179 // PI- PI0 P ET PI+ PI0 N 187 isosp[0]=0; 180 isosp[0]=0; 188 } 181 } 189 } // if (npion != 3) 182 } // if (npion != 3) 190 else { 183 else { 191 // PI N -> PI PI PI N 184 // PI N -> PI PI PI N 192 // IF (IPI*IND2) 20,21,22 185 // IF (IPI*IND2) 20,21,22 193 if (itot == -2) { 186 if (itot == -2) { 194 // CAS PI- P ET PI+ N 187 // CAS PI- P ET PI+ N 195 rjcd *= 135.; 188 rjcd *= 135.; 196 if (rjcd <= 28.) { 189 if (rjcd <= 28.) { 197 // PI0 PI0 PI0 N ET PI 190 // PI0 PI0 PI0 N ET PI0 PI0 PI0 P 198 isosp[0]=0; 191 isosp[0]=0; 199 isosp[1]=0; 192 isosp[1]=0; 200 isosp[2]=0; 193 isosp[2]=0; 201 ind2=-ind2; 194 ind2=-ind2; 202 } 195 } 203 else { 196 else { 204 if (rjcd <= 84.) { 197 if (rjcd <= 84.) { 205 // PI+ PI- PI0 N E 198 // PI+ PI- PI0 N ET PI- PI+ PI0 P 206 isosp[0]=2*ind2; 199 isosp[0]=2*ind2; 207 isosp[2]=0; 200 isosp[2]=0; 208 ind2=-ind2; 201 ind2=-ind2; 209 } 202 } 210 else { 203 else { 211 if (rjcd <= 118.) { 204 if (rjcd <= 118.) { 212 // PI- PI- PI+ 205 // PI- PI- PI+ P ET PI- PI+ PI+ N 213 isosp[0]=ipi; 206 isosp[0]=ipi; 214 isosp[2]=-ipi; 207 isosp[2]=-ipi; 215 } 208 } 216 else { 209 else { 217 // PI- PI0 PI0 210 // PI- PI0 PI0 P ET PI0 PI0 PI+ N 218 isosp[0]=0; 211 isosp[0]=0; 219 isosp[2]=0; 212 isosp[2]=0; 220 } 213 } 221 } 214 } 222 } 215 } 223 } 216 } 224 else if (itot == 0) { 217 else if (itot == 0) { 225 // CAS PI0 P ET PI0 N 218 // CAS PI0 P ET PI0 N 226 rjcd *= 270.; 219 rjcd *= 270.; 227 if (rjcd <= 39.) { 220 if (rjcd <= 39.) { 228 // PI0 PI0 PI0 P ET PI 221 // PI0 PI0 PI0 P ET PI0 PI0 PI0 N 229 isosp[0]=0; 222 isosp[0]=0; 230 isosp[2]=0; 223 isosp[2]=0; 231 } 224 } 232 else { 225 else { 233 if (rjcd <= 156.) { 226 if (rjcd <= 156.) { 234 // PI+ PI- PI0 P E 227 // PI+ PI- PI0 P ET PI- PI+ PI0 N 235 isosp[0]=2; 228 isosp[0]=2; 236 isosp[2]=-2; 229 isosp[2]=-2; 237 } 230 } 238 else { 231 else { 239 if (rjcd <= 194.) { 232 if (rjcd <= 194.) { 240 // PI+ PI0 PI0 233 // PI+ PI0 PI0 N ET PI0 PI0 PI- P 241 isosp[0]=0; 234 isosp[0]=0; 242 isosp[2]=2*ind2; 235 isosp[2]=2*ind2; 243 ind2=-ind2; 236 ind2=-ind2; 244 } 237 } 245 else { 238 else { 246 // PI- PI+ PI+ 239 // PI- PI+ PI+ N ET PI- PI- PI+ P 247 isosp[0]=2*ind2; 240 isosp[0]=2*ind2; 248 isosp[1]=2*ind2; 241 isosp[1]=2*ind2; 249 isosp[2]=-2*ind2; 242 isosp[2]=-2*ind2; 250 ind2=-ind2; 243 ind2=-ind2; 251 } 244 } 252 } 245 } 253 } 246 } 254 } 247 } 255 else if (itot == 2) { 248 else if (itot == 2) { 256 // CAS PI+ P ET PI- N 249 // CAS PI+ P ET PI- N 257 rjcd *= 5.; 250 rjcd *= 5.; 258 if (rjcd <= 2.) { 251 if (rjcd <= 2.) { 259 // PI+ P PI0 PI0 ET PI 252 // PI+ P PI0 PI0 ET PI- N PI0 PI0 260 isosp[0]=0; 253 isosp[0]=0; 261 isosp[2]=0; 254 isosp[2]=0; 262 } 255 } 263 else { 256 else { 264 if (rjcd <= 3.) { 257 if (rjcd <= 3.) { 265 // PI+ P PI+ PI- E 258 // PI+ P PI+ PI- ET PI- N PI+ PI- 266 isosp[0]=-2; 259 isosp[0]=-2; 267 isosp[2]=2; 260 isosp[2]=2; 268 } 261 } 269 else { 262 else { 270 // PI+ N PI+ PI0 E 263 // PI+ N PI+ PI0 ET PI- P PI0 PI- 271 isosp[0]=2*ind2; 264 isosp[0]=2*ind2; 272 isosp[2]=0; 265 isosp[2]=0; 273 ind2=-ind2; 266 ind2=-ind2; 274 } 267 } 275 } 268 } 276 } 269 } 277 } 270 } 278 271 279 std::shuffle(isosp,isosp+npion,Random: << 272 std::random_shuffle(isosp,isosp+npion,Random::getAdapter()); // isospin randomly distributed 280 } 273 } 281 274 282 } 275 } 283 276