[819] | 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 | // |
---|
[962] | 27 | // $Id: G4FTFParticipants.cc,v 1.9 2008/06/13 12:49:23 vuzhinsk Exp $ |
---|
| 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
[819] | 29 | // |
---|
| 30 | // ------------------------------------------------------------ |
---|
| 31 | // GEANT 4 class implementation file |
---|
| 32 | // |
---|
| 33 | // ---------------- G4FTFParticipants---------------- |
---|
| 34 | // by Gunter Folger, June 1998. |
---|
| 35 | // class finding colliding particles in FTFPartonStringModel |
---|
| 36 | // Changed in a part by V. Uzhinsky in oder to put in correcpondence |
---|
| 37 | // with original FRITIOF mode. November - December 2006. |
---|
| 38 | // ------------------------------------------------------------ |
---|
| 39 | |
---|
[962] | 40 | #include "G4FTFParameters.hh" // Uzhi 29.03.08 |
---|
[819] | 41 | #include "G4FTFParticipants.hh" |
---|
| 42 | #include "G4DiffractiveSplitableHadron.hh" |
---|
| 43 | #include "G4VSplitableHadron.hh" |
---|
| 44 | #include "Randomize.hh" |
---|
[962] | 45 | #include <utility> // Uzhi 29.03.08 |
---|
[819] | 46 | |
---|
| 47 | // Class G4FTFParticipants |
---|
| 48 | |
---|
| 49 | G4FTFParticipants::G4FTFParticipants() |
---|
| 50 | { |
---|
| 51 | } |
---|
| 52 | |
---|
| 53 | G4FTFParticipants::G4FTFParticipants(const G4FTFParticipants &): G4VParticipants() |
---|
| 54 | { |
---|
| 55 | } |
---|
| 56 | |
---|
| 57 | |
---|
| 58 | G4FTFParticipants::~G4FTFParticipants() |
---|
| 59 | { |
---|
| 60 | } |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | //const G4FTFParticipants & G4FTFParticipants::operator=(const G4FTFParticipants &right) |
---|
| 64 | //{} |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | //int G4FTFParticipants::operator==(const G4FTFParticipants &right) const |
---|
| 68 | //{} |
---|
| 69 | |
---|
| 70 | //int G4FTFParticipants::operator!=(const G4FTFParticipants &right) const |
---|
| 71 | //{} |
---|
| 72 | |
---|
[962] | 73 | void G4FTFParticipants::GetList(const G4ReactionProduct &thePrimary, |
---|
| 74 | G4FTFParameters *theParameters) // Uzhi 29.03.08 |
---|
[819] | 75 | { |
---|
| 76 | |
---|
| 77 | StartLoop(); // reset Loop over Interactions |
---|
| 78 | |
---|
| 79 | for(unsigned int i=0; i<theInteractions.size(); i++) delete theInteractions[i]; |
---|
| 80 | theInteractions.clear(); |
---|
| 81 | |
---|
[962] | 82 | G4double deltaxy=2 * fermi; // Extra nuclear radius |
---|
[819] | 83 | |
---|
| 84 | G4VSplitableHadron * primarySplitable=new G4DiffractiveSplitableHadron(thePrimary); |
---|
| 85 | |
---|
[962] | 86 | G4double xyradius; |
---|
| 87 | xyradius =theNucleus->GetOuterRadius() + deltaxy; // Impact parameter sampling |
---|
| 88 | // radius |
---|
[819] | 89 | G4bool nucleusNeedsShift = true; |
---|
| 90 | |
---|
| 91 | while ( theInteractions.size() == 0 ) |
---|
| 92 | { |
---|
| 93 | std::pair<G4double, G4double> theImpactParameter; |
---|
| 94 | theImpactParameter = theNucleus->ChooseImpactXandY(xyradius); |
---|
| 95 | G4double impactX = theImpactParameter.first; |
---|
| 96 | G4double impactY = theImpactParameter.second; |
---|
| 97 | |
---|
| 98 | theNucleus->StartLoop(); |
---|
| 99 | G4Nucleon * nucleon; |
---|
[962] | 100 | //G4int InterNumber=0; // Uzhi |
---|
| 101 | //while ( (nucleon=theNucleus->GetNextNucleon())&& (InterNumber < 1) ) // Uzhi |
---|
| 102 | while ( (nucleon=theNucleus->GetNextNucleon()) ) // Uzhi |
---|
[819] | 103 | { |
---|
| 104 | G4double impact2= sqr(impactX - nucleon->GetPosition().x()) + |
---|
[962] | 105 | sqr(impactY - nucleon->GetPosition().y()); |
---|
| 106 | |
---|
| 107 | // if ( theParameters->GetInelasticProbability(impact2/fermi/fermi) // Uzhi 29.03.08 |
---|
| 108 | if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi) // Uzhi 29.03.08 |
---|
[819] | 109 | > G4UniformRand() ) |
---|
| 110 | { |
---|
[962] | 111 | //InterNumber++; |
---|
[819] | 112 | if ( nucleusNeedsShift ) |
---|
| 113 | { // on the first hit, shift nucleus |
---|
| 114 | nucleusNeedsShift = false; |
---|
| 115 | theNucleus->DoTranslation(G4ThreeVector(-1*impactX,-1*impactY,0.)); |
---|
| 116 | impactX=0; |
---|
| 117 | impactY=0; |
---|
| 118 | } |
---|
| 119 | G4VSplitableHadron * targetSplitable; |
---|
| 120 | if ( (targetSplitable=nucleon->GetSplitableHadron()) == NULL ) |
---|
| 121 | { |
---|
| 122 | targetSplitable= new G4DiffractiveSplitableHadron(*nucleon); |
---|
| 123 | nucleon->Hit(targetSplitable); |
---|
| 124 | } |
---|
[962] | 125 | G4InteractionContent * aInteraction = |
---|
| 126 | new G4InteractionContent(primarySplitable); |
---|
[819] | 127 | aInteraction->SetTarget(targetSplitable); |
---|
| 128 | theInteractions.push_back(aInteraction); |
---|
| 129 | } |
---|
| 130 | } |
---|
| 131 | |
---|
| 132 | // G4cout << "Number of Hit nucleons " << theInteractions.size() // entries() |
---|
| 133 | // << "\t" << impactX/fermi << "\t"<<impactY/fermi |
---|
| 134 | // << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl; |
---|
| 135 | |
---|
| 136 | } |
---|
| 137 | |
---|
| 138 | } |
---|
| 139 | |
---|
| 140 | |
---|
| 141 | // Implementation (private) methods |
---|