// // ******************************************************************** // * 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: G4QIonIonCollision.cc,v 1.9 2010/06/19 07:46: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 "G4QIonIonCollision.hh" // Promoting model parameters from local variables class properties @@(? M.K.) // Definition of static parameters G4int G4QIonIonCollision::nCutMax=7; G4double G4QIonIonCollision::stringTension=1.*GeV/fermi; G4double G4QIonIonCollision::tubeDensity =1./fermi; // Parameters of diffractional fragmentation G4double G4QIonIonCollision::widthOfPtSquare=-0.75*GeV*GeV; // ptWidth2 forStringExcitation G4QIonIonCollision::G4QIonIonCollision(G4QNucleus &pNucleus, const G4QNucleus &tNucleus) { static const G4double mProt= G4QPDGCode(2212).GetMass(); // Mass of proton static const G4double mPi0= G4QPDGCode(111).GetMass(); // Mass of Pi0 theWorld= G4QCHIPSWorld::Get(); // Get a pointer to the CHIPS World theResult = new G4QHadronVector; // Define theResultingHadronVector G4bool stringsInitted=false; // Strings are initiated G4LorentzRotation toZ; // Lorentz Transformation to the projectileSystem G4LorentzVector proj4M=pNucleus.Get4Momentum(); // Projectile nucleus 4-momentum in LS //G4double projM=pNucleus.GetGSMass(); // Ground state mass of the projectile nucleus G4double targM=tNucleus.GetGSMass(); // Ground state mass of the target nucleus #ifdef edebug G4cout<<"G4QIn::Constr:*Called*,pA="<LS (at the end) 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) theTargNucleus=G4QNucleus(tZ,tN); // Create theTargNucleus to Move From LS to CM theTargNucleus.InitByPDG(tPDG); // Reinit the Nucleus for the new Attempt? theTargNucleus.Init3D(); // 3D-initialisation(nucleons)ofTheTGNucleusClone #ifdef debug G4cout<<"G4QIonIonCollision::Constr:TargNuclMom="< Only diffractive interaction { #ifdef debug G4cout<<"G4QIonIonCollision::Constr: ***OnlyDiffraction***, ThM="<sqrt(s)="< only Diffraction is possible"<GetPosition(); // Position of the tNucleon WRTo tNucl G4double dImpX = pImpX-tNucR.x(); G4double dImpY = pImpY-tNucR.y(); G4double Distance2=dImpX*dImpX+dImpY*dImpY; #ifdef sdebug G4cout<<"G4QIonIonCollision::Construct: s="<EMC-->G4QIonIonCollision::Construct: TargNucleon is filled, 4M/PDG=" <Get4Momentum()<GetPDGCode()< G4UniformRand() && ModelMode==SOFT ) || ModelMode==DIFFRACTIVE) { // ------------->>>> diffractive interaction @@ IsSingleDiffractive called once if(IsSingleDiffractive()) ExciteSingDiffParticipants(aProjectile, aTarget); else ExciteDiffParticipants(aProjectile, aTarget); G4QInteraction* anInteraction = new G4QInteraction(aProjectile); anInteraction->SetTarget(aTarget); anInteraction->SetNumberOfDiffractiveCollisions(1); // Why not increment? M.K.? curInteractions.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<<"G4QIonIonCollision::Constr: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; // tNuc delete [] running; #ifdef debug G4cout<<"G4QIonIonCollision::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? aProjectile->IncrementCollisionCount(nCut+1); G4QInteraction* anInteraction = new G4QInteraction(aProjectile); anInteraction->SetTarget(aTarget); anInteraction->SetNumberOfSoftCollisions(nCut+1); curInteractions.push_back(anInteraction); // Now curInteractions are not empty totalCuts += nCut+1; #ifdef debug G4cout<<"G4QIonIonCollision::Constr:NLOOP SoftInteract,tC="<LS) return; } // // ------------------ now build the parton pairs for the strings ------------------ // for(G4int i=0; iSplitHadrons(); #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-G4QIonIonCollision::Construct: Interaction#"<Get4Momentum()-pSP<<",dT4M="<Get4Momentum()-tSP<>>>>>>> make soft collisions (ordering is vital) // G4QInteractionVector::iterator it; #ifdef debug G4cout<<"G4QIonIonCollision::Constr: Creation ofSoftCollisionPartonPair STARTS"<GetNumberOfSoftCollisions(); #ifdef debug G4cout<<"G4QIonIonCollision::Construct: #0f SoftCollisions ="<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<<"--->G4QIonIonCollision::Constr: 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<<"G4QIonIonCollision::Constr: 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<<"G4QIonIonCollision::Constr: 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<<"G4QIonIonCollision::Constr: target Diffractive PartonPair's filled"<>>>>>>>>>>>>> clean-up Interactions, if necessary // std::for_each(theInteractions.begin(),theInteractions.end(), DeleteQInteraction()); theInteractions.clear(); #ifdef debug G4cout<<"G4QIonIonCollision::Construct: Temporary objects are cleaned up"<>>>>>>>>>>>G4QIonIonCollision::Construct: >>>>>> Strings are created "<LorentzRotate(toLab); // Recove Z-direction in LS ("LS"->LS) theProjNucleus.DoLorentzRotation(toLab); // Recove Z-dir in LS ("LS"->LS) for ProjNucleus theTargNucleus.DoLorentzRotation(toLab); // Recove Z-dir in LS ("LS"->LS) for TargNucleus // Now everything is in LS system #ifdef edebug G4LorentzVector sm=theProjNucleus.Get4Momentum()+theTargNucleus.Get4Momentum();// NucInLS G4int rCg=totChg-theProjNucleus.GetZ()-theTargNucleus.GetZ(); G4int rBC=totBaN-theProjNucleus.GetA()-theTargNucleus.GetA(); G4int nStrs=strings.size(); G4cout<<"-EMCLS-G4QIonIonCollision::Constr:#ofS="<Get4Momentum(); sm+=strI4M; G4int sChg=strings[i]->GetCharge(); rCg-=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); rBC-=sBaN; G4cout<<"-EMCLS-G4QInel::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<<"G4QIonIonCollision::Construct: Needs Fusion? cLPDG="< GSM="< miM) bad=false; // String is OK } if(bad) // String should be merged with others { #ifdef debug G4cout<<"G4QInel::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 pS4M=(*pst)->Get4Momentum()+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<<"->G4QIonIonCollision::Construct: sum4M="< 7 && ( (pLPDG<0 && (-pLPDG==L1 || -pLPDG==L2) ) || (pRPDG<0 && (-pRPDG==L1 || -pRPDG==L2) ) ) ) af=1; else if(cRPDG > 7 && ( (pLPDG<0 && (-pLPDG==R1 || -pLPDG==R2) ) || (pRPDG<0 && (-pRPDG==R1 || -pRPDG==R2) ) ) ) af=2; else if(cLPDG <-7 && ( (pLPDG>0 && ( pLPDG==L1 || pLPDG==L2) ) || (pRPDG>0 && ( pRPDG==L1 || pRPDG==L2) ) ) ) af=3; else if(cRPDG <-7 && ( (pLPDG>0 && ( pLPDG==R1 || pLPDG==R2) ) || (pRPDG>0 && ( pRPDG==R1 || pRPDG==R2) ) ) ) af=4; #ifdef debug else G4cout<<"G4QIonIonCollision::Constr: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<<"-G4QIonIonCollision::Constr: 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<<"-G4QIonIonCollision::Constr: 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<<"-G4QIonIonCollision::Constr: 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-G4QIonIonCollision::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=theProjNucleus.Get4Momentum()+theTargNucleus.Get4Momentum();//NucInLS G4int rCh=totChg-theProjNucleus.GetZ()-theTargNucleus.GetZ(); G4int rBa=totBaN-theProjNucleus.GetA()-theTargNucleus.GetA(); G4int nStri=strings.size(); G4cout<<"-EMCLS-G4QIn::Const: FinalConstruct, #ofSt="<Get4Momentum(); u4M+=strI4M; G4int sChg=strings[i]->GetCharge(); rCh-=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); rBa-=sBaN; G4cout<<"-EMCLS-G4QIonIonCollision::Construct: St#"<G4QIonIonCollision::Fragment: ***Called***, Res="<size(); // Find out if there're hadrons #ifdef edebug G4int nQm=theQuasmons.size(); G4LorentzVector totLS4M=theProjNucleus.Get4Momentum()+theTargNucleus.Get4Momentum(); //LS G4int totChg=theProjNucleus.GetZ()+theTargNucleus.GetZ(); G4int totBaN=theTargNucleus.GetA()+theTargNucleus.GetA(); G4cout<<"-EMCLS-G4QIn::Fragment: CHECKRecovery, #ofS="<G4QIonIonCollision::Fragm: #OfStr="<G4QIonIonCollision::Fragm:**Quasi-Elastic**, #OfResult="<clear(); } G4LorentzVector rp4M=theProjNucleus.Get4Momentum(); // Nucleus 4-momentum in LS G4int rpPDG=theProjNucleus.GetPDG(); // Nuclear PDG G4QHadron* resPNuc = new G4QHadron(rpPDG,rp4M); // Nucleus -> Hadron theResult->push_back(resPNuc); // Fill the residual nucleus G4LorentzVector rt4M=theTargNucleus.Get4Momentum(); // Nucleus 4-momentum in LS G4int rtPDG=theTargNucleus.GetPDG(); // Nuclear PDG G4QHadron* resTNuc = new G4QHadron(rtPDG,rt4M); // Nucleus -> Hadron theResult->push_back(resTNuc); // 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<<"***>G4QIonIonCollision::Fragm:beforeEnv, #OfQ="<Get4Momentum(); // 4-Momentum of the Nucleuz G4int resNucPDG= resNuc->GetPDGCode(); // PDG Code of the Nucleus 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 pdebug G4cout<<"G4QIonIonCollision::Fragm:#OfRemainingHadron="< DELETED --->----------+ #ifdef pdebug G4cout<<"G4QIonIonCollision::Fragm: nucE="<size(); // #ofHadrons in the Nuclear Fragmentation | for(G4int j=0; jBoost(nucVel); // Boost it back to Laboratory System | theResult->push_back(curHadron); // Transfer it to the result | } // | delete output; // Delete the OUTPUT <-----<-----<-----<---+ } } else if(!striNum) G4cout<<"-Warning-G4QIonIonCollision::Fragment:NothingWasDone"<G4QIonIonCollision::Fragment: Final #OfResult="<size()<size(); G4cout<<"-EMCLS-G4QIonIonCollision::Fragment: #ofHadr="<Get4Momentum(); f4M+=hI4M; G4int hChg=(*theResult)[i]->GetCharge(); fCh-=hChg; G4int hBaN=(*theResult)[i]->GetBaryonNumber(); fBN-=hBaN; G4cout<<"-EMCLS-G4QIonIonCollision::Fragment: Hadron#"<Get4Momentum(); totLS4M+=strI4M; G4int sChg=strings[i]->GetCharge(); totChg+=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); totBaN+=sBaN; G4cout<<"-EMCLS-G4QIonIonCollision::Breeder: St#"<G4QIonIonCollision::Breed:1stTest,S#"<G4QIonIonCollision::Breed:*TotQ*,QC="<push_back(resPNuc); // Fill the residual projectile nucleus G4LorentzVector rt4M=theTargNucleus.Get4Momentum(); // Nucleus 4-momentum in LS G4int rtPDG=theTargNucleus.GetPDG(); G4QHadron* resTNuc = new G4QHadron(rtPDG,rt4M); theResult->push_back(resTNuc); // Fill the residual target nucleus return; } for (G4int astring=0; astring < nOfStr; astring++) { #ifdef edebug G4LorentzVector sum=theProjNucleus.Get4Momentum()+theTargNucleus.Get4Momentum(); //inLS G4int rChg=totChg-theProjNucleus.GetZ()-theTargNucleus.GetZ(); G4int rBaN=totBaN-theProjNucleus.GetA()-theTargNucleus.GetA(); G4int nOfHadr=theResult->size(); G4cout<<"-EMCLS-G4QIonIonCollision::Breed:#ofSt="<Get4Momentum(); sum+=strI4M; G4int sChg=strings[i]->GetCharge(); rChg-=sChg; G4int sBaN=strings[i]->GetBaryonNumber(); rBaN-=sBaN; G4cout<<"-EMCLS-G4QI::Breed:S#"<Get4Momentum(); sum+=hI4M; G4int hChg=(*theResult)[i]->GetCharge(); rChg-=hChg; G4int hBaN=(*theResult)[i]->GetBaryonNumber(); rBaN-=hBaN; G4cout<<"-EMCLS-G4QIn::Breed: H#"<G4QIonIonCollision::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<<"*G4QIonIonCollision::Breed:CL="< resRR=ReducePair((-nPDG)/100, mPDG/100); G4int newCR=resRR.first; G4int newPR=resRR.second; if(!newCR || !newPR) { G4cerr<<"*G4QIonIonCollision::Breed: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<<"*G4QIonIonCollision::Breed:CL="< resRR=ReducePair(nPDG/100, (-mPDG)/100); G4int newCR=resRR.first; G4int newPR=resRR.second; if(!newCR || !newPR) { G4cerr<<"*G4QIonIonCollision::Breed: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<<"*G4QIonIonCollision::Breed:CL="< resRR=ReducePair((-nPDG)/100, uPDG/100); G4int newCR=resRR.first; G4int newPL=resRR.second; if(!newCR || !newPR) { G4cerr<<"*G4QIonIonCollision::Breed: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<<"*G4QIonIonCollision::Breed:CL="< resRR=ReducePair(nPDG/100, (-uPDG)/100); G4int newCR=resRR.first; G4int newPL=resRR.second; if(!newCR || !newPR) { G4cerr<<"*G4QIonIonCollision::Breed: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<<"G4QInel::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<<"G4QIonIonCollision::Breeder: StringCand#"< fuse strings { #ifdef debug G4cout<<"G4QInel::Breeder: StPartner#"<"<Get4Momentum()<Get4Momentum().m()<>>>G4QIonIonCollision::Breed: 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->>G4QIonIonCollision::Breed:String=HadrChiPro1's filled,f4M=" <>G4QIonIonCollision::Breed:String=HadrChiPro2's filled,s4M=" <>G4QIonIonCollis::Breed:String=Hadr,H#"< to Quasm="<>>G4QIonIonCollision::Breeder: SQC="<>>G4QIonIonCollision::Breeder: minMass="<>>G4QIonIonCollision::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->>G4QIonIonCollision::Breed:Str=2HadrAR Prod-F is filled, f4M=" <>G4QIonIonCollision::Breed:Str=2HadrAR Prod-S is filled, s4M=" <>G4QIonIonCollision::Breed: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->>>G4QIonIonCollision::Breed:Str=Hadr Prod-F's filled,f4M=" <>>G4QIonIonCollision::Breed:Str=Hadr Prod-S's filled,s4M=" <h1="<push_back(sHad); // The original string-hadron is filled #ifdef debug G4cout<<"-EMC->>>G4QIonIonCollision::Breeder:Str=Hadr Filled, 4M=" <Get4Momentum()<<", M="<>>G4QIonIonCollision::Breeder:*Corrected* String->Hadr="<0.) } // End of IF(Can try to correct by String-String) #ifdef debug else G4cerr<<"***G4QIonIonCollision::Breed:**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<<"G4QIonIonCollision::Breeder: theH="<h1=("<Set4Momentum(sp4M); #ifdef debug G4cout<<"-EMC->...>G4QIonIonCollision::Breed: 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<<"G4QInelast::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->>>G4QIonIonCollision::Breed: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->>G4QIonIonCollision::Breed: CorStrHadr Prod-1 is filled, f4M=" <>>G4QIonIonCollision::Breed:CorStrHadr Prod-2 is filled, n4M=" <>>>>>G4QIonIonCollision::Breeder: CorStr=Hadr is Filled, 4M=" <Get4Momentum()<>>G4QIonIonCollision::Breeder:*Corrected* String+Hadr="<>>G4QIonIonCollision::Breeder: Str+Hadr Failed, 4M="<G4QIonIonCollision::Breed:S#"<G4QIonIonCollision::Breed:AllStrings are summed up in a Quasmon"<>>>>>>>G4QIonIonCollision::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 #ifdef edebug G4QHadron* prodH =(*tmpQHadVec)[aH]; G4LorentzVector p4M=prodH->Get4Momentum(); G4int PDG=prodH->GetPDGCode(); G4int Chg=prodH->GetCharge(); G4int BaN=prodH->GetBaryonNumber(); curH4M-=p4M; curString4M-=p4M; curStrChg-=Chg; curStrBaN-=BaN; curHCh-=Chg; curHBN-=BaN; G4cout<<"-EMC->>>>G4QIonIonCollision::Breed:Str*Filled, 4M="<>>>>>G4QIonIonCollision::Breeder: curH filled 4M="<GetPDGCode()<<", Chg="<Get4Momentum(); s4M+=hI4M; G4int hChg=(*theResult)[i]->GetCharge(); rCh-=hChg; G4int hBaN=(*theResult)[i]->GetBaryonNumber(); rBN-=hBaN; G4cout<<"-EMCLS-G4QIonIonCollision::Breeder: Hadron#"<G4QIonIonCollision::Breeder: TRY hPDG="<G4QIonIonCollision::Breeder:Exclude,4M="<<(*nih)->Get4Momentum() <<", & 4m="<<(*mih)->Get4Momentum()< mih) // Exclude nucleon first { theResult->erase(nih); // erase Baryon from theResult theResult->erase(mih); // erase Meson from theResult } else // Exclude meson first { theResult->erase(mih); // erase Baryon from theResult theResult->erase(nih); // erase Meson from theResult } #ifdef debug G4cout<<"%->G4QI::Breed: BeforeLOOP, dE="<G4QIonIonCollision::Breed:Exclude,4M="<erase(ih); // erase Hadron from theResult --ih; } } } G4Quasmon* softQuasmon = new G4Quasmon(qQC, q4M); // SoftPart -> Quasmon #ifdef debug G4cout<<"%->G4QIonIonCollision::Breed: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-G4QIonIonCollision::Breeder:#ofHadr="<Get4Momentum(); f4M+=hI4M; G4int hChg=(*theResult)[i]->GetCharge(); fCh-=hChg; G4int hBaN=(*theResult)[i]->GetBaryonNumber(); fBN-=hBaN; G4cout<<"-EMCLS-G4QIonIonCollision::Breeder: Hadron#"<GetMass2()*(1.-perCent); // Isn't it too big reduction? M.K. } else { #ifdef debug G4cout<<"---1/2---G4QIonIonCollision::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<<"G4QIonIonCollision::ExciteSingDiffParticipants: *1*abortCollision*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<<"***G4QIonIonCollision::SumPartonPDG: PDG1="< G4QIonIonCollision::ReducePair(G4int P1, G4int P2) const { #ifdef debug G4cout<<"G4QIonIonCollision::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-G4QIonIonCollision::AnnihilationOrder: Wrong 22 fusion, L=" < 7) // Fuse pLDiQ { #ifdef debug G4cout<<"G4QIonIonCollision::AnnihOrder:pLDiQ, sPDG="<cM2="<