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