Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 08:58:07

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 // G4BOptrForceCollision
0027 //
0028 // Class Description:
0029 //
0030 // A G4VBiasingOperator that implements a "force collision" a la
0031 // MCNP. This is meant for neutral particles.
0032 // When the track enters the volume, it is cloned. One copy makes
0033 // a forced free flight up to the volume exit. The other copy makes
0034 // a forced collision inside the volume.
0035 //
0036 // Author: Marc Verderi, November 2013.
0037 // --------------------------------------------------------------------
0038 #ifndef G4BOptrForceCollision_hh
0039 #define G4BOptrForceCollision_hh 1
0040 
0041 #include "G4VBiasingOperator.hh"
0042 #include "G4ThreeVector.hh"
0043 
0044 #include <vector>
0045 #include <map>
0046 
0047 class G4BOptnForceFreeFlight;
0048 class G4BOptnForceCommonTruncatedExp;
0049 class G4BOptnCloning;
0050 class G4VProcess;
0051 class G4BiasingProcessInterface;
0052 class G4ParticleDefinition;
0053 class G4BOptrForceCollisionTrackData;
0054 
0055 class G4BOptrForceCollision : public G4VBiasingOperator
0056 {
0057   public:
0058 
0059     G4BOptrForceCollision(const G4String& particleToForce,
0060                           const G4String& name="ForceCollision");
0061     G4BOptrForceCollision(const G4ParticleDefinition* particleToForce,
0062                           const G4String& name="ForceCollision");
0063     ~G4BOptrForceCollision();
0064   
0065     virtual void Configure() final;
0066     virtual void ConfigureForWorker() final;
0067     virtual void StartRun() final;
0068     virtual void StartTracking( const G4Track* track ) final;
0069     virtual void ExitBiasing( const G4Track*, const G4BiasingProcessInterface* ) final {};
0070     virtual void EndTracking() final;
0071 
0072     // -- operation applied:
0073     void OperationApplied( const G4BiasingProcessInterface* callingProcess,
0074                                  G4BiasingAppliedCase biasingCase,
0075                                  G4VBiasingOperation* operationApplied,
0076                            const G4VParticleChange* particleChangeProduced ) final;
0077     void OperationApplied( const G4BiasingProcessInterface* callingProcess,
0078                                  G4BiasingAppliedCase biasingCase,
0079                                  G4VBiasingOperation* occurenceOperationApplied,
0080                                  G4double weightForOccurenceInteraction,
0081                                  G4VBiasingOperation* finalStateOperationApplied,
0082                            const G4VParticleChange* particleChangeProduced ) final;
0083 
0084   private:
0085 
0086     // -- Mandatory from base class :
0087     virtual G4VBiasingOperation*
0088     ProposeNonPhysicsBiasingOperation(const G4Track* track,
0089                          const G4BiasingProcessInterface* callingProcess) final;
0090     virtual G4VBiasingOperation*
0091     ProposeOccurenceBiasingOperation(const G4Track* track,
0092                          const G4BiasingProcessInterface* callingProcess) final;
0093     virtual G4VBiasingOperation*
0094     ProposeFinalStateBiasingOperation(const G4Track* track,
0095                          const G4BiasingProcessInterface* callingProcess) final;
0096 
0097   private:
0098 
0099     G4int fForceCollisionModelID = 0;
0100     const G4Track* fCurrentTrack = nullptr;
0101     G4BOptrForceCollisionTrackData* fCurrentTrackData = nullptr;
0102     std::map< const G4BiasingProcessInterface*, G4BOptnForceFreeFlight* > fFreeFlightOperations;
0103     G4BOptnForceCommonTruncatedExp* fSharedForceInteractionOperation = nullptr;
0104     G4BOptnCloning* fCloningOperation = nullptr;
0105     G4double fInitialTrackWeight = -1.0;
0106     G4bool fSetup = true;
0107     const G4ParticleDefinition* fParticleToBias = nullptr;
0108 };
0109 
0110 #endif