// // ******************************************************************** // * 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. * // ******************************************************************** // // !!! Was used in QBBC PL, NOW it is not. Must be absolete !!! // ============================================================ //#define debug //#define pdebug #include "G4StringChipsInterface.hh" #include "globals.hh" #include #include #include "G4KineticTrackVector.hh" #include "G4Nucleon.hh" #include "G4LorentzRotation.hh" G4StringChipsInterface::G4StringChipsInterface() { #ifdef CHIPSdebug G4cout << "Please enter the energy loss per fermi in GeV"<> theEnergyLossPerFermi; #endif #ifdef debug G4cout<<"G4StringChipsInterface::Constructor is called"<size() == 1) throw G4HadronicException(__FILE__, __LINE__, "G4StringChipsInterface: Only one particle from String models!"); // Calculate the mean energy lost std::pair theImpact = theNucleus->RefetchImpactXandY(); G4double impactX = theImpact.first; G4double impactY = theImpact.second; G4double inpactPar2 = impactX*impactX + impactY*impactY; G4double radius2 = theNucleus->GetNuclearRadius(5*perCent); radius2 *= radius2; G4double pathlength = 0; if(radius2 - inpactPar2>0) pathlength = 2.*std::sqrt(radius2 - inpactPar2); G4double theEnergyLostInFragmentation = theEnergyLossPerFermi*pathlength/fermi; // now select all particles in range std::list > theSorted; std::list >::iterator current; for(unsigned int secondary = 0; secondarysize(); secondary++) { G4LorentzVector a4Mom = theSecondaries->operator[](secondary)->Get4Momentum(); #ifdef CHIPSdebug G4cout <<"ALL STRING particles "<operator[](secondary)->GetDefinition()->GetPDGCharge()<<" " << theSecondaries->operator[](secondary)->GetDefinition()->GetPDGEncoding()<<" " << a4Mom < it; it.first = toSort; it.second = theSecondaries->operator[](secondary); G4bool inserted = false; for(current = theSorted.begin(); current!=theSorted.end(); current++) { if((*current).first > toSort) { theSorted.insert(current, it); inserted = true; break; } } if(!inserted) { theSorted.push_front(it); } } G4LorentzVector proj4Mom(0.,0.,0.,0.); // @@ Use the G4QContent class, which is exactly (nD,nU,nS,nAD,nAU,nAS) ! // The G4QContent class is a basic clas in CHIPS (not PDG Code as in GEANT4), // so in CHIPS on can has a hadronic obgect (Quasmon) with any Quark Content. // As a simple extantion for the hadron (which is a special case for Hadron) // there is a clas G4QChipolino, which is a Quasmon, which can decay in two // hadrons. In future the three-hadron class can be added... G4int nD = 0; G4int nU = 0; G4int nS = 0; G4int nAD = 0; G4int nAU = 0; G4int nAS = 0; std::list >::iterator firstEscaping = theSorted.begin(); G4double runningEnergy = 0; G4int particleCount = 0; G4LorentzVector theLow = (*(theSorted.begin())).second->Get4Momentum(); G4LorentzVector theHigh; #ifdef CHIPSdebug G4cout << "CHIPS ENERGY LOST "<GetDefinition()->GetQuarkContent(3)!=0 || (*current).second->GetDefinition()->GetAntiQuarkContent(3) !=0) { G4KineticTrack * aResult = (*current).second; G4ParticleDefinition * pdef=aResult->GetDefinition(); secondaries = NULL; if ( pdef->GetPDGWidth() > 0 && pdef->GetPDGLifeTime() < 5E-17*s ) { secondaries = aResult->Decay(); } if ( secondaries == NULL ) { theSec = new G4ReactionProduct(aResult->GetDefinition()); G4LorentzVector current4Mom = aResult->Get4Momentum(); theSec->SetTotalEnergy(current4Mom.t()); theSec->SetMomentum(current4Mom.vect()); theResult->push_back(theSec); } else { for (unsigned int aSecondary=0; aSecondarysize(); aSecondary++) { theSec = new G4ReactionProduct(secondaries->operator[](aSecondary)->GetDefinition()); G4LorentzVector current4Mom = secondaries->operator[](aSecondary)->Get4Momentum(); theSec->SetTotalEnergy(current4Mom.t()); theSec->SetMomentum(current4Mom.vect()); theResult->push_back(theSec); } std::for_each(secondaries->begin(), secondaries->end(), DeleteKineticTrack()); delete secondaries; } continue; } runningEnergy += (*current).second->Get4Momentum().t(); if(runningEnergy > theEnergyLostInFragmentation) break; #ifdef CHIPSdebug G4cout <<"ABSORBED STRING particles "<second->GetDefinition()->GetPDGCharge()<<" " << current->second->GetDefinition()->GetPDGEncoding()<<" " << current->second->Get4Momentum() <second->Get4Momentum().rapidity()< G4QContent class) nD += (*current).second->GetDefinition()->GetQuarkContent(1); nU += (*current).second->GetDefinition()->GetQuarkContent(2); nS += (*current).second->GetDefinition()->GetQuarkContent(3); nAD += (*current).second->GetDefinition()->GetAntiQuarkContent(1); nAU += (*current).second->GetDefinition()->GetAntiQuarkContent(2); nAS += (*current).second->GetDefinition()->GetAntiQuarkContent(3); } // construct G4QContent #ifdef CHIPSdebug G4cout << "Quark content: d="<StartLoop(); G4Nucleon * aNucleon; G4int resA = 0; G4int resZ = 0; G4ThreeVector hitMomentum(0,0,0); G4double hitMass = 0; G4int hitCount = 0; while((aNucleon = theNucleus->GetNextNucleon())) { if(!aNucleon->AreYouHit()) { resA++; resZ+=G4int (aNucleon->GetDefinition()->GetPDGCharge()); } else { hitMomentum += aNucleon->GetMomentum().vect(); hitMass += aNucleon->GetMomentum().m(); hitCount ++; } } G4int targetPDGCode = 90000000 + 1000*resZ + (resA-resZ); G4double targetMass = theNucleus->GetMass(); targetMass -= hitMass; G4double targetEnergy = std::sqrt(hitMomentum.mag2()+targetMass*targetMass); // !! @@ Target should be at rest: hitMomentum=(0,0,0) @@ !! M.K. G4LorentzVector targ4Mom(-1.*hitMomentum, targetEnergy); // construct the quasmon // G4int nop = 122; // clusters up to Alpha cluster G4int nop = 152; // V.Ivanchenko set the same parameter as for all CHIPS models G4double fractionOfSingleQuasiFreeNucleons = 0.5; // It is A-dependent (C=.85, U=.40) G4double fractionOfPairedQuasiFreeNucleons = 0.05; G4double clusteringCoefficient = 5.; G4double temperature = 180.; G4double halfTheStrangenessOfSee = 0.3; // = s/d = s/u G4double etaToEtaPrime = 0.3; G4QNucleus::SetParameters(fractionOfSingleQuasiFreeNucleons, fractionOfPairedQuasiFreeNucleons, clusteringCoefficient); G4Quasmon::SetParameters(temperature, halfTheStrangenessOfSee, etaToEtaPrime); #ifdef CHIPSdebug G4cout << "G4QNucleus parameters "<< fractionOfSingleQuasiFreeNucleons << " " << fractionOfPairedQuasiFreeNucleons << " "<< clusteringCoefficient << G4endl; G4cout << "G4Quasmon parameters "<< temperature << " "<< halfTheStrangenessOfSee << " " <Fragment(); } catch(G4HadronicException & aR) { G4cerr << "Exception thrown passing through G4ChiralInvariantPhaseSpace "<Get4Momentum()<<" "<GetPDGCode()<GetDefinition(); secondaries = NULL; if ( pdef->GetPDGWidth() > 0 && pdef->GetPDGLifeTime() < 5E-17*s ) { secondaries = aResult->Decay(); } if ( secondaries == NULL ) { theSec = new G4ReactionProduct(aResult->GetDefinition()); G4LorentzVector current4Mom = aResult->Get4Momentum(); current4Mom = toLab*current4Mom; current4Mom.boost(targ4Mom.boostVector()); theSec->SetTotalEnergy(current4Mom.t()); theSec->SetMomentum(current4Mom.vect()); theResult->push_back(theSec); } else { for (unsigned int aSecondary=0; aSecondarysize(); aSecondary++) { theSec = new G4ReactionProduct(secondaries->operator[](aSecondary)->GetDefinition()); G4LorentzVector current4Mom = secondaries->operator[](aSecondary)->Get4Momentum(); current4Mom = toLab*current4Mom; current4Mom.boost(targ4Mom.boostVector()); theSec->SetTotalEnergy(current4Mom.t()); theSec->SetMomentum(current4Mom.vect()); theResult->push_back(theSec); } std::for_each(secondaries->begin(), secondaries->end(), DeleteKineticTrack()); delete secondaries; } } std::for_each(theSecondaries->begin(), theSecondaries->end(), DeleteKineticTrack()); delete theSecondaries; // now add the quasmon output #ifdef CHIPSdebug G4cout << "Number of particles from string"<size()<size()<size(); particle++) { if(output->operator[](particle)->GetNFragments() != 0) { delete output->operator[](particle); continue; } theSec = new G4ReactionProduct; G4int pdgCode = output->operator[](particle)->GetPDGCode(); G4ParticleDefinition * theDefinition; // Note that I still have to take care of strange nuclei // For this I need the mass calculation, and a changed interface // for ion-table ==> work for Hisaya @@@@@@@ // Then I can sort out the pdgCode. I also need a decau process // for strange nuclei; may be another chips interface if(pdgCode>90000000) { G4int aZ = (pdgCode-90000000)/1000; if (aZ>1000) aZ=aZ%1000; // patch for strange nuclei, to be repaired @@@@ G4int anN = pdgCode-90000000-1000*aZ; if(anN>1000) anN=anN%1000; // patch for strange nuclei, to be repaired @@@@ if(pdgCode==91000000) theDefinition = G4Lambda::LambdaDefinition(); else if(pdgCode==92000000) theDefinition = G4Lambda::LambdaDefinition(); else if(pdgCode==93000000) theDefinition = G4Lambda::LambdaDefinition(); else if(pdgCode==94000000) theDefinition = G4Lambda::LambdaDefinition(); else if(pdgCode==95000000) theDefinition = G4Lambda::LambdaDefinition(); else if(pdgCode==96000000) theDefinition = G4Lambda::LambdaDefinition(); else if(pdgCode==97000000) theDefinition = G4Lambda::LambdaDefinition(); else if(pdgCode==98000000) theDefinition = G4Lambda::LambdaDefinition(); else if(aZ == 0 && anN == 1) theDefinition = G4Neutron::Neutron(); else theDefinition = G4ParticleTable::GetParticleTable()->FindIon(aZ,anN+aZ,0,aZ); } else { theDefinition = G4ParticleTable::GetParticleTable()->FindParticle(output->operator[](particle)->GetPDGCode()); } #ifdef CHIPSdebug G4cout << "Particle code produced = "<< pdgCode <operator[](particle)->Get4Momentum(); current4Mom = toLab*current4Mom; current4Mom.boost(targ4Mom.boostVector()); theSec->SetTotalEnergy(current4Mom.t()); theSec->SetMomentum(current4Mom.vect()); theResult->push_back(theSec); #ifdef CHIPSdebug G4cout <<"CHIPS particles "<GetPDGCharge()<<" " << theDefinition->GetPDGEncoding()<<" " << current4Mom <operator[](particle); } delete output; #ifdef CHIPSdebug G4cout << "Number of particles"<size()<