G4GammaParticipants.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 #include "globals.hh"
00027 #include "G4GammaParticipants.hh"
00028 #include "G4LorentzVector.hh"
00029 #include "G4V3DNucleus.hh"
00030 #include <utility>
00031 
00032 // Class G4GammaParticipants 
00033 
00034 // J.P. Wellisch, April 2002
00035 // new participants class for gamma nuclear, with this design more can come with 
00036 // cross-section based, and quasi-eiconal model based modelling 
00037 //
00038 // 20110805  M. Kelsey -- Follow change to G4V3DNucleus::GetNucleons()
00039 
00040 G4VSplitableHadron* G4GammaParticipants::SelectInteractions(const G4ReactionProduct  &thePrimary) 
00041 {
00042         // Check reaction threshold  - goes to CheckThreshold
00043         G4VSplitableHadron* aProjectile = new G4QGSMSplitableHadron(thePrimary, TRUE); // @@@ check the TRUE
00044 
00045         const std::vector<G4Nucleon>& theTargetNuc = theNucleus->GetNucleons();
00046         G4LorentzVector aPrimaryMomentum(thePrimary.GetMomentum(), thePrimary.GetTotalEnergy());
00047         if((!(aPrimaryMomentum.e()>-1)) && (!(aPrimaryMomentum.e()<1)) )
00048         {
00049                 throw G4HadronicException(__FILE__, __LINE__,
00050                                 "G4GammaParticipants::SelectInteractions: primary nan energy.");
00051         }
00052         G4double S = (aPrimaryMomentum + theTargetNuc[0].Get4Momentum()).mag2();
00053         G4double ThresholdMass = thePrimary.GetMass() + theTargetNuc[0].GetDefinition()->GetPDGMass();
00054         ModelMode = SOFT;
00055         if (sqr(ThresholdMass + ThresholdParameter) > S)
00056         {
00057                 ModelMode = DIFFRACTIVE;
00058                 //throw G4HadronicException(__FILE__, __LINE__, "Initial energy is too low. The 4-vectors of the input are inconsistant with the particle masses.");
00059         }
00060         if (sqr(ThresholdMass + QGSMThreshold) > S) // thus only diffractive in cascade!
00061         {
00062                 ModelMode = DIFFRACTIVE;
00063         }
00064 
00065         // first find the collisions HPW
00066         std::for_each(theInteractions.begin(), theInteractions.end(), DeleteInteractionContent());
00067         theInteractions.clear();
00068         G4int totalCuts = 0;
00069 
00070         #ifdef debug_G4GammaParticipants
00071                 G4double eK = thePrimary.GetKineticEnergy()/GeV;
00072                 G4int nucleonCount = theTargetNuc.size(); // debug
00073         #endif
00074 
00075         G4int theCurrent = static_cast<G4int> (theTargetNuc.size()*G4UniformRand());
00076         const G4Nucleon& pNucleon = theTargetNuc[theCurrent];
00077         G4QGSMSplitableHadron* aTarget = new G4QGSMSplitableHadron(pNucleon);
00078         theTargets.push_back(aTarget);
00079         const_cast<G4Nucleon&>(pNucleon).Hit(aTarget);
00080         if ( (0.06 > G4UniformRand() &&(ModelMode==SOFT)) || (ModelMode==DIFFRACTIVE ) )
00081         {
00082                 // diffractive interaction occurs
00083                 if(IsSingleDiffractive())
00084                 {
00085                         theSingleDiffExcitation.ExciteParticipants(aProjectile, aTarget);
00086                 }
00087                 else
00088                 {
00089                         theDiffExcitaton.ExciteParticipants(aProjectile, aTarget);
00090                 }
00091                 G4InteractionContent * aInteraction = new G4InteractionContent(aProjectile);
00092                 aInteraction->SetTarget(aTarget);
00093                 theInteractions.push_back(aInteraction);
00094                 aInteraction->SetNumberOfDiffractiveCollisions(1);
00095                 totalCuts += 1;
00096         }
00097         else
00098         {
00099                 // nondiffractive soft interaction occurs
00100                 aTarget->IncrementCollisionCount(1);
00101                 aProjectile->IncrementCollisionCount(1);
00102                 G4InteractionContent * aInteraction = new G4InteractionContent(aProjectile);
00103                 aInteraction->SetTarget(aTarget);
00104                 aInteraction->SetNumberOfSoftCollisions(1);
00105                 theInteractions.push_back(aInteraction);
00106                 totalCuts += 1;
00107         }
00108         return aProjectile;
00109 }

Generated on Mon May 27 17:48:19 2013 for Geant4 by  doxygen 1.4.7