56{
58 if(aChange != 0)
59 {
60 aResult = aChange;
61 }
62 else
63 {
64 aResult = & theResult;
67 }
68
73
74
77 G4int targetPDGCode = 90000000 + 1000*targetZ + (targetA-targetZ);
78
82
83
84
86
87 G4double fractionOfSingleQuasiFreeNucleons = 0.4;
88 G4double fractionOfPairedQuasiFreeNucleons = 0.0;
89 if(targetA>27) fractionOfPairedQuasiFreeNucleons = 0.04;
92 G4double halfTheStrangenessOfSee = 0.1;
94
95
96
99 fractionOfPairedQuasiFreeNucleons,
100 clusteringCoefficient);
102 halfTheStrangenessOfSee,
103 etaToEtaPrime);
104
105
106
107
108
109
112 projHV.push_back(iH);
113
114
115
116
117
118
120
121 bool retry=true;
122 int retryes=0;
123 int maxretries=10;
124
125 while ( retry && retryes < maxretries )
126 {
128
129 try
130 {
131 ++retryes;
133 retry=false;
134 }
135 catch( ... )
136 {
137 G4cerr <<
"***WARNING*** Exception thrown passing through G4ChiralInvariantPhaseSpace "<<
G4endl;
139 G4cerr <<
" Dumping the information in the pojectile list"<<
G4endl;
140 for(size_t i=0; i< projHV.size(); i++)
141 {
142 G4cerr <<
" Incoming 4-momentum and PDG code of "<<i<<
"'th hadron: "
143 <<
" "<< projHV[i]->Get4Momentum()<<
" "<<projHV[i]->GetPDGCode()<<
G4endl;
144 }
146
147 }
148 delete pan;
149 }
150 if ( retryes >= maxretries )
151 {
152 G4cerr <<
"***ERROR*** Maximum number of retries ("<<maxretries<<
") reached for G4QEnvironment::Fragment(), exception is being thrown" <<
G4endl;
153 throw G4HadronicException(__FILE__,__LINE__,
"G4ChiralInvariantPhaseSpace::ApplyYourself(...) - Maximum number of re-tries reached, abandon interaction");
154 }
155
156
158#ifdef CHIPSdebug
159 G4cout <<
"G4ChiralInvariantPhaseSpace: NEW EVENT #ofHadrons="
161#endif
162
163
164 unsigned int particle;
165 for( particle = 0; particle < output->size(); particle++)
166 {
167 if(output->operator[](particle)->GetNFragments() != 0)
168 {
169 delete output->operator[](particle);
170 continue;
171 }
173 G4int pdgCode = output->operator[](particle)->GetPDGCode();
174#ifdef CHIPSdebug
175 G4cout <<
"G4ChiralInvariantPhaseSpace: h#"<<particle
176 <<
", PDG="<<pdgCode<<
G4endl;
177#endif
179
180
181
182
183
184 if(pdgCode>90000000)
185 {
186 G4int aZ = (pdgCode-90000000)/1000;
187 G4int anN = pdgCode-90000000-1000*aZ;
190 }
191
192 else if ( pdgCode == 90000000 && output->operator[](particle)->Get4Momentum().m()<1*MeV )
193 {
194
195
196
197
199 }
200
201 else
202 {
204 ->
FindParticle(output->operator[](particle)->GetPDGCode());
205 }
206
207
208
209
210 if ( theDefinition == NULL )
211 {
212
213
214 G4cerr<<
"**WARNING*** G4ChiralInvariantPhaseSpace::ApplyYourself(...) : G4QEnvironment::Fragment() returns an invalid fragment\n with fourMom(MeV)=";
215 G4cerr<<output->operator[](particle)->Get4Momentum()<<
" and mass(MeV)="<<output->operator[](particle)->Get4Momentum().m();
216 G4cerr<<
". Offending PDG is:"<<pdgCode<<
" abandon interaction. \n Taget PDG was:"<<targetPDGCode<<
" \n Dumping the information in the projectile list:\n";
217 for(size_t i=0; i< projHV.size(); i++)
218 {
219 G4cerr <<
" Incoming 4-momentum and PDG code of "<<i<<
"'th hadron: "
220 <<" "<< projHV[i]->Get4Momentum()<<" "<<projHV[i]->GetPDGCode()<<"\n";
221 }
222 G4cerr<<
"\n Please report as bug \n***END OF MESSAGE***"<<
G4endl;
223
224 for ( unsigned int cparticle=0 ; cparticle<output->size();++cparticle)
225 delete output->operator[](cparticle);
226 delete output;
227 std::for_each(projHV.begin(), projHV.end(),
DeleteQHadron());
228 projHV.clear();
229
234 return aResult;
235 }
236
237
238
240 theSec->
SetMomentum(output->operator[](particle)->Get4Momentum().vect());
242 delete output->operator[](particle);
243 }
244 delete output;
245 std::for_each(projHV.begin(), projHV.end(),
DeleteQHadron());
246 projHV.clear();
247 return aResult;
248}
std::vector< G4QHadron * > G4QHadronVector
G4DLLIMPORT std::ostream G4cerr
G4DLLIMPORT std::ostream G4cout
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMomentum(const G4ThreeVector &momentum)
void SetStatusChange(G4HadFinalStateStatus aS)
void AddSecondary(G4DynamicParticle *aP)
void SetEnergyChange(G4double anEnergy)
void SetMomentumChange(const G4ThreeVector &aV)
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
const G4LorentzVector & Get4Momentum() const
G4double GetIonMass(G4int Z, G4int A, G4int L=0) const
!! Only ground states are supported now
static G4Neutron * Neutron()
G4int GetPDGEncoding() const
G4ParticleDefinition * FindIon(G4int atomicNumber, G4int atomicMass, G4double excitationEnergy)
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4IonTable * GetIonTable()
static G4QCHIPSWorld * Get()
G4QParticleVector * GetParticles(G4int nOfParts=0)
G4QHadronVector * Fragment()
static void SetParameters(G4double fN=.1, G4double fD=.05, G4double cP=4., G4double mR=1., G4double nD=.8 *CLHEP::fermi)
static void SetParameters(G4double temper=180., G4double ssin2g=.3, G4double etaetap=.3)