Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
G4DiffractiveSplitableHadron.cc
이 파일의 문서화 페이지로 가기
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 // $Id: G4DiffractiveSplitableHadron.cc 108010 2017-12-19 08:59:48Z gcosmo $
28 // GEANT4 tag $Name: $
29 //
30 
31 // ------------------------------------------------------------
32 // GEANT 4 class implementation file
33 //
34 // ---------------- G4DiffractiveSplitableHadron----------------
35 // by Gunter Folger, August 1998.
36 // class splitting an interacting particle. Used by FTF String Model.
37 // ------------------------------------------------------------
38 
40 
41 #include "G4ParticleDefinition.hh"
42 #include "Randomize.hh"
43 
44 
45 //============================================================================
46 
48 {
49  PartonIndex = -1;
50  G4LorentzVector tmp=G4LorentzVector(0.,0.,0.,0.); // Uzhi 16 Oct. 2017
51  Parton[0] = new G4Parton( 1 );
52  Parton[1] = new G4Parton(-1 );
53 
54  Parton[0]->Set4Momentum(tmp); Parton[1]->Set4Momentum(tmp); // Uzhi 16 Oct. 2017
55 }
56 
57 
58 //============================================================================
59 
61  G4VSplitableHadron( aPrimary )
62 {
63  PartonIndex = -2;
64  Parton[0] = NULL;
65 }
66 
67 
68 //============================================================================
69 
71  G4VSplitableHadron( aNucleon )
72 {
73  PartonIndex = -2;
74  Parton[0] = NULL;
75 }
76 
77 
78 //============================================================================
79 
81  G4VSplitableHadron( aNucleon )
82 {
83  PartonIndex = -2;
84  Parton[0] = NULL;
85 }
86 
87 
88 //============================================================================
89 
91 }
92 
93 
94 //============================================================================
95 
97 
98  if ( IsSplit() ) return;
99  Splitting();
100  // Split once only...
101  if ( Parton[0] != NULL ) return;
102 
103  // flavours of quark ends
104  G4int PDGcode = GetDefinition()->GetPDGEncoding();
105  G4int stringStart, stringEnd;
106  ChooseStringEnds( PDGcode, &stringStart, &stringEnd );
107 
108  Parton[0] = new G4Parton( stringStart );
109  Parton[1] = new G4Parton( stringEnd );
110 
111  G4LorentzVector tmp=G4LorentzVector(0.,0.,0.,0.); // Uzhi 16 Oct. 2017
112  Parton[0]->Set4Momentum(tmp); Parton[1]->Set4Momentum(tmp); // Uzhi 16 Oct. 2017
113 
114  /* // Inversion of a string
115  if ( G4UniformRand() < 1.75 ) { //0.75
116  Parton[0] = new G4Parton( stringStart );
117  Parton[1] = new G4Parton( stringEnd );
118  } else {
119  Parton[0] = new G4Parton( stringEnd );
120  Parton[1] = new G4Parton( stringStart );
121  }
122  */
123 
124  PartonIndex = -1;
125 }
126 
127 
128 //============================================================================
129 
131  ++PartonIndex;
132  if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL;
133  G4int PartonInd( PartonIndex );
134  if ( PartonIndex == 1 ) PartonIndex = -1;
135  return Parton[ PartonInd ];
136 }
137 
138 
139 //============================================================================
140 
142  ++PartonIndex;
143  if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL;
144  G4int PartonInd( PartonIndex );
145  if ( PartonIndex == 1 ) PartonIndex = -1;
146  return Parton[ PartonInd ];
147 }
148 
149 
150 //============================================================================
151 
153  delete Parton[0];
154  Parton[0] = new G4Parton( PDGcode );
155  G4LorentzVector tmp=G4LorentzVector(0.,0.,0.,0.); // Uzhi 16 Oct. 2017
156  Parton[0]->Set4Momentum(tmp); // Uzhi 16 Oct. 2017
157 
158 }
159 
160 
161 //============================================================================
162 
164  delete Parton[1];
165  Parton[1] = new G4Parton( PDGcode );
166  G4LorentzVector tmp=G4LorentzVector(0.,0.,0.,0.); // Uzhi 16 Oct. 2017
167  Parton[1]->Set4Momentum(tmp); // Uzhi 16 Oct. 2017
168 }
169 
170 
171 //============================================================================
172 
174  G4int* bEnd ) const {
175  G4int absPDGcode = std::abs( PDGcode );
176 
177  if ( absPDGcode < 1000 ) { //-------------------- Meson -------------
178  G4int heavy(0), light(0);
179  if(!((absPDGcode == 111)||(absPDGcode == 221)||(absPDGcode == 331)))
180  { // Ordinary mesons =======================
181  heavy = absPDGcode/100;
182  light = (absPDGcode % 100)/10;
183  //G4int anti = std::pow( -1 , std::max( heavy, light ) );
184  G4int anti = 1 - 2*( std::max( heavy, light ) % 2 );
185  if (PDGcode < 0 ) anti *= -1;
186  heavy *= anti;
187  light *= -1 * anti;
188  }
189  else
190  { // Pi0, Eta, Eta' =======================
191  if( G4UniformRand() < 0.5 ) {heavy = 1; light = -1;}
192  else {heavy = 2; light = -2;}
193  }
194  if ( G4UniformRand() < 0.5 ) {
195  *aEnd = heavy;
196  *bEnd = light;
197  } else {
198  *aEnd = light;
199  *bEnd = heavy;
200  }
201  } else { //-------------------- Baryon --------------
202  G4int j1000 = PDGcode/1000;
203  G4int j100 = (PDGcode % 1000)/100;
204  G4int j10 = (PDGcode % 100)/10;
205 
206  G4double SuppresUUDDSS=1.0/2.0;
207  if((j1000 == j100) && (j1000 == j10)) SuppresUUDDSS=1.;
208 
209 //
210  const G4int maxNumberOfLoops = 1000;
211  G4int loopCounter = 0;
212  do
213  {
214  G4double random = G4UniformRand();
215 
216  if(random < 0.33333)
217  {
218  if(( j100 == j10 ) && ( G4UniformRand() > SuppresUUDDSS )) continue;
219  *aEnd = j1000;
220  if( j100 == j10 ) {*bEnd = Diquark( j100, j10, 1 );}
221  else
222  if( G4UniformRand() > 0.25) {*bEnd = Diquark( j100, j10, 0 );}
223  else {*bEnd = Diquark( j100, j10, 1 );}
224  break;
225  }
226  else if(random < 0.66667)
227  {
228  if(( j1000 == j10 ) && ( G4UniformRand() > SuppresUUDDSS )) continue;
229  *aEnd = j100;
230  if( j1000 == j10 ) {*bEnd = Diquark( j1000, j10, 1 );}
231  else
232  if( G4UniformRand() > 0.25) {*bEnd = Diquark( j1000, j10, 0 );}
233  else {*bEnd = Diquark( j1000, j10, 1 );}
234  break;
235  }
236  else
237  {
238  if(( j1000 == j100 ) && ( G4UniformRand() > SuppresUUDDSS )) continue;
239  *aEnd = j10;
240  if( j1000 == j100 ) {*bEnd = Diquark( j1000, j100, 1 );}
241  else
242  if( G4UniformRand() > 0.25) {*bEnd = Diquark( j1000, j100, 0 );}
243  else {*bEnd = Diquark( j1000, j100, 1 );}
244  break;
245  }
246  } while ( (true) &&
247  ++loopCounter < maxNumberOfLoops ); /* Loop checking, 10.08.2015, A.Ribon */
248  if ( loopCounter >= maxNumberOfLoops ) {
249  *aEnd = j10; *bEnd = Diquark( j1000, j100, 1 ); // Just something acceptable, without any physics consideration.
250  }
251 
252  /*
253  if ( std::abs( j100 ) >= std::abs( j10 ) ) {
254  if ( random < udspin1 ) {
255  *aEnd = j1000;
256  *bEnd = Diquark( j100, j10, 1 );
257  } else if ( random < udspin1 + uuspin1 ) {
258  *aEnd = j10;
259  *bEnd = Diquark( j1000, j100, 1 );
260  } else {
261  *aEnd = j100;
262  // Careful, there is no diquark q1=q2, (q1 q2)0, possible for Omega-
263  *bEnd = Diquark( j1000, j10, j1000 != j100 ? 0 : 1 );
264  }
265  } else {
266  // Lambda-like hadrons have two lightest quarks in spin 0
267  if ( random < udspin1 ) {
268  *aEnd = j1000;
269  // as above, but with charmed baryons
270  *bEnd = Diquark( j100, j10, j100 != j10 ? 0 : 10 );
271  } else if ( random < udspin1 + uuspin1 ) {
272  *aEnd = j10;
273  *bEnd = Diquark( j1000, j100, 1 );
274  } else {
275  *aEnd = j100;
276  *bEnd = Diquark( j1000, j10, 1 );
277  }
278  }
279  */
280 
281  }
282 }
283 
284 
285 //============================================================================
286 
288  G4int diquarkPDG = std::max( std::abs( aquark ), std::abs( bquark ) ) * 1000 +
289  std::min( std::abs( aquark ), std::abs( bquark ) ) * 100 +
290  2*Spin + 1;
291  return ( aquark > 0 && bquark > 0 ) ? diquarkPDG : -1*diquarkPDG;
292 }
293 
T max(const T t1, const T t2)
brief Return the largest of the two arguments
const G4ParticleDefinition * GetDefinition() const
Float_t tmp
double G4double
Definition: G4Types.hh:76
G4int Diquark(G4int aquark, G4int bquark, G4int Spin) const
#define G4UniformRand()
Definition: Randomize.hh:53
void ChooseStringEnds(G4int PDGcode, G4int *aEnd, G4int *bEnd) const
int G4int
Definition: G4Types.hh:78
CLHEP::HepLorentzVector G4LorentzVector
void Set4Momentum(const G4LorentzVector &aMomentum)
Definition: G4Parton.hh:148
T min(const T t1, const T t2)
brief Return the smallest of the two arguments