82 fP0_d( 0.0 ), fP0_dbar( 0.0 ) {}
100 G4double ekin = std::sqrt( pz*pz + mproj*mproj ) - mproj;
102 fP0_dbar = 130.0 / ( 1.0 + std::exp( 21.6 - std::log( 0.001*ekin )/0.089 ) );
103 fP0_d = 118.1 * ( 1.0 + std::exp( 5.53 - std::log( 0.001*ekin )/0.43 ) );
120 std::vector< std::pair< G4int, G4ThreeVector > > proton;
121 std::vector< std::pair< G4int, G4ThreeVector > > neutron;
122 std::vector< std::pair< G4int, G4ThreeVector > > antiproton;
123 std::vector< std::pair< G4int, G4ThreeVector > > antineutron;
124 for (
unsigned int i = 0; i < result->size(); ++i ) {
125 G4int pdgid = result->operator[](i)->GetDefinition()->GetPDGEncoding();
126 if ( pdgid == 2212 ) {
127 proton.push_back( std::make_pair( i, result->operator[](i)->GetMomentum() ) );
128 result->erase( result->begin() + i );
131 for (
unsigned int i = 0; i < result->size(); ++i ) {
132 G4int pdgid = result->operator[](i)->GetDefinition()->GetPDGEncoding();
133 if ( pdgid == 2112 ) {
134 neutron.push_back( std::make_pair( i, result->operator[](i)->GetMomentum() ) );
135 result->erase( result->begin() + i );
138 for (
unsigned int i = 0; i < result->size(); ++i ) {
139 G4int pdgid = result->operator[](i)->GetDefinition()->GetPDGEncoding();
140 if ( pdgid == -2212 ) {
141 antiproton.push_back( std::make_pair( i, result->operator[](i)->GetMomentum() ) );
142 result->erase( result->begin() + i );
145 for (
unsigned int i = 0; i < result->size(); ++i ) {
146 G4int pdgid = result->operator[](i)->GetDefinition()->GetPDGEncoding();
147 if ( pdgid == -2112 ) {
148 antineutron.push_back( std::make_pair( i, result->operator[](i)->GetMomentum() ) );
149 result->erase( result->begin() + i );
153 for (
unsigned int i = 0; i < proton.size(); ++i ) {
154 if ( proton.at(i).first == -1 )
continue;
158 if ( partner1 == -1 ) {
163 G4double totalEnergy = std::sqrt( p1.
mag()*p1.
mag() + massp*massp );
167 result->push_back( finalp );
171 PushDeuteron( p1, p2, 1, result );
172 neutron.at(partner1).first = -1;
175 for (
unsigned int i = 0; i < neutron.size(); ++i ) {
176 if ( neutron.at(i).first == -1 )
continue;
182 G4double totalEnergy = std::sqrt( p2.
mag()*p2.
mag() + massn*massn );
186 result->push_back( finaln );
189 for (
unsigned int i = 0; i < antiproton.size(); ++i ) {
190 if ( antiproton.at(i).first == -1 )
continue;
192 int partner1 = FindPartner( p1,
G4Proton::Proton()->GetPDGMass(), antineutron,
194 if ( partner1 == -1 ) {
199 G4double totalEnergy = std::sqrt( p1.
mag()*p1.
mag() + massp*massp );
203 result->push_back( finalpbar );
207 PushDeuteron( p1, p2, -1, result );
208 antineutron.at(partner1).first = -1;
211 for (
unsigned int i = 0; i < antineutron.size(); ++i ) {
212 if ( antineutron.at(i).first == -1 )
continue;
218 G4double totalEnergy = std::sqrt( p2.
mag()*p2.
mag() + massn*massn );
222 result->push_back( finalnbar );
236 G4double massd = deuteron->GetPDGMass();
237 G4double totalEnergy = std::sqrt( psum.
mag()*psum.
mag() + massd*massd );
241 result->push_back( finaldeut );
248 G4double totalEnergy = std::sqrt( psum.
mag()*psum.
mag() + massd*massd );
251 finalantideut->
SetMass( massd );
252 result->push_back( finalantideut );
258 std::vector< std::pair< G4int, G4ThreeVector > > &neutron,
264 for (
unsigned int j = 0; j <
neutron.size(); ++j ) {
265 if (
neutron.at(j).first == -1 )
continue;
267 if ( ! Coalescence( p1, m1, p2, m2, charge ) )
continue;
278 return Coalescence( p1.
x(), p1.
y(), p1.
z(), m1, p2.
x(), p2.
y(), p2.
z(), m2, charge );
287 G4double deltaP = GetPcm( p1x, p1y, p1z, m1, p2x, p2y, p2z, m2 );
288 if ( charge > 0 )
return ( deltaP < fP0_d );
289 else return ( deltaP < fP0_dbar );
296 return GetPcm( p1.
x(), p1.
y(), p1.
z(), m1, p2.
x(), p2.
y(), p2.
z(), m2 );
303 G4double scm = GetS( p1x, p1y, p1z, m1, p2x, p2y, p2z, m2 );
304 return std::sqrt( (scm - (m1-m2)*(m1-m2))*(scm - (m1+m2)*(m1+m2)) ) / (2.0*std::sqrt( scm ));
311 G4double E1 = std::sqrt( p1x*p1x + p1y*p1y + p1z*p1z + m1*m1 );
312 G4double E2 = std::sqrt( p2x*p2x + p2y*p2y + p2z*p2z + m2*m2 );
313 return (E1+E2)*(E1+E2) - (p1x+p2x)*(p1x+p2x) - (p1y+p2y)*(p1y+p2y) - (p1z+p2z)*(p1z+p2z);
std::vector< G4ReactionProduct * > G4ReactionProductVector
void GenerateDeuterons(G4ReactionProductVector *result)
~G4CRCoalescence() override
void SetP0Coalescence(const G4HadProjectile &thePrimary, G4String)
const G4ParticleDefinition * GetDefinition() const
const G4LorentzVector & Get4Momentum() const
static G4Neutron * Neutron()
G4double GetPDGMass() const
G4int GetPDGEncoding() const
G4ParticleDefinition * FindParticle(G4int PDGEncoding)
static G4ParticleTable * GetParticleTable()
G4ParticleDefinition * FindAntiParticle(G4int PDGEncoding)
static G4Proton * Proton()
void SetMomentum(const G4double x, const G4double y, const G4double z)
void SetTotalEnergy(const G4double en)
void SetDefinition(const G4ParticleDefinition *aParticleDefinition)
void SetMass(const G4double mas)