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 // 26 // 27 27 28 28 29 // ------------------------------------------- 29 // ------------------------------------------------------------ 30 // GEANT 4 class implementation file 30 // GEANT 4 class implementation file 31 // 31 // 32 // ---------------- G4FragmentingString - 32 // ---------------- G4FragmentingString ---------------- 33 // by Gunter Folger, September 200 33 // by Gunter Folger, September 2001. 34 // class for an excited string used in F 34 // class for an excited string used in Fragmention 35 // ------------------------------------------- 35 // ------------------------------------------------------------ 36 36 37 37 38 // G4FragmentingString 38 // G4FragmentingString 39 #include "G4FragmentingString.hh" 39 #include "G4FragmentingString.hh" 40 #include "G4ExcitedString.hh" 40 #include "G4ExcitedString.hh" 41 41 42 //-------------------------------------------- 42 //--------------------------------------------------------------------------------- 43 43 44 //-------------------------------------------- 44 //--------------------------------------------------------------------------------- 45 45 46 G4FragmentingString::G4FragmentingString(const 46 G4FragmentingString::G4FragmentingString(const G4FragmentingString &old) 47 { 47 { 48 LeftParton=old.LeftParton; 48 LeftParton=old.LeftParton; 49 RightParton=old.RightParton; 49 RightParton=old.RightParton; 50 Ptleft=old.Ptleft; 50 Ptleft=old.Ptleft; 51 Ptright=old.Ptright; 51 Ptright=old.Ptright; 52 Pplus=old.Pplus; 52 Pplus=old.Pplus; 53 Pminus=old.Pminus; 53 Pminus=old.Pminus; 54 theStableParton=old.theStableParton; 54 theStableParton=old.theStableParton; 55 theDecayParton=old.theDecayParton; 55 theDecayParton=old.theDecayParton; 56 decaying=old.decaying; 56 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 } 57 } 81 58 82 //-------------------------------------------- 59 //--------------------------------------------------------------------------------- 83 60 84 G4FragmentingString::G4FragmentingString(const 61 G4FragmentingString::G4FragmentingString(const G4ExcitedString &excited) 85 { 62 { 86 LeftParton=excited.GetLeftParton()->GetDefin 63 LeftParton=excited.GetLeftParton()->GetDefinition(); 87 RightParton=excited.GetRightParton()->GetDef 64 RightParton=excited.GetRightParton()->GetDefinition(); 88 Ptleft=excited.GetLeftParton()->Get4Momentum 65 Ptleft=excited.GetLeftParton()->Get4Momentum().vect(); 89 Ptleft.setZ(0.); 66 Ptleft.setZ(0.); 90 Ptright=excited.GetRightParton()->Get4Moment 67 Ptright=excited.GetRightParton()->Get4Momentum().vect(); 91 Ptright.setZ(0.); 68 Ptright.setZ(0.); >> 69 G4LorentzVector P=excited.Get4Momentum(); >> 70 Pplus =P.e() + P.pz(); >> 71 Pminus=P.e() - P.pz(); 92 theStableParton=0; 72 theStableParton=0; 93 theDecayParton=0; 73 theDecayParton=0; 94 << 74 decaying=None; 95 if (excited.GetDirection() > 0) {decay << 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 } 75 } 105 76 106 //-------------------------------------------- 77 //--------------------------------------------------------------------------------- 107 78 108 G4FragmentingString::G4FragmentingString(const 79 G4FragmentingString::G4FragmentingString(const G4FragmentingString &old, 109 G4ParticleDefinition * newdecay, 80 G4ParticleDefinition * newdecay, 110 const G4LorentzVector *momentum) 81 const G4LorentzVector *momentum) 111 { 82 { 112 decaying=None; 83 decaying=None; 113 // Momentum of produced hadron << 84 if ( old.decaying == Left ) 114 G4LorentzVector Momentum = G4LorentzVe << 85 { 115 << 86 RightParton= old.RightParton; 116 if ( old.decaying == Left ) << 87 Ptright = old.Ptright; 117 { << 88 LeftParton = newdecay; 118 RightParton= old.RightParton; << 89 Ptleft = old.Ptleft - momentum->vect(); 119 Ptright = old.Ptright; << 90 Ptleft.setZ(0.); 120 Pright = old.Pright; << 91 theDecayParton=GetLeftParton(); 121 << 92 theStableParton=GetRightParton(); 122 LeftParton = newdecay; << 93 } else if ( old.decaying == Right ) 123 Ptleft = old.Ptleft - mome << 94 { 124 Ptleft.setZ(0.); << 95 RightParton = newdecay; 125 Pleft = old.Pleft - Momentum; << 96 Ptright = old.Ptright - momentum->vect(); 126 << 97 Ptright.setZ(0.); 127 Pstring = Pleft + Pright; << 98 LeftParton = old.LeftParton; 128 Pplus = Pstring.plus(); << 99 Ptleft = old.Ptleft; 129 Pminus = Pstring.minus(); << 100 theDecayParton=GetRightParton(); 130 << 101 theStableParton=GetLeftParton(); 131 theDecayParton=GetLeftParton() << 102 } else 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 { 103 { 154 throw G4HadronicException(__FILE__, __LINE << 104 throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::G4FragmentingString: no decay Direction defined"); 155 "G4FragmentingString::G4Frag << 156 } 105 } >> 106 Pplus = old.Pplus - (momentum->e() + momentum->pz()); >> 107 Pminus = old.Pminus - (momentum->e() - momentum->pz()); >> 108 >> 109 //G4double Eold=0.5 * (old.Pplus + old.Pminus); >> 110 //G4double Enew=0.5 * (Pplus + Pminus); 157 } 111 } 158 112 159 113 160 //-------------------------------------------- 114 //--------------------------------------------------------------------------------- 161 115 162 G4FragmentingString::G4FragmentingString(const 116 G4FragmentingString::G4FragmentingString(const G4FragmentingString &old, 163 G4ParticleDefinition * newdecay) 117 G4ParticleDefinition * newdecay) 164 { 118 { 165 decaying=None; 119 decaying=None; 166 120 167 Ptleft.setX(0.); Ptleft.setY(0.); Pt << 121 Ptleft.setX(0.); Ptleft.setY(0.); Ptleft.setZ(0.); // Uzhi 25.02.2011 168 Ptright.setX(0.); Ptright.setY(0.); Pt << 122 Ptright.setX(0.); Ptright.setY(0.); Ptright.setZ(0.); // Uzhi 25.02.2011 169 Pplus=0.; Pminus=0.; << 123 Pplus=0.; Pminus=0.; // Uzhi 25.02.2011 170 theStableParton=0; theDecayParton=0; << 124 theStableParton=0; theDecayParton=0; // Uzhi 25.02.2011 171 << 172 Pstring=G4LorentzVector(0.,0.,0.,0.); << 173 Pleft =G4LorentzVector(0.,0.,0.,0.); << 174 Pright =G4LorentzVector(0.,0.,0.,0.); << 175 125 176 if ( old.decaying == Left ) 126 if ( old.decaying == Left ) 177 { 127 { 178 RightParton= old.RightParton; 128 RightParton= old.RightParton; 179 LeftParton = newdecay; 129 LeftParton = newdecay; 180 decaying=Left; << 181 } else if ( old.decaying == Right ) 130 } else if ( old.decaying == Right ) 182 { 131 { 183 RightParton = newdecay; 132 RightParton = newdecay; 184 LeftParton = old.LeftParton; 133 LeftParton = old.LeftParton; 185 decaying=Right; << 186 } else 134 } else 187 { 135 { 188 throw G4HadronicException(__FILE__, __LINE << 136 throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::G4FragmentingString: no decay Direction defined"); 189 "G4FragmentingString::G4Frag << 190 } 137 } 191 } 138 } 192 139 193 140 194 //-------------------------------------------- 141 //--------------------------------------------------------------------------------- 195 142 196 G4FragmentingString::~G4FragmentingString() 143 G4FragmentingString::~G4FragmentingString() 197 {} 144 {} 198 145 >> 146 199 //-------------------------------------------- 147 //--------------------------------------------------------------------------------- 200 148 201 void G4FragmentingString::SetLeftPartonStable( 149 void G4FragmentingString::SetLeftPartonStable() 202 { 150 { 203 theStableParton=GetLeftParton(); 151 theStableParton=GetLeftParton(); 204 theDecayParton=GetRightParton(); 152 theDecayParton=GetRightParton(); 205 decaying=Right; 153 decaying=Right; 206 } 154 } 207 155 208 //-------------------------------------------- 156 //--------------------------------------------------------------------------------- 209 157 210 void G4FragmentingString::SetRightPartonStable 158 void G4FragmentingString::SetRightPartonStable() 211 { 159 { 212 theStableParton=GetRightParton(); 160 theStableParton=GetRightParton(); 213 theDecayParton=GetLeftParton(); 161 theDecayParton=GetLeftParton(); 214 decaying=Left; 162 decaying=Left; 215 } 163 } 216 164 217 //-------------------------------------------- 165 //--------------------------------------------------------------------------------- 218 166 219 G4int G4FragmentingString::GetDecayDirection() 167 G4int G4FragmentingString::GetDecayDirection() const 220 { 168 { 221 if (decaying == Left ) return +1; 169 if (decaying == Left ) return +1; 222 else if (decaying == Right) return -1; 170 else if (decaying == Right) return -1; 223 else throw G4HadronicException(__FILE__, __L << 171 else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::GetDecayDirection: decay side UNdefined!"); 224 "G4FragmentingString::GetDecayD << 225 return 0; 172 return 0; 226 } 173 } 227 174 228 //-------------------------------------------- 175 //--------------------------------------------------------------------------------- 229 176 230 G4bool G4FragmentingString::IsAFourQuarkString << 177 G4bool G4FragmentingString::FourQuarkString() const 231 { 178 { 232 return LeftParton->GetParticleSubType()== 179 return LeftParton->GetParticleSubType()== "di_quark" 233 && RightParton->GetParticleSubType()== 180 && RightParton->GetParticleSubType()== "di_quark"; 234 } 181 } 235 182 236 //-------------------------------------------- 183 //--------------------------------------------------------------------------------- 237 184 238 G4bool G4FragmentingString::DecayIsQuark() 185 G4bool G4FragmentingString::DecayIsQuark() 239 { 186 { 240 return theDecayParton->GetParticleSubType()= 187 return theDecayParton->GetParticleSubType()== "quark"; 241 } 188 } 242 189 243 G4bool G4FragmentingString::StableIsQuark() 190 G4bool G4FragmentingString::StableIsQuark() 244 { 191 { 245 return theStableParton->GetParticleSubType() 192 return theStableParton->GetParticleSubType()== "quark"; 246 } 193 } 247 194 248 //-------------------------------------------- 195 //--------------------------------------------------------------------------------- 249 196 250 G4ThreeVector G4FragmentingString::StablePt() 197 G4ThreeVector G4FragmentingString::StablePt() 251 { 198 { 252 if (decaying == Left ) return Ptright; 199 if (decaying == Left ) return Ptright; 253 else if (decaying == Right ) return Ptleft; 200 else if (decaying == Right ) return Ptleft; 254 else throw G4HadronicException(__FILE__, __L 201 else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!"); 255 return G4ThreeVector(); 202 return G4ThreeVector(); 256 } 203 } 257 204 258 G4ThreeVector G4FragmentingString::DecayPt() 205 G4ThreeVector G4FragmentingString::DecayPt() 259 { 206 { 260 if (decaying == Left ) return Ptleft; 207 if (decaying == Left ) return Ptleft; 261 else if (decaying == Right ) return Ptright; 208 else if (decaying == Right ) return Ptright; 262 else throw G4HadronicException(__FILE__, __L 209 else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!"); 263 return G4ThreeVector(); 210 return G4ThreeVector(); 264 } 211 } 265 212 266 //-------------------------------------------- 213 //--------------------------------------------------------------------------------- 267 214 268 G4double G4FragmentingString::LightConePlus() 215 G4double G4FragmentingString::LightConePlus() 269 { 216 { 270 return Pplus; 217 return Pplus; 271 } 218 } 272 219 273 G4double G4FragmentingString::LightConeMinus() 220 G4double G4FragmentingString::LightConeMinus() 274 { 221 { 275 return Pminus; 222 return Pminus; 276 } 223 } 277 224 278 G4double G4FragmentingString::LightConeDecay() 225 G4double G4FragmentingString::LightConeDecay() 279 { 226 { 280 if (decaying == Left ) return Pplus; 227 if (decaying == Left ) return Pplus; 281 else if (decaying == Right ) return Pminus; 228 else if (decaying == Right ) return Pminus; 282 else throw G4HadronicException(__FILE__, __L 229 else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!"); >> 230 return 0; 283 } 231 } 284 232 285 //-------------------------------------------- 233 //--------------------------------------------------------------------------------- 286 234 287 G4LorentzVector G4FragmentingString::Get4Momen 235 G4LorentzVector G4FragmentingString::Get4Momentum() const 288 { 236 { 289 return Pstring; << 237 G4LorentzVector momentum(Ptleft+Ptright,0); >> 238 momentum.setPz(0.5*(Pplus-Pminus)); >> 239 momentum.setE(0.5*(Pplus+Pminus)); >> 240 return momentum; 290 } 241 } 291 242 292 G4double G4FragmentingString::Mass2() const 243 G4double G4FragmentingString::Mass2() const 293 { 244 { 294 return Pstring.mag2(); << 245 return Pplus*Pminus - (Ptleft+Ptright).mag2(); 295 } 246 } 296 247 297 G4double G4FragmentingString::Mass() const 248 G4double G4FragmentingString::Mass() const 298 { 249 { 299 return Pstring.mag(); << 250 return std::sqrt(this->Mass2()); 300 } 251 } 301 252 302 G4double G4FragmentingString::MassT2() const 253 G4double G4FragmentingString::MassT2() const 303 { 254 { 304 return Pplus*Pminus; << 255 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 } 256 } 343 257