Geant4-11
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
G4DiffractiveSplitableHadron Class Reference

#include <G4DiffractiveSplitableHadron.hh>

Inheritance diagram for G4DiffractiveSplitableHadron:
G4VSplitableHadron

Public Member Functions

 G4DiffractiveSplitableHadron ()
 
 G4DiffractiveSplitableHadron (const G4Nucleon &aNucleon)
 
 G4DiffractiveSplitableHadron (const G4ReactionProduct &aPrimary)
 
 G4DiffractiveSplitableHadron (const G4VKineticNucleon *aNucleon)
 
const G4LorentzVectorGet4Momentum () const
 
const G4ParticleDefinitionGetDefinition () const
 
G4PartonGetNextAntiParton ()
 
G4PartonGetNextParton ()
 
const G4ThreeVectorGetPosition () const
 
G4int GetSoftCollisionCount ()
 
G4int GetStatus ()
 
G4double GetTimeOfCreation ()
 
void IncrementCollisionCount (G4int aCount)
 
G4bool IsSplit ()
 
G4bool operator!= (const G4VSplitableHadron &right) const
 
G4bool operator== (const G4VSplitableHadron &right) const
 
void Set4Momentum (const G4LorentzVector &a4Momentum)
 
void SetCollisionCount (G4int aCount)
 
void SetDefinition (const G4ParticleDefinition *aDefinition)
 
void SetFirstParton (G4int PDGcode)
 
void SetPosition (const G4ThreeVector &aPosition)
 
void SetSecondParton (G4int PDGcode)
 
void SetStatus (const G4int aStatus)
 
void SetTimeOfCreation (G4double aTime)
 
void SplitUp ()
 
 ~G4DiffractiveSplitableHadron ()
 

Protected Member Functions

void Splitting ()
 

Private Member Functions

void ChooseStringEnds (G4int PDGcode, G4int *aEnd, G4int *bEnd) const
 
G4int Diquark (G4int aquark, G4int bquark, G4int Spin) const
 
 G4DiffractiveSplitableHadron (const G4DiffractiveSplitableHadron &)
 
G4bool operator!= (const G4DiffractiveSplitableHadron &right) const
 
G4DiffractiveSplitableHadronoperator= (const G4DiffractiveSplitableHadron &)
 
G4bool operator== (const G4DiffractiveSplitableHadron &right) const
 

Private Attributes

G4int curStatus
 
G4bool isSplit
 
G4PartonParton [2]
 
G4int PartonIndex
 
G4LorentzVector the4Momentum
 
G4int theCollisionCount
 
const G4ParticleDefinitiontheDefinition
 
G4ThreeVector thePosition
 
G4double TimeOfCreation
 

Detailed Description

Definition at line 45 of file G4DiffractiveSplitableHadron.hh.

Constructor & Destructor Documentation

◆ G4DiffractiveSplitableHadron() [1/5]

G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron ( )

Definition at line 45 of file G4DiffractiveSplitableHadron.cc.

46{
47 PartonIndex = -1;
48 G4LorentzVector tmp=G4LorentzVector(0.,0.,0.,0.);
49 Parton[0] = new G4Parton( 1 );
50 Parton[1] = new G4Parton(-1 );
51
52 Parton[0]->Set4Momentum(tmp); Parton[1]->Set4Momentum(tmp);
53}
CLHEP::HepLorentzVector G4LorentzVector
void Set4Momentum(const G4LorentzVector &aMomentum)
Definition: G4Parton.hh:148

References Parton, PartonIndex, and G4Parton::Set4Momentum().

◆ G4DiffractiveSplitableHadron() [2/5]

G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron ( const G4ReactionProduct aPrimary)

Definition at line 58 of file G4DiffractiveSplitableHadron.cc.

58 :
59 G4VSplitableHadron( aPrimary )
60{
61 PartonIndex = -2;
62 Parton[0] = NULL;
63}

References Parton, and PartonIndex.

◆ G4DiffractiveSplitableHadron() [3/5]

G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron ( const G4Nucleon aNucleon)

Definition at line 68 of file G4DiffractiveSplitableHadron.cc.

68 :
69 G4VSplitableHadron( aNucleon )
70{
71 PartonIndex = -2;
72 Parton[0] = NULL;
73}

References Parton, and PartonIndex.

◆ G4DiffractiveSplitableHadron() [4/5]

G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron ( const G4VKineticNucleon aNucleon)

Definition at line 78 of file G4DiffractiveSplitableHadron.cc.

78 :
79 G4VSplitableHadron( aNucleon )
80{
81 PartonIndex = -2;
82 Parton[0] = NULL;
83}

References Parton, and PartonIndex.

◆ ~G4DiffractiveSplitableHadron()

G4DiffractiveSplitableHadron::~G4DiffractiveSplitableHadron ( )

Definition at line 88 of file G4DiffractiveSplitableHadron.cc.

88{}

◆ G4DiffractiveSplitableHadron() [5/5]

G4DiffractiveSplitableHadron::G4DiffractiveSplitableHadron ( const G4DiffractiveSplitableHadron )
private

Member Function Documentation

◆ ChooseStringEnds()

void G4DiffractiveSplitableHadron::ChooseStringEnds ( G4int  PDGcode,
G4int aEnd,
G4int bEnd 
) const
private

Definition at line 169 of file G4DiffractiveSplitableHadron.cc.

170 {
171 G4int absPDGcode = std::abs( PDGcode );
172
173 if ( absPDGcode < 1000 ) { //-------------------- Meson -------------
174 G4int heavy(0), light(0);
175 if (!((absPDGcode == 111)||(absPDGcode == 221)||(absPDGcode == 331)))
176 { // Ordinary mesons =======================
177 heavy = absPDGcode/100;
178 light = (absPDGcode % 100)/10;
179 //G4int anti = std::pow( -1 , std::max( heavy, light ) );
180 G4int anti = 1 - 2*( std::max( heavy, light ) % 2 );
181 if (PDGcode < 0 ) anti *= -1;
182 heavy *= anti;
183 light *= -1 * anti;
184 }
185 else
186 { // Pi0, Eta, Eta' =======================
187 if ( G4UniformRand() < 0.5 ) {heavy = 1; light = -1;}
188 else {heavy = 2; light = -2;}
189 }
190 if ( G4UniformRand() < 0.5 ) {
191 *aEnd = heavy;
192 *bEnd = light;
193 } else {
194 *aEnd = light;
195 *bEnd = heavy;
196 }
197 } else { //-------------------- Baryon --------------
198 G4int j1000 = PDGcode/1000;
199 G4int j100 = (PDGcode % 1000)/100;
200 G4int j10 = (PDGcode % 100)/10;
201
202 G4double SuppresUUDDSS=1.0/2.0;
203 if ((j1000 == j100) && (j1000 == j10)) SuppresUUDDSS=1.;
204
205 const G4int maxNumberOfLoops = 1000;
206 G4int loopCounter = 0;
207 do
208 {
209 G4double random = G4UniformRand();
210
211 if (random < 0.33333)
212 {
213 if (( j100 == j10 ) && ( G4UniformRand() > SuppresUUDDSS )) continue;
214 *aEnd = j1000;
215 if ( j100 == j10 ) {*bEnd = Diquark( j100, j10, 1 );}
216 else
217 if ( G4UniformRand() > 0.25) {*bEnd = Diquark( j100, j10, 0 );}
218 else {*bEnd = Diquark( j100, j10, 1 );}
219 break;
220 }
221 else if (random < 0.66667)
222 {
223 if (( j1000 == j10 ) && ( G4UniformRand() > SuppresUUDDSS )) continue;
224 *aEnd = j100;
225 if ( j1000 == j10 ) {*bEnd = Diquark( j1000, j10, 1 );}
226 else
227 if ( G4UniformRand() > 0.25) {*bEnd = Diquark( j1000, j10, 0 );}
228 else {*bEnd = Diquark( j1000, j10, 1 );}
229 break;
230 }
231 else
232 {
233 if (( j1000 == j100 ) && ( G4UniformRand() > SuppresUUDDSS )) continue;
234 *aEnd = j10;
235 if ( j1000 == j100 ) {*bEnd = Diquark( j1000, j100, 1 );}
236 else
237 if ( G4UniformRand() > 0.25) {*bEnd = Diquark( j1000, j100, 0 );}
238 else {*bEnd = Diquark( j1000, j100, 1 );}
239 break;
240 }
241 } while ( (true) &&
242 ++loopCounter < maxNumberOfLoops ); /* Loop checking, 10.08.2015, A.Ribon */
243 if ( loopCounter >= maxNumberOfLoops ) {
244 *aEnd = j10; *bEnd = Diquark( j1000, j100, 1 ); // Just something acceptable, without any physics consideration.
245 }
246
247 }
248}
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85
#define G4UniformRand()
Definition: Randomize.hh:52
G4int Diquark(G4int aquark, G4int bquark, G4int Spin) const
T max(const T t1, const T t2)
brief Return the largest of the two arguments

References Diquark(), G4UniformRand, and G4INCL::Math::max().

Referenced by SplitUp().

◆ Diquark()

G4int G4DiffractiveSplitableHadron::Diquark ( G4int  aquark,
G4int  bquark,
G4int  Spin 
) const
private

Definition at line 253 of file G4DiffractiveSplitableHadron.cc.

253 {
254 G4int diquarkPDG = std::max( std::abs( aquark ), std::abs( bquark ) ) * 1000 +
255 std::min( std::abs( aquark ), std::abs( bquark ) ) * 100 +
256 2*Spin + 1;
257 return ( aquark > 0 && bquark > 0 ) ? diquarkPDG : -1*diquarkPDG;
258}
T min(const T t1, const T t2)
brief Return the smallest of the two arguments

References G4INCL::Math::max(), and G4INCL::Math::min().

Referenced by ChooseStringEnds().

◆ Get4Momentum()

const G4LorentzVector & G4VSplitableHadron::Get4Momentum ( ) const
inlineinherited

◆ GetDefinition()

const G4ParticleDefinition * G4VSplitableHadron::GetDefinition ( ) const
inlineinherited

◆ GetNextAntiParton()

G4Parton * G4DiffractiveSplitableHadron::GetNextAntiParton ( )
virtual

Implements G4VSplitableHadron.

Definition at line 138 of file G4DiffractiveSplitableHadron.cc.

138 {
139 ++PartonIndex;
140 if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL;
141 G4int PartonInd( PartonIndex );
142 if ( PartonIndex == 1 ) PartonIndex = -1;
143 return Parton[ PartonInd ];
144}

References Parton, and PartonIndex.

◆ GetNextParton()

G4Parton * G4DiffractiveSplitableHadron::GetNextParton ( )
virtual

Implements G4VSplitableHadron.

Definition at line 127 of file G4DiffractiveSplitableHadron.cc.

127 {
128 ++PartonIndex;
129 if ( PartonIndex > 1 || PartonIndex < 0 ) return NULL;
130 G4int PartonInd( PartonIndex );
131 if ( PartonIndex == 1 ) PartonIndex = -1;
132 return Parton[ PartonInd ];
133}

References Parton, and PartonIndex.

◆ GetPosition()

const G4ThreeVector & G4VSplitableHadron::GetPosition ( void  ) const
inlineinherited

◆ GetSoftCollisionCount()

G4int G4VSplitableHadron::GetSoftCollisionCount ( )
inlineinherited

◆ GetStatus()

G4int G4VSplitableHadron::GetStatus ( )
inlineinherited

◆ GetTimeOfCreation()

G4double G4VSplitableHadron::GetTimeOfCreation ( )
inlineinherited

◆ IncrementCollisionCount()

void G4VSplitableHadron::IncrementCollisionCount ( G4int  aCount)
inlineinherited

◆ IsSplit()

G4bool G4VSplitableHadron::IsSplit ( )
inlineinherited

Definition at line 88 of file G4VSplitableHadron.hh.

88{ return isSplit;}

References G4VSplitableHadron::isSplit.

Referenced by SplitUp(), and G4QGSMSplitableHadron::SplitUp().

◆ operator!=() [1/2]

G4bool G4DiffractiveSplitableHadron::operator!= ( const G4DiffractiveSplitableHadron right) const
private

◆ operator!=() [2/2]

G4bool G4VSplitableHadron::operator!= ( const G4VSplitableHadron right) const
inherited

Definition at line 106 of file G4VSplitableHadron.cc.

107{
108 return this!=&right;
109}

◆ operator=()

G4DiffractiveSplitableHadron & G4DiffractiveSplitableHadron::operator= ( const G4DiffractiveSplitableHadron )
private

◆ operator==() [1/2]

G4bool G4DiffractiveSplitableHadron::operator== ( const G4DiffractiveSplitableHadron right) const
private

◆ operator==() [2/2]

G4bool G4VSplitableHadron::operator== ( const G4VSplitableHadron right) const
inherited

Definition at line 101 of file G4VSplitableHadron.cc.

102{
103 return this==&right;
104}

◆ Set4Momentum()

void G4VSplitableHadron::Set4Momentum ( const G4LorentzVector a4Momentum)
inlineinherited

◆ SetCollisionCount()

void G4VSplitableHadron::SetCollisionCount ( G4int  aCount)
inlineinherited

◆ SetDefinition()

void G4VSplitableHadron::SetDefinition ( const G4ParticleDefinition aDefinition)
inlineinherited

◆ SetFirstParton()

void G4DiffractiveSplitableHadron::SetFirstParton ( G4int  PDGcode)
virtual

Implements G4VSplitableHadron.

Definition at line 149 of file G4DiffractiveSplitableHadron.cc.

149 {
150 delete Parton[0];
151 Parton[0] = new G4Parton( PDGcode );
152 G4LorentzVector tmp=G4LorentzVector(0.,0.,0.,0.);
153 Parton[0]->Set4Momentum(tmp);
154}

References Parton, and G4Parton::Set4Momentum().

◆ SetPosition()

void G4VSplitableHadron::SetPosition ( const G4ThreeVector aPosition)
inlineinherited

◆ SetSecondParton()

void G4DiffractiveSplitableHadron::SetSecondParton ( G4int  PDGcode)
virtual

Implements G4VSplitableHadron.

Definition at line 159 of file G4DiffractiveSplitableHadron.cc.

159 {
160 delete Parton[1];
161 Parton[1] = new G4Parton( PDGcode );
162 G4LorentzVector tmp=G4LorentzVector(0.,0.,0.,0.);
163 Parton[1]->Set4Momentum(tmp);
164}

References Parton, and G4Parton::Set4Momentum().

◆ SetStatus()

void G4VSplitableHadron::SetStatus ( const G4int  aStatus)
inlineinherited

◆ SetTimeOfCreation()

void G4VSplitableHadron::SetTimeOfCreation ( G4double  aTime)
inlineinherited

◆ Splitting()

void G4VSplitableHadron::Splitting ( )
inlineprotectedinherited

Definition at line 93 of file G4VSplitableHadron.hh.

93{isSplit = true;}

References G4VSplitableHadron::isSplit.

Referenced by SplitUp(), and G4QGSMSplitableHadron::SplitUp().

◆ SplitUp()

void G4DiffractiveSplitableHadron::SplitUp ( )
virtual

Implements G4VSplitableHadron.

Definition at line 93 of file G4DiffractiveSplitableHadron.cc.

93 {
94
95 if ( IsSplit() ) return;
96 Splitting();
97 // Split once only...
98 if ( Parton[0] != NULL ) return;
99
100 // flavours of quark ends
101 G4int PDGcode = GetDefinition()->GetPDGEncoding();
102 G4int stringStart, stringEnd;
103 ChooseStringEnds( PDGcode, &stringStart, &stringEnd );
104
105 Parton[0] = new G4Parton( stringStart );
106 Parton[1] = new G4Parton( stringEnd );
107
108 G4LorentzVector tmp=G4LorentzVector(0.,0.,0.,0.);
109 Parton[0]->Set4Momentum(tmp); Parton[1]->Set4Momentum(tmp);
110
111 /* // Inversion of a string
112 if ( G4UniformRand() < 1.75 ) { //0.75
113 Parton[0] = new G4Parton( stringStart );
114 Parton[1] = new G4Parton( stringEnd );
115 } else {
116 Parton[0] = new G4Parton( stringEnd );
117 Parton[1] = new G4Parton( stringStart );
118 }
119 */
120
121 PartonIndex = -1;
122}
void ChooseStringEnds(G4int PDGcode, G4int *aEnd, G4int *bEnd) const
const G4ParticleDefinition * GetDefinition() const

References ChooseStringEnds(), G4VSplitableHadron::GetDefinition(), G4ParticleDefinition::GetPDGEncoding(), G4VSplitableHadron::IsSplit(), Parton, PartonIndex, G4Parton::Set4Momentum(), and G4VSplitableHadron::Splitting().

Field Documentation

◆ curStatus

G4int G4VSplitableHadron::curStatus
privateinherited

◆ isSplit

G4bool G4VSplitableHadron::isSplit
privateinherited

◆ Parton

G4Parton* G4DiffractiveSplitableHadron::Parton[2]
private

◆ PartonIndex

G4int G4DiffractiveSplitableHadron::PartonIndex
private

◆ the4Momentum

G4LorentzVector G4VSplitableHadron::the4Momentum
privateinherited

◆ theCollisionCount

G4int G4VSplitableHadron::theCollisionCount
privateinherited

◆ theDefinition

const G4ParticleDefinition* G4VSplitableHadron::theDefinition
privateinherited

◆ thePosition

G4ThreeVector G4VSplitableHadron::thePosition
privateinherited

◆ TimeOfCreation

G4double G4VSplitableHadron::TimeOfCreation
privateinherited

The documentation for this class was generated from the following files: