G4QGSModel.icc

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 
00027 //****************************************************************************************************************
00028 template<class ParticipantType>
00029 G4QGSModel<ParticipantType>::G4QGSModel() 
00030     {
00031         G4VPartonStringModel::SetThisPointer(this);
00032         SetEnergyMomentumCheckLevels(2*CLHEP::perCent, 150*CLHEP::MeV);
00033     }
00034 template<class ParticipantType>
00035 G4QGSModel<ParticipantType>::G4QGSModel(const G4QGSModel &right)
00036     {
00037         G4VPartonStringModel::SetThisPointer(this);
00038         std::pair<G4double, G4double> levels=right.GetEnergyMomentumCheckLevels();
00039         SetEnergyMomentumCheckLevels(levels.first, levels.second);
00040     }
00041 
00042 template<class ParticipantType>
00043 G4QGSModel<ParticipantType>& G4QGSModel<ParticipantType>::operator=(const G4QGSModel &right)
00044     {
00045        if (this != &right )
00046        {
00047          G4VPartonStringModel::SetThisPointer(this);
00048          std::pair<G4double, G4double> levels=right.GetEnergyMomentumCheckLevels();
00049          SetEnergyMomentumCheckLevels(levels.first, levels.second);
00050       }
00051     }
00052 template<class ParticipantType>
00053 G4QGSModel<ParticipantType>::~G4QGSModel()
00054     {
00055     }
00056 
00057 template<class ParticipantType>
00058 void G4QGSModel<ParticipantType>::Init(const G4Nucleus & aNucleus, const G4DynamicParticle & aProjectile)
00059     {
00060      // clean-up and consistency with design, HPW Feb 1999
00061     theParticipants.Init(aNucleus.GetA_asInt(),aNucleus.GetZ_asInt());
00062     theCurrentVelocity.setX(0);    
00063     theCurrentVelocity.setY(0); 
00064      // HPW Feb 1999 
00065      // this is an approximation, neglecting the motion of nucleons in the nucleus & p,n mass differences. @@@
00066 //    G4double vz_old = aProjectile.Get4Momentum().pz()/
00067 //                  (aProjectile.Get4Momentum().e() + G4Proton::Proton()->GetPDGMass());
00068     G4double nCons = 1;
00069     if(std::abs(aProjectile.GetDefinition()->GetBaryonNumber()) !=0) 
00070     {
00071       nCons = std::abs(aProjectile.GetDefinition()->GetBaryonNumber());
00072     }
00073     G4double pz_per_projectile = aProjectile.Get4Momentum().pz()/nCons;
00074 //    G4double e_per_projectile = aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
00075 //             e_per_projectile /=nCons*nCons;
00076 //           e_per_projectile += G4Proton::Proton()->GetPDGMass()*G4Proton::Proton()->GetPDGMass();
00077     G4double e_per_projectile = aProjectile.Get4Momentum()*aProjectile.Get4Momentum();
00078              e_per_projectile += aProjectile.Get4Momentum().vect()*aProjectile.Get4Momentum().vect();
00079              e_per_projectile /=nCons*nCons;
00080              e_per_projectile = std::sqrt(e_per_projectile);
00081              e_per_projectile += G4Proton::Proton()->GetPDGMass();
00082     G4double vz = pz_per_projectile/e_per_projectile;
00083 //--DEBUG--    G4cout << "IncomingMomentum - vz "<<aProjectile.Get4Momentum()<< ", " << vz <<G4endl;
00084     theCurrentVelocity.setZ(vz);
00085     theParticipants.DoLorentzBoost(-theCurrentVelocity); 
00086     G4LorentzVector Mom = aProjectile.Get4Momentum();
00087     Mom.boost(-theCurrentVelocity);
00088     G4ReactionProduct theProjectile;   
00089     theProjectile.SetDefinition(aProjectile.GetDefinition());
00090     theProjectile.SetTotalEnergy(Mom.e());
00091     theProjectile.SetMomentum(Mom.vect());
00092 //--DEBUG--    G4cout << "PreInteractionMomentum "<<Mom<<G4endl;
00093     theParticipants.BuildInteractions(theProjectile);
00094     theParticipants.GetWoundedNucleus()->DoLorentzBoost(theCurrentVelocity);
00095     }
00096 
00097 template<class ParticipantType>
00098 G4ExcitedStringVector * G4QGSModel<ParticipantType>::GetStrings()
00099 {
00100   // clean-up and consistancy with design, HPW Feb 1999
00101   // also fixing a memory leak, removing unnecessary caching, and 
00102   // streamlining of logic
00103   G4PartonPair* aPair;
00104   G4ExcitedStringVector* theStrings = new G4ExcitedStringVector;
00105   G4ExcitedString * aString;
00106   while( (aPair = theParticipants.GetNextPartonPair()) )
00107   {
00108     if (aPair->GetCollisionType() == G4PartonPair::DIFFRACTIVE)
00109     {
00110       aString = theDiffractiveStringBuilder.BuildString(aPair);
00111       // G4cout << "diffractive "<<aString->Get4Momentum()<<G4endl;
00112     }
00113     else
00114     {
00115       aString = theSoftStringBuilder.BuildString(aPair);
00116       // G4cout << "soft "<<aString->Get4Momentum()<<G4endl;
00117     }
00118 //--DEBUG-- G4cout << " QGSModel.icc::GetStrings() theCurrentVelocity " << theCurrentVelocity << G4endl;   
00119     aString->Boost(theCurrentVelocity);  
00120     theStrings->push_back(aString);
00121     delete aPair;
00122   }
00123 //--DEBUG--  G4cout << G4endl;
00124 //  for(G4int i=0; i<theStrings->size(); i++)
00125 //  {
00126 //   G4cout << "String = "<<theStrings->operator[](i)->Get4Momentum()<<G4endl;
00127 //  }
00128   return theStrings;
00129 }
00130 
00131 template<class ParticipantType>
00132 G4V3DNucleus* G4QGSModel<ParticipantType>::GetWoundedNucleus() const
00133 {
00134   return theParticipants.GetWoundedNucleus();
00135 }
00136 
00137 template<class ParticipantType>
00138 void G4QGSModel<ParticipantType>::ModelDescription(std::ostream& outFile) const
00139 {
00140   outFile << "The Quark-Gluon String (QGS) model simulates the interaction\n"
00141           << "of protons, neutrons, pions and kaons with nuclei in the\n"
00142           << "approximate energy range 20 GeV to 50 TeV. The model handles\n"
00143           << "the selection of collision partners, splitting of the nucleons\n"
00144           << "into quarks and di-quarks, the formation and excitation of\n"
00145           << "quark-gluon strings, string hadronization and diffractive dissociation.\n";
00146 }
00147 //********************************************************************************************************************* 
00148 

Generated on Mon May 27 17:49:34 2013 for Geant4 by  doxygen 1.4.7