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 | |
---|
37 | G4VSplitableHadron* 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 + ThersholdParameter) > s) |
---|
53 | { |
---|
54 | throw G4HadronicException(__FILE__, __LINE__, "Initial energy is too low. The 4-vectors of the input are inconsistant with the particle masses."); |
---|
55 | } |
---|
56 | if (sqr(ThresholdMass + QGSMThershold) > s) // thus only diffractive in cascade! |
---|
57 | { |
---|
58 | ModelMode = DIFFRACTIVE; |
---|
59 | } |
---|
60 | |
---|
61 | // first find the collisions HPW |
---|
62 | std::for_each(theInteractions.begin(), theInteractions.end(), DeleteInteractionContent()); |
---|
63 | theInteractions.clear(); |
---|
64 | G4int totalCuts = 0; |
---|
65 | |
---|
66 | #ifdef debug_G4GammaParticipants |
---|
67 | G4double eK = thePrimary.GetKineticEnergy()/GeV; |
---|
68 | G4int nucleonCount = theTargetNuc.size(); // debug |
---|
69 | #endif |
---|
70 | |
---|
71 | G4int theCurrent = static_cast<G4int> (theTargetNuc.size()*G4UniformRand()); |
---|
72 | G4Nucleon * pNucleon = theTargetNuc[theCurrent]; |
---|
73 | G4QGSMSplitableHadron* aTarget = new G4QGSMSplitableHadron(*pNucleon); |
---|
74 | theTargets.push_back(aTarget); |
---|
75 | pNucleon->Hit(aTarget); |
---|
76 | if ( (0.06 > G4UniformRand() &&(ModelMode==SOFT)) || (ModelMode==DIFFRACTIVE ) ) |
---|
77 | { |
---|
78 | // diffractive interaction occurs |
---|
79 | if(IsSingleDiffractive()) |
---|
80 | { |
---|
81 | theSingleDiffExcitation.ExciteParticipants(aProjectile, aTarget); |
---|
82 | } |
---|
83 | else |
---|
84 | { |
---|
85 | theDiffExcitaton.ExciteParticipants(aProjectile, aTarget); |
---|
86 | } |
---|
87 | G4InteractionContent * aInteraction = new G4InteractionContent(aProjectile); |
---|
88 | aInteraction->SetTarget(aTarget); |
---|
89 | theInteractions.push_back(aInteraction); |
---|
90 | aInteraction->SetNumberOfDiffractiveCollisions(1); |
---|
91 | totalCuts += 1; |
---|
92 | } |
---|
93 | else |
---|
94 | { |
---|
95 | // nondiffractive soft interaction occurs |
---|
96 | aTarget->IncrementCollisionCount(1); |
---|
97 | aProjectile->IncrementCollisionCount(1); |
---|
98 | G4InteractionContent * aInteraction = new G4InteractionContent(aProjectile); |
---|
99 | aInteraction->SetTarget(aTarget); |
---|
100 | aInteraction->SetNumberOfSoftCollisions(1); |
---|
101 | theInteractions.push_back(aInteraction); |
---|
102 | totalCuts += 1; |
---|
103 | } |
---|
104 | return aProjectile; |
---|
105 | } |
---|