47 if(nProducts!=1)
throw G4HadronicException(__FILE__, __LINE__,
"More than one product in SampleOne");
54 G4int icounter_max=1024;
57 if ( icounter > icounter_max ) {
58 G4cout <<
"Loop-counter exceeded the threshold value at " << __LINE__ <<
"th line of " << __FILE__ <<
"." <<
G4endl;
61 temp = theProducts[i++].
Sample(anEnergy,1);
65 if(temp->size()!=1)
throw G4HadronicException(__FILE__, __LINE__,
"SampleOne: Yield not correct");
68 result = temp->operator[](0);
89 G4ThreeVector the3IncidentPart = fCache.
Get().theProjectileRP->GetMomentum();
90 G4double nEnergy = fCache.
Get().theProjectileRP->GetTotalEnergy();
92 G4double tEnergy = fCache.
Get().theTarget->GetTotalEnergy();
96 G4double cmsMom = std::sqrt(the3CMS*the3CMS);
97 G4double sqrts = std::sqrt((totE-cmsMom)*(totE+cmsMom));
101 aIncidentPart.
Lorentz(*fCache.
Get().theProjectileRP, theCMS);
107 anEnergy = fCache.
Get().theProjectileRP->GetKineticEnergy();
114 fCache.
Get().theTotalMeanEnergy=0;
117 for(i=0; i<nProducts; i++)
121 it = theProducts[i].
Sample(anEnergy,nPart);
128 fCache.
Get().theTotalMeanEnergy += aMeanEnergy;
132 fCache.
Get().theTotalMeanEnergy = anEnergy/nProducts+theProducts[i].
GetQValue();
136 for(
unsigned int ii=0; ii<it->size(); ii++)
140 it->operator[](ii)->GetTotalEnergy());
142 it->operator[](ii)->SetMomentum(pTmp1.
vect());
143 it->operator[](ii)->SetTotalEnergy(pTmp1.
e());
147 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*(*fCache.
Get().theTarget));
149 else if(frameFlag==2 )
152 if( std::getenv(
"G4ParticleHPDebug") )
153 G4cout <<
"G4ParticleHPEnAngCorrelation: before Lorentz boost "<<
154 it->at(ii)->GetKineticEnergy()<<
" "<<
155 it->at(ii)->GetMomentum()<<
G4endl;
157 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
159 if( std::getenv(
"G4ParticleHPDebug") )
160 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
161 it->at(ii)->GetKineticEnergy()<<
" "<<
162 it->at(ii)->GetMomentum()<<
G4endl;
166 else if(frameFlag==3)
168 if ( theProducts[i].GetMassCode() > 2004.5 )
171 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*(*fCache.
Get().theTarget));
173 if( std::getenv(
"G4ParticleHPDebug") )
174 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
175 it->at(ii)->GetKineticEnergy()<<
" "<<
176 it->at(ii)->GetMomentum()<<
G4endl;
182 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
184 if( std::getenv(
"G4ParticleHPDebug") )
185 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
186 it->at(ii)->GetKineticEnergy()<<
" "<<
187 it->at(ii)->GetMomentum()<<
G4endl;
193 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPEnAngCorrelation::Sample: The frame of the finalstate is not specified");
198 result->push_back(it->operator[](ii));
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
G4ReactionProduct * SampleOne(G4double anEnergy)
G4ReactionProductVector * Sample(G4double anEnergy)
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)