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 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

  1 //
  2 // ********************************************************************
  3 // * License and Disclaimer                                           *
  4 // *                                                                  *
  5 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
  6 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
  7 // * conditions of the Geant4 Software License,  included in the file *
  8 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
  9 // * include a list of copyright holders.                             *
 10 // *                                                                  *
 11 // * Neither the authors of this software system, nor their employing *
 12 // * institutes,nor the agencies providing financial support for this *
 13 // * work  make  any representation or  warranty, express or implied, *
 14 // * regarding  this  software system or assume any liability for its *
 15 // * use.  Please see the license in the file  LICENSE  and URL above *
 16 // * for the full disclaimer and the limitation of liability.         *
 17 // *                                                                  *
 18 // * This  code  implementation is the result of  the  scientific and *
 19 // * technical work of the GEANT4 collaboration.                      *
 20 // * By using,  copying,  modifying or  distributing the software (or *
 21 // * any work based  on the software)  you  agree  to acknowledge its *
 22 // * use  in  resulting  scientific  publications,  and indicate your *
 23 // * acceptance of all terms of the Geant4 Software license.          *
 24 // ********************************************************************
 25 //
 26 //
 27 //
 28 
 29 #ifndef G4ExcitedString_h
 30 #define G4ExcitedString_h 1
 31 
 32 // ------------------------------------------------------------
 33 //      GEANT 4 class header file
 34 //
 35 //      ---------------- G4ExcitedString ----------------
 36 //             by Gunter Folger, June 1998.
 37 //       class for an excited string used by Parton String Models
 38 // ------------------------------------------------------------
 39 
 40 #include "G4ios.hh"
 41 #include "globals.hh"
 42 #include "G4ThreeVector.hh"
 43 #include "G4LorentzVector.hh"
 44 #include "G4LorentzRotation.hh"
 45 #include "G4Parton.hh"
 46 #include "G4PartonVector.hh"
 47 #include "G4KineticTrack.hh"
 48 #include "G4HadronicException.hh"
 49 #include <algorithm>
 50 
 51 class G4ExcitedString 
 52 {
 53 
 54   public:
 55 
 56       enum {
 57            PROJECTILE  = 1, 
 58            TARGET  = -1 
 59            };
 60 
 61       G4ExcitedString(G4Parton* Color, G4Parton* Gluon,  G4Parton* AntiColor, G4int Direction=PROJECTILE);
 62       G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Direction=PROJECTILE);
 63       G4ExcitedString(G4KineticTrack * atrack);
 64      
 65 
 66       ~G4ExcitedString();
 67 
 68 private:
 69       G4ExcitedString(const G4ExcitedString &right);
 70       G4ExcitedString& operator= (const G4ExcitedString &right);
 71 
 72 public:
 73       G4bool operator==(const G4ExcitedString &right) const;
 74       G4bool operator!=(const G4ExcitedString &right) const;
 75 
 76 public:
 77       G4double GetTimeOfCreation() const;
 78 
 79       void  SetTimeOfCreation(G4double aTime);
 80 
 81       const G4ThreeVector & GetPosition() const;
 82 
 83       void SetPosition(const G4ThreeVector &aPosition); 
 84 
 85       const G4PartonVector * GetPartonList() const;
 86 
 87       G4LorentzVector Get4Momentum() const;
 88       void LorentzRotate(const G4LorentzRotation & rotation);
 89 
 90       void InsertParton(G4Parton * aParton, const G4Parton * addafter = NULL);
 91 
 92       G4LorentzRotation TransformToCenterOfMass();
 93       G4LorentzRotation TransformToAlignedCms();
 94 
 95 
 96       void      Boost(G4ThreeVector& Velocity);
 97 
 98       G4Parton* GetColorParton(void) const;
 99       G4Parton* GetGluon(void) const;
100       G4Parton* GetAntiColorParton(void) const;
101       G4Parton* GetGluon(G4int GluonPos) const;
102       
103       G4KineticTrack * GetKineticTrack() const;
104 
105       G4Parton* GetLeftParton(void) const;
106       G4Parton* GetRightParton(void) const;
107 
108       G4bool    IsItKinkyString(void) const;
109       G4int     GetDirection(void) const;
110       
111       G4bool    IsExcited() const;
112 
113 
114   private:
115 
116       G4int    theDirection;  // must be 1 or -1 (PROJECTILE or TARGET)
117       G4double theTimeOfCreation;
118       G4ThreeVector thePosition;
119       G4PartonVector thePartons;  // would like initial capacity for 3 Partons.
120       G4KineticTrack* theTrack;
121 
122 };
123 
124 inline
125 G4bool G4ExcitedString::operator==(const G4ExcitedString &right) const
126 {
127   return this == &right;
128 }
129 
130 inline
131 G4bool G4ExcitedString::operator!=(const G4ExcitedString &right) const
132 {
133   return this != &right;
134 }
135 
136 inline
137 G4double G4ExcitedString::GetTimeOfCreation() const
138 {
139   return theTimeOfCreation;
140 }
141 
142 inline
143 void G4ExcitedString::SetTimeOfCreation(G4double aTime)
144 {
145   theTimeOfCreation=aTime;
146 }
147 
148 inline
149 const G4ThreeVector & G4ExcitedString::GetPosition() const 
150 {
151   return thePosition;
152 }
153 
154 inline
155 void G4ExcitedString::SetPosition(const G4ThreeVector &aPosition)
156 {
157   thePosition= aPosition;
158 }
159 
160 inline
161 G4LorentzVector G4ExcitedString::Get4Momentum() const
162 {
163   G4LorentzVector momentum;
164         if ( IsExcited() )
165         {
166       for ( unsigned int index=0; index < thePartons.size() ; index++ )
167       {
168           // std::cout << "HPW "<<thePartons[index]->Get4Momentum()<<std::endl;
169           momentum += thePartons[index]->Get4Momentum();
170       }
171         }
172         else
173         {
174             momentum=theTrack->Get4Momentum();
175         }
176   return momentum;
177 }
178 
179 inline
180 void G4ExcitedString::LorentzRotate(const G4LorentzRotation & rotation)
181 {
182         if ( IsExcited() )
183         {
184       for ( unsigned int index=0; index < thePartons.size() ; index++ )
185       {
186           thePartons[index]->Set4Momentum(rotation*thePartons[index]->Get4Momentum());
187       }
188         }
189         else
190         {
191             theTrack->Set4Momentum(rotation*theTrack->Get4Momentum());
192         }
193 }
194 
195 inline
196 void G4ExcitedString::InsertParton(G4Parton *aParton, const G4Parton * addafter)
197 {
198 
199   G4PartonVector::iterator insert_index;
200   
201   if ( addafter != NULL ) 
202   {
203       insert_index=std::find(thePartons.begin(), thePartons.end(), addafter);
204       if ( insert_index == thePartons.end() )   // No object addafter in thePartons
205       {
206           G4String text = "G4ExcitedString::InsertParton called with invalid second argument";
207             throw G4HadronicException(__FILE__, __LINE__, text);
208       }
209   }
210   
211   thePartons.insert(insert_index+1, aParton);
212 } 
213 
214 inline
215 G4LorentzRotation G4ExcitedString::TransformToCenterOfMass()
216 {
217   G4LorentzVector momentum=Get4Momentum();
218   G4LorentzRotation toCms(-1*momentum.boostVector());
219 
220         if ( IsExcited() )
221         {
222       for ( unsigned int index=0; index < thePartons.size() ; index++ )
223       {
224           momentum=toCms * thePartons[index]->Get4Momentum();
225           thePartons[index]->Set4Momentum(momentum);
226       }
227         }
228         else
229         {
230             momentum*=toCms;
231             theTrack->Set4Momentum(momentum);
232         }
233   return toCms;
234 }
235 
236 inline
237 G4LorentzRotation G4ExcitedString::TransformToAlignedCms()
238 {
239   G4LorentzVector momentum=Get4Momentum();
240   G4LorentzRotation toAlignedCms(-1*momentum.boostVector());
241 
242   momentum= toAlignedCms* thePartons[0]->Get4Momentum();
243   toAlignedCms.rotateZ(-1*momentum.phi());
244   toAlignedCms.rotateY(-1*momentum.theta());
245   
246   for ( unsigned int index=0; index < thePartons.size() ; index++ )
247   {
248       momentum=toAlignedCms * thePartons[index]->Get4Momentum();
249       thePartons[index]->Set4Momentum(momentum);
250   }
251   return toAlignedCms;
252 }
253 
254 
255 inline 
256 const G4PartonVector * G4ExcitedString::GetPartonList() const
257 {
258   return &thePartons;
259 }
260 
261 inline 
262 G4KineticTrack * G4ExcitedString::GetKineticTrack() const
263 {
264   return theTrack;
265 }
266 
267 inline 
268 G4bool G4ExcitedString::IsExcited() const
269 {
270   return theTrack == 0;
271 }
272 
273 
274 #endif
275