ECCE @ EIC Software
Reference for
ECCE @ EIC
simulation and reconstruction software on GitHub
Home page
Related Pages
Modules
Namespaces
Classes
Files
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
GB06BOptrSplitAndKillByImportance.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file GB06BOptrSplitAndKillByImportance.cc
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
#include "
GB06BOptrSplitAndKillByImportance.hh
"
30
#include "
GB06BOptnSplitAndKillByImportance.hh
"
31
32
#include "
G4BiasingProcessInterface.hh
"
33
#include "
G4ParallelGeometriesLimiterProcess.hh
"
34
#include "
G4BiasingProcessSharedData.hh
"
35
36
37
#include "
G4ParticleDefinition.hh
"
38
#include "
G4ParticleTable.hh
"
39
#include "
G4VProcess.hh
"
40
41
#include "
G4TransportationManager.hh
"
42
#include "
G4TouchableHistoryHandle.hh
"
43
44
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
45
46
GB06BOptrSplitAndKillByImportance::
47
GB06BOptrSplitAndKillByImportance
(
G4String
particleName,
48
G4String
name
)
49
:
G4VBiasingOperator
(name),
50
fParallelWorld ( nullptr ),
51
fParallelWorldIndex ( -1 ),
52
fBiasingLimiterProcess ( nullptr )
53
{
54
fParticleToBias
=
G4ParticleTable::GetParticleTable
()->
FindParticle
(particleName);
55
56
if
(
fParticleToBias
== 0 )
57
{
58
G4ExceptionDescription
ed;
59
ed <<
"Particle `"
<< particleName <<
"' not found !"
<<
G4endl
;
60
G4Exception
(
"GB06BOptrSplitAndKillByImportance(...)"
,
61
"exGB06.01"
,
62
JustWarning
,
63
ed);
64
}
65
66
fSplitAndKillByImportance
=
67
new
GB06BOptnSplitAndKillByImportance
(
"splitterFor_"
+particleName);
68
69
}
70
71
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72
73
GB06BOptrSplitAndKillByImportance::~GB06BOptrSplitAndKillByImportance
()
74
{
75
delete
fSplitAndKillByImportance
;
76
}
77
78
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
79
80
void
GB06BOptrSplitAndKillByImportance::StartRun
()
81
{
82
// ---------------
83
// -- Setup stage:
84
// ---------------
85
// -- get the particle process manager...
86
const
G4ProcessManager
* processManager =
fParticleToBias
->
GetProcessManager
();
87
// -- ... to obtain the biasing information shared among this particle processes:
88
fBiasingSharedData
=
G4BiasingProcessInterface::GetSharedData
( processManager );
89
// -- Remember the index of the parallel world:
90
fBiasingLimiterProcess
=
fBiasingSharedData
->
GetParallelGeometriesLimiterProcess
();
91
fParallelWorldIndex
=
fBiasingLimiterProcess
->
GetParallelWorldIndex
(
fParallelWorld
);
92
93
// -- Setup the biasing operation:
94
fSplitAndKillByImportance
-> SetBiasingSharedData(
fBiasingSharedData
);
95
fSplitAndKillByImportance
->
SetParallelWorldIndex
(
fParallelWorldIndex
);
96
fSplitAndKillByImportance
-> SetImportanceMap( &
fImportanceMap
);
97
98
}
99
100
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
101
102
G4VBiasingOperation
*
103
GB06BOptrSplitAndKillByImportance::
104
ProposeNonPhysicsBiasingOperation
(
const
G4Track
*
track
,
105
const
G4BiasingProcessInterface
*
/*callingProcess*/
)
106
{
107
// -- Check if current particle type is the one to bias:
108
if
( track->
GetDefinition
() !=
fParticleToBias
)
return
0;
109
110
// -- if so, request biasing:
111
return
fSplitAndKillByImportance
;
112
113
}
114
geant4
tree
geant4-10.6-release
examples
extended
biasing
GB06
src
GB06BOptrSplitAndKillByImportance.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:02
using
1.8.2 with
ECCE GitHub integration