G4ExcitedString.hh

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 #ifndef G4ExcitedString_h
00030 #define G4ExcitedString_h 1
00031 
00032 // ------------------------------------------------------------
00033 //      GEANT 4 class header file
00034 //
00035 //      ---------------- G4ExcitedString ----------------
00036 //             by Gunter Folger, June 1998.
00037 //       class for an excited string used by Parton String Models
00038 // ------------------------------------------------------------
00039 
00040 #include "G4ios.hh"
00041 #include "globals.hh"
00042 #include "G4ThreeVector.hh"
00043 #include "G4LorentzVector.hh"
00044 #include "G4LorentzRotation.hh"
00045 #include "G4Parton.hh"
00046 #include "G4PartonVector.hh"
00047 #include "G4KineticTrack.hh"
00048 #include "G4HadronicException.hh"
00049 #include <algorithm>
00050 
00051 class G4ExcitedString 
00052 {
00053 
00054   public:
00055 
00056       enum {
00057            PROJECTILE  = 1, 
00058            TARGET  = -1 
00059            };
00060 
00061       G4ExcitedString(G4Parton* Color, G4Parton* Gluon,  G4Parton* AntiColor, G4int Direction=PROJECTILE);
00062       G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Direction=PROJECTILE);
00063       G4ExcitedString(G4KineticTrack * atrack);
00064      
00065 
00066       ~G4ExcitedString();
00067 
00068 private:
00069       G4ExcitedString(const G4ExcitedString &right);
00070       G4ExcitedString& operator= (const G4ExcitedString &right);
00071 
00072 public:
00073       int operator==(const G4ExcitedString &right) const;
00074       int operator!=(const G4ExcitedString &right) const;
00075 
00076 public:
00077       G4double GetTimeOfCreation() const;               // Uzhi 15.05.08
00078 
00079       void  SetTimeOfCreation(G4double aTime);          // Uzhi 15.05.08
00080 
00081       const G4ThreeVector & GetPosition() const;
00082 
00083       void SetPosition(const G4ThreeVector &aPosition); 
00084 
00085       const G4PartonVector * GetPartonList() const;
00086       
00087       G4LorentzVector Get4Momentum() const;
00088       void LorentzRotate(const G4LorentzRotation & rotation);
00089 
00090       void InsertParton(G4Parton * aParton, const G4Parton * addafter = NULL);
00091 
00092       G4LorentzRotation TransformToCenterOfMass();
00093       G4LorentzRotation TransformToAlignedCms();
00094 
00095 
00096       void      Boost(G4ThreeVector& Velocity);
00097 
00098       G4Parton* GetColorParton(void) const;
00099       G4Parton* GetGluon(void) const;
00100       G4Parton* GetAntiColorParton(void) const;
00101       G4Parton* GetGluon(G4int GluonPos) const;
00102       
00103       G4KineticTrack * GetKineticTrack() const;
00104 
00105       G4Parton* GetLeftParton(void) const;
00106       G4Parton* GetRightParton(void) const;
00107 
00108       G4bool    IsItKinkyString(void) const;
00109       G4int     GetDirection(void) const;
00110       
00111       G4bool    IsExcited() const;
00112 
00113 
00114   private:
00115 
00116       G4int    theDirection;  // must be 1 or -1 (PROJECTILE or TARGET)
00117       G4double theTimeOfCreation;                   // Uzhi 15.05.08
00118       G4ThreeVector thePosition;
00119       G4PartonVector thePartons;  // would like initial capacity for 3 Partons.
00120       G4KineticTrack* theTrack;
00121 
00122 };
00123 
00124 inline
00125 int G4ExcitedString::operator==(const G4ExcitedString &right) const
00126 {
00127         return this == &right;
00128 }
00129 
00130 inline
00131 int G4ExcitedString::operator!=(const G4ExcitedString &right) const
00132 {
00133         return this != &right;
00134 }
00135 
00136 inline
00137 G4double G4ExcitedString::GetTimeOfCreation() const      // Uzhi 15.05.08
00138 {
00139         return theTimeOfCreation;
00140 }
00141 
00142 inline
00143 void G4ExcitedString::SetTimeOfCreation(G4double aTime)  // Uzhi 15.05.08
00144 {
00145         theTimeOfCreation=aTime;                         // Uzhi 15.05.08
00146 }
00147 
00148 inline
00149 const G4ThreeVector & G4ExcitedString::GetPosition() const 
00150 {
00151         return thePosition;
00152 }
00153 
00154 inline
00155 void G4ExcitedString::SetPosition(const G4ThreeVector &aPosition)
00156 {
00157         thePosition= aPosition;
00158 }
00159 
00160 inline
00161 G4LorentzVector G4ExcitedString::Get4Momentum() const
00162 {
00163         G4LorentzVector momentum;
00164         for ( unsigned int index=0; index < thePartons.size() ; index++ )
00165         {
00166             // std::cout << "HPW "<<thePartons[index]->Get4Momentum()<<std::endl;
00167             momentum += thePartons[index]->Get4Momentum();
00168         }
00169         return momentum;
00170 }
00171 
00172 inline
00173 void G4ExcitedString::LorentzRotate(const G4LorentzRotation & rotation)
00174 {
00175         for ( unsigned int index=0; index < thePartons.size() ; index++ )
00176         {
00177             thePartons[index]->Set4Momentum(rotation*thePartons[index]->Get4Momentum());
00178         }
00179 }
00180 
00181 inline
00182 void G4ExcitedString::InsertParton(G4Parton *aParton, const G4Parton * addafter)
00183 {
00184 
00185         G4PartonVector::iterator insert_index;
00186         
00187         if ( addafter != NULL ) 
00188         {
00189            insert_index=std::find(thePartons.begin(), thePartons.end(), addafter);
00190            if (insert_index == thePartons.end())                // No object addafter in thePartons
00191            {
00192               G4String text = "G4ExcitedString::InsertParton called with invalid second argument";
00193               throw G4HadronicException(__FILE__, __LINE__, text);
00194            }
00195         }
00196         
00197         thePartons.insert(insert_index+1, aParton);
00198 } 
00199 
00200 inline
00201 G4LorentzRotation G4ExcitedString::TransformToCenterOfMass()
00202 {
00203         G4LorentzVector momentum=Get4Momentum();
00204         G4LorentzRotation toCms(-1*momentum.boostVector());
00205 
00206         for ( unsigned int index=0; index < thePartons.size() ; index++ )
00207         {
00208             momentum=toCms * thePartons[index]->Get4Momentum();
00209             thePartons[index]->Set4Momentum(momentum);
00210         }
00211         return toCms;
00212 }
00213 
00214 inline
00215 G4LorentzRotation G4ExcitedString::TransformToAlignedCms()
00216 {
00217         G4LorentzVector momentum=Get4Momentum();
00218         G4LorentzRotation toAlignedCms(-1*momentum.boostVector());
00219 
00220         momentum= toAlignedCms* thePartons[0]->Get4Momentum();
00221         toAlignedCms.rotateZ(-1*momentum.phi());
00222         toAlignedCms.rotateY(-1*momentum.theta());
00223         
00224         for ( unsigned int index=0; index < thePartons.size() ; index++ )
00225         {
00226             momentum=toAlignedCms * thePartons[index]->Get4Momentum();
00227             thePartons[index]->Set4Momentum(momentum);
00228         }
00229         return toAlignedCms;
00230 }
00231 
00232 
00233 inline 
00234 const G4PartonVector * G4ExcitedString::GetPartonList() const
00235 {
00236         return &thePartons;
00237 }
00238 
00239 inline 
00240 G4KineticTrack * G4ExcitedString::GetKineticTrack() const
00241 {
00242         return theTrack;
00243 }
00244 
00245 inline 
00246 G4bool G4ExcitedString::IsExcited() const
00247 {
00248         return theTrack == 0;
00249 }
00250 
00251 
00252 #endif
00253 
00254 

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