G4CollisionNN.cc

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 // $Id: G4CollisionNN.cc,v 1.4 2010-03-12 15:45:18 gunter Exp $ //
00028 
00029 
00030 #include "globals.hh"
00031 #include "G4CollisionNN.hh"
00032 #include "G4CollisionComposite.hh"
00033 #include "G4VCollision.hh"
00034 #include "G4CollisionVector.hh"
00035 #include "G4KineticTrack.hh"
00036 #include "G4VCrossSectionSource.hh"
00037 #include "G4XNNTotal.hh"
00038 #include "G4Proton.hh"
00039 #include "G4Neutron.hh"
00040 #include "G4CollisionNNElastic.hh"
00041 #include "G4CollisionnpElastic.hh"
00042 #include "G4CollisionNNToNDelta.hh"
00043 #include "G4CollisionNNToDeltaDelta.hh"
00044 #include "G4CollisionNNToNDeltastar.hh"
00045 #include "G4CollisionNNToDeltaDeltastar.hh"
00046 #include "G4CollisionNNToNNstar.hh"
00047 #include "G4CollisionNNToDeltaNstar.hh"
00048 #include "G4Pair.hh"
00049 
00050 typedef GROUP8(G4CollisionnpElastic, G4CollisionNNElastic, 
00051               G4CollisionNNToNDelta, G4CollisionNNToDeltaDelta, 
00052               G4CollisionNNToNDeltastar, G4CollisionNNToDeltaDeltastar,
00053               G4CollisionNNToNNstar, G4CollisionNNToDeltaNstar) theChannels;
00054 
00055 G4CollisionNN::G4CollisionNN()
00056 { 
00057   components=0;
00058   crossSectionSource = new G4XNNTotal();
00059   G4CollisionComposite::Register aR;
00060   G4ForEach<theChannels>::Apply(&aR, this);
00061 }
00062 
00063 
00064 G4CollisionNN::~G4CollisionNN()
00065 { 
00066   if (components) {
00067         delete components;
00068         components=0;
00069   }
00070   delete crossSectionSource;
00071   crossSectionSource = 0;
00072 }
00073 
00074 
00075 const std::vector<G4String>& G4CollisionNN::GetListOfColliders(G4int ) const
00076 {
00077           throw G4HadronicException(__FILE__, __LINE__, "G4CollisionNN::GetListOfColliders - Argument outside valid range"); 
00078           return colliders1;
00079 }
00080 
00081 
00082 G4double G4CollisionNN::CrossSection(const G4KineticTrack& aTrk1, 
00083                                     const G4KineticTrack& aTrk2) const
00084 {
00085   G4double sigma = 0.;
00086 
00087   // nucleon-nucleon cross-sections made for on-shell particles.
00088   // here we take the kinetic energy as the quantity relevant
00089   // for calculating the scattering cross-sections for off-shell hadrons
00090   
00091   const G4VCrossSectionSource* xSource = GetCrossSectionSource();
00092   G4LorentzVector p1 = aTrk1.Get4Momentum();
00093   G4LorentzVector p2 = aTrk2.Get4Momentum();
00094   G4double t1 = p1.e()-aTrk1.GetActualMass();
00095   G4double t2 = p2.e()-aTrk2.GetActualMass();
00096   p1.setE(t1+aTrk1.GetDefinition()->GetPDGMass());
00097   p2.setE(t2+aTrk2.GetDefinition()->GetPDGMass());
00098   G4KineticTrack trk1(aTrk1);
00099   trk1.Set4Momentum(p1);
00100   G4KineticTrack trk2(aTrk2);
00101   trk2.Set4Momentum(p2);
00102   if( (p1+p2).mag()<aTrk1.GetDefinition()->GetPDGMass()+aTrk2.GetDefinition()->GetPDGMass())
00103   {
00104     return 0.;
00105   }
00106 
00107   if (xSource != 0)
00108     {
00109       // There is a cross section for this Collision
00110       sigma = xSource->CrossSection(trk1,trk2);
00111     }
00112   return sigma;
00113 }
00114 

Generated on Mon May 27 17:47:54 2013 for Geant4 by  doxygen 1.4.7