Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros 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"
58 #include <map>
59 
61 public:
62  // -- Constructor :
64  // -- destructor:
66 
67 public:
68  // -- Methods from G4VBiasingOperation interface:
69  // -------------------------------------------
70  // -- Used:
73  virtual G4GPILSelection ProposeGPILSelection( const G4GPILSelection processSelection );
75  const G4Track*,
76  const G4Step*,
77  G4bool& );
78  // -- Unused:
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 laws:
90  {
91  return fCommonTruncatedExpLaw;
92  }
94  {
95  return fForceFreeFlightLaw;
96  }
97 
98  void Initialize( const G4Track* );
99  void UpdateForStep( const G4Step* );
100  void Sample();
101  const G4ThreeVector& GetInitialMomentum() const { return fInitialMomentum; }
102  G4double GetMaximumDistance() const { return fMaximumDistance; }
103  void ChooseProcessToApply();
104  const G4VProcess* GetProcessToApply() const { return fProcessToApply; }
105  void AddCrossSection( const G4VProcess*, G4double );
106  size_t GetNumberOfSharing() const { return fNumberOfSharing;}
107  void SetInteractionOccured( G4bool b ) { fInteractionOccured = b; }
108  G4bool GetInteractionOccured() const { return fInteractionOccured; }
109 
110 private:
111  G4ILawCommonTruncatedExp* fCommonTruncatedExpLaw;
112  G4ILawForceFreeFlight* fForceFreeFlightLaw;
113  G4double fTotalCrossSection;
114  std::map < const G4VProcess*, G4double > fCrossSections;
115  size_t fNumberOfSharing;
116  const G4VProcess* fProcessToApply;
117  G4bool fInteractionOccured;
118  G4ThreeVector fInitialMomentum;
119  G4double fMaximumDistance;
120  G4ParticleChangeForNothing fDummyParticleChange;
121 };
122 
123 #endif
const XML_Char * name
Definition: expat.h:151
virtual G4VParticleChange * ApplyFinalStateBiasing(const G4BiasingProcessInterface *, const G4Track *, const G4Step *, G4bool &)
virtual const G4VBiasingInteractionLaw * ProvideOccurenceBiasingInteractionLaw(const G4BiasingProcessInterface *, G4ForceCondition &)
void AddCrossSection(const G4VProcess *, G4double)
const G4ThreeVector & GetInitialMomentum() const
virtual G4VParticleChange * GenerateBiasingFinalState(const G4Track *, const G4Step *)
bool G4bool
Definition: G4Types.hh:79
Definition: G4Step.hh:76
virtual G4double ProposeAlongStepLimit(const G4BiasingProcessInterface *)
G4ILawCommonTruncatedExp * GetCommonTruncatedExpLaw()
double G4double
Definition: G4Types.hh:76
virtual G4GPILSelection ProposeGPILSelection(const G4GPILSelection processSelection)
G4ForceCondition
#define DBL_MAX
Definition: templates.hh:83
virtual G4double DistanceToApplyOperation(const G4Track *, G4double, G4ForceCondition *)
G4GPILSelection