44 #ifndef CEXMC_CHARGE_EXCHANGE_PRODUCTION_MODEL_HH
45 #define CEXMC_CHARGE_EXCHANGE_PRODUCTION_MODEL_HH
59 template <
typename OutputParticle >
79 template <
typename OutputParticle >
84 nucleusParticleMass( 0 ), phaseSpaceGenerator( NULL )
112 #ifdef CEXMC_USE_GENBOD
113 phaseSpaceGenerator =
new CexmcGenbod;
122 template <
typename OutputParticle >
126 delete phaseSpaceGenerator;
130 template <
typename OutputParticle >
135 theParticleChange.
Clear();
141 const_cast< const G4LorentzRotation & >(
142 theProjectile.GetTrafoToLab() ) );
143 productionModelData.incidentParticleLAB = projectile.
Get4Momentum();
144 productionModelData.incidentParticleLAB.
transform( projToLab );
145 productionModelData.nucleusParticleLAB.
setPx( 0 );
146 productionModelData.nucleusParticleLAB.setPy( 0 );
147 productionModelData.nucleusParticleLAB.setPz( 0 );
148 productionModelData.nucleusParticleLAB.setE( nucleusParticleMass );
150 if ( fermiMotionIsOn )
155 std::sqrt( targetNucleusMomentum.mag2() +
156 nucleusParticleMass * nucleusParticleMass ) );
158 targetNucleusMomentum, targetNucleusEnergy );
160 productionModelData.nucleusParticleLAB.transform( projToLab );
162 productionModelData.nucleusParticleLAB );
165 productionModelData.incidentParticleSCM =
166 productionModelData.incidentParticleLAB;
167 productionModelData.nucleusParticleSCM =
168 productionModelData.nucleusParticleLAB;
170 productionModelData.incidentParticleSCM.boost( -boostVec );
171 productionModelData.nucleusParticleSCM.boost( -boostVec );
173 triggeredAngularRanges.clear();
175 if ( ! phaseSpaceGenerator->CheckKinematics() )
177 theParticleChange.SetEnergyChange( kinEnergy );
178 theParticleChange.SetMomentumChange(
180 return &theParticleChange;
185 phaseSpaceGenerator->Generate();
186 G4double cosTheta( productionModelData.outputParticleSCM.cosTheta() );
187 for ( CexmcAngularRangeList::iterator k( angularRanges.begin() );
188 k != angularRanges.end(); ++k )
190 if ( cosTheta <= k->top && cosTheta > k->bottom )
192 k->top, k->bottom, k->index ) );
194 }
while ( triggeredAngularRanges.empty() );
196 productionModelData.outputParticleLAB =
197 productionModelData.outputParticleSCM;
198 productionModelData.nucleusOutputParticleLAB =
199 productionModelData.nucleusOutputParticleSCM;
201 productionModelData.outputParticleLAB.boost( boostVec );
202 productionModelData.nucleusOutputParticleLAB.boost( boostVec );
205 theParticleChange.SetEnergyChange( 0.0 );
209 productionModelData.outputParticleLAB ) );
210 theParticleChange.AddSecondary( secOutParticle );
212 nucleusOutputParticle,
213 productionModelData.nucleusOutputParticleLAB ) );
214 theParticleChange.AddSecondary( secNeutron );
219 productionModelData.incidentParticle = projectile.
GetDefinition();
221 return &theParticleChange;
const G4String CexmcChargeExchangeInteractionName("Cexmc"+CexmcChargeExchangeProductionModelName)
std::vector< const G4LorentzVector * > CexmcPhaseSpaceInVector
Hep3Vector boostVector() const
const G4ParticleDefinition * nucleusParticle
G4ParticleDefinition * nucleusOutputParticle
std::vector< CexmcPhaseSpaceOutVectorElement > CexmcPhaseSpaceOutVector
const G4ParticleDefinition * incidentParticle
CexmcProductionModelData productionModelData
G4LorentzVector incidentParticleSCM
G4HadFinalState * ApplyYourself(const G4HadProjectile &projectile, G4Nucleus &targetNucleus)
G4LorentzVector outputParticleSCM
const G4ParticleDefinition * outputParticle
static G4Proton * Definition()
G4LorentzVector nucleusOutputParticleSCM
~CexmcChargeExchangeProductionModel()
const G4ParticleDefinition * GetDefinition() const
G4double GetKineticEnergy() const
G4ParticleDefinition * nucleusParticle
const G4LorentzVector & Get4Momentum() const
G4ThreeVector GetFermiMomentum()
G4double GetPDGMass() const
G4ParticleDefinition * incidentParticle
static G4PionMinus * Definition()
static G4Neutron * Definition()
CexmcChargeExchangeProductionModel()
HepLorentzVector & transform(const HepRotation &)
const G4ParticleDefinition * nucleusOutputParticle
void SetParticles(const CexmcPhaseSpaceInVector &inVec_, const CexmcPhaseSpaceOutVector &outVec_)
const G4String CexmcChargeExchangeProductionModelName("ChargeExchange")
G4LorentzVector nucleusParticleSCM
G4ParticleDefinition * outputParticle
CLHEP::HepLorentzVector G4LorentzVector