Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4BOptnForceCommonTruncatedExp.hh
Go to the documentation of this file.
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 //
27 // $Id: $
28 //
29 //---------------------------------------------------------------
30 //
31 // G4BOptnForceCommonTruncatedExp
32 //
33 // Class Description:
34 // A G4VBiasingOperation physics-based biasing operation. It
35 // handles several processes together, biasing on the total
36 // cross-section of these processes (instead of biasing them
37 // individually).
38 // The biasing interaction law is a truncated exponential
39 // one, driven by the total cross-section and which extends
40 // in the range [0,L].
41 // Process are registered with the AddCrossSection method.
42 // As cross-sections are all known at the end of the
43 // PostStepGPIL loop, the step limitation is made at the
44 // AlongStepGPIL level.
45 //
46 //---------------------------------------------------------------
47 // Initial version Nov. 2013 M. Verderi
48 
49 
50 #ifndef G4BOptnForceCommonTruncatedExp_hh
51 #define G4BOptnForceCommonTruncatedExp_hh 1
52 
53 #include "G4VBiasingOperation.hh"
54 #include "G4ThreeVector.hh"
56 #include <map>
57 
59 public:
60  // -- Constructor :
62  // -- destructor:
64 
65 public:
66  // -- Methods from G4VBiasingOperation interface:
67  // -------------------------------------------
68  // -- Used:
70  virtual G4ForceCondition ProposeForceCondition( const G4ForceCondition processCondition );
73  virtual G4GPILSelection ProposeGPILSelection( const G4GPILSelection processSelection );
74 
75  // -- Unused:
77  const G4Track*,
78  const G4Step* ) {return 0;}
80  G4double,
81  G4ForceCondition*) {return DBL_MAX;}
83  const G4Step* ) {return 0;}
84 
85 public:
86  // -- Additional methods, specific to this class:
87  // ----------------------------------------------
88  // -- return concrete type of interaction law:
90  {
91  return fCommonTruncatedExpLaw;
92  }
93  void Initialize( const G4Track* );
94  void UpdateForStep( const G4Step* );
95  void Sample();
96  const G4ThreeVector& GetInitialMomentum() const { return fInitialMomentum; }
97  G4double GetMaximumDistance() const { return fMaximumDistance;}
98  void ChooseProcessToApply();
99  const G4VProcess* GetProcessToApply() const { return fProcessToApply; }
100  void AddCrossSection( const G4VProcess*, G4double );
102  void PostStepInteractionOccured( const G4VProcess* );
103  void SetInteractionOccured( G4bool b ) { fInteractionOccured = b; }
104  G4bool GetInteractionOccured() const { return fInteractionOccured; }
105 
106 private:
107  G4ILawCommonTruncatedExp* fCommonTruncatedExpLaw;
108  G4double fTotalCrossSection;
109  std::map < const G4VProcess*, G4double > fCrossSections;
110  size_t fNumberOfSharing;
111  //G4bool fFirstCallToDeny;
112  const G4VProcess* fProcessToApply;
113  G4bool fInteractionOccured;
114  G4ThreeVector fInitialMomentum;
115  G4double fMaximumDistance;
116 };
117 
118 #endif
void AddCrossSection(const G4VProcess *, G4double)
const XML_Char * name
const G4VProcess * GetProcessToApply() const
const G4ThreeVector & GetInitialMomentum() const
virtual G4bool DenyProcessPostStepDoIt(const G4BiasingProcessInterface *, const G4Track *, const G4Step *, G4double &)
virtual G4VParticleChange * GenerateBiasingFinalState(const G4Track *, const G4Step *)
virtual const G4VBiasingInteractionLaw * ProvideOccurenceBiasingInteractionLaw(const G4BiasingProcessInterface *)
bool G4bool
Definition: G4Types.hh:79
virtual G4VParticleChange * ApplyFinalStateBiasing(const G4BiasingProcessInterface *, const G4Track *, const G4Step *)
Definition: G4Step.hh:76
void PostStepInteractionOccured(const G4VProcess *)
G4ILawCommonTruncatedExp * GetCommonTruncatedExpLaw()
double G4double
Definition: G4Types.hh:76
virtual G4GPILSelection ProposeGPILSelection(const G4GPILSelection processSelection)
G4ForceCondition
virtual G4double ProposeAlongStepLimit(const G4BiasingProcessInterface *)
#define DBL_MAX
Definition: templates.hh:83
virtual G4double DistanceToApplyOperation(const G4Track *, G4double, G4ForceCondition *)
G4GPILSelection
virtual G4ForceCondition ProposeForceCondition(const G4ForceCondition processCondition)