56 {
59
60
61
62
65
68
69
70 G4double psq = particle1->getMomentum().mag2();
76 G4double y = 1.0 - ranres * (1.0 - z);
80
81
82 if((particle1->getType() ==
Proton && particle2->getType() ==
Neutron) ||
83 (particle1->getType() ==
Neutron && particle2->getType() ==
Proton)) {
84 if(pl > 800.0) {
86 apt = (800.0/pl)*(800.0/pl);
87 G4double cpt = std::max(6.23 * std::exp(-1.79*x), 0.3);
89 G4double aaa = (1 + apt) * (1 - std::exp(-btmax))/b;
91
92 if(argu >= 8) {
93 argu = 0.0;
94 } else {
95 argu = std::exp(-4.0 * argu);
96 }
97
98 G4double aac = cpt * (1.0 - argu)/alphac;
101 z = std::exp(-4.0 * psq *alphac);
102 iexpi = 1;
103 y = 1.0 - ranres*(1.0 - z);
104 T = std::log(y)/alphac;
105 }
106 }
107 }
108
110 if(std::abs(ctet) > 1.0) ctet =
Math::sign(ctet);
111 G4double stet = std::sqrt(1.0 - ctet*ctet);
113
117
118 G4double xx = particle1->getMomentum().perp2();
119 G4double zz = std::pow(particle1->getMomentum().getZ(), 2);
120
121 if(xx >= (zz * 1.0e-8)) {
122 ThreeVector p = particle1->getMomentum();
126 ez[0] = p.getX() / pnorm;
127 ez[1] = p.getY() / pnorm;
128 ez[2] = p.getZ() / pnorm;
129
130
131 ex[0] = p.getY() / yn;
132 ex[1] = -p.getX() / yn;
133 ex[2] = 0.0;
134
135 ey[0] = p.getX() * p.getZ() / zn;
136 ey[1] = p.getY() * p.getZ() / zn;
137 ey[2] = -xx/zn;
138
139 G4double pX = (ex[0]*cfi*stet + ey[0]*sfi*stet + ez[0]*ctet) * pnorm;
140 G4double pY = (ex[1]*cfi*stet + ey[1]*sfi*stet + ez[1]*ctet) * pnorm;
141 G4double pZ = (ex[2]*cfi*stet + ey[2]*sfi*stet + ez[2]*ctet) * pnorm;
142
143 ThreeVector p1momentum = ThreeVector(pX, pY, pZ);
144 particle1->setMomentum(p1momentum);
145 particle2->setMomentum(-p1momentum);
146 } else {
147 G4double momZ = particle1->getMomentum().getZ();
151
152 ThreeVector p1momentum(pX, pY, pZ);
153 particle1->setMomentum(p1momentum);
154 particle2->setMomentum(-p1momentum);
155 }
156
157 if (thenucleus) {
158 srcChannel = new SrcChannel(particle1, particle2, thenucleus);
159 srcChannel->fillFinalState(fs, particle1->getType(), particle2->getType());
160 delete srcChannel;
161 } else {
162
163
164
165 if((particle1->getType() ==
Proton && particle2->getType() ==
Neutron) ||
166 (particle1->getType() ==
Neutron && particle2->getType() ==
Proton)) {
168 apt = 1.0;
169 if(pl > 800.0) {
170 apt = std::pow(800.0/pl, 2);
171 }
172 if(iexpi == 1 || rndm > 1.0/(1.0 + apt)) {
173 particle1->setType(p2TypeOld);
174 particle2->setType(p1TypeOld);
175 }
176 }
177
178
179
180
181 fs->addModifiedParticle(particle1);
182 fs->addModifiedParticle(particle2);
183
184 }
185 }
G4double calculateNNAngularSlope(G4double energyCM, G4int iso)
Calculate the slope of the NN DDXS.
G4double squareTotalEnergyInCM(Particle const *const p1, Particle const *const p2)
G4double momentumInLab(Particle const *const p1, Particle const *const p2)
gives the momentum in the lab frame of two particles.
G4int getIsospin(const ParticleType t)
Get the isospin of a particle.
const G4double effectiveNucleonMass