Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GB06BOptrSplitAndKillByImportance.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 // GB06BOptrSplitAndKillByImportance
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 G4BOptnChangeImportance 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 GB06BOptrSplitAndKillByImportance_hh
48 #define GB06BOptrSplitAndKillByImportance_hh 1
49 
50 #include "G4VBiasingOperator.hh"
51 
52 
57 class G4VPhysicalVolume;
58 #include <map>
59 
60 
62 public:
63  // ------------------------------------------------------------
64  // -- Constructor: takes the name of the particle type to bias:
65  // ------------------------------------------------------------
67  G4String name = "SplitAndKillByImportance");
69 
70  // -- method called at beginning of run:
71  virtual void StartRun();
72 
73 private:
74  // -----------------------------
75  // -- Mandatory from base class:
76  // -----------------------------
77  // -- Not used:
78  virtual G4VBiasingOperation*
79  ProposeOccurenceBiasingOperation(const G4Track*,
80  const G4BiasingProcessInterface*) final
81  { return 0; }
82 
83  // -- Not used:
84  virtual G4VBiasingOperation*
85  ProposeFinalStateBiasingOperation(const G4Track*,
86  const G4BiasingProcessInterface*) final
87  { return 0; }
88 
89  // -- Used method : it will return the biasing operation that will split particles
90  // -- with a probabilty depending on the total absorption cross-section.
91  virtual G4VBiasingOperation*
92  ProposeNonPhysicsBiasingOperation(const G4Track*,
93  const G4BiasingProcessInterface*) final;
94 
95 
96  // ---------------------------------------
97  // -- Method specific to this application:
98  // ---------------------------------------
99 public:
100  void SetParallelWorld( G4VPhysicalVolume* parallelWorld )
101  { fParallelWorld = parallelWorld; }
102 
103  // -- The importance map, linking a replica number to an volume importance:
104  std::map< G4int, G4int >& GetImportanceMap() { return fImportanceMap; }
105 
106 
107 
108 private:
109  GB06BOptnSplitAndKillByImportance* fSplitAndKillByImportance;
110  const G4ParticleDefinition* fParticleToBias;
111  G4VPhysicalVolume* fParallelWorld;
112  G4int fParallelWorldIndex;
113  const G4BiasingProcessSharedData* fBiasingSharedData;
114  const G4ParallelGeometriesLimiterProcess* fBiasingLimiterProcess;
115  std::map< G4int, G4int > fImportanceMap;
116 
117 };
118 
119 #endif
const XML_Char * name
Definition: expat.h:151
void SetParallelWorld(G4VPhysicalVolume *parallelWorld)
int G4int
Definition: G4Types.hh:78
GB06BOptrSplitAndKillByImportance(G4String particleToBias, G4String name="SplitAndKillByImportance")