G4VKinkyStringDecay.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 // $Id$
00028 //  Maxim Komogorov
00029 //
00030 // -----------------------------------------------------------------------------
00031 //      GEANT 4 class implementation file
00032 //
00033 //      History: first implementation, Maxim Komogorov, 10-Oct-1998
00034 // -----------------------------------------------------------------------------
00035 
00036 #include "G4VKinkyStringDecay.hh"
00037 #include "G4KineticTrackVector.hh"
00038 #include "G4KineticTrack.hh"
00039 #include "Randomize.hh"
00040 
00041 //*****************************************************************************************************
00042 
00043 G4VKinkyStringDecay::G4VKinkyStringDecay(G4VLongitudinalStringDecay* theModal)
00044    {
00045    this->SetLongitudinalStringDecay(theModal);
00046    }
00047 
00048 //*****************************************************************************************************
00049 
00050 G4double G4VKinkyStringDecay::GetLightConeGluonZ(G4double zmin, G4double zmax)
00051     {
00052     G4double z, yf;
00053     do {
00054        z = zmin + G4UniformRand()*(zmax-zmin);
00055        yf = z*z +sqr(1 - z);    
00056        } 
00057     while (G4UniformRand() > yf); 
00058     return z;
00059     }
00060 
00061 //*****************************************************************************************************
00062 
00063 G4KineticTrackVector* G4VKinkyStringDecay::FragmentString(const G4ExcitedString& String) 
00064     {
00065     G4LorentzVector Mom = String.GetGluon()->Get4Momentum();
00066     G4ThreeVector Pos = String.GetGluon()->GetPosition();
00067     G4int QuarkEncoding = theLongitudinalStringDecay->SampleQuarkFlavor();
00068     G4ThreeVector Pquark=theLongitudinalStringDecay->SampleQuarkPt();
00069     G4double Pt2 = Pquark.mag2();
00070     G4double z = GetLightConeGluonZ(0, 1);
00071     G4double w = Mom.e() + Mom.pz();
00072     //... now compute quark longitudinal momentum and energy
00073 
00074     Pquark.setZ(  (z*w - Pt2/(z*w))*0.5);
00075     G4double E  = (z*w + Pt2/(z*w))*0.5;
00076     
00077     G4Parton* AntiColor = new G4Parton(-QuarkEncoding);
00078     AntiColor->SetPosition(Pos);
00079     G4LorentzVector AntiColorMom(-Pquark, E);
00080     AntiColor->Set4Momentum(AntiColorMom);
00081     G4Parton* Color = new G4Parton(*String.GetColorParton());
00082     G4ExcitedString Str1(Color, AntiColor, String.GetDirection());
00083     G4KineticTrackVector* KTV1 = theLongitudinalStringDecay->FragmentString(Str1);
00084 
00085     Color = new G4Parton(QuarkEncoding);
00086     Color->SetPosition(Pos);
00087     G4LorentzVector ColorMom(Pquark, E);
00088     Color->Set4Momentum(ColorMom);
00089     AntiColor = new G4Parton(*String.GetAntiColorParton());
00090     G4ExcitedString Str2(Color, AntiColor, String.GetDirection());
00091     G4KineticTrackVector* KTV2 = theLongitudinalStringDecay->FragmentString(Str2);
00092 
00093     if (KTV1 && KTV2)
00094          while(!KTV2->empty())
00095          {
00096              KTV1->push_back(KTV2->back());
00097              KTV1->erase(KTV1->end()-1);
00098          }
00099     return KTV1;            
00100     } 
00101  
00102 //*****************************************************************************************************
00103  
00104  
00105  
00106  
00107  
00108  
00109  
00110  
00111  
00112  
00113  
00114  
00115  
00116  

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