78{
84
85 if(frameFlag==2
86 || frameFlag==3)
87 {
88
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);
102
103
104
105
106
107 anEnergy = fCache.
Get().theProjectileRP->GetKineticEnergy();
108
110
113 }
114 fCache.
Get().theTotalMeanEnergy=0;
116
117 for(i=0; i<nProducts; i++)
118 {
120
121 it = theProducts[i].
Sample(anEnergy,nPart);
123
124
125
126
127 if(aMeanEnergy>=0)
128 {
129 fCache.
Get().theTotalMeanEnergy += aMeanEnergy;
130 }
131 else
132 {
133 fCache.
Get().theTotalMeanEnergy = anEnergy/nProducts+theProducts[i].
GetQValue();
134 }
135 if(it!=0)
136 {
137 for(unsigned int ii=0; ii<it->size(); ii++)
138 {
139
141 it->operator[](ii)->GetTotalEnergy());
142 pTmp1 = toLab*pTmp1;
143 if( std::getenv(
"G4PHPTEST") )
G4cout <<
" G4particleHPEnAngCorrelation COS THETA " << std::cos(it->operator[](ii)->GetMomentum().theta()) <<
G4endl;
144 it->operator[](ii)->SetMomentum(pTmp1.vect());
145 it->operator[](ii)->SetTotalEnergy(pTmp1.e());
146 if( std::getenv(
"G4PHPTEST") )
G4cout <<
" G4particleHPEnAngCorrelation COS THETA after toLab " << std::cos(it->operator[](ii)->GetMomentum().theta()) <<
G4endl;
147
148 if(frameFlag==1)
149 {
150 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*(*fCache.
Get().theTarget));
151 }
152 else if(frameFlag==2 )
153 {
154#ifdef G4PHPDEBUG
155 if( std::getenv("G4ParticleHPDebug") )
156 G4cout <<
"G4ParticleHPEnAngCorrelation: before Lorentz boost "<<
157 it->at(ii)->GetKineticEnergy()<<" "<<
158 it->at(ii)->GetMomentum()<<
G4endl;
159#endif
160 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
161#ifdef G4PHPDEBUG
162 if( std::getenv("G4ParticleHPDebug") )
163 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
164 it->at(ii)->GetKineticEnergy()<<" "<<
165 it->at(ii)->GetMomentum()<<
G4endl;
166#endif
167 }
168
169 else if(frameFlag==3)
170 {
171 if ( theProducts[i].GetMassCode() > 2004.5 )
172 {
173
174 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*(*fCache.
Get().theTarget));
175#ifdef G4PHPDEBUG
176 if( std::getenv("G4ParticleHPDebug") )
177 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
178 it->at(ii)->GetKineticEnergy()<<" "<<
179 it->at(ii)->GetMomentum()<<
G4endl;
180#endif
181 }
182 else
183 {
184
185 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
186#ifdef G4PHPDEBUG
187 if( std::getenv("G4ParticleHPDebug") )
188 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
189 it->at(ii)->GetKineticEnergy()<<" "<<
190 it->at(ii)->GetMomentum()<<
G4endl;
191#endif
192 }
193 }
194 else
195 {
196 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPEnAngCorrelation::Sample: The frame of the finalstate is not specified");
197 }
198 if( std::getenv(
"G4PHPTEST") )
G4cout << frameFlag <<
" G4particleHPEnAngCorrelation COS THETA after Lorentz " << std::cos(it->operator[](ii)->GetMomentum().theta()) <<
G4endl;
199
200
201
202 result->push_back(it->operator[](ii));
203 }
204 delete it;
205 }
206 }
207
208 return result;
209}
std::vector< G4ReactionProduct * > G4ReactionProductVector
G4GLOB_DLL std::ostream G4cout
HepLorentzRotation & rotateY(double delta)
HepLorentzRotation & rotateZ(double delta)
HepLorentzRotation inverse() const
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)