Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:58:19

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 //
0027 //
0028 
0029 #ifndef G4FTFParticipants_h
0030 #define G4FTFParticipants_h 1
0031 
0032 // ------------------------------------------------------------
0033 //      GEANT 4 class header file
0034 //
0035 //      ---------------- G4FTFParticipants----------------
0036 //             by Gunter Folger, June 1998.
0037 //       class finding colliding particles in FTFPartonStringModel
0038 // ------------------------------------------------------------
0039 
0040 #include "G4VParticipants.hh"
0041 #include "G4FTFParameters.hh"
0042 #include <vector>
0043 #include "G4Nucleon.hh"
0044 #include "G4V3DNucleus.hh"
0045 #include "G4Fancy3DNucleus.hh"
0046 #include "G4ReactionProduct.hh"
0047 #include "G4InteractionContent.hh"
0048 
0049 
0050 class G4FTFParticipants : public G4VParticipants {
0051   public:
0052     G4FTFParticipants();
0053     ~G4FTFParticipants();
0054 
0055     const G4FTFParticipants& operator=( const G4FTFParticipants& right ) = delete;
0056     G4bool operator==( const G4FTFParticipants& right ) const = delete;
0057     G4bool operator!=( const G4FTFParticipants& right ) const = delete;
0058     G4FTFParticipants( const G4FTFParticipants& right ) = delete;
0059 
0060     // New methods to get/set the impact parameter.
0061     // (Note: to get the impact parameter in fermi units, do:
0062     //          GetImpactParameter() / fermi )
0063     // By default, SampleBinInterval() is false and therefore the sampling of
0064     // the impact parameter is done as usual by FTF taking into account the
0065     // radius of target nucleus, and, in the case of nucleus-nucleus collisions,
0066     // also of radius of the projectile nucleus; if, instead, SampleBinInterval()
0067     // is true, then the square of the impact parameter is drawn from a flat
0068     // distribution in the specified interval [Bmin2, Bmax2].
0069     void SetImpactParameter( const G4double b_value );
0070     G4double GetImpactParameter() const;
0071     void SetBminBmax( const G4double bmin_value, const G4double bmax_value );
0072     G4bool SampleBinInterval() const;
0073     G4double GetBmin2() const;  // Minimum value of the square of the impact parameter
0074     G4double GetBmax2() const;  // Maximum value of the square of the impact parameter
0075 
0076     void GetList( const G4ReactionProduct& thePrimary, G4FTFParameters* theParameters );
0077     void StartLoop();
0078     G4bool Next();
0079     void SortInteractionsIncT();
0080     void ShiftInteractionTime();
0081     G4InteractionContent& GetInteraction();  
0082     void Clean();
0083 
0084   private:
0085     G4double Bimpact;
0086     G4bool   BinInterval;
0087     G4double Bmin2;
0088     G4double Bmax2;
0089 
0090     std::vector< G4InteractionContent* > theInteractions;
0091     G4int currentInteraction;
0092 };
0093 
0094 
0095 inline void G4FTFParticipants::SetImpactParameter( const G4double b_value ) {
0096   Bimpact = b_value;
0097 }
0098 
0099 inline G4double G4FTFParticipants::GetImpactParameter() const {
0100   return Bimpact;
0101 }
0102 
0103 inline void G4FTFParticipants::SetBminBmax( const G4double bmin_value, const G4double bmax_value ) {
0104   BinInterval = false;
0105   if ( bmin_value < 0.0 || bmax_value < 0.0 || bmax_value < bmin_value ) return;
0106   BinInterval = true;
0107   Bmin2 = bmin_value * bmin_value;
0108   Bmax2 = bmax_value * bmax_value;
0109 }
0110 
0111 inline G4bool G4FTFParticipants::SampleBinInterval() const {
0112   return BinInterval;
0113 }
0114 
0115 inline G4double G4FTFParticipants::GetBmin2() const {
0116   return Bmin2;
0117 }
0118 
0119 inline G4double G4FTFParticipants::GetBmax2() const {
0120   return Bmax2;
0121 }
0122 
0123 inline void G4FTFParticipants::StartLoop() {
0124   currentInteraction = -1;
0125 }
0126 
0127 inline G4bool G4FTFParticipants::Next() {
0128   return ++currentInteraction < static_cast< G4int >( theInteractions.size() );
0129 }
0130 
0131 inline G4InteractionContent& G4FTFParticipants::GetInteraction() {
0132   return *theInteractions[ currentInteraction ];
0133 }
0134 
0135 #endif
0136