G4ExcitedString.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 //      ---------------- G4ExcitedString ----------------
00033 //             by Gunter Folger, June 1998.
00034 //       class for an excited string used by Parton String Models
00035 // ------------------------------------------------------------
00036 
00037 
00038 // G4ExcitedString
00039 #include "G4ExcitedString.hh"
00040 #include <algorithm>
00041 
00042 
00043 G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Direction)
00044     {
00045     thePartons.push_back(Color);
00046     thePartons.push_back(AntiColor);
00047     theTimeOfCreation = 0.;                           // Uzhi 15.05.08
00048     thePosition = Color->GetPosition();
00049     theDirection = Direction;
00050     theTrack=0;
00051     }
00052 
00053 G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* Gluon,  G4Parton* AntiColor, G4int Direction)
00054     {
00055     thePartons.push_back(Color);
00056     thePartons.push_back(Gluon);
00057     thePartons.push_back(AntiColor);
00058     theTimeOfCreation = 0.;                            // Uzhi 15.05.08
00059     thePosition = Color->GetPosition();
00060     theDirection = Direction;
00061     theTrack=0;
00062     }
00063 
00064 G4ExcitedString::G4ExcitedString(G4KineticTrack * track)
00065 {
00066         theTimeOfCreation = track->GetFormationTime(); // Uzhi 15.05.08
00067         thePosition = track->GetPosition();
00068         theTrack= track;
00069         theDirection=0;
00070 }
00071 
00072 G4ExcitedString::~G4ExcitedString()
00073 {
00074   std::for_each(thePartons.begin(), thePartons.end(), DeleteParton());
00075 }
00076 
00077 
00078 //const G4ExcitedString & G4ExcitedString::operator=(const G4ExcitedString &right)
00079 //{}
00080 
00081 
00082 //int G4ExcitedString::operator==(const G4ExcitedString &right) const
00083 //{}
00084 
00085 //int G4ExcitedString::operator!=(const G4ExcitedString &right) const
00086 //{}
00087 
00088 
00089 
00090 // Additional Declarations
00091 
00092 
00093 void G4ExcitedString::Boost(G4ThreeVector& Velocity)
00094     {
00095     for(unsigned int cParton = 0; cParton < thePartons.size() ; cParton++ )
00096         {
00097         G4LorentzVector Mom = thePartons[cParton]->Get4Momentum();
00098         Mom.boost(Velocity);
00099         thePartons[cParton]->Set4Momentum(Mom);
00100         }
00101     }
00102 
00103 //---------------------------------------------------------------------------------
00104 
00105 G4Parton* G4ExcitedString::GetColorParton(void) const
00106     {
00107     G4Parton * start = *(thePartons.begin());
00108     G4Parton * end = *(thePartons.end()-1);
00109     G4int Encoding = start->GetPDGcode();
00110     if (Encoding < -1000 || ((Encoding  < 1000) && (Encoding > 0)))
00111         return start;
00112     return end; 
00113     }
00114 
00115 //---------------------------------------------------------------------------------
00116 
00117 G4Parton* G4ExcitedString::GetGluon(void) const
00118     {
00119     return thePartons[1]; 
00120     }
00121 
00122 //---------------------------------------------------------------------------------
00123 
00124 G4Parton* G4ExcitedString::GetGluon(G4int GluonPos) const
00125     {
00126     return thePartons[1 + GluonPos]; 
00127     }
00128 
00129 //---------------------------------------------------------------------------------
00130 
00131 G4Parton* G4ExcitedString::GetAntiColorParton(void) const
00132     {
00133     G4Parton * start = *(thePartons.begin());
00134     G4Parton * end = *(thePartons.end()-1);
00135     G4int Encoding = start->GetPDGcode();
00136     if (Encoding < -1000 || ((Encoding  < 1000) && (Encoding > 0)))
00137         return end; 
00138     return start; 
00139     }
00140 
00141 //---------------------------------------------------------------------------------
00142 
00143 G4bool G4ExcitedString::IsItKinkyString(void) const
00144     {
00145     return (thePartons.size() > 2);    
00146     }
00147 
00148 //---------------------------------------------------------------------------------
00149 
00150 G4int G4ExcitedString::GetDirection(void) const
00151     {
00152     return theDirection;    
00153     }
00154 
00155 //*********************************************************************************
00156 
00157 G4Parton* G4ExcitedString::GetLeftParton(void) const
00158     {
00159     return *thePartons.begin(); 
00160     }
00161 
00162 //---------------------------------------------------------------------------------
00163 
00164 G4Parton* G4ExcitedString::GetRightParton(void) const
00165     {
00166     return *(thePartons.end()-1); 
00167     }
00168 
00169 //*********************************************************************************

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