G4FragmentingString.cc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 
00028 
00029 // ------------------------------------------------------------
00030 //      GEANT 4 class implementation file
00031 //
00032 //      ---------------- G4FragmentingString ----------------
00033 //             by Gunter Folger, September 2001.
00034 //       class for an excited string used in Fragmention
00035 // ------------------------------------------------------------
00036 
00037 
00038 // G4FragmentingString
00039 #include "G4FragmentingString.hh"
00040 #include "G4ExcitedString.hh"
00041 
00042 //---------------------------------------------------------------------------------
00043 
00044 //---------------------------------------------------------------------------------
00045 
00046 G4FragmentingString::G4FragmentingString(const G4FragmentingString &old)
00047 {
00048         LeftParton=old.LeftParton;
00049         RightParton=old.RightParton;
00050         Ptleft=old.Ptleft;
00051         Ptright=old.Ptright;
00052         Pplus=old.Pplus;
00053         Pminus=old.Pminus;
00054         theStableParton=old.theStableParton;
00055         theDecayParton=old.theDecayParton;
00056         decaying=old.decaying;
00057 }
00058 
00059 G4FragmentingString & G4FragmentingString::operator =(const G4FragmentingString &old)
00060 {
00061    if (this != &old)
00062    {
00063    LeftParton=old.LeftParton;
00064    RightParton=old.RightParton;
00065    Ptleft=old.Ptleft;
00066    Ptright=old.Ptright;
00067    Pplus=old.Pplus;
00068    Pminus=old.Pminus;
00069    theStableParton=old.theStableParton;
00070    theDecayParton=old.theDecayParton;
00071    decaying=old.decaying;
00072    }
00073    return *this;
00074 }
00075 
00076 //---------------------------------------------------------------------------------
00077 
00078 G4FragmentingString::G4FragmentingString(const G4ExcitedString &excited)
00079 {
00080         LeftParton=excited.GetLeftParton()->GetDefinition();
00081         RightParton=excited.GetRightParton()->GetDefinition();
00082         Ptleft=excited.GetLeftParton()->Get4Momentum().vect();
00083         Ptleft.setZ(0.);
00084         Ptright=excited.GetRightParton()->Get4Momentum().vect();
00085         Ptright.setZ(0.);
00086         G4LorentzVector P=excited.Get4Momentum();
00087         Pplus =P.e() + P.pz();
00088         Pminus=P.e() - P.pz();
00089         theStableParton=0;
00090         theDecayParton=0;
00091         decaying=None;
00092 }
00093 
00094 //---------------------------------------------------------------------------------
00095 
00096 G4FragmentingString::G4FragmentingString(const G4FragmentingString &old,
00097                                          G4ParticleDefinition * newdecay,
00098                                          const G4LorentzVector *momentum)
00099 {
00100         decaying=None;
00101         if ( old.decaying == Left )
00102         {
00103                 RightParton= old.RightParton;
00104                 Ptright    = old.Ptright;
00105                 LeftParton = newdecay;
00106                 Ptleft     = old.Ptleft - momentum->vect();
00107                 Ptleft.setZ(0.);
00108                 theDecayParton=GetLeftParton();
00109                 theStableParton=GetRightParton();
00110         } else if ( old.decaying == Right )
00111         {
00112                 RightParton = newdecay;
00113                 Ptright     = old.Ptright - momentum->vect();
00114                 Ptright.setZ(0.);
00115                 LeftParton  = old.LeftParton;
00116                 Ptleft      = old.Ptleft;
00117                 theDecayParton=GetRightParton();
00118                 theStableParton=GetLeftParton();
00119         } else
00120         {
00121                 throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::G4FragmentingString: no decay Direction defined");
00122         }
00123         Pplus  = old.Pplus  - (momentum->e() + momentum->pz());
00124         Pminus = old.Pminus - (momentum->e() - momentum->pz());
00125         
00126         //G4double Eold=0.5 * (old.Pplus + old.Pminus);
00127         //G4double Enew=0.5 * (Pplus + Pminus);
00128 }
00129 
00130 
00131 //---------------------------------------------------------------------------------
00132 
00133 G4FragmentingString::G4FragmentingString(const G4FragmentingString &old,  
00134                                          G4ParticleDefinition * newdecay) 
00135 {                                                                         
00136         decaying=None;                                                    
00137 
00138         Ptleft.setX(0.);  Ptleft.setY(0.);  Ptleft.setZ(0.);  // Uzhi 25.02.2011
00139         Ptright.setX(0.); Ptright.setY(0.); Ptright.setZ(0.); // Uzhi 25.02.2011
00140         Pplus=0.; Pminus=0.;                                  // Uzhi 25.02.2011
00141         theStableParton=0; theDecayParton=0;                  // Uzhi 25.02.2011
00142 
00143         if ( old.decaying == Left )                                       
00144         {                                                                 
00145                 RightParton= old.RightParton;                             
00146                 LeftParton = newdecay;                                    
00147         } else if ( old.decaying == Right )                               
00148         {                                                                 
00149                 RightParton = newdecay;                                   
00150                 LeftParton  = old.LeftParton;                             
00151         } else                                                            
00152         {
00153                 throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::G4FragmentingString: no decay Direction defined");
00154         }
00155 }
00156 
00157 
00158 //---------------------------------------------------------------------------------
00159 
00160 G4FragmentingString::~G4FragmentingString()
00161 {}
00162 
00163 
00164 //---------------------------------------------------------------------------------
00165 
00166 void G4FragmentingString::SetLeftPartonStable()
00167 {
00168      theStableParton=GetLeftParton();
00169      theDecayParton=GetRightParton();
00170      decaying=Right;
00171 }
00172 
00173 //---------------------------------------------------------------------------------
00174 
00175 void G4FragmentingString::SetRightPartonStable()
00176 {
00177      theStableParton=GetRightParton();
00178      theDecayParton=GetLeftParton();
00179      decaying=Left;
00180 }
00181 
00182 //---------------------------------------------------------------------------------
00183 
00184 G4int G4FragmentingString::GetDecayDirection() const
00185 {
00186         if      (decaying == Left ) return +1;
00187         else if (decaying == Right) return -1;
00188         else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::GetDecayDirection: decay side UNdefined!");
00189         return 0;
00190 }
00191  
00192 //---------------------------------------------------------------------------------
00193 
00194 G4bool G4FragmentingString::FourQuarkString() const
00195 {
00196         return   LeftParton->GetParticleSubType()== "di_quark" 
00197              && RightParton->GetParticleSubType()== "di_quark";
00198 }
00199 
00200 //---------------------------------------------------------------------------------
00201 
00202 G4bool G4FragmentingString::DecayIsQuark()
00203 {
00204         return theDecayParton->GetParticleSubType()== "quark";
00205 }
00206 
00207 G4bool G4FragmentingString::StableIsQuark()
00208 {
00209         return theStableParton->GetParticleSubType()== "quark";
00210 }
00211 
00212 //---------------------------------------------------------------------------------
00213 
00214 G4ThreeVector G4FragmentingString::StablePt()
00215 {
00216         if (decaying == Left ) return Ptright;
00217         else if (decaying == Right ) return Ptleft;
00218         else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!");
00219         return G4ThreeVector();
00220 }
00221 
00222 G4ThreeVector G4FragmentingString::DecayPt()
00223 {
00224         if (decaying == Left ) return Ptleft;
00225         else if (decaying == Right ) return Ptright;
00226         else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!");
00227         return G4ThreeVector();
00228 }
00229 
00230 //---------------------------------------------------------------------------------
00231 
00232 G4double G4FragmentingString::LightConePlus()
00233 {
00234         return Pplus;
00235 }
00236 
00237 G4double G4FragmentingString::LightConeMinus()
00238 {
00239         return Pminus;
00240 }
00241 
00242 G4double G4FragmentingString::LightConeDecay()
00243 {
00244         if (decaying == Left ) return Pplus;
00245         else if (decaying == Right ) return Pminus;
00246         else throw G4HadronicException(__FILE__, __LINE__, "G4FragmentingString::DecayPt: decay side UNdefined!");
00247         return 0;
00248 }
00249 
00250 //---------------------------------------------------------------------------------
00251 
00252 G4LorentzVector G4FragmentingString::Get4Momentum() const
00253 {
00254         G4LorentzVector momentum(Ptleft+Ptright,0);
00255         momentum.setPz(0.5*(Pplus-Pminus));
00256         momentum.setE(0.5*(Pplus+Pminus));
00257         return momentum;
00258 }
00259 
00260 G4double G4FragmentingString::Mass2() const
00261 {
00262         return Pplus*Pminus - (Ptleft+Ptright).mag2();
00263 }
00264 
00265 G4double G4FragmentingString::Mass() const
00266 {
00267         return std::sqrt(this->Mass2());
00268 }
00269 
00270 G4double G4FragmentingString::MassT2() const
00271 {
00272         return Pplus*Pminus;
00273 }

Generated on Mon May 27 17:48:17 2013 for Geant4 by  doxygen 1.4.7