source: trunk/source/processes/hadronic/models/util/src/G4ExcitedString.cc@ 967

Last change on this file since 967 was 962, checked in by garnier, 17 years ago

update processes

File size: 5.6 KB
Line 
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// ------------------------------------------------------------
30// GEANT 4 class implementation file
31//
32// ---------------- G4ExcitedString ----------------
33// by Gunter Folger, June 1998.
34// class for an excited string used by Parton String Models
35// ------------------------------------------------------------
36
37
38// G4ExcitedString
39#include "G4ExcitedString.hh"
40#include <algorithm>
41
42//G4ExcitedString::G4ExcitedString(const G4ExcitedString &right)
43//{}
44
45G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* AntiColor, G4int Direction)
46 {
47 thePartons.push_back(Color);
48 thePartons.push_back(AntiColor);
49 theTimeOfCreation = 0.; // Uzhi 15.05.08
50 thePosition = Color->GetPosition();
51 theDirection = Direction;
52 theTrack=0;
53 }
54
55G4ExcitedString::G4ExcitedString(G4Parton* Color, G4Parton* Gluon, G4Parton* AntiColor, G4int Direction)
56 {
57 thePartons.push_back(Color);
58 thePartons.push_back(Gluon);
59 thePartons.push_back(AntiColor);
60 theTimeOfCreation = 0.; // Uzhi 15.05.08
61 thePosition = Color->GetPosition();
62 theDirection = Direction;
63 theTrack=0;
64 }
65
66G4ExcitedString::G4ExcitedString(G4KineticTrack * track)
67{
68 theTimeOfCreation = track->GetFormationTime(); // Uzhi 15.05.08
69 thePosition = track->GetPosition();
70 theTrack= track;
71 theDirection=0;
72}
73
74G4ExcitedString::~G4ExcitedString()
75{
76 std::for_each(thePartons.begin(), thePartons.end(), DeleteParton());
77}
78
79
80//const G4ExcitedString & G4ExcitedString::operator=(const G4ExcitedString &right)
81//{}
82
83
84//int G4ExcitedString::operator==(const G4ExcitedString &right) const
85//{}
86
87//int G4ExcitedString::operator!=(const G4ExcitedString &right) const
88//{}
89
90
91
92// Additional Declarations
93
94
95void G4ExcitedString::Boost(G4ThreeVector& Velocity)
96 {
97 for(unsigned int cParton = 0; cParton < thePartons.size() ; cParton++ )
98 {
99 G4LorentzVector Mom = thePartons[cParton]->Get4Momentum();
100 Mom.boost(Velocity);
101 thePartons[cParton]->Set4Momentum(Mom);
102 }
103 }
104
105//---------------------------------------------------------------------------------
106
107G4Parton* G4ExcitedString::GetColorParton(void) const
108 {
109 G4Parton * start = *(thePartons.begin());
110 G4Parton * end = *(thePartons.end()-1);
111 G4int Encoding = start->GetPDGcode();
112 if (Encoding < -1000 || ((Encoding < 1000) && (Encoding > 0)))
113 return start;
114 return end;
115 }
116
117//---------------------------------------------------------------------------------
118
119G4Parton* G4ExcitedString::GetGluon(void) const
120 {
121 return thePartons[1];
122 }
123
124//---------------------------------------------------------------------------------
125
126G4Parton* G4ExcitedString::GetGluon(G4int GluonPos) const
127 {
128 return thePartons[1 + GluonPos];
129 }
130
131//---------------------------------------------------------------------------------
132
133G4Parton* G4ExcitedString::GetAntiColorParton(void) const
134 {
135 G4Parton * start = *(thePartons.begin());
136 G4Parton * end = *(thePartons.end()-1);
137 G4int Encoding = start->GetPDGcode();
138 if (Encoding < -1000 || ((Encoding < 1000) && (Encoding > 0)))
139 return end;
140 return start;
141 }
142
143//---------------------------------------------------------------------------------
144
145G4bool G4ExcitedString::IsItKinkyString(void) const
146 {
147 return (thePartons.size() > 2);
148 }
149
150//---------------------------------------------------------------------------------
151
152G4int G4ExcitedString::GetDirection(void) const
153 {
154 return theDirection;
155 }
156
157//*********************************************************************************
158
159G4Parton* G4ExcitedString::GetLeftParton(void) const
160 {
161 return *thePartons.begin();
162 }
163
164//---------------------------------------------------------------------------------
165
166G4Parton* G4ExcitedString::GetRightParton(void) const
167 {
168 return *(thePartons.end()-1);
169 }
170
171//*********************************************************************************
Note: See TracBrowser for help on using the repository browser.