source: trunk/source/processes/hadronic/models/parton_string/qgsm/src/G4GammaParticipants.cc@ 1199

Last change on this file since 1199 was 1055, checked in by garnier, 17 years ago

maj sur la beta de geant 4.9.3

File size: 4.7 KB
Line 
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26#include "globals.hh"
27#include "G4GammaParticipants.hh"
28#include "G4LorentzVector.hh"
29#include <utility>
30
31// Class G4GammaParticipants
32
33// J.P. Wellisch, April 2002
34// new participants class for gamma nuclear, with this design more can come with
35// cross-section based, and quasi-eiconal model based modelling
36
37G4VSplitableHadron* G4GammaParticipants::SelectInteractions(const G4ReactionProduct &thePrimary)
38{
39 // Check reaction threshold - goes to CheckThreshold
40 G4VSplitableHadron* aProjectile = new G4QGSMSplitableHadron(thePrimary, TRUE); // @@@ check the TRUE
41
42 const std::vector<G4Nucleon *> & theTargetNuc = theNucleus->GetNucleons();
43 G4LorentzVector aPrimaryMomentum(thePrimary.GetMomentum(), thePrimary.GetTotalEnergy());
44 if((!(aPrimaryMomentum.e()>-1)) && (!(aPrimaryMomentum.e()<1)) )
45 {
46 throw G4HadronicException(__FILE__, __LINE__,
47 "G4GammaParticipants::SelectInteractions: primary nan energy.");
48 }
49 G4double s = (aPrimaryMomentum + theTargetNuc[0]->Get4Momentum()).mag2();
50 G4double ThresholdMass = thePrimary.GetMass() + theTargetNuc[0]->GetDefinition()->GetPDGMass();
51 ModelMode = SOFT;
52 if (sqr(ThresholdMass + ThresholdParameter) > s)
53 {
54 ModelMode = DIFFRACTIVE;
55 //throw G4HadronicException(__FILE__, __LINE__, "Initial energy is too low. The 4-vectors of the input are inconsistant with the particle masses.");
56 }
57 if (sqr(ThresholdMass + QGSMThreshold) > s) // thus only diffractive in cascade!
58 {
59 ModelMode = DIFFRACTIVE;
60 }
61
62 // first find the collisions HPW
63 std::for_each(theInteractions.begin(), theInteractions.end(), DeleteInteractionContent());
64 theInteractions.clear();
65 G4int totalCuts = 0;
66
67 #ifdef debug_G4GammaParticipants
68 G4double eK = thePrimary.GetKineticEnergy()/GeV;
69 G4int nucleonCount = theTargetNuc.size(); // debug
70 #endif
71
72 G4int theCurrent = static_cast<G4int> (theTargetNuc.size()*G4UniformRand());
73 G4Nucleon * pNucleon = theTargetNuc[theCurrent];
74 G4QGSMSplitableHadron* aTarget = new G4QGSMSplitableHadron(*pNucleon);
75 theTargets.push_back(aTarget);
76 pNucleon->Hit(aTarget);
77 if ( (0.06 > G4UniformRand() &&(ModelMode==SOFT)) || (ModelMode==DIFFRACTIVE ) )
78 {
79 // diffractive interaction occurs
80 if(IsSingleDiffractive())
81 {
82 theSingleDiffExcitation.ExciteParticipants(aProjectile, aTarget);
83 }
84 else
85 {
86 theDiffExcitaton.ExciteParticipants(aProjectile, aTarget);
87 }
88 G4InteractionContent * aInteraction = new G4InteractionContent(aProjectile);
89 aInteraction->SetTarget(aTarget);
90 theInteractions.push_back(aInteraction);
91 aInteraction->SetNumberOfDiffractiveCollisions(1);
92 totalCuts += 1;
93 }
94 else
95 {
96 // nondiffractive soft interaction occurs
97 aTarget->IncrementCollisionCount(1);
98 aProjectile->IncrementCollisionCount(1);
99 G4InteractionContent * aInteraction = new G4InteractionContent(aProjectile);
100 aInteraction->SetTarget(aTarget);
101 aInteraction->SetNumberOfSoftCollisions(1);
102 theInteractions.push_back(aInteraction);
103 totalCuts += 1;
104 }
105 return aProjectile;
106}
Note: See TracBrowser for help on using the repository browser.