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 if(aMeanEnergy>=0)
127 {
128 fCache.
Get().theTotalMeanEnergy += aMeanEnergy;
129 }
130 else
131 {
132 fCache.
Get().theTotalMeanEnergy = anEnergy/nProducts+theProducts[i].
GetQValue();
133 }
134 if(it!=0)
135 {
136 for(unsigned int ii=0; ii<it->size(); ii++)
137 {
138
140 it->operator[](ii)->GetTotalEnergy());
141 pTmp1 = toLab*pTmp1;
142 it->operator[](ii)->SetMomentum(pTmp1.vect());
143 it->operator[](ii)->SetTotalEnergy(pTmp1.e());
144
145 if(frameFlag==1)
146 {
147 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*(*fCache.
Get().theTarget));
148 }
149 else if(frameFlag==2 )
150 {
151#ifdef G4PHPDEBUG
152 if( std::getenv("G4ParticleHPDebug") )
153 G4cout <<
"G4ParticleHPEnAngCorrelation: before Lorentz boost "<<
154 it->at(ii)->GetKineticEnergy()<<" "<<
155 it->at(ii)->GetMomentum()<<
G4endl;
156#endif
157 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
158#ifdef G4PHPDEBUG
159 if( std::getenv("G4ParticleHPDebug") )
160 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
161 it->at(ii)->GetKineticEnergy()<<" "<<
162 it->at(ii)->GetMomentum()<<
G4endl;
163#endif
164 }
165
166 else if(frameFlag==3)
167 {
168 if ( theProducts[i].GetMassCode() > 2004.5 )
169 {
170
171 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*(*fCache.
Get().theTarget));
172#ifdef G4PHPDEBUG
173 if( std::getenv("G4ParticleHPDebug") )
174 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
175 it->at(ii)->GetKineticEnergy()<<" "<<
176 it->at(ii)->GetMomentum()<<
G4endl;
177#endif
178 }
179 else
180 {
181
182 it->operator[](ii)->Lorentz(*(it->operator[](ii)), -1.*theCMS);
183#ifdef G4PHPDEBUG
184 if( std::getenv("G4ParticleHPDebug") )
185 G4cout <<
"G4ParticleHPEnAngCorrelation: after Lorentz boost "<<
186 it->at(ii)->GetKineticEnergy()<<" "<<
187 it->at(ii)->GetMomentum()<<
G4endl;
188#endif
189 }
190 }
191 else
192 {
193 throw G4HadronicException(__FILE__, __LINE__,
"G4ParticleHPEnAngCorrelation::Sample: The frame of the finalstate is not specified");
194 }
195
196
197
198 result->push_back(it->operator[](ii));
199 }
200 delete it;
201 }
202 }
203
204 return result;
205}
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)