[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 | // |
---|
[1340] | 27 | // $Id: G4FTFParticipants.cc,v 1.17 2010/09/20 15:50:46 vuzhinsk Exp $ |
---|
[1347] | 28 | // GEANT4 tag $Name: geant4-09-04-ref-00 $ |
---|
[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, |
---|
[1228] | 74 | G4FTFParameters *theParameters) |
---|
[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 |
---|
[1196] | 89 | // G4bool nucleusNeedsShift = true; // Uzhi 20 July 2009 |
---|
[819] | 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 | |
---|
[1228] | 98 | G4ThreeVector thePosition(impactX, impactY, -DBL_MAX); |
---|
| 99 | primarySplitable->SetPosition(thePosition); |
---|
[1196] | 100 | |
---|
[819] | 101 | theNucleus->StartLoop(); |
---|
| 102 | G4Nucleon * nucleon; |
---|
[1228] | 103 | |
---|
| 104 | while ( (nucleon=theNucleus->GetNextNucleon()) ) |
---|
[819] | 105 | { |
---|
| 106 | G4double impact2= sqr(impactX - nucleon->GetPosition().x()) + |
---|
[962] | 107 | sqr(impactY - nucleon->GetPosition().y()); |
---|
| 108 | |
---|
[1228] | 109 | if ( theParameters->GetProbabilityOfInteraction(impact2/fermi/fermi) |
---|
[819] | 110 | > G4UniformRand() ) |
---|
| 111 | { |
---|
[1196] | 112 | primarySplitable->SetStatus(1); // It takes part in the interaction |
---|
| 113 | |
---|
| 114 | G4VSplitableHadron * targetSplitable=0; |
---|
| 115 | if ( ! nucleon->AreYouHit() ) |
---|
[819] | 116 | { |
---|
| 117 | targetSplitable= new G4DiffractiveSplitableHadron(*nucleon); |
---|
| 118 | nucleon->Hit(targetSplitable); |
---|
[1228] | 119 | nucleon->SetBindingEnergy(3.*nucleon->GetBindingEnergy()); |
---|
[1196] | 120 | targetSplitable->SetStatus(1); // It takes part in the interaction |
---|
[819] | 121 | } |
---|
[962] | 122 | G4InteractionContent * aInteraction = |
---|
| 123 | new G4InteractionContent(primarySplitable); |
---|
[819] | 124 | aInteraction->SetTarget(targetSplitable); |
---|
[1196] | 125 | aInteraction->SetTargetNucleon(nucleon); // Uzhi 16.07.09 |
---|
[819] | 126 | theInteractions.push_back(aInteraction); |
---|
| 127 | } |
---|
| 128 | } |
---|
[1228] | 129 | |
---|
[1196] | 130 | // G4cout << "Number of Hit nucleons " << theInteractions.size()<<G4endl; // entries() |
---|
[819] | 131 | // << "\t" << impactX/fermi << "\t"<<impactY/fermi |
---|
| 132 | // << "\t" << std::sqrt(sqr(impactX)+sqr(impactY))/fermi <<G4endl; |
---|
[1228] | 133 | |
---|
[819] | 134 | } |
---|
| 135 | |
---|
| 136 | } |
---|
| 137 | |
---|
| 138 | |
---|
| 139 | // Implementation (private) methods |
---|