Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:57:59

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