117{
123
124
125
126
127 if (frameFlag == 2 || frameFlag == 3)
128 {
129 G4ThreeVector the3IncidentPart = fCache.
Get().theProjectileRP->GetMomentum();
130
131 G4double nEnergy = fCache.
Get().theProjectileRP->GetTotalEnergy();
133
134 G4double tEnergy = fCache.
Get().theTarget->GetTotalEnergy();
138 G4double cmsMom = std::sqrt(the3CMS * the3CMS);
139 G4double sqrts = std::sqrt((totE - cmsMom) * (totE + cmsMom));
143 aIncidentPart.
Lorentz(*fCache.
Get().theProjectileRP, theCMS);
144
145
146
147
148
149 anEnergy = fCache.
Get().theProjectileRP->GetKineticEnergy();
150
151
154
156 toZ.
rotateY(-1 * Ptmp.theta());
157 }
158 fCache.
Get().theTotalMeanEnergy = 0;
160
161
162 for (i = 0; i < nProducts; ++i) {
164 it = theProducts[i].
Sample(anEnergy, nPart);
166
167
168
169 if (aMeanEnergy >= 0) {
170 fCache.
Get().theTotalMeanEnergy += aMeanEnergy;
171 }
172 else {
173 fCache.
Get().theTotalMeanEnergy = anEnergy/nProducts + theProducts[i].
GetQValue();
174 }
175 if (it != nullptr) {
176 for (unsigned int ii = 0; ii < it->size(); ++ii) {
178 it->operator[](ii)->GetTotalEnergy());
179 pTmp1 = toLab * pTmp1;
180 it->operator[](ii)->SetMomentum(pTmp1.vect());
181 it->operator[](ii)->SetTotalEnergy(pTmp1.e());
182
183 if (frameFlag == 1)
184 {
185 it->operator[](ii)->Lorentz(
186 *(it->operator[](ii)),
187 -1. * (*fCache.
Get().theTarget));
188 }
189 else if (frameFlag == 2)
190 {
191#ifdef G4PHPDEBUG
193 G4cout <<
"G4ParticleHPEnAngCorrelation: before Lorentz boost "
194 << it->at(ii)->GetKineticEnergy() << " "
195 << it->at(ii)->GetMomentum() <<
G4endl;
196#endif
197 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1. * theCMS);
198#ifdef G4PHPDEBUG
200 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "
201 << it->at(ii)->GetKineticEnergy() << " "
202 << it->at(ii)->GetMomentum() <<
G4endl;
203#endif
204 }
205
206 else if (frameFlag == 3)
207 {
208 if (theProducts[i].GetMassCode() > 2004.5)
209 {
210
211 it->operator[](ii)->Lorentz(
212 *(it->operator[](ii)),
213 -1. * (*fCache.
Get().theTarget));
214#ifdef G4PHPDEBUG
216 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "
217 << it->at(ii)->GetKineticEnergy() << " "
218 << it->at(ii)->GetMomentum() <<
G4endl;
219#endif
220 }
221 else {
222
223 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1. * theCMS);
224#ifdef G4PHPDEBUG
226 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "
227 << it->at(ii)->GetKineticEnergy() << " "
228 << it->at(ii)->GetMomentum() <<
G4endl;
229#endif
230 }
231 }
232 else
233 {
235 "Sample: The frame of the final state is not specified");
236 }
237 result->push_back(it->operator[](ii));
238 }
239 delete it;
240 }
241 }
242 return result;
243}
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
static G4ParticleHPManager * GetInstance()
G4ReactionProductVector * Sample(G4double anEnergy, G4int nParticles)
G4double MeanEnergyOfThisInteraction()
G4int GetMultiplicity(G4double anEnergy)
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
G4double GetTotalEnergy() const
G4ThreeVector GetMomentum() const
void Lorentz(const G4ReactionProduct &p1, const G4ReactionProduct &p2)
void SetMass(const G4double mas)