117{
118
121
122 #ifdef debug_QGSMfragmentation
126 <<
"------------------------------------"<<
G4endl;
133 #endif
134
135
137
138
140
141 if ( !IsItFragmentable(&aString) ) {
143
144 #ifdef debug_QGSMfragmentation
145 if ( LeftVector != 0 )
G4cout<<
"Non fragmentable - the string is converted to one hadron "<<
G4endl;
146 #endif
147
149 return LeftVector;
150 }
151
152 #ifdef debug_QGSMfragmentation
154 #endif
155
158
161
162 G4bool success=
false, inner_sucess=
true;
165 {
166 #ifdef debug_QGSMfragmentation
170 #endif
171
173
175 LeftVector->clear();
177 RightVector->clear();
178
179 inner_sucess=true;
180 const G4int maxNumberOfLoops = 1000;
181 G4int loopCounter = -1;
182 while (! StopFragmenting(currentString) && ++loopCounter < maxNumberOfLoops )
183 {
184
185 #ifdef debug_QGSMfragmentation
187 #endif
190
191 if ( Hadron != 0 )
192 {
193 #ifdef debug_QGSMfragmentation
195 #endif
196
198 LeftVector->push_back(Hadron);
199 else
200 RightVector->push_back(Hadron);
201
202 delete currentString;
203 currentString=newString;
204
205 } else {
206
207 #ifdef debug_QGSMfragmentation
208 G4cout<<
"abandon ... start from the beginning ---------------"<<
G4endl;
209 #endif
210
211
212 if (newString) delete newString;
213 inner_sucess=false;
214 break;
215 }
216 }
217 if ( loopCounter >= maxNumberOfLoops ) {
218 inner_sucess=false;
219 }
220
221
222 #ifdef debug_QGSMfragmentation
223 if( inner_sucess ) {
224 G4cout<<
"Split remaining string into 2 final hadrons."<<
G4endl;
225 } else {
227 }
228 #endif
229
230 if ( inner_sucess &&
231 SplitLast(currentString,LeftVector, RightVector) )
232 {
233 success=true;
234 }
235 delete currentString;
236 }
237
238 delete theStringInCMS;
239
240 if ( ! success )
241 {
243 LeftVector->clear();
245 delete RightVector;
246 return LeftVector;
247 }
248
249
250 while(!RightVector->empty())
251 {
252 LeftVector->push_back(RightVector->back());
253 RightVector->erase(RightVector->end()-1);
254 }
255 delete RightVector;
256
258
260
261 for (
size_t C1 = 0;
C1 < LeftVector->size();
C1++)
262 {
268 Momentum = toObserverFrame*Coordinate;
272 }
273 return LeftVector;
274}
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation inverse() const
const G4ThreeVector & GetPosition() const
G4int GetDirection(void) const
G4LorentzRotation TransformToAlignedCms()
G4Parton * GetRightParton(void) const
G4Parton * GetLeftParton(void) const
G4LorentzVector Get4Momentum() const
G4int GetDecayDirection() const
G4double GetFormationTime() const
void SetPosition(const G4ThreeVector aPosition)
void Set4Momentum(const G4LorentzVector &a4Momentum)
const G4ThreeVector & GetPosition() const
const G4ParticleDefinition * GetDefinition() const
void SetFormationTime(G4double aFormationTime)
const G4LorentzVector & Get4Momentum() const
const G4String & GetParticleName() const
const G4LorentzVector & Get4Momentum() const
G4KineticTrackVector * ProduceOneHadron(const G4ExcitedString *const theString)
G4int StringLoopInterrupt
void CalculateHadronTimePosition(G4double theInitialStringMass, G4KineticTrackVector *)
void SetMinimalStringMass(const G4FragmentingString *const string)
G4ExcitedString * CopyExcited(const G4ExcitedString &string)