[819] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4DiffractiveSplitableHadron.cc,v 1.6 2006/06/29 20:54:36 gunter Exp $ |
---|
| 28 | // GEANT4 tag $Name: geant4-09-01-patch-02 $ |
---|
| 29 | // |
---|
| 30 | |
---|
| 31 | // ------------------------------------------------------------ |
---|
| 32 | // GEANT 4 class implementation file |
---|
| 33 | // |
---|
| 34 | // ---------------- G4DiffractiveSplitableHadron---------------- |
---|
| 35 | // by Gunter Folger, August 1998. |
---|
| 36 | // class splitting an interacting particle. Used by FTF String Model. |
---|
| 37 | // ------------------------------------------------------------ |
---|
| 38 | |
---|
| 39 | #include "G4DiffractiveSplitableHadron.hh" |
---|
| 40 | |
---|
| 41 | #include "G4ParticleDefinition.hh" |
---|
| 42 | #include "Randomize.hh" |
---|
| 43 | |
---|
| 44 | G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron() |
---|
| 45 | |
---|
| 46 | { |
---|
| 47 | } |
---|
| 48 | |
---|
| 49 | G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron(const G4ReactionProduct & aPrimary) |
---|
| 50 | : G4VSplitableHadron(aPrimary) |
---|
| 51 | { |
---|
| 52 | PartonIndex=-2; |
---|
| 53 | Parton[0]=NULL; |
---|
| 54 | } |
---|
| 55 | |
---|
| 56 | G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron(const G4Nucleon & aNucleon) |
---|
| 57 | : G4VSplitableHadron(aNucleon) |
---|
| 58 | { |
---|
| 59 | PartonIndex=-2; |
---|
| 60 | Parton[0]=NULL; |
---|
| 61 | } |
---|
| 62 | |
---|
| 63 | G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron(const G4VKineticNucleon * aNucleon) |
---|
| 64 | : G4VSplitableHadron(aNucleon) |
---|
| 65 | { |
---|
| 66 | PartonIndex=-2; |
---|
| 67 | Parton[0]=NULL; |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | G4DiffractiveSplitableHadron::~G4DiffractiveSplitableHadron() |
---|
| 71 | {} |
---|
| 72 | |
---|
| 73 | const G4DiffractiveSplitableHadron & G4DiffractiveSplitableHadron::operator=(const G4DiffractiveSplitableHadron &) |
---|
| 74 | { |
---|
| 75 | throw G4HadronicException(__FILE__, __LINE__, "G4DiffractiveSplitableHadron::operator= meant to not be accessable"); |
---|
| 76 | return *this; |
---|
| 77 | } |
---|
| 78 | |
---|
| 79 | void G4DiffractiveSplitableHadron::SplitUp() |
---|
| 80 | { |
---|
| 81 | if (IsSplit()) return; |
---|
| 82 | Splitting(); |
---|
| 83 | // Split once only... |
---|
| 84 | if (Parton[0] != NULL) return; |
---|
| 85 | |
---|
| 86 | // flavours of quark ends |
---|
| 87 | |
---|
| 88 | G4int PDGcode=GetDefinition()->GetPDGEncoding(); |
---|
| 89 | G4int stringStart, stringEnd; |
---|
| 90 | ChooseStringEnds(PDGcode, &stringStart,&stringEnd); |
---|
| 91 | |
---|
| 92 | Parton[0] = new G4Parton(stringStart); |
---|
| 93 | Parton[1] = new G4Parton(stringEnd); |
---|
| 94 | PartonIndex=-1; |
---|
| 95 | |
---|
| 96 | } |
---|
| 97 | |
---|
| 98 | G4Parton * G4DiffractiveSplitableHadron::GetNextParton() |
---|
| 99 | { |
---|
| 100 | ++PartonIndex; |
---|
| 101 | if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL; |
---|
| 102 | |
---|
| 103 | return Parton[PartonIndex]; |
---|
| 104 | } |
---|
| 105 | |
---|
| 106 | G4Parton * G4DiffractiveSplitableHadron::GetNextAntiParton() |
---|
| 107 | { |
---|
| 108 | return NULL; // to be looked at @@ |
---|
| 109 | } |
---|
| 110 | |
---|
| 111 | // |
---|
| 112 | //----------------------- Implementation-------------------------- |
---|
| 113 | // |
---|
| 114 | |
---|
| 115 | void G4DiffractiveSplitableHadron::ChooseStringEnds(G4int PDGcode,G4int * aEnd, G4int * bEnd) const |
---|
| 116 | { |
---|
| 117 | const G4double udspin1= 1./6.; |
---|
| 118 | const G4double uuspin1= 1./3.; |
---|
| 119 | // const G4double udspin0= 1./2.; //@ |
---|
| 120 | |
---|
| 121 | G4int absPDGcode=std::abs(PDGcode); |
---|
| 122 | |
---|
| 123 | if ( absPDGcode < 1000 ) //-------------------- Meson ------------- |
---|
| 124 | { |
---|
| 125 | G4int heavy= absPDGcode/ 100; |
---|
| 126 | G4int light= (absPDGcode %100)/10; |
---|
| 127 | |
---|
| 128 | // G4int anti= std::pow(-1 , std::max( heavy, light)); |
---|
| 129 | G4int anti= 1 -2 * ( std::max( heavy, light ) % 2 ); |
---|
| 130 | if (PDGcode < 0 ) anti *=-1; |
---|
| 131 | |
---|
| 132 | heavy *= anti; |
---|
| 133 | light *= -1 * anti; |
---|
| 134 | |
---|
| 135 | if ( G4UniformRand() < 0.5 ) |
---|
| 136 | { |
---|
| 137 | *aEnd=heavy; |
---|
| 138 | *bEnd=light; |
---|
| 139 | } |
---|
| 140 | else |
---|
| 141 | { |
---|
| 142 | *aEnd=light; |
---|
| 143 | *bEnd=heavy; |
---|
| 144 | } |
---|
| 145 | } |
---|
| 146 | else //-------------------- Barion -------------- |
---|
| 147 | { |
---|
| 148 | G4int j1000 = PDGcode/ 1000; |
---|
| 149 | G4int j100 = (PDGcode % 1000) / 100; |
---|
| 150 | G4int j10 = (PDGcode % 100) / 10; |
---|
| 151 | |
---|
| 152 | G4double random= G4UniformRand(); |
---|
| 153 | |
---|
| 154 | |
---|
| 155 | if ( std::abs(j100) >= std::abs(j10) ) |
---|
| 156 | { |
---|
| 157 | if ( random < udspin1 ) |
---|
| 158 | { |
---|
| 159 | *aEnd=j1000; |
---|
| 160 | *bEnd= Diquark( j100, j10, 1); |
---|
| 161 | } else if ( random < (udspin1 + uuspin1) ) |
---|
| 162 | { |
---|
| 163 | *aEnd= j10; |
---|
| 164 | *bEnd= Diquark( j1000, j100, 1); |
---|
| 165 | } else |
---|
| 166 | { |
---|
| 167 | *aEnd=j100; |
---|
| 168 | // Careful, there is no diquark q1=q2, (q1 q2)0, |
---|
| 169 | // possible for Omega- |
---|
| 170 | *bEnd= Diquark( j1000, j10, j1000 != j100 ? 0 : 1); |
---|
| 171 | } |
---|
| 172 | } else |
---|
| 173 | { |
---|
| 174 | // Lambda-like hadrons have two lightest quarks in spin 0 |
---|
| 175 | if ( random < udspin1 ) |
---|
| 176 | { |
---|
| 177 | *aEnd=j1000; |
---|
| 178 | // as above, but with charmed barions |
---|
| 179 | *bEnd= Diquark( j100, j10, j100 != j10 ? 0 : 10); |
---|
| 180 | } else if ( random < (udspin1 + uuspin1) ) |
---|
| 181 | { |
---|
| 182 | *aEnd= j10; |
---|
| 183 | *bEnd= Diquark( j1000, j100, 1); |
---|
| 184 | } else |
---|
| 185 | { |
---|
| 186 | *aEnd=j100; |
---|
| 187 | *bEnd= Diquark( j1000, j10, 1); |
---|
| 188 | } |
---|
| 189 | |
---|
| 190 | } |
---|
| 191 | |
---|
| 192 | } |
---|
| 193 | |
---|
| 194 | |
---|
| 195 | |
---|
| 196 | } |
---|
| 197 | |
---|
| 198 | G4int G4DiffractiveSplitableHadron::Diquark(G4int aquark,G4int bquark,G4int Spin) const |
---|
| 199 | { |
---|
| 200 | G4int diquarkPDG; |
---|
| 201 | |
---|
| 202 | diquarkPDG = std::max( std::abs(aquark), std::abs(bquark) )*1000 + |
---|
| 203 | std::min( std::abs(aquark), std::abs(bquark) )*100 + |
---|
| 204 | 2*Spin + 1; |
---|
| 205 | return ( aquark > 0 && bquark > 0 ) ? diquarkPDG : -1*diquarkPDG; |
---|
| 206 | } |
---|