// // ******************************************************************** // * License and Disclaimer * // * * // * The Geant4 software is copyright of the Copyright Holders of * // * the Geant4 Collaboration. It is provided under the terms and * // * conditions of the Geant4 Software License, included in the file * // * LICENSE and available at http://cern.ch/geant4/license . These * // * include a list of copyright holders. * // * * // * Neither the authors of this software system, nor their employing * // * institutes,nor the agencies providing financial support for this * // * work make any representation or warranty, express or implied, * // * regarding this software system or assume any liability for its * // * use. Please see the license in the file LICENSE and URL above * // * for the full disclaimer and the limitation of liability. * // * * // * This code implementation is the result of the scientific and * // * technical work of the GEANT4 collaboration. * // * By using, copying, modifying or distributing the software (or * // * any work based on the software) you agree to acknowledge its * // * use in resulting scientific publications, and indicate your * // * acceptance of all terms of the Geant4 Software license. * // ******************************************************************** // // $Id: G4PreCompoundModel.cc,v 1.25 2010/10/11 13:54:59 vnivanch Exp $ // GEANT4 tag $Name: geant4-09-03-ref-09 $ // // by V. Lara // // Modified: // 01.04.2008 J.M.Quesada Several changes. Soft cut-off switched off. // 01.05.2008 J.M.Quesada Protection against non-physical preeq. // transitional regime has been set // 03.09.2008 J.M.Quesada for external choice of inverse cross section option // 06.09.2008 J.M.Quesada Also external choices have been added for: // - superimposed Coulomb barrier (useSICB=true) // - "never go back" hipothesis (useNGB=true) // - soft cutoff from preeq. to equlibrium (useSCO=true) // - CEM transition probabilities (useCEMtr=true) // 20.08.2010 V.Ivanchenko Cleanup of the code: // - integer Z and A; // - emission and transition classes created at initialisation // - options are set at initialisation // - do not use copy-constructors for G4Fragment #include "G4PreCompoundModel.hh" #include "G4PreCompoundEmission.hh" #include "G4PreCompoundTransitions.hh" #include "G4GNASHTransitions.hh" #include "G4ParticleDefinition.hh" #include "G4Proton.hh" #include "G4Neutron.hh" #include "G4NucleiProperties.hh" #include "G4PreCompoundParameters.hh" #include "Randomize.hh" #include "G4DynamicParticle.hh" #include "G4ParticleTypes.hh" #include "G4ParticleTable.hh" #include "G4LorentzVector.hh" #ifdef PRECOMPOUND_TEST G4Fragment G4PreCompoundModel::theInitialFragmentForTest; std::vector G4PreCompoundModel::theCreatorModels; #endif G4PreCompoundModel::G4PreCompoundModel(G4ExcitationHandler * const value) : G4VPreCompoundModel(value), useHETCEmission(false), useGNASHTransition(false), OPTxs(3), useSICB(false), useNGB(false), useSCO(false), useCEMtr(true) { theParameters = G4PreCompoundParameters::GetAddress(); theEmission = new G4PreCompoundEmission(); if(useHETCEmission) { theEmission->SetHETCModel(); } else { theEmission->SetDefaultModel(); } theEmission->SetOPTxs(OPTxs); theEmission->UseSICB(useSICB); if(useGNASHTransition) { theTransition = new G4GNASHTransitions; } else { theTransition = new G4PreCompoundTransitions(); } theTransition->UseNGB(useNGB); theTransition->UseCEMtr(useCEMtr); proton = G4Proton::Proton(); neutron = G4Neutron::Neutron(); } G4PreCompoundModel::~G4PreCompoundModel() { delete theEmission; delete theTransition; } ///////////////////////////////////////////////////////////////////////////////////////// G4HadFinalState* G4PreCompoundModel::ApplyYourself(const G4HadProjectile & thePrimary, G4Nucleus & theNucleus) { const G4ParticleDefinition* primary = thePrimary.GetDefinition(); if(primary != neutron && primary != proton) { std::ostringstream errOs; errOs << "BAD primary type in G4PreCompoundModel: " << primary->GetParticleName() <GetBaryonNumber()); // Number of Charged Excited Particles // JMQ/AH modify number of charged particles with probability of the Z/A ratio of the nucleus: // if(G4UniformRand() <= aZ/anA) BUG! - integer arithmetic if(G4UniformRand() <= (static_cast(aZ))/(static_cast(anA))) anInitialState.SetNumberOfCharged(static_cast(thePrimary.GetDefinition()->GetPDGCharge()+.01) + 1); else anInitialState.SetNumberOfCharged(static_cast(thePrimary.GetDefinition()->GetPDGCharge()+.01)); //AH anInitialState.SetNumberOfCharged(static_cast(thePrimary.GetDefinition()->GetPDGCharge()+.01) + //AH static_cast(0.5+G4UniformRand())); // Number of Holes anInitialState.SetNumberOfHoles(1); */ // call excitation handler // const G4Fragment aFragment(anInitialState); G4ReactionProductVector * result = DeExcite(anInitialState); #ifdef PRECOMPOUND_TEST for (std::vector::iterator icm = theCreatorModels.begin(); icm != theCreatorModels.end(); ++icm ) { delete (*icm); } theCreatorModels.clear(); #endif // fill particle change theResult.Clear(); theResult.SetStatusChange(stopAndKill); for(G4ReactionProductVector::iterator i= result->begin(); i != result->end(); ++i) { G4DynamicParticle * aNew = new G4DynamicParticle((*i)->GetDefinition(), (*i)->GetTotalEnergy(), (*i)->GetMomentum()); #ifdef PRECOMPOUND_TEST theCreatorModels.push_back(new G4String((*i)->GetCreatorModel())); #endif delete (*i); theResult.AddSecondary(aNew); } delete result; //return the filled particle change return &theResult; } ///////////////////////////////////////////////////////////////////////////////////////// G4ReactionProductVector* G4PreCompoundModel::DeExcite(G4Fragment& aFragment) { G4ReactionProductVector * Result = new G4ReactionProductVector; G4double Eex = aFragment.GetExcitationEnergy(); G4int A = aFragment.GetA_asInt(); //G4cout << "### G4PreCompoundModel::DeExcite" << G4endl; //G4cout << aFragment << G4endl; // Perform Equilibrium Emission if (A < 5 || Eex < keV /*|| Eex > 3.*MeV*A*/) { PerformEquilibriumEmission(aFragment, Result); return Result; } // main loop for (;;) { //fragment++; //G4cout<<"-------------------------------------------------------------------"<Initialize(aFragment); G4double g = (6.0/pi2)*aFragment.GetA_asInt()*theParameters->GetLevelDensity(); G4int EquilibriumExcitonNumber = static_cast(std::sqrt(2.0*g*aFragment.GetExcitationEnergy())+ 0.5); // // G4cout<<"Neq="<(aFragment.GetNumberOfHoles()); G4int test = aFragment.GetNumberOfExcitons(); if (test < EquilibriumExcitonNumber) { go_ahead=true; } //J. M. Quesada (Apr. 08): soft-cutoff switched off by default if (useSCO) { if (test < EquilibriumExcitonNumber) { G4double x = G4double(test)/G4double(EquilibriumExcitonNumber) - 1; if( G4UniformRand() < 1.0 - std::exp(-x*x/0.32) ) { go_ahead = true; } /* test = test*test; test /= 0.32; test = 1.0 - std::exp(-test); go_ahead = (G4UniformRand() < test); */ } } // JMQ: WARNING: CalculateProbability MUST be called prior to Get methods !! // (O values would be returned otherwise) G4double TotalTransitionProbability = theTransition->CalculateProbability(aFragment); G4double P1 = theTransition->GetTransitionProb1(); G4double P2 = theTransition->GetTransitionProb2(); G4double P3 = theTransition->GetTransitionProb3(); //G4cout<<"P1="< " << theInitialState.GetA() - ProductsA << '\n'; } if (ProductsZ != theInitialState.GetZ()) { G4cout << "!!!!!!!!!! Charge Conservation Violation !!!!!!!!!!\n" << "G4PreCompoundModel.cc: Charge Conservation test for just preequilibrium fragments\n" << "Initial Z = " << theInitialState.GetZ() << " Fragments Z = " << ProductsZ << " Diference --> " << theInitialState.GetZ() - ProductsZ << '\n'; } if (std::abs(ProductsEnergy-theInitialState.GetMomentum().e()) > 1.0*keV) { G4cout << "!!!!!!!!!! Energy Conservation Violation !!!!!!!!!!\n" << "G4PreCompoundModel.cc: Energy Conservation test for just preequilibrium fragments\n" << "Initial E = " << theInitialState.GetMomentum().e()/MeV << " MeV" << " Fragments E = " << ProductsEnergy/MeV << " MeV Diference --> " << (theInitialState.GetMomentum().e() - ProductsEnergy)/MeV << " MeV\n"; } if (std::abs(ProductsMomentum.x()-theInitialState.GetMomentum().x()) > 1.0*keV || std::abs(ProductsMomentum.y()-theInitialState.GetMomentum().y()) > 1.0*keV || std::abs(ProductsMomentum.z()-theInitialState.GetMomentum().z()) > 1.0*keV) { G4cout << "!!!!!!!!!! Momentum Conservation Violation !!!!!!!!!!\n" << "G4PreCompoundModel.cc: Momentum Conservation test for just preequilibrium fragments\n" << "Initial P = " << theInitialState.GetMomentum().vect() << " MeV" << " Fragments P = " << ProductsMomentum << " MeV Diference --> " << theInitialState.GetMomentum().vect() - ProductsMomentum << " MeV\n"; } return; } #endif