Back to home page

EIC code displayed by LXR

 
 

    


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

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 // G4ChannelingOptrMultiParticleChangeCrossSection
0029 //
0030 // Class Description:
0031 //        A G4VBiasingOperator concrete implementation example to
0032 //    illustrate how an operator can make use of another operator.
0033 //        In the present case, the G4ChannelingOptrChangeCrossSection
0034 //    operator, that is made to bias processes of one particle
0035 //    type is instancied several times, one for each particle type
0036 //    to bias.
0037 //
0038 //-----------------------------------------------------------------
0039 //
0040 
0041 #ifndef G4ChannelingOptrMultiParticleChangeCrossSection_hh
0042 #define G4ChannelingOptrMultiParticleChangeCrossSection_hh 1
0043 
0044 #include "G4VBiasingOperator.hh"
0045 class G4ChannelingOptrChangeCrossSection;
0046 class G4ParticleDefinition;
0047 
0048 #include <map>
0049 
0050 class G4ChannelingOptrMultiParticleChangeCrossSection : public G4VBiasingOperator {
0051 public:
0052   G4ChannelingOptrMultiParticleChangeCrossSection();
0053   virtual ~G4ChannelingOptrMultiParticleChangeCrossSection() {}
0054   
0055   // ---------------------------------
0056   // -- Method specific to this class:
0057   // ---------------------------------
0058   // -- Each particle type for which its name is passed will be biased; *provided*
0059   // -- that the proper calls to biasingPhysics->Bias(particleName) have been done
0060   // -- in the main program.
0061     void AddParticle( G4String particleName );
0062     void AddChargedParticles();
0063   
0064   
0065 private:
0066   // -----------------------------
0067   // -- Mandatory from base class:
0068   // -----------------------------
0069   // -- This method returns a biasing operation that will bias the physics process occurrence:
0070   virtual G4VBiasingOperation*
0071   ProposeOccurenceBiasingOperation(const G4Track*                            track,
0072                                    const G4BiasingProcessInterface* callingProcess);
0073   // -- Methods not used:
0074   virtual G4VBiasingOperation*
0075   ProposeFinalStateBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
0076   {return 0;}
0077   virtual G4VBiasingOperation*
0078   ProposeNonPhysicsBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
0079   {return 0;}
0080 
0081   
0082 private:
0083   // -- ("using" is to avoid compiler complaining against (false) method shadowing.)
0084     using G4VBiasingOperator::OperationApplied;
0085 
0086   // -- Optionnal base class method implementation.
0087   // -- This method is called to inform the operator that a proposed operation has been applied.
0088   // -- In the present case, it means that a physical interaction occured (interaction at
0089   // -- PostStepDoIt level):
0090   virtual void OperationApplied( const G4BiasingProcessInterface*                callingProcess,
0091                                  G4BiasingAppliedCase                               biasingCase,
0092                                  G4VBiasingOperation*                 occurenceOperationApplied,
0093                                  G4double                         weightForOccurenceInteraction,
0094                                  G4VBiasingOperation*                finalStateOperationApplied, 
0095                                  const G4VParticleChange*                particleChangeProduced );
0096 
0097 public:
0098   // -- Optionnal base class method. It is called at the time a tracking of a particle starts:
0099   void StartTracking( const G4Track* track );
0100   
0101 private:
0102   // -- List of associations between particle types and biasing operators:
0103   std::map < const G4ParticleDefinition*, 
0104              G4ChannelingOptrChangeCrossSection* >    fBOptrForParticle;
0105   std::vector < const G4ParticleDefinition* >   fParticlesToBias;
0106   G4ChannelingOptrChangeCrossSection*                  fCurrentOperator;
0107 
0108   // -- count number of biased interations for current track:
0109   G4int fnInteractions;
0110 };
0111 
0112 #endif