Geant4 Cross Reference |
1 // 1 // 2 // ******************************************* 2 // ******************************************************************** 3 // * License and Disclaimer << 3 // * DISCLAIMER * 4 // * 4 // * * 5 // * The Geant4 software is copyright of th << 5 // * The following disclaimer summarizes all the specific disclaimers * 6 // * the Geant4 Collaboration. It is provided << 6 // * of contributors to this software. The specific disclaimers,which * 7 // * conditions of the Geant4 Software License << 7 // * govern, are listed with their locations in: * 8 // * LICENSE and available at http://cern.ch/ << 8 // * http://cern.ch/geant4/license * 9 // * include a list of copyright holders. << 10 // * 9 // * * 11 // * Neither the authors of this software syst 10 // * Neither the authors of this software system, nor their employing * 12 // * institutes,nor the agencies providing fin 11 // * institutes,nor the agencies providing financial support for this * 13 // * work make any representation or warran 12 // * work make any representation or warranty, express or implied, * 14 // * regarding this software system or assum 13 // * regarding this software system or assume any liability for its * 15 // * use. Please see the license in the file << 14 // * use. * 16 // * for the full disclaimer and the limitatio << 17 // * 15 // * * 18 // * This code implementation is the result << 16 // * This code implementation is the intellectual property of the * 19 // * technical work of the GEANT4 collaboratio << 17 // * GEANT4 collaboration. * 20 // * By using, copying, modifying or distri << 18 // * By copying, distributing or modifying the Program (or any work * 21 // * any work based on the software) you ag << 19 // * based on the Program) you indicate your acceptance of this * 22 // * use in resulting scientific publicati << 20 // * statement, and all its terms. * 23 // * acceptance of all terms of the Geant4 Sof << 24 // ******************************************* 21 // ******************************************************************** 25 // 22 // 26 // 23 // 27 24 28 25 29 // ------------------------------------------- 26 // ------------------------------------------------------------ 30 // GEANT 4 class implementation file 27 // GEANT 4 class implementation file 31 // 28 // 32 // ---------------- G4FragmentingString - 29 // ---------------- G4FragmentingString ---------------- 33 // by Gunter Folger, September 200 30 // by Gunter Folger, September 2001. 34 // class for an excited string used in F 31 // class for an excited string used in Fragmention 35 // ------------------------------------------- 32 // ------------------------------------------------------------ 36 33 37 34 38 // G4FragmentingString 35 // G4FragmentingString 39 #include "G4FragmentingString.hh" 36 #include "G4FragmentingString.hh" 40 #include "G4ExcitedString.hh" 37 #include "G4ExcitedString.hh" 41 38 42 //-------------------------------------------- 39 //--------------------------------------------------------------------------------- 43 40 44 //-------------------------------------------- 41 //--------------------------------------------------------------------------------- 45 42 46 G4FragmentingString::G4FragmentingString(const 43 G4FragmentingString::G4FragmentingString(const G4FragmentingString &old) 47 { 44 { 48 LeftParton=old.LeftParton; 45 LeftParton=old.LeftParton; 49 RightParton=old.RightParton; 46 RightParton=old.RightParton; 50 Ptleft=old.Ptleft; 47 Ptleft=old.Ptleft; 51 Ptright=old.Ptright; 48 Ptright=old.Ptright; 52 Pplus=old.Pplus; 49 Pplus=old.Pplus; 53 Pminus=old.Pminus; 50 Pminus=old.Pminus; 54 theStableParton=old.theStableParton; << 55 theDecayParton=old.theDecayParton; << 56 decaying=old.decaying; 51 decaying=old.decaying; 57 Pstring=old.Pstring; << 58 Pleft =old.Pleft; << 59 Pright =old.Pright; << 60 } << 61 << 62 G4FragmentingString & G4FragmentingString::ope << 63 { << 64 if (this != &old) << 65 { << 66 LeftParton=old.LeftParton; << 67 RightParton=old.RightParton; << 68 Ptleft=old.Ptleft; << 69 Ptright=old.Ptright; << 70 Pplus=old.Pplus; << 71 Pminus=old.Pminus; << 72 theStableParton=old.theStableParton; << 73 theDecayParton=old.theDecayParton; << 74 decaying=old.decaying; << 75 Pstring=old.Pstring; << 76 Pleft =old.Pleft; << 77 Pright =old.Pright; << 78 } << 79 return *this; << 80 } 52 } 81 53 82 //-------------------------------------------- 54 //--------------------------------------------------------------------------------- 83 55 84 G4FragmentingString::G4FragmentingString(const 56 G4FragmentingString::G4FragmentingString(const G4ExcitedString &excited) 85 { 57 { 86 LeftParton=excited.GetLeftParton()->GetDefin 58 LeftParton=excited.GetLeftParton()->GetDefinition(); 87 RightParton=excited.GetRightParton()->GetDef 59 RightParton=excited.GetRightParton()->GetDefinition(); 88 Ptleft=excited.GetLeftParton()->Get4Momentum 60 Ptleft=excited.GetLeftParton()->Get4Momentum().vect(); 89 Ptleft.setZ(0.); 61 Ptleft.setZ(0.); 90 Ptright=excited.GetRightParton()->Get4Moment 62 Ptright=excited.GetRightParton()->Get4Momentum().vect(); 91 Ptright.setZ(0.); 63 Ptright.setZ(0.); 92 theStableParton=0; << 64 G4LorentzVector P=excited.Get4Momentum(); 93 theDecayParton=0; << 65 Pplus =P.e() + P.pz(); 94 << 66 Pminus=P.e() - P.pz(); 95 if (excited.GetDirection() > 0) {decay << 67 decaying=None; 96 else {decay << 97 << 98 Pleft = excited.GetLeftParton()->Get4 << 99 Pright = excited.GetRightParton()->Get << 100 Pstring= Pleft + Pright; << 101 << 102 Pplus = Pstring.plus(); << 103 Pminus = Pstring.minus(); << 104 } 68 } 105 69 106 //-------------------------------------------- 70 //--------------------------------------------------------------------------------- 107 71 108 G4FragmentingString::G4FragmentingString(const 72 G4FragmentingString::G4FragmentingString(const G4FragmentingString &old, 109 G4ParticleDefinition * newdecay, 73 G4ParticleDefinition * newdecay, 110 const G4LorentzVector *momentum) 74 const G4LorentzVector *momentum) 111 { 75 { 112 decaying=None; 76 decaying=None; 113 // Momentum of produced hadron << 77 if ( old.decaying == Left ) 114 G4LorentzVector Momentum = G4LorentzVe << 115 << 116 if ( old.decaying == Left ) << 117 { << 118 RightParton= old.RightParton; << 119 Ptright = old.Ptright; << 120 Pright = old.Pright; << 121 << 122 LeftParton = newdecay; << 123 Ptleft = old.Ptleft - mome << 124 Ptleft.setZ(0.); << 125 Pleft = old.Pleft - Momentum; << 126 << 127 Pstring = Pleft + Pright; << 128 Pplus = Pstring.plus(); << 129 Pminus = Pstring.minus(); << 130 << 131 theDecayParton=GetLeftParton() << 132 theStableParton=GetRightParton << 133 decaying = Left; << 134 } else if ( old.decaying == Right ) << 135 { << 136 RightParton = newdecay; << 137 Ptright = old.Ptright - mo << 138 Ptright.setZ(0.); << 139 Pright = old.Pright - Momentum << 140 << 141 LeftParton = old.LeftParton; << 142 Ptleft = old.Ptleft; << 143 Pleft = old.Pleft; << 144 << 145 Pstring = Pleft + Pright; << 146 Pplus = Pstring.plus(); << 147 Pminus = Pstring.minus(); << 148 << 149 theDecayParton=GetRightParton( << 150 theStableParton=GetLeftParton( << 151 decaying = Right; << 152 } else << 153 { 78 { 154 throw G4HadronicException(__FILE__, __LINE << 79 RightParton= old.RightParton; 155 "G4FragmentingString::G4Frag << 80 Ptright = old.Ptright; 156 } << 81 LeftParton = newdecay; 157 } << 82 Ptleft = old.Ptleft - momentum->vect(); 158 << 83 Ptleft.setZ(0.); 159 << 84 } else if ( old.decaying == Right ) 160 //-------------------------------------------- << 161 << 162 G4FragmentingString::G4FragmentingString(const << 163 G4ParticleDefinition * newdecay) << 164 { << 165 decaying=None; << 166 << 167 Ptleft.setX(0.); Ptleft.setY(0.); Pt << 168 Ptright.setX(0.); Ptright.setY(0.); Pt << 169 Pplus=0.; Pminus=0.; << 170 theStableParton=0; theDecayParton=0; << 171 << 172 Pstring=G4LorentzVector(0.,0.,0.,0.); << 173 Pleft =G4LorentzVector(0.,0.,0.,0.); << 174 Pright =G4LorentzVector(0.,0.,0.,0.); << 175 << 176 if ( old.decaying == Left ) << 177 { << 178 RightParton= old.RightParton; << 179 LeftParton = newdecay; << 180 decaying=Left; << 181 } else if ( old.decaying == Right ) << 182 { << 183 RightParton = newdecay; << 184 LeftParton = old.LeftParton; << 185 decaying=Right; << 186 } else << 187 { 85 { 188 throw G4HadronicException(__FILE__, __LINE << 86 RightParton = newdecay; 189 "G4FragmentingString::G4Frag << 87 Ptright = old.Ptright - momentum->vect(); >> 88 Ptright.setZ(0.); >> 89 LeftParton = old.LeftParton; >> 90 Ptleft = old.Ptleft; >> 91 } else >> 92 { >> 93 throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::G4FragmentingString: no decay Direction defined"); 190 } 94 } >> 95 Pplus = old.Pplus - (momentum->e() + momentum->pz()); >> 96 Pminus = old.Pminus - (momentum->e() - momentum->pz()); >> 97 >> 98 //G4double Eold=0.5 * (old.Pplus + old.Pminus); >> 99 //G4double Enew=0.5 * (Pplus + Pminus); 191 } 100 } 192 101 193 102 194 //-------------------------------------------- 103 //--------------------------------------------------------------------------------- 195 104 196 G4FragmentingString::~G4FragmentingString() 105 G4FragmentingString::~G4FragmentingString() 197 {} 106 {} 198 107 >> 108 199 //-------------------------------------------- 109 //--------------------------------------------------------------------------------- 200 110 201 void G4FragmentingString::SetLeftPartonStable( 111 void G4FragmentingString::SetLeftPartonStable() 202 { 112 { 203 theStableParton=GetLeftParton(); 113 theStableParton=GetLeftParton(); 204 theDecayParton=GetRightParton(); 114 theDecayParton=GetRightParton(); 205 decaying=Right; 115 decaying=Right; 206 } 116 } 207 117 208 //-------------------------------------------- 118 //--------------------------------------------------------------------------------- 209 119 210 void G4FragmentingString::SetRightPartonStable 120 void G4FragmentingString::SetRightPartonStable() 211 { 121 { 212 theStableParton=GetRightParton(); 122 theStableParton=GetRightParton(); 213 theDecayParton=GetLeftParton(); 123 theDecayParton=GetLeftParton(); 214 decaying=Left; 124 decaying=Left; 215 } 125 } 216 126 217 //-------------------------------------------- 127 //--------------------------------------------------------------------------------- 218 128 219 G4int G4FragmentingString::GetDecayDirection() 129 G4int G4FragmentingString::GetDecayDirection() const 220 { 130 { 221 if (decaying == Left ) return +1; 131 if (decaying == Left ) return +1; 222 else if (decaying == Right) return -1; 132 else if (decaying == Right) return -1; 223 else throw G4HadronicException(__FILE__, __L << 133 else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::GetDecayDirection: decay side UNdefined!"); 224 "G4FragmentingString::GetDecayD << 225 return 0; 134 return 0; 226 } 135 } 227 136 228 //-------------------------------------------- 137 //--------------------------------------------------------------------------------- 229 138 230 G4bool G4FragmentingString::IsAFourQuarkString << 139 G4bool G4FragmentingString::FourQuarkString() const 231 { 140 { 232 return LeftParton->GetParticleSubType()== 141 return LeftParton->GetParticleSubType()== "di_quark" 233 && RightParton->GetParticleSubType()== 142 && RightParton->GetParticleSubType()== "di_quark"; 234 } 143 } 235 144 236 //-------------------------------------------- 145 //--------------------------------------------------------------------------------- 237 146 238 G4bool G4FragmentingString::DecayIsQuark() 147 G4bool G4FragmentingString::DecayIsQuark() 239 { 148 { 240 return theDecayParton->GetParticleSubType()= 149 return theDecayParton->GetParticleSubType()== "quark"; 241 } 150 } 242 151 243 G4bool G4FragmentingString::StableIsQuark() 152 G4bool G4FragmentingString::StableIsQuark() 244 { 153 { 245 return theStableParton->GetParticleSubType() 154 return theStableParton->GetParticleSubType()== "quark"; 246 } 155 } 247 156 248 //-------------------------------------------- 157 //--------------------------------------------------------------------------------- 249 158 250 G4ThreeVector G4FragmentingString::StablePt() 159 G4ThreeVector G4FragmentingString::StablePt() 251 { 160 { 252 if (decaying == Left ) return Ptright; 161 if (decaying == Left ) return Ptright; 253 else if (decaying == Right ) return Ptleft; 162 else if (decaying == Right ) return Ptleft; 254 else throw G4HadronicException(__FILE__, __L 163 else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!"); 255 return G4ThreeVector(); 164 return G4ThreeVector(); 256 } 165 } 257 166 258 G4ThreeVector G4FragmentingString::DecayPt() 167 G4ThreeVector G4FragmentingString::DecayPt() 259 { 168 { 260 if (decaying == Left ) return Ptleft; 169 if (decaying == Left ) return Ptleft; 261 else if (decaying == Right ) return Ptright; 170 else if (decaying == Right ) return Ptright; 262 else throw G4HadronicException(__FILE__, __L 171 else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!"); 263 return G4ThreeVector(); 172 return G4ThreeVector(); 264 } 173 } 265 174 266 //-------------------------------------------- 175 //--------------------------------------------------------------------------------- 267 176 268 G4double G4FragmentingString::LightConePlus() 177 G4double G4FragmentingString::LightConePlus() 269 { 178 { 270 return Pplus; 179 return Pplus; 271 } 180 } 272 181 273 G4double G4FragmentingString::LightConeMinus() 182 G4double G4FragmentingString::LightConeMinus() 274 { 183 { 275 return Pminus; 184 return Pminus; 276 } 185 } 277 186 278 G4double G4FragmentingString::LightConeDecay() 187 G4double G4FragmentingString::LightConeDecay() 279 { 188 { 280 if (decaying == Left ) return Pplus; 189 if (decaying == Left ) return Pplus; 281 else if (decaying == Right ) return Pminus; 190 else if (decaying == Right ) return Pminus; 282 else throw G4HadronicException(__FILE__, __L 191 else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!"); >> 192 return 0; 283 } 193 } 284 194 285 //-------------------------------------------- 195 //--------------------------------------------------------------------------------- 286 196 287 G4LorentzVector G4FragmentingString::Get4Momen 197 G4LorentzVector G4FragmentingString::Get4Momentum() const 288 { 198 { 289 return Pstring; << 199 G4LorentzVector momentum(Ptleft+Ptright,0); >> 200 momentum.setPz(0.5*(Pplus-Pminus)); >> 201 momentum.setE(0.5*(Pplus+Pminus)); >> 202 return momentum; 290 } 203 } 291 204 292 G4double G4FragmentingString::Mass2() const 205 G4double G4FragmentingString::Mass2() const 293 { 206 { 294 return Pstring.mag2(); << 207 return Pplus*Pminus - (Ptleft+Ptright).mag2(); 295 } 208 } 296 209 297 G4double G4FragmentingString::Mass() const 210 G4double G4FragmentingString::Mass() const 298 { 211 { 299 return Pstring.mag(); << 212 return sqrt(this->Mass2()); 300 } << 301 << 302 G4double G4FragmentingString::MassT2() const << 303 { << 304 return Pplus*Pminus; << 305 } << 306 << 307 G4LorentzVector G4FragmentingString::GetPstrin << 308 { << 309 return Pstring; << 310 } << 311 << 312 G4LorentzVector G4FragmentingString::GetPleft( << 313 { << 314 return Pleft; << 315 } << 316 << 317 G4LorentzVector G4FragmentingString::GetPright << 318 { << 319 return Pright; << 320 } << 321 << 322 G4LorentzRotation G4FragmentingString::Transfo << 323 { << 324 G4LorentzVector momentum = Pstring; << 325 G4LorentzRotation toAlignedCms(-1*momentu << 326 momentum = toAlignedCms * Pleft; << 327 << 328 toAlignedCms.rotateZ(-1*momentum.phi()); << 329 toAlignedCms.rotateY(-1*momentum.theta()) << 330 << 331 Pleft *= toAlignedCms; << 332 Pright *= toAlignedCms; << 333 Pstring *= toAlignedCms; << 334 << 335 Ptleft = G4ThreeVector(Pleft.vect()); << 336 Ptleft.setZ(0.); << 337 Ptright = G4ThreeVector(Pright.vect()); << 338 Pplus = Pstring.plus(); << 339 Pminus = Pstring.minus(); << 340 << 341 return toAlignedCms; << 342 } 213 } 343 214