// // ******************************************************************** // * 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: G4QGluonString.cc,v 1.3 2008/10/02 21:10:07 dennis Exp $ // GEANT4 tag $Name: geant4-09-02 $ // // ---------------- G4QGluonString class ----------------- // by Mikhail Kossov, December 2003. // G4QGluonString class of the CHIPS Simulation Branch in GEANT4 // --------------------------------------------------------------- // **************************************************************************************** // ********** This CLASS is temporary moved from the photolepton_hadron directory ********* // **************************************************************************************** //#define debug //#define pdebug //#define ppdebug #include "G4QGluonString.hh" // Initialization of static vectors std::vector G4QGluonString::ElementZ; // Z of the element(i) in theLastCalc std::vector G4QGluonString::ElProbInMat; // SumProbabilityElements in Material std::vector*> G4QGluonString::ElIsoN; // N of isotope(j) of Element(i) std::vector*>G4QGluonString::IsoProbInEl;//SumProbabIsotopeInElementI G4QGluonString::G4QGluonString(const G4String& processName): G4VDiscreteProcess(processName, fHadronic) { #ifdef debug G4cout<<"G4QGluonString::Constructor is called"<0) G4cout<GetParticles(nPartCWorld); // Create CHIPS World with 234 particles G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // Clusterization param's G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime); // Hadronic parameters G4QEnvironment::SetParameters(SolidAngle); // SolAngle of pbar-A secondary mesons capture //@@ Initialize here other parameters } G4bool G4QGluonString::manualFlag=false; // If false then standard parameters are used G4double G4QGluonString::Temperature=180.; // Critical Temperature (sensitive at High En) G4double G4QGluonString::SSin2Gluons=0.3; // Supression of s-quarks (in respect to u&d) G4double G4QGluonString::EtaEtaprime=0.3; // Supression of eta mesons (gg->qq/3g->qq) G4double G4QGluonString::freeNuc=0.5; // Percentage of free nucleons on the surface G4double G4QGluonString::freeDib=0.05; // Percentage of free diBaryons on the surface G4double G4QGluonString::clustProb=5.; // Nuclear clusterization parameter G4double G4QGluonString::mediRatio=10.; // medium/vacuum hadronization ratio G4int G4QGluonString::nPartCWorld=152; // The#of particles initialized in CHIPS World G4double G4QGluonString::SolidAngle=0.5; // Part of Solid Angle to capture (@@A-dep.) G4bool G4QGluonString::EnergyFlux=false; // Flag for Energy Flux use (not MultyQuasmon) G4double G4QGluonString::PiPrThresh=141.4; // Pion Production Threshold for gammas G4double G4QGluonString::M2ShiftVir=20000.;// Shift for M2=-Q2=m_pi^2 of the virtualGamma G4double G4QGluonString::DiNuclMass=1880.; // DoubleNucleon Mass for VirtualNormalization void G4QGluonString::SetManual() {manualFlag=true;} void G4QGluonString::SetStandard() {manualFlag=false;} // Fill the private parameters void G4QGluonString::SetParameters(G4double temper, G4double ssin2g, G4double etaetap, G4double fN, G4double fD, G4double cP, G4double mR, G4int nParCW, G4double solAn, G4bool efFlag, G4double piThresh, G4double mpisq, G4double dinum) {// ============================================================================= Temperature=temper; SSin2Gluons=ssin2g; EtaEtaprime=etaetap; freeNuc=fN; freeDib=fD; clustProb=cP; mediRatio=mR; nPartCWorld = nParCW; EnergyFlux=efFlag; SolidAngle=solAn; PiPrThresh=piThresh; M2ShiftVir=mpisq; DiNuclMass=dinum; G4QCHIPSWorld::Get()->GetParticles(nPartCWorld); // Create CHIPS World with 234 particles G4QNucleus::SetParameters(freeNuc,freeDib,clustProb,mediRatio); // Clusterization param's G4Quasmon::SetParameters(Temperature,SSin2Gluons,EtaEtaprime); // Hadronic parameters G4QEnvironment::SetParameters(SolidAngle); // SolAngle of pbar-A secondary mesons capture } // Destructor G4QGluonString::~G4QGluonString() {} // Internal E/P conservation 4-Mom & the selected number of neutrons in the Element G4LorentzVector G4QGluonString::GetEnegryMomentumConservation() { return EnMomConservation; } G4int G4QGluonString::GetNumberOfNeutronsInTarget() { return nOfNeutrons; } // output of the function must be in units of length! L=1/sig_V,sig_V=SUM(n(j,i)*sig(j,i)), // where n(i,j) is a number of nuclei of the isotop j of the element i in V=1(lengtUnit^3) // ********** All CHIPS cross sections are calculated in the surface units ************ G4double G4QGluonString::GetMeanFreePath(const G4Track& aTrack, G4double, G4ForceCondition* Fc) { #ifdef debug G4cout<<"G4QGluonString::GetMeanFreePath: Called Fc="<<*Fc<GetDefinition(); if( !IsApplicable(*incidentParticleDefinition)) G4cout<<"-W-G4QGluonString::GetMeanFreePath called for NotImplementedParticle"<GetTotalMomentum(); // 3-momentum of the Particle #ifdef debug G4cout<<"G4QCollis::GetMeanFreePath: BeforeGetMaterial"<GetVecNbOfAtomsPerVolume(); const G4ElementVector* theElementVector = material->GetElementVector(); G4int nE=material->GetNumberOfElements(); #ifdef debug G4cout<<"G4QGluonString::GetMeanFreePath:"<* SPI=IsoProbInEl[ip]; // Pointer to the SPI vector SPI->clear(); delete SPI; std::vector* IsN=ElIsoN[ip]; // Pointer to the N vector IsN->clear(); delete IsN; } ElProbInMat.clear(); // Clean up the SumProb's of Elements (SPE) ElementZ.clear(); // Clear the body vector for Z of Elements IsoProbInEl.clear(); // Clear the body vector for SPI ElIsoN.clear(); // Clear the body vector for N of Isotopes for(G4int i=0; i(pElement->GetZ()); // Z of the Element ElementZ.push_back(Z); // Remember Z of the Element G4int isoSize=0; // The default for the isoVectorLength is 0 G4int indEl=0; // Index of non-trivial element or 0(default) G4IsotopeVector* isoVector=pElement->GetIsotopeVector(); // Get the predefined IsoVect if(isoVector) isoSize=isoVector->size();// Get size of the existing isotopeVector #ifdef debug G4cout<<"G4QGluonString::GetMeanFreePath: isovectorLength="<GetIndex(); // Index of the non-trivial element if(!Isotopes->IsDefined(Z,indEl)) // This index is not defined for this Z: define { std::vector*>* newAbund = new std::vector*>; G4double* abuVector=pElement->GetRelativeAbundanceVector(); for(G4int j=0; jGetIsotope(j)->GetN()-Z; // N means A=N+Z ! if(pElement->GetIsotope(j)->GetZ()!=Z)G4cerr<<"G4QCaptureAtRest::GetMeanFreePath" <<": Z="<GetIsotope(j)->GetZ()<<"#"<* pr= new std::pair(N,abund); #ifdef debug G4cout<<"G4QGluonString::GetMeanFreePath:p#"<push_back(pr); } #ifdef debug G4cout<<"G4QGluonString::PostStepDoIt:pairVectorLength="<size()<InitElement(Z,indEl,newAbund); // definition of the newInd for(G4int k=0; k*>* cs= Isotopes->GetCSVector(Z,indEl);//CSPointer std::vector* SPI = new std::vector; // Pointer to the SPI vector IsoProbInEl.push_back(SPI); std::vector* IsN = new std::vector; // Pointer to the N vector ElIsoN.push_back(IsN); G4int nIs=cs->size(); // A#Of Isotopes in the Element G4double susi=0.; // sum of CS over isotopes if(nIs) for(G4int j=0; j* curIs=(*cs)[j]; // A pointer, which is used twice G4int N=curIs->first; // #of Neuterons in the isotope j of El i IsN->push_back(N); // Remember Min N for the Element G4double CSI=CSmanager->GetCrossSection(true,Momentum,Z,N,pPDG);//CS(j,i) for isotope #ifdef debug G4cout<<"GQC::GMF:X="<second = CSI; // Remenber the calculated cross-section susi+=CSI; // Make a sum per isotopes SPI->push_back(susi); // Remember summed cross-section } // End of temporary initialization of the cross sections in the G4QIsotope singeltone sigma+=Isotopes->GetMeanCrossSection(Z,indEl)*NOfNucPerVolume[i];//SUM(MeanCS*NOfNperV) ElProbInMat.push_back(sigma); } // End of LOOP over Elements #ifdef debug G4cout<<"G4QCol::GetMeanFrPa: S="< 0.) return 1./sigma; // Mean path [distance] return DBL_MAX; // If Sigma=0, return max value for PATH } // Check applicability of the process G4bool G4QGluonString::IsApplicable(const G4ParticleDefinition& particle) { if (particle == *( G4Proton::Proton() )) return true; //else if (particle == *( G4Neutron::Neutron() )) return true; //else if (particle == *( G4PionMinus::PionMinus() )) return true; //else if (particle == *( G4PionPlus::PionPlus() )) return true; //else if (particle == *( G4KaonPlus::KaonPlus() )) return true; //else if (particle == *( G4KaonMinus::KaonMinus() )) return true; //else if (particle == *( G4KaonZeroLong::KaonZeroLong() )) return true; //else if (particle == *( G4KaonZeroShort::KaonZeroShort() )) return true; //else if (particle == *( G4Lambda::Lambda() )) return true; //else if (particle == *( G4SigmaPlus::SigmaPlus() )) return true; //else if (particle == *( G4SigmaMinus::SigmaMinus() )) return true; //else if (particle == *( G4SigmaZero::SigmaZero() )) return true; //else if (particle == *( G4XiMinus::XiMinus() )) return true; //else if (particle == *( G4XiZero::XiZero() )) return true; //else if (particle == *( G4OmegaMinus::OmegaMinus() )) return true; //else if (particle == *( G4AntiNeutron::AntiNeutron() )) return true; //else if (particle == *( G4AntiProton::AntiProton() )) return true; //else if (particle == *( G4AntiLambda::AntiLambda() )) return true; //else if (particle == *( G4AntiSigmaPlus::AntiSigmaPlus() )) return true; //else if (particle == *(G4AntiSigmaMinus::AntiSigmaMinus())) return true; //else if (particle == *( G4AntiSigmaZero::AntiSigmaZero() )) return true; //else if (particle == *( G4AntiXiMinus::AntiXiMinus() )) return true; //else if (particle == *( G4AntiXiZero::AntiXiZero() )) return true; //else if (particle == *(G4AntiOmegaMinus::AntiOmegaMinus())) return true; else G4cerr<<"***G4QGluonString::IsApplicable: PDG?="<GetDefinition(); #ifdef debug G4cout<<"G4QGluonString::PostStepDoIt: Before the GetMeanFreePath is called"<0 #ifdef debug G4cout<<"G4QGluonString::PostStepDoIt: After the GetMeanFreePath is called"<Get4Momentum(); G4double momentum = projHadron->GetTotalMomentum(); // 3-momentum of the Particle G4double Momentum=proj4M.rho(); if(std::fabs(Momentum-momentum)>.001) G4cerr<<"G4QGluonString::PostStepDoIt: P="<GetElementVector(); G4int nE=material->GetNumberOfElements(); #ifdef debug G4cout<<"G4QGluonString::PostStepDoIt: "<GetPDGEncoding(); G4cout<<"G4QGluonString::PostStepDoIt: projPDG="<size(); // #of isotopes in the element i #ifdef debug G4cout<<"G4QCollis::PosStDoIt:n="<1) { G4double rndI=(*SPI)[nofIsot-1]*G4UniformRand(); // Randomize the isotop of the Element for(j=0; j work for Hisaya @@ // The decau process for hypernuclei must be developed in GEANT4 (change CHIPS body) G4QHadron* hadr=(*output)[i]; // Pointer to the output hadron G4int PDGCode = hadr->GetPDGCode(); G4int nFrag = hadr->GetNFragments(); #ifdef pdebug G4cout<<"G4QGluonString::AtRestDoIt: H#"<