// // ******************************************************************** // * 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: G4QFragmentation.cc,v 1.17 2010/06/25 14:03:44 mkossov Exp $ // GEANT4 tag $Name: hadr-chips-V09-03-08 $ // // ----------------------------------------------------------------------------- // GEANT 4 class header file // // History: // Created by Mikhail Kossov, October 2006 // CHIPS QGS fragmentation class // For comparison similar member functions can be found in the G4 classes: // G4QGSParticipants // G4QGSModels // G4ExcitedStringDecay // ----------------------------------------------------------------------------- // Short description: CHIPS QG string fragmentation class // Rhe key member function is Scatter, making the interaction (see G4QCollision) // ----------------------------------------------------------------------------- //#define debug //#define edebug //#define pdebug //#define sdebug //#define ppdebug #include "G4QFragmentation.hh" // Promoting model parameters from local variables class properties @@(? M.K.) // Definition of static parameters G4int G4QFragmentation::nCutMax=27; G4double G4QFragmentation::stringTension=1.5*GeV/fermi; //G4double G4QFragmentation::tubeDensity =1./fermi; G4double G4QFragmentation::tubeDensity =.5/fermi; // Parameters of diffractional fragmentation (was .72*) G4double G4QFragmentation::widthOfPtSquare=-GeV*GeV;// pt -width2 forStringExcitation G4QFragmentation::G4QFragmentation(const G4QNucleus &aNucleus, const G4QHadron &aPrimary) { static const G4double mProt= G4QPDGCode(2212).GetMass(); // Mass of proton static const G4double mProt2= mProt*mProt; // SquaredMass of proton static const G4double mPi0= G4QPDGCode(111).GetMass(); // Mass of Pi0 static const G4double thresh= 1000; // Diffraction threshold (MeV) theWorld= G4QCHIPSWorld::Get(); // Pointer to CHIPS World theQuasiElastic=G4QuasiFreeRatios::GetPointer(); // Pointer to CHIPS quasiElastic theDiffraction=G4QDiffractionRatio::GetPointer(); // Pointer to CHIPS Diffraction theResult = new G4QHadronVector; // Define theResultingHadronVector G4bool stringsInitted=false; // Strings are initiated G4QHadron aProjectile = aPrimary; // As a primary is const G4LorentzRotation toZ; // Lorentz Transformation to the projectileSystem G4LorentzVector proj4M=aProjectile.Get4Momentum(); // Projectile 4-momentum in LS #ifdef edebug G4LorentzVector targ4M=aProjectile.Get4Momentum(); // Target 4-momentum in LS G4double tgMass=aNucleus.GetGSMass(); // Ground state mass of the nucleus G4double cM=0.; G4double cs=(proj4M+targ4M).mag2(); // s of the compound if(cs > 0.) cM=std::sqrt(cs); G4cout<<"G4QFragmentation::Construct: *Called*, p4M="<LS (at the end) G4int pPDG=aProjectile.GetPDGCode(); // The PDG code of the projectile G4double projM=aProjectile.GetMass(); // Mass of the projectile G4QInteractionVector theInteractions; // A vector of interactions (taken from the Body) G4QPartonPairVector thePartonPairs; // The parton pairs (taken from the Body) G4int ModelMode=SOFT; // The current model type (taken from the Body) theNucleus=G4QNucleus(tZ,tN); // Create theNucleus (Body) to Move From LS to CM theNucleus.InitByPDG(tPDG); // Reinit the Nucleus for the new Attempt #ifdef debug G4cout<<"G4QFragmentation::Construct: Nucleus4Mom="< ratios=std::make_pair(0.,0.); G4int apPDG=std::abs(pPDG); if(apPDG>99) // Diffraction or Quasi-elastic { G4double pMom=proj4M.vect().mag(); // proj.Momentum in MeV (indepUnits) ratios = theQuasiElastic->GetRatios(pMom, pPDG, tZ, tN); G4double qeRat = ratios.first*ratios.second; // quasi-elastic part [qe/in] G4double difRat= theDiffraction->GetRatio(pMom, pPDG, tZ, tN); // diffrPart [d/(in-qe)] //if(qeRat < 1.) difRat /= (1.-qeRat)*.5; // Double for Top/Bottom @@ ? if(qeRat<1. && proj4M.e()>thresh) difRat /= 1.-qeRat; // Both Top & Bottom else difRat=0.; // Close diffraction for low Energy difRat += qeRat; // for the diffraction selection G4double rnd=G4UniformRand(); if(rnd < qeRat) // --> Make Quasi-Elastic reaction { theNucleus.StartLoop(); // Prepare Loop ovder nucleons G4QHadron* pNucleon = theNucleus.GetNextNucleon(); // Get the next nucleon to try G4LorentzVector pN4M=pNucleon->Get4Momentum(); // Selected Nucleon 4-momentum G4int pNPDG=pNucleon->GetPDGCode(); // Selected Nucleon PDG code #ifdef debug G4cout<<">QE>G4QFragmentation::Construct:TryQE,R="<QE-->G4QFragmentation::Construct:QEDone, N4M="<Dif-->G4QFragmentation::Construct: qe="<1) nCons = projAbsB; // @@ what if this is a meson ? // Very important! Here the projectile 4M is recalculated in the ZLS (previously in LS) proj4M = aProjectile.Get4Momentum(); // 4-mom of theProjectileHadron inZLS G4double pz_per_projectile = proj4M.pz()/nCons; // Momentum per nucleon (hadron?) // @@ use M_A/A instead of mProt ------------ M.K. G4double e_per_projectile = proj4M.e()/nCons+mProt;// @@ Add MassOfTargetProtonAtRest G4double vz = pz_per_projectile/e_per_projectile; // Speed of the "oneNuclenCM" #ifdef debug G4cout<<"G4QFragmentation::Construct: Projectile4M="<Get4Momentum(); // 4-mom of the current nucleon G4double cs=(cmProjMom + cp4M).mag2(); // Squared CM Energy of compound if(cs > maxS) // Remember nucleon with the biggest s { maxS=cs; pNucleon=bNucleon; } } aTarget = new G4QHadron(*pNucleon); // Copy selected nucleon for String aProjectile =cmProjectile; theNucleus.DoLorentzBoost(theCurrentVelocity); // Boost theResNucleus toRotatedLS theNucleus.SubtractNucleon(pNucleon); // Pointer to theUsedNucleon to delete theNucleus.DoLorentzBoost(-theCurrentVelocity); // Boost theResNucleus back to CM G4QContent QQC=aTarget->GetQC()+aProjectile->GetQC(); // QContent of the compound G4LorentzVector Q4M=aTarget->Get4Momentum()+aProjectile->Get4Momentum(); // 4-mom of Q delete aTarget; delete aProjectile; //if(maxNuc>1) // Absorb moreNucleons to theQuasmon //{ // for(G4int i=1; iGetQC(); // Add it to the Quasmon // Q4M+=pNucleon->Get4Momentum(); // theNucleus.DoLorentzBoost(theCurrentVelocity); // Boost theResNucleus toRotatedLS // theNucleus.SubtractNucleon(pNucleon); // Exclude the used nucleon from Nuc // theNucleus.DoLorentzBoost(-theCurrentVelocity);// Boost theResNucleus back to CM // } //} // 4-Mom should be converted to LS Q4M.boost(theCurrentVelocity); Q4M=toLab*Q4M; G4Quasmon* stringQuasmon = new G4Quasmon(QQC, Q4M); theQuasmons.push_back(stringQuasmon); theNucleus.DoLorentzBoost(theCurrentVelocity); // BoostTheResidualNucleus toRotatedLS theNucleus.DoLorentzRotation(toLab);// Recove Z-direction in LS ("LS"->LS) for rNucleus return; } if (s < sqr(ThresholdMass)) // --> Only diffractive interaction { #ifdef debug G4cout<<"G4QFragmentation::Construct:*OnlyDiffraction*ThM="<sqrt(s)=" < only Diffraction is possible"< theImpactParameter; theImpactParameter = theNucleus.ChooseImpactXandY(outerRadius); G4double impactX = theImpactParameter.first; G4double impactY = theImpactParameter.second; #ifdef debug G4cout<<"G4QFragmentation::Construct: Impact Par X="<EMC-->G4QFragmentation::Construct: Target Nucleon is filled, 4M/PDG=" <Get4Momentum()<GetPDGCode()< G4UniformRand() && ModelMode==SOFT ) || ModelMode==DIFFRACTIVE) { // ------------->>>> diffractive interaction @@ IsSingleDiffractive called once if(IsSingleDiffractive()) ExciteSingDiffParticipants(cmProjectile, aTarget); else ExciteDiffParticipants(cmProjectile, aTarget); G4QInteraction* anInteraction = new G4QInteraction(cmProjectile); anInteraction->SetTarget(aTarget); anInteraction->SetNumberOfDiffractiveCollisions(1); // Why not increment? M.K.? theInteractions.push_back(anInteraction); //--> now theInteractions not empty // @@ Why not breake the NLOOP, if only one diffractive can happend? totalCuts++; // UpdateOfNucleons in't necessary #ifdef debug G4cout<<"G4QFragmentation::Construct:NLOOP DiffInteract, tC="<>>>> nondiffractive = soft interaction // sample nCut+1 (cut Pomerons) pairs of strings can be produced G4int nCut; // Result in a chosen number of cuts G4double* running = new G4double[nCutMax]; // @@ This limits the max cuts for(nCut = 0; nCut < nCutMax; nCut++) // Calculates multiCut probabilities { running[nCut]= theProbability.GetCutPomProbability(s, Distance2, nCut+1); if(nCut) running[nCut] += running[nCut-1];// Sum up with the previous one } G4double random = running[nCutMax-1]*G4UniformRand(); for(nCut = 0; nCut < nCutMax; nCut++) if(running[nCut] > random) break; delete [] running; #ifdef debug G4cout<<"G4QFragmentation::Construct: NLOOP-Soft Chosen nCut="<0 interaction with a few nucleons is possible // @@ nCut is found with big efforts and now nCut=0 ?? M.K. ?? !! //nCut = 0; // @@ in original code ?? @@ aTarget->IncrementCollisionCount(nCut+1); // @@ What about multyNucleon target? cmProjectile->IncrementCollisionCount(nCut+1); G4QInteraction* anInteraction = new G4QInteraction(cmProjectile); anInteraction->SetTarget(aTarget); anInteraction->SetNumberOfSoftCollisions(nCut+1); theInteractions.push_back(anInteraction); totalCuts += nCut+1; #ifdef debug G4cout<<"G4QFragmentation::Construct:NLOOP SoftInteract, tC="<LS) for rNucleus return; } // // ------------------ now build the parton pairs for the strings ------------------ // #ifdef debug G4cout<<"G4QFragmentation::Construct: Before PartPairCreation nInt="<SplitHadrons(); #ifdef edebug G4QHadron* projH=theInteractions[i]->GetProjectile(); // Projectile of theInteraction G4QHadron* targH=theInteractions[i]->GetTarget(); // Target of the Interaction G4LorentzVector pSP(0.,0.,0.,0.); // Sum of parton's 4mom's for proj G4LorentzVector tSP(0.,0.,0.,0.); // Sum of parton's 4mom's for proj std::list projCP=projH->GetColor(); // Pointers to proj Color-partons std::list projAC=projH->GetAntiColor();// PointersTo projAntiColorPartons std::list targCP=targH->GetColor(); // Pointers to targ Color-partons std::list targAC=targH->GetAntiColor();// PointersTo targAntiColorPartons std::list::iterator picp = projCP.begin(); std::list::iterator pecp = projCP.end(); std::list::iterator piac = projAC.begin(); std::list::iterator peac = projAC.end(); std::list::iterator ticp = targCP.begin(); std::list::iterator tecp = targCP.end(); std::list::iterator tiac = targAC.begin(); std::list::iterator teac = targAC.end(); for(; picp!=pecp&& piac!=peac&& ticp!=tecp&& tiac!=teac; ++picp,++piac,++ticp,++tiac) { pSP+=(*picp)->Get4Momentum(); pSP+=(*piac)->Get4Momentum(); tSP+=(*ticp)->Get4Momentum(); tSP+=(*tiac)->Get4Momentum(); } G4cout<<"-EMC-G4QFragmentation::Construct: Interaction#"<Get4Momentum()-pSP<<",dT4M="<Get4Momentum()-tSP<>>>>>>> make soft collisions (ordering is vital) // G4QInteractionVector::iterator it; #ifdef debug G4cout<<"G4QFragmentation::Construct: Creation ofSoftCollisionPartonPair STARTS"<GetNumberOfSoftCollisions(); #ifdef debug G4cout<<"G4QFragmentation::Construct: #0f SOFT collisions ="<GetProjectile(); G4QHadron* pTarget = anIniteraction->GetTarget(); for (G4int j = 0; j < nSoftCollisions; j++) { aPair = new G4QPartonPair(pTarget->GetNextParton(), pProjectile->GetNextAntiParton(), G4QPartonPair::SOFT, G4QPartonPair::TARGET); thePartonPairs.push_back(aPair); // A target pair (Why TAGRET?) aPair = new G4QPartonPair(pProjectile->GetNextParton(), pTarget->GetNextAntiParton(), G4QPartonPair::SOFT, G4QPartonPair::PROJECTILE); thePartonPairs.push_back(aPair); // A projectile pair (Why Projectile?) #ifdef debug G4cout<<"--->G4QFragmentation::Construct: SOFT, 2 parton pairs are filled"< Parton pairs for SOFT strings are made"<>>>>>>>>>>>>>> make the rest as the diffractive interactions // for(unsigned i = 0; i < theInteractions.size(); i++) // Interactions are reduced bySoft { // The double or single diffraction is defined by the presonce of proj/targ partons G4QInteraction* anIniteraction = theInteractions[i]; G4QPartonPair* aPartonPair; #ifdef debug G4cout<<"G4QFragmentation::Construct: CreationOfDiffractivePartonPairs, i="<GetProjectile(); G4QParton* aParton = aProjectile->GetNextParton(); if (aParton) { aPartonPair = new G4QPartonPair(aParton, aProjectile->GetNextAntiParton(), G4QPartonPair::DIFFRACTIVE, G4QPartonPair::PROJECTILE); thePartonPairs.push_back(aPartonPair); #ifdef debug G4cout<<"G4QFragmentation::Construct: proj Diffractive PartonPair is filled"<GetTarget(); aParton = aTarget->GetNextParton(); if (aParton) { aPartonPair = new G4QPartonPair(aParton, aTarget->GetNextAntiParton(), G4QPartonPair::DIFFRACTIVE, G4QPartonPair::TARGET); thePartonPairs.push_back(aPartonPair); #ifdef debug G4cout<<"G4QFragmentation::Constr: target Diffractive PartonPair is filled"<>>>>>>>>>>>>> clean-up Interactions and cmProjectile, if necessary // std::for_each(theInteractions.begin(),theInteractions.end(), DeleteQInteraction()); theInteractions.clear(); delete cmProjectile; #ifdef debug G4cout<<"G4QFragmentation::Construct: Temporary objects are cleaned up"<>>>>>>>>>>>G4QFragmentation::Construct: >>>>>>>> Strings are created "<LorentzRotate(toLab); // Recove Z-direction in LS ("LS"->LS) theNucleus.DoLorentzRotation(toLab); // Recove Z-direction in LS ("LS"->LS) for rNucleus // Now everything is in LS system #ifdef edebug G4LorentzVector sm=theNucleus.Get4Momentum(); // Nucleus 4Mom in LS G4int rCg=totChg-theNucleus.GetZ(); G4int rBC=totBaN-theNucleus.GetA(); G4int nStrs=strings.size(); G4cout<<"-EMCLS-G4QFragmentation::Constr: #ofS="<Get4Momentum(); sm+=strI4M; G4int sChg=strings[i]->GetCharge(); rCg-=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); rBC-=sBaN; G4cout<<"-EMCLS-G4QFragm::Construct:String#"<Get4Momentum(); sm+=strI4M; G4int sChg=strings[i]->GetCharge(); rCg-=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); rBC-=sBaN; G4cout<<"-EMCLS-G4QFragm::Construct:String#"<Get4Momentum(); G4double cSM2=cS4M.m2(); // Squared mass of the String G4QParton* cLeft=(*ist)->GetLeftParton(); G4QParton* cRight=(*ist)->GetRightParton(); G4int cLT=cLeft->GetType(); G4int cRT=cRight->GetType(); G4int cLPDG=cLeft->GetPDGCode(); G4int cRPDG=cRight->GetPDGCode(); G4int aLPDG=0; G4int aRPDG=0; if (cLPDG > 7) aLPDG= cLPDG/100; else if(cLPDG <-7) aLPDG=(-cLPDG)/100; if (cRPDG > 7) aRPDG= cRPDG/100; else if(cRPDG <-7) aRPDG=(-cRPDG)/100; G4int L1=0; G4int L2=0; if(aLPDG) { L1=aLPDG/10; L2=aLPDG%10; } G4int R1=0; G4int R2=0; if(aRPDG) { R1=aRPDG/10; R2=aRPDG%10; } G4double cSM=cSM2; if(cSM2>0.) cSM=std::sqrt(cSM2); #ifdef debug G4cout<<"G4QFrag::Constr:NeedsFusion? cLPDG="<0.) // Mass can be calculated { G4bool single=true; G4double miM=0.; // Proto of the Min HadronString Mass if(cLT==2 && cRT==2) { if(L1!=R1 && L1!=R2 && L2!=R1 && L2!=R2) // Unreducable DiQ-aDiQ { single=false; G4QPDGCode tmp; std::pair paB=tmp.MakeTwoBaryons(L1, L2, R1, R2); miM=G4QPDGCode(paB.first).GetMass()+G4QPDGCode(paB.second).GetMass(); } } if(single) miM=G4QPDGCode((*ist)->GetQC().GetSPDGCode()).GetMass() + mPi0;//MinHSMass //if(single) miM=G4QPDGCode((*ist)->GetQC().GetSPDGCode()).GetMass();//MinHSMass #ifdef debug G4cout<<"G4QFrag::Const:*IsItGood? realM="< GSM="< miM) bad=false; // String is OK } if(bad) // String should be merged with others { #ifdef debug G4cout<<"G4QFrag::Const:TryFuse,L1="<0.) minC=false; // If M2>0 already don'tSearchFor M2>0 for(pst = strings.begin(); pst < strings.end(); pst++) if(pst != ist) { G4LorentzVector sS4M=(*pst)->Get4Momentum(); // Partner's 4-momentum G4LorentzVector pS4M=sS4M+cS4M; // Summed 4-momentum G4int nLPDG=0; // new Left (like in theStringPartner) G4int nRPDG=0; // new Right(like in theStringPartner) G4double pExcess=-DBL_MAX; // Prototype of the excess G4double pSM2=pS4M.m2(); // Squared mass of the Fused Strings #ifdef debug G4cout<<"->G4QFragm::Construct: sum4M="<0.) // The partner can be a candidate //{ G4QParton* pLeft=(*pst)->GetLeftParton(); G4QParton* pRight=(*pst)->GetRightParton(); G4int pLT=pLeft->GetType(); G4int pRT=pRight->GetType(); G4int pLPDG=pLeft->GetPDGCode(); G4int pRPDG=pRight->GetPDGCode(); G4int LPDG=0; G4int RPDG=0; if (pLPDG > 7) LPDG= pLPDG/100; else if(pLPDG <-7) LPDG=(-pLPDG)/100; if (pRPDG > 7) RPDG= pRPDG/100; else if(pRPDG <-7) RPDG=(-pRPDG)/100; G4int pL1=0; G4int pL2=0; if(LPDG) { pL1=LPDG/10; pL2=LPDG%10; } G4int pR1=0; G4int pR2=0; if(RPDG) { pR1=RPDG/10; pR2=RPDG%10; } G4int pST=pLT+pRT; #ifdef debug G4cout<<"G4QFragm::Construct: Partner/w pLPDG="< 7 && ( (pLPDG<0 && (-pLPDG==L1 || -pLPDG==L2 || -pLPDG==cRPDG) ) || (pRPDG<0 && (-pRPDG==L1 || -pRPDG==L2 || -pRPDG==cRPDG) ) ) ) af=1; else if(cRPDG > 7 && ( (pLPDG<0 && (-pLPDG==R1 || -pLPDG==R2 || -pLPDG==cLPDG) ) || (pRPDG<0 && (-pRPDG==R1 || -pRPDG==R2 || -pRPDG==cLPDG) ) ) ) af=2; else if(cLPDG <-7 && ( (pLPDG>0 && ( pLPDG==L1 || pLPDG==L2 || pLPDG==-cRPDG) ) || (pRPDG>0 && ( pRPDG==L1 || pRPDG==L2 || pRPDG==-cRPDG) ) ) ) af=3; else if(cRPDG <-7 && ( (pLPDG>0 && ( pLPDG==R1 || pLPDG==R2 || pLPDG==-cLPDG) ) || (pRPDG>0 && ( pRPDG==R1 || pRPDG==R2 || pRPDG==-cLPDG) ) ) ) af=4; #ifdef debug else G4cout<<"G4QFragmentation::Construct:3(QDiQ/aQaDiQ+QaQ) Can't fuse"< 7) // pRPDG <-7 { if ( (-cLPDG==pL1 || -cLPDG==pL2) && (cRPDG==pR1 || cRPDG==pR2) ) af=1; else if( (-cRPDG==pL1 || -cRPDG==pL2) && (cLPDG==pR1 || cLPDG==pR2) ) af=2; } else if(pRPDG > 7) // pLPDG <-7 { if ( (-cRPDG==pR1 || -cRPDG==pR2) && (cLPDG==pL1 || cLPDG==pL2) ) af=3; else if( (-cLPDG==pR1 || -cLPDG==pR2) && (cRPDG==pL1 || cRPDG==pL2) ) af=4; } #ifdef debug else G4cout<<"-G4QFragmentation::Construct: 4 (QaQ+aQDiQDiQ) Can't fuse"< 7) // cRPDG<-7 { if ( (-pLPDG==L1 || -pLPDG==L2) && (pRPDG==R1 || pRPDG==R2) ) af=1; else if( (-pRPDG==L1 || -pRPDG==L2) && (pLPDG==R1 || pLPDG==R2) ) af=2; } else if(cRPDG > 7) // cLPDG<-7 { if ( (-pRPDG==R1 || -pRPDG==R2) && (pLPDG==L1 || pLPDG==L2) ) af=3; else if( (-pLPDG==R1 || -pLPDG==R2) && (pRPDG==L1 || pRPDG==L2) ) af=4; } #ifdef debug else G4cout<<"-G4QFragmentation::Construct: 5 (aQDiQDiQ+QaQ) Can't fuse"< 7) { if (cLPDG<-7 && (-cRPDG==pL1 || -cRPDG==pL2) && (pRPDG==L1 || pRPDG==L2)) af=1; else if(cRPDG<-7 && (-cLPDG==pL1 || -cLPDG==pL2) && (pRPDG==R1 || pRPDG==R2)) af=2; } else if(pRPDG > 7) { if (cLPDG<-7 && (-cRPDG==pR1 || -cRPDG==pR2) && (pLPDG==L1 || pLPDG==L2)) af=3; else if(cRPDG<-7 && (-cLPDG==pR1 || -cLPDG==pR2) && (pLPDG==R1 || pLPDG==R2)) af=4; } else if(cLPDG > 7) { if (pLPDG<-7 && (-pRPDG==L1 || -pRPDG==L2) && (cRPDG==pL1 || cRPDG==pL2)) af=5; else if(pRPDG<-7 && (-pLPDG==L1 || -pLPDG==L2) && (cRPDG==pR1 || cRPDG==pR2)) af=6; } else if(cRPDG > 7) { if (pLPDG<-7 && (-pRPDG==R1 || -pRPDG==R2) && (cLPDG==pL1 || cLPDG==pL2)) af=7; else if(pRPDG<-7 && (-pLPDG==R1 || -pLPDG==R2) && (cLPDG==pR1 || cLPDG==pR2)) af=8; } #ifdef debug else G4cout<<"-G4QFragmentation::Construct: 6 (QDiQ+aQaDiQ) Can't fuse"<Get4Momentum(); t4M+=strI4M; G4int sChg=strings[i]->GetCharge(); rC-=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); rB-=sBaN; G4cout<<"-EMCLS-G4QFragm::Construct: St#"<SetPDGCode(sPDG); cRight->SetPDGCode(nPDG); } else if(sPDG==-3 && nPDG==3) { sPDG=-1; nPDG= 1; cLeft->SetPDGCode(sPDG); cRight->SetPDGCode(nPDG); } } SwapPartons(); } // End of IF(problem) #ifdef edebug G4LorentzVector u4M=theNucleus.Get4Momentum(); // Nucleus 4Mom in LS G4int rCh=totChg-theNucleus.GetZ(); G4int rBa=totBaN-theNucleus.GetA(); G4int nStri=strings.size(); G4cout<<"-EMCLS-G4QFr::Const: FinalConstruct, #ofSt="<Get4Momentum(); u4M+=strI4M; G4int sChg=strings[i]->GetCharge(); rCh-=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); rBa-=sBaN; G4cout<<"-EMCLS-G4QFragm::Construct: St#"<G4QFragmentation::Fragment: ***Called***, Res="<size(); // Find out if there're hadrons #ifdef edebug G4int nQm=theQuasmons.size(); G4LorentzVector totLS4M=theNucleus.Get4Momentum(); // Nucleus 4Mom in LS G4int totChg=theNucleus.GetZ(); G4int totBaN=theNucleus.GetA(); G4cout<<"-EMCLS-G4QF::Fragment: CHECKRecovery, #ofS="<G4QFragmentation::Fragment: #OfStr="<G4QFragmentation::Fragment:**Quasi-Elastic**,#OfResult="<clear(); } G4LorentzVector r4M=theNucleus.Get4Momentum(); // Nucleus 4-momentum in LS G4int rPDG=theNucleus.GetPDG(); // Nuclear PDG G4QHadron* resNuc = new G4QHadron(rPDG,r4M); // Nucleus -> Hadron theResult->push_back(resNuc); // Fill the residual nucleus } G4int nQuas=theQuasmons.size(); // Size of the Quasmon OUTPUT G4int theRS=theResult->size(); // Size of Hadron Output by now #ifdef debug G4cout<<"***>G4QFragmentation::Fragment:beforeEnv,#OfQ="<Get4Momentum(); // 4-Momentum of the Nucleuz G4int resNucPDG= resNuc->GetPDGCode(); // PDG Code of the Nucleus if(resNucPDG==90000000) { resNuc4M=G4LorentzVector(0.,0.,0.,0.); resNuc->Set4Momentum(resNuc4M); } #ifdef edebug G4int rnChg=resNuc->GetCharge(); G4int rnBaN=resNuc->GetBaryonNumber(); #endif G4QNucleus theEnv(resNucPDG); // NucleusHadron->NucleusAtRest delete resNuc; // Delete resNucleus as aHadron theResult->pop_back(); // Exclude the nucleus from HV --theRS; // Reduce the OUTPUT by theNucl #ifdef debug G4cout<<"G4QFragmentation::Fragment:#OfRemainingHadron="<-2; --j) // try to reach M_compound>M_GS { G4LorentzVector qsum4M=resNuc4M; // Proto compound 4-momentum G4QContent qsumQC=theEnv.GetQCZNS(); // Proto compound Quark Content #ifdef debug G4cout<<"G4QFragmentation::Fragm:rN4M"<Get4Momentum(); // 4-Mom of the Quasmon G4QContent curQC=curQuasm->GetQC(); // Quark Content of the Quasmon qsum4M+=cur4M; // Add quasmon's 4-momentum qsumQC+=curQC; // Add quasmon's Quark Content #ifdef debug G4cout<<"G4QFr::Fr:Q#"< DELETED --->----------+ #ifdef debug G4cout<<"G4QFragm::Fragm: nucE="<Fragment();// DESTROYED after theHadrons are transferred to theResult | } // | | catch (G4QException& error) // | | { // | | G4cerr<<"***G4QFragmentation::Fragment: G4QE Exception is catched"<size(); // #ofHadrons in the Nuclear Fragmentation | for(G4int j=0; jBoost(nucVel); // Boost it back to Laboratory System | G4int hPDG=curHadr->GetPDGCode(); // PDGC of the hadron | G4LorentzVector h4M=curHadr->Get4Momentum(); // 4-mom of the hadron | if((hPDG!=90000000 && hPDG!=22) || h4M!=nul4M) theResult->push_back(curHadr); //| else delete curHadr; // delete zero-photons | } // | delete output; // Delete the OUTPUT <-----<-----<-----<---+ } } else if(!striNum) G4cout<<"-Warning-G4QFragmentation::Fragment:Nothing was done"<G4QFragmentation::Fragment: Final #OfResult="<size()<size(); #ifdef edebug G4LorentzVector f4M(0.,0.,0.,0.); // Sum of the Result in LS G4int fCh=totChg; G4int fBN=totBaN; G4cout<<"-EMCLS-G4QFragmentation::Fragment: #ofHadr="< m1="<pop_back(); delete resNuc; G4QHadron* m1H = new G4QHadron(mPDG,m14M); theResult->push_back(m1H); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn3, M1="<push_back(m2H); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn3, M2="<push_back(nH); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn3, Nucleon="< m1="<pop_back(); delete resNuc; G4QHadron* m1H = new G4QHadron(mPDG,m14M); theResult->push_back(m1H); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn2, M1="<push_back(nH); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn2, Nucleon="<Get4Momentum(); // 4-mom to be split G4LorentzVector n14M(0.,0.,0.,mNeut); G4LorentzVector n24M(0.,0.,0.,mNeut); if(!G4QHadron(tot4M).DecayIn2(n14M,n24M)) { G4cerr<<"***G4QFrag::Frag: tM="< n*2="<<2*mNeut<pop_back(); delete resNuc; G4QHadron* n1H = new G4QHadron(2112,n14M); theResult->push_back(n1H); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn2, Neutron1="<push_back(n2H); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn2, Neutron2="<Get4Momentum(); // 4-mom to be split G4LorentzVector n14M(0.,0.,0.,mProt); G4LorentzVector n24M(0.,0.,0.,mProt); if(!G4QHadron(tot4M).DecayIn2(n14M,n24M)) { G4cerr<<"***G4QFrag::Frag: tM="< n*2="<<2*mProt<pop_back(); delete resNuc; G4QHadron* n1H = new G4QHadron(2212,n14M); theResult->push_back(n1H); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn2, Proton1="<push_back(n2H); #ifdef debug G4cout<<"G4QFragment::Fragment:DecayIn2, Proton2="<22 nHd=theResult->size(); for(G4int i=0; iGetPDGCode(); if(hPDG==90000000 || hPDG==22) { G4QHadron* curHadr=(*theResult)[i]; G4LorentzVector curh4M=curHadr->Get4Momentum(); if ( curh4M > 0.) curHadr->SetPDGCode(22); else if( curh4M == nul4M) { G4QHadron* theLast = (*theResult)[nHd-1]; if(theLast != curHadr) { curHadr->Set4Momentum(theLast->Get4Momentum()); //4-Mom of CurHadr G4QPDGCode lQP=theLast->GetQPDG(); if(lQP.GetPDGCode()!=10) curHadr->SetQPDG(lQP); else curHadr->SetQC(theLast->GetQC()); } theResult->pop_back(); // theLastQHadron is excluded from OUTPUT --nHd; delete theLast; //*!!When kill, delete theLastQHadr as an Instance!* break; } } else if(hPDG==2212 || hPDG==2112) { for(G4int j=i+1; jGetPDGCode(); if(hPDG==pPDG) // The pp or nn pair is found { G4LorentzVector h4M=(*theResult)[i]->Get4Momentum(); G4LorentzVector p4M=(*theResult)[j]->Get4Momentum(); G4LorentzVector d4M=h4M+p4M; G4double E=d4M.mag(); // Proto of tot CM energy if(hPDG==2212) E -= mProt+mProt; // Reduction to tot kin energy in CM else E -= mNeut+mNeut; if(E < 140. && G4UniformRand() < .6)// A close pair was found @@ Par 140. { G4int piPDG= 211; // Pi+ default for nn pairs if(hPDG==2212) piPDG=-211; // Pi- for pp pairs for(G4int k=0; kGetPDGCode(); if(mPDG==111 || mPDG==piPDG) // Appropriate for correction pion is found { G4LorentzVector m4M=(*theResult)[k]->Get4Momentum(); G4double mN=mProt; // Final nucleon after charge exchange (nn) G4int nPDG=2212; G4int tPDG=-211; // Proto Pion after charge exchange from Pi0 if(hPDG==2212) // (pp) { mN=mNeut; nPDG=2112; tPDG= 211; } G4double mPi=mPiZr; // Pion after the charge exchange from Pi+/- G4int sPDG=111; if(mPDG==111) { mPi=mPiCh; // Pion after the charge exchange from Pi0 sPDG=tPDG; } //G4cout<<"G4QFrag::Frag: H="<Get4Momentum(); totLS4M+=strI4M; G4int sChg=strings[i]->GetCharge(); totChg+=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); totBaN+=sBaN; G4cout<<"-EMCLS-G4QFragm::Breeder: St#"<G4QFrag::Br:1stTest,S#"<G4QFragmentation::Breeder:*TotQ*,QC="<push_back(resNuc); // Fill the residual nucleus return; } for (G4int astring=0; astring < nOfStr; astring++) { #ifdef edebug G4LorentzVector sum=theNucleus.Get4Momentum(); // Nucleus 4Mom in LS G4int rChg=totChg-theNucleus.GetZ(); G4int rBaN=totBaN-theNucleus.GetA(); G4int nOfHadr=theResult->size(); G4cout<<"-EMCLS-G4QFragmentation::Breeder:#ofSt="<Get4Momentum(); sum+=strI4M; G4int sChg=strings[i]->GetCharge(); rChg-=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); rBaN-=sBaN; G4cout<<"-EMCLS-G4QF::Breed:S#"<Get4Momentum(); sum+=hI4M; G4int hChg=(*theResult)[i]->GetCharge(); rChg-=hChg; G4int hBaN=(*theResult)[i]->GetBaryonNumber(); rBaN-=hBaN; G4cout<<"-EMCLS-G4QFr::Breed: H#"<G4QFragmentation::Breeder: String#"<0 && uPDG<0) // LL/RR Reduction { std::pair resLL=ReducePair(sPDG/100, (-uPDG)/100); G4int newCL=resLL.first; G4int newPL=resLL.second; if(!newCL || !newPL) { G4cerr<<"*G4QFragmentation::Breeder:CL="< resRR=ReducePair((-nPDG)/100, mPDG/100); G4int newCR=resRR.first; G4int newPR=resRR.second; if(!newCR || !newPR) { G4cerr<<"*G4QFragmentation::Breeder:CR="<SetPDGCode(newCL); // Reset the left quark of curString cRight->SetPDGCode(-newCR); // Reset the right quark of curString Left->SetPDGCode(-newPL); // Reset the left quark of reString Right->SetPDGCode(newPR); // Reset the right quark of reString break; // Break out of the reString internal LOOP } else if(sPDG<0 && uPDG>0) // LL/RR Reduction { std::pair resLL=ReducePair((-sPDG)/100, uPDG/100); G4int newCL=resLL.first; G4int newPL=resLL.second; if(!newCL || !newPL) { G4cerr<<"*G4QFragmentation::Breeder:CL="< resRR=ReducePair(nPDG/100, (-mPDG)/100); G4int newCR=resRR.first; G4int newPR=resRR.second; if(!newCR || !newPR) { G4cerr<<"*G4QFragmentation::Breeder:CR="<SetPDGCode(-newCL); // Reset the left quark of curString cRight->SetPDGCode(newCR); // Reset the right quark of curString Left->SetPDGCode(newPL); // Reset the left quark of reString Right->SetPDGCode(-newPR); // Reset the right quark of reString break; // Break out of the reString internal LOOP } else if(sPDG>0 && mPDG<0) // LR Reduction { std::pair resLL=ReducePair(sPDG/100, (-mPDG)/100); G4int newCL=resLL.first; G4int newPR=resLL.second; if(!newCL || !newPR) { G4cerr<<"*G4QFragmentation::Breeder:CL="< resRR=ReducePair((-nPDG)/100, uPDG/100); G4int newCR=resRR.first; G4int newPL=resRR.second; if(!newCR || !newPR) { G4cerr<<"*G4QFragmentation::Breeder:CR="<SetPDGCode(newCL); // Reset the left quark of curString cRight->SetPDGCode(-newCR); // Reset the right quark of curString Left->SetPDGCode(newPL); // Reset the left quark of reString Right->SetPDGCode(-newPR); // Reset the right quark of reString break; // Break out of the reString internal LOOP } else // RL Reduction { std::pair resLL=ReducePair((-sPDG)/100, mPDG/100); G4int newCL=resLL.first; G4int newPR=resLL.second; if(!newCL || !newPR) { G4cerr<<"*G4QFragmentation::Breeder:CL="< resRR=ReducePair(nPDG/100, (-uPDG)/100); G4int newCR=resRR.first; G4int newPL=resRR.second; if(!newCR || !newPR) { G4cerr<<"*G4QFragmentation::Breeder:CR="<SetPDGCode(-newCL); // Reset the left quark of curString cRight->SetPDGCode(newCR); // Reset the right quark of curString Left->SetPDGCode(-newPL); // Reset the left quark of reString Right->SetPDGCode(newPR); // Reset the right quark of reString break; // Break out of the reString internal LOOP } } // End of IF(possible reduction) } // Check StringsCanBeFused: all QaQ+QaQ(22), single QaQ+QDiQ/aQaDtQ(23/32), // double QaQ+DiQaDiQ(24/42), QDiQ+aDiQaQ(34/43) #ifdef debug G4cout<<"G4QFragm::Breed:TryFuse/w #"< 7 && (-dPDG==aPDG/10 || -dPDG==aPDG%10) ) || // cAQ w DQ (dPDG> 7 && (-aPDG==dPDG/10 || -aPDG==dPDG%10) ) || // AQ w cDQ (rPDG<-7 && (qPDG==(-rPDG)/10 || qPDG==(-rPDG)%10) ) || // cQ w ADQ (qPDG<-7 && (rPDG==(-qPDG)/10 || rPDG==(-qPDG)%10) ) // Q w cADQ //|| (aPDG< 0 && -aPDG==qPDG) || (dPDG< 0 && -dPDG==rPDG) // aQ w Q ) ) || // ----------------------- ( ( LS==2 && PLS==4 &&// QaQ w DiQaDiQ (double) (aPDG> 7 && (-dPDG == aPDG/10 || -dPDG == aPDG%10) ) && (rPDG<-7 && (qPDG==(-rPDG)/10 || qPDG==(-rPDG)%10) ) ) || ( LS==4 && PLS==2 &&// DiQaDiQ w QaQ (double) (dPDG> 7 && (-aPDG == dPDG/10 || -aPDG == dPDG%10) ) && (qPDG<-7 && (rPDG==(-qPDG)/10 || rPDG==(-qPDG)%10) ) ) ) || // ----------------------- ( LS==3 && PLS==3 &&// QDiQ w aDiQaQ (double) ( (aPDG> 7 && (-dPDG == aPDG/10 || -dPDG == aPDG%10) && qPDG<-7 && (rPDG==(-qPDG)/10 || rPDG==(-qPDG)%10) ) || (dPDG> 7 && (-aPDG == dPDG/10 || -aPDG == dPDG%10) && rPDG<-7 && (dPDG==(-rPDG)/10 || dPDG==(-rPDG)%10) ) ) ) ) { G4LorentzVector reString4M = reString->Get4Momentum(); G4ThreeVector reV = reString4M.vect()/reString4M.e(); G4double dV=(curV-reV).mag2(); // Squared difference between relVelocities #ifdef debug G4cout<<"G4QFragmentation::Breeder: StringCand#"< fuse strings { #ifdef debug G4cout<<"G4QFragm::Breeder: StPartner#"<GetLeftParton(); G4QParton* Right=fuString->GetRightParton(); G4int uPDG=Left->GetPDGCode(); G4int mPDG=Right->GetPDGCode(); G4int rPDG=uPDG; G4int aPDG=mPDG; if(aPDG<-99 || (aPDG>0 && aPDG<7) || rPDG>99 || (rPDG<0 && rPDG>-7)) { swap=rPDG; rPDG=aPDG; aPDG=swap; } if(aPDG > 99) aPDG/=100; if(rPDG <-99) rPDG=-(-rPDG)/100; // Check that the strings can fuse (no anti-diquarks assumed) G4LorentzVector resL4M(0.,0.,0.,0.); G4LorentzVector resR4M(0.,0.,0.,0.); G4LorentzVector L4M=cLeft->Get4Momentum(); G4LorentzVector R4M=cRight->Get4Momentum(); #ifdef debug G4cout<<"G4QFragmentation::Breeder:BeforeFuDir,sL="<"<Get4Momentum()<Get4Momentum().m()<>>>G4QFragmentation::Breeder: S+=H, 4M="<h1="<push_back(h1H); // (delete equivalent) #ifdef debug G4LorentzVector f4M=h1H->Get4Momentum(); G4int fPD=h1H->GetPDGCode(); G4int fCg=h1H->GetCharge(); G4int fBN=h1H->GetBaryonNumber(); G4cout<<"-EMC->>>G4QFragment::Breeder: String=Hadr ChiPro1 is filled, f4M=" <>>G4QFragmentation::Breeder: String=Hadr ChiPro2 is filled, s4M=" <>>G4QFragment::Breeder:String=Hadr,H#"< to Quasm="<>>G4QFragmentation::Breeder: SQC="<>>G4QFragmentation::Breeder: minMass="<>>G4QFragmentation::Breeder:S->H="<push_back(h1H); // (delete equivalent) #ifdef debug G4LorentzVector f4M=h1H->Get4Momentum(); G4int fPD=h1H->GetPDGCode(); G4int fCg=h1H->GetCharge(); G4int fBN=h1H->GetBaryonNumber(); G4cout<<"-EMC->>>G4QFragmentation::Breeder:Str=2HadrAR Prod-F is filled,f4M=" <>>G4QFragmentation::Breeder:Str=2HadrAR Prod-S is filled,s4M=" <>>G4QFragmentation::Breeder:St=Had,pH#"<h1="<push_back(h1H); // (delete equivalent) #ifdef debug G4LorentzVector f4M=h1H->Get4Momentum(); G4int fPD=h1H->GetPDGCode(); G4int fCg=h1H->GetCharge(); G4int fBN=h1H->GetBaryonNumber(); G4cout<<"-EMC->>>G4QFragmentation::Breeder:Str=Hadr Prod-F's filled,f4M=" <>>G4QFragmentation::Breeder:Str=Hadr Prod-S's filled,s4M=" <h1="<push_back(sHad); // The original string-hadron is filled #ifdef debug G4cout<<"-EMC->>>G4QFragmentation::Breeder:Str=Hadr Filled, 4M=" <Get4Momentum()<<", M="<>>G4QFragmentation::Breeder:*Corrected* String->Hadr="<0.) } // End of IF(Can try to correct by String-String) #ifdef debug else G4cout<<"***G4QFragmentation::Breeder: **No SSCorrection**,next="<GetLeftParton(); G4QParton* rpcS=curString->GetRightParton(); G4int lPDGcS=lpcS->GetPDGCode(); G4int rPDGcS=rpcS->GetPDGCode(); if (lPDGcS==3 && rPDGcS==-3) { lpcS->SetPDGCode( 1); rpcS->SetPDGCode(-1); } else if(lPDGcS==-3 && rPDGcS==3) { lpcS->SetPDGCode(-1); rpcS->SetPDGCode( 1); } // -------- Now the only hope is Correction, using the already prodused Hadrons ----- G4int nofRH=theResult->size(); // #of resulting Hadrons #ifdef debug G4cout<<"G4QFragmentation::Breeder: theH="<h1=("<Set4Momentum(sp4M); #ifdef debug G4cout<<"-EMC->...>G4QFragmentation::Breeder: H# "<h1M=("< 2) // Decay Hadron-Resonans { G4Quasmon Quasm; G4QHadron* sHad = new G4QHadron(miPDG,mi4M); G4QHadronVector* tmpQHadVec=Quasm.DecayQHadron(sHad); // It deletes sHad #ifdef debug G4cout<<"G4QFragment::Breeder:*HS* DecStrHad, nH="<size()<size(); aH++) { theResult->push_back((*tmpQHadVec)[aH]);// TheDecayProductOfTheHadronIsFilled #ifdef debug G4QHadron* prodH =(*tmpQHadVec)[aH]; G4LorentzVector p4M=prodH->Get4Momentum(); G4int PDG=prodH->GetPDGCode(); G4int Chg=prodH->GetCharge(); G4int BaN=prodH->GetBaryonNumber(); G4cout<<"-EMC->>>G4QFragmentation::Breeder:Str+Hadr PrH#"<h1="<push_back(h1H); // (delete equivalent) #ifdef debug G4LorentzVector f4M=h1H->Get4Momentum(); G4int fPD=h1H->GetPDGCode(); G4int fCg=h1H->GetCharge(); G4int fBN=h1H->GetBaryonNumber(); G4cout<<"-EMC->>>G4QFragmentation::Breeder:CorStrHadr Prod-1 is filled, f4M=" <>>G4QFragmentation::Breeder:CorStrHadr Prod-2 is filled, n4M=" <>>>>>G4QFragmentation::Breeder: CorStr=Hadr is Filled, 4M=" <Get4Momentum()<>>G4QFragmentation::Breeder:*Corrected* String+Hadr="< Now try to recover the string as a hadron"<Get4Momentum(); // G4double pM=p4M.m(); // Mass of the Partner-Hadron // G4LorentzVector t4M=p4M+curString4M; // Total momentum of the compound // G4double tM2=t4M.m2(); // Squared total mass of the compound // if(tM2 >= sqr(pM+miM+eps)) // Condition of possible correction // { // G4double tM=std::sqrt(tM2); // Mass of the Hadron+String compound // G4double dM=tM-pM-miM; // Excess of the compound mass // if(dM < dMmin) // { // dMmin=dM; // fuha=reha; // spM=pM; // s4M=t4M; // sM=tM; // } // } //} // End of the LOOP over string-partners for Correction } // @@@ convert string to Quasmon with curString4M G4QContent curStringQC=curString->GetQC(); G4Quasmon* stringQuasmon = new G4Quasmon(curStringQC, curString4M); theQuasmons.push_back(stringQuasmon); continue; // Continue the LOOP over the curStrings } // End of IF(Can try the String-Hadron correction } // End of IF(NO_Hadrons) = Problem solution namespace G4Quasmon tmpQ; // @@ an issue of Q to decay resonances G4int nHfin=0; if(theHadrons) nHfin=theHadrons->size(); else // !! Sum Up all strings and convert them in a Quasmon (Exception for development) { G4LorentzVector ss4M(0.,0.,0.,0.); G4QContent ssQC(0,0,0,0,0,0); G4int tnSt=strings.size(); for(G4int i=astring; i < tnSt; ++i) { G4LorentzVector pS4M=strings[i]->Get4Momentum(); // String 4-momentum ss4M+=pS4M; G4QContent pSQC=strings[i]->GetQC(); // String Quark Content ssQC+=pSQC; #ifdef debug G4cout<<"====>G4QFragmentation::Breeder:S#"<G4QFragmentation::Breeder:AllStrings are summed up in a Quasmon"<>>>>>>>G4QFragmentation::Breeder:S#"<resize(tmpS+theResult->size()); // Resize theQHadrons length //copy(tmpQHadVec->begin(), tmpQHadVec->end(), theResult->end()-tmpS); for(unsigned aH=0; aH < tmpQHadVec->size(); aH++) { theResult->push_back((*tmpQHadVec)[aH]);// TheDecayProduct of TheHadron is filled // G4QHadron* prodH =(*tmpQHadVec)[aH]; G4LorentzVector p4M=prodH->Get4Momentum(); G4int Chg=prodH->GetCharge(); G4int BaN=prodH->GetBaryonNumber(); curString4M-=p4M; curStrChg-=Chg; curStrBaN-=BaN; curH4M-=p4M; curHCh-=Chg; curHBN-=BaN; #ifdef edebug G4int PDG=prodH->GetPDGCode(); G4cout<<"-EMC->>>>G4QFragmentation::Breeder:Str*Filled, 4M="<>>>>>G4QFragmentation::Breeder: curH filled 4M="<GetPDGCode()<<", Chg="<Set4Momentum(theLast->Get4Momentum()); //4-Mom of CurHadr G4QPDGCode lQP=theLast->GetQPDG(); if(lQP.GetPDGCode()!=10) curHadr->SetQPDG(lQP); else curHadr->SetQC(theLast->GetQC()); theResult->pop_back(); // theLastQHadron is excluded from OUTPUT delete theLast; //*!!When kill, delete theLastQHadr as an Instance!* break; } if( !(hCh+mCh+curStrChg) && !(hBN+mBN+curStrBaN) && std::fabs(dEn+hEn+mEn)push_back(resNuc); // Fill the residual nucleus #ifdef edebug G4LorentzVector s4M(0.,0.,0.,0.); // Sum of the Result in LS G4int rCh=totChg; G4int rBN=totBaN; G4int nHadr=theResult->size(); G4int nQuasm=theQuasmons.size(); G4cout<<"-EMCLS-G4QFragmentation::Breeder:#ofHadr="<Get4Momentum(); s4M+=hI4M; G4int hChg=(*theResult)[i]->GetCharge(); rCh-=hChg; G4int hBaN=(*theResult)[i]->GetBaryonNumber(); rBN-=hBaN; G4cout<<"-EMCLS-G4QFragmentation::Breeder:(1) Hadron#"<G4QFragmentation::Breeder:Exclude,4M="<push_back(ih); // Delete equivalent } // End of Loop over sorted pairs G4Quasmon* softQuasmon = new G4Quasmon(qQC, q4M); // SoftPart -> Quasmon #ifdef debug G4cout<<"%->G4QFragmentation::Breeder:QuasmonIsFilled,4M="<push_back(resNuc); #ifdef edebug G4LorentzVector f4M(0.,0.,0.,0.); // Sum of the Result in LS G4int fCh=totChg; G4int fBN=totBaN; G4int nHd=theResult->size(); G4int nQm=theQuasmons.size(); G4cout<<"-EMCLS-G4QFragmentation::Breeder:#ofHadr="<Get4Momentum(); f4M+=hI4M; G4int hChg=(*theResult)[i]->GetCharge(); fCh-=hChg; G4int hBaN=(*theResult)[i]->GetBaryonNumber(); fBN-=hBaN; G4cout<<"-EMCLS-G4QFragmentation::Breeder:(2) Hadron#"<GetMass2()*(1.-perCent); // Isn't it too big reduction? M.K. } else { #ifdef debug G4cout<<"---1/2---G4QFragmentation::ExSingDiffParticipants: Target is fixed"<GetMass2()*(1.-perCent); // @@ Isn't it too big reduction? M.K. } // @@ From this point it repeats the Diffractional excitation (? Use flag ?) // Transform momenta to cms and then rotate parallel to z axis; G4LorentzVector Psum=Pprojectile+Ptarget; G4LorentzRotation toCms(-Psum.boostVector()); // Boost Rotation to CMS G4LorentzVector Ptmp=toCms*Pprojectile; if(Ptmp.pz()<=0.) // "String" moving backwards in CMS, abort collision !! ? M.K. { #ifdef debug G4cout<<"G4QFragment::ExciteSingDiffParticipants: *1* abort Collision!! *1*"< 0) // Sum up ADiQ and Q in AQ { G4int PDG=-PDG2/100; if(PDG1==PDG/10) return -PDG%10; if(PDG1==PDG%10) return -PDG/10; else { G4cerr<<"***4QFragmentation::SumPartonPDG: PDG1="< 99 && PDG2 >-7 && PDG2 < 0) // Sum up DiQ and AQ in Q { G4int PDG=PDG1/100; if(PDG2==-PDG/10) return PDG%10; if(PDG2==-PDG%10) return PDG/10; else { G4cerr<<"***4QFragmentation::SumPartonPDG: PDG1="< 99 && PDG1 >-7 && PDG1 < 0) // Sum up AQ and DiQ in Q { G4int PDG=PDG2/100; if(PDG1==-PDG/10) return PDG%10; if(PDG1==-PDG%10) return PDG/10; else { G4cerr<<"***G4QFragmentation::SumPartonPDG: PDG1="< G4QFragmentation::ReducePair(G4int P1, G4int P2) const { #ifdef debug G4cout<<"G4QFragmentation::ReducePair: **Called** P1="<DiQ-aDiQ, uPDG="<0 && sPDG>0 && mPDG<0 && nPDG<0) || (uPDG<0 && sPDG<0 && mPDG>0 && nPDG>0) ) Ord= 1; // LL/RR else if( (uPDG>0 && nPDG>0 && mPDG<0 && sPDG<0) || (uPDG<0 && nPDG<0 && mPDG>0 && sPDG>0) ) Ord=-1; // LR/RL else G4cerr<<"-Warning-G4QFragmentation::AnnihilationOrder: Wrong 22 fusion, L="<cM2="<