Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GB01BOptrChangeCrossSection.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 //
28 //
29 // $Id: $
30 //---------------------------------------------------------------
31 //
32 // GB01BOptrChangeCrossSection
33 //
34 // Class Description:
35 // A G4VBiasingOperator concrete implementation example to
36 // illustrate how to bias physics processes cross-section for
37 // one particle type.
38 // The G4VBiasingOperation G4BOptnChangeCrossSection is
39 // selected by this operator, and is sent to each process
40 // calling the operator.
41 // A simple constant bias to the cross-section is applied,
42 // but more sophisticated changes can be applied.
43 //
44 //---------------------------------------------------------------
45 //
46 
47 #ifndef GB01BOptrChangeCrossSection_hh
48 #define GB01BOptrChangeCrossSection_hh 1
49 
50 #include "G4VBiasingOperator.hh"
53 #include <map>
54 
56 public:
57  // ------------------------------------------------------------
58  // -- Constructor: takes the name of the particle type to bias:
59  // ------------------------------------------------------------
60  GB01BOptrChangeCrossSection(G4String particleToBias, G4String name = "ChangeXS");
62 
63  // -- method called at beginning of run:
64  virtual void StartRun();
65 
66 private:
67  // -----------------------------
68  // -- Mandatory from base class:
69  // -----------------------------
70  // -- This method returns the biasing operation that will bias the physics process occurence.
71  virtual G4VBiasingOperation*
72  ProposeOccurenceBiasingOperation(const G4Track* track,
73  const G4BiasingProcessInterface* callingProcess);
74  // -- Methods not used:
75  virtual G4VBiasingOperation*
76  ProposeFinalStateBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
77  {return 0;}
78  virtual G4VBiasingOperation*
79  ProposeNonPhysicsBiasingOperation(const G4Track*, const G4BiasingProcessInterface*)
80  {return 0;}
81 
82 private:
83  // -- ("using" is avoid compiler complaining against (false) method shadowing.)
85 
86  // -- Optionnal base class method implementation.
87  // -- This method is called to inform the operator that a proposed operation has been applied.
88  // -- In the present case, it means that a physical interaction occured (interaction at
89  // -- PostStepDoIt level):
90  virtual void OperationApplied( const G4BiasingProcessInterface* callingProcess,
91  G4BiasingAppliedCase biasingCase,
92  G4VBiasingOperation* occurenceOperationApplied,
93  G4double weightForOccurenceInteraction,
94  G4VBiasingOperation* finalStateOperationApplied,
95  const G4VParticleChange* particleChangeProduced );
96 
97 private:
98  // -- List of associations between processes and biasing operations:
99  std::map< const G4BiasingProcessInterface*,
100  G4BOptnChangeCrossSection* > fChangeCrossSectionOperations;
101  G4bool fSetup;
102  const G4ParticleDefinition* fParticleToBias;
103 
104 };
105 
106 #endif
const XML_Char * name
Definition: expat.h:151
virtual void OperationApplied(const G4BiasingProcessInterface *callingProcess, G4BiasingAppliedCase biasingCase, G4VBiasingOperation *operationApplied, const G4VParticleChange *particleChangeProduced)
GB01BOptrChangeCrossSection(G4String particleToBias, G4String name="ChangeXS")
G4BiasingAppliedCase
bool G4bool
Definition: G4Types.hh:79
double G4double
Definition: G4Types.hh:76