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
GB04BOptrBremSplitting.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file GB04BOptrBremSplitting.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
//
26
//
29
30
#include "
GB04BOptrBremSplitting.hh
"
31
#include "
GB04BOptnBremSplitting.hh
"
32
33
#include "
G4BiasingProcessInterface.hh
"
34
#include "
G4GenericMessenger.hh
"
35
36
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
37
38
GB04BOptrBremSplitting::GB04BOptrBremSplitting
()
39
:
G4VBiasingOperator
(
"BremSplittingOperator"
),
40
fSplittingFactor(1),
41
fBiasPrimaryOnly(
true
),
42
fBiasOnlyOnce(
true
)
43
{
44
fBremSplittingOperation
=
new
GB04BOptnBremSplitting
(
"BremSplittingOperation"
);
45
46
// -- Define messengers:
47
// -- Splitting factor:
48
fSplittingFactorMessenger
=
49
new
G4GenericMessenger
(
this
,
"/GB04/biasing/"
,
"Biasing control"
);
50
G4GenericMessenger::Command
& splittingFactorCmd =
51
fSplittingFactorMessenger
->
DeclareProperty
(
"setSplittingFactor"
,
fSplittingFactor
,
52
"Define the brem. splitting factor."
);
53
splittingFactorCmd.
SetStates
(
G4State_Idle
);
54
// -- Bias ony primary particle:
55
fBiasPrimaryOnlyMessenger
=
56
new
G4GenericMessenger
(
this
,
"/GB04/biasing/"
,
"Biasing control"
);
57
G4GenericMessenger::Command
& biasPrimaryCmd =
58
fBiasPrimaryOnlyMessenger
->
DeclareProperty
(
"biasPrimaryOnly"
,
fBiasPrimaryOnly
,
59
"Chose if brem. splitting applies to primary particles only."
);
60
biasPrimaryCmd.
SetStates
(
G4State_Idle
);
61
// -- Bias ony primary particle:
62
fBiasOnlyOnceMessenger
=
63
new
G4GenericMessenger
(
this
,
"/GB04/biasing/"
,
"Biasing control"
);
64
G4GenericMessenger::Command
& biasOnlyOnceCmd =
65
fBiasPrimaryOnlyMessenger
->
DeclareProperty
(
"biasOnlyOnce"
,
fBiasOnlyOnce
,
66
"Chose if apply the brem. splitting only once for the track."
);
67
biasOnlyOnceCmd.
SetStates
(
G4State_Idle
);
68
69
}
70
71
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
72
73
void
GB04BOptrBremSplitting::StartRun
()
74
{
75
fBremSplittingOperation
->
SetSplittingFactor
(
fSplittingFactor
);
76
G4cout
<<
GetName
() <<
" : starting run with brem. splitting factor = "
77
<<
fSplittingFactor
;
78
if
(
fBiasPrimaryOnly
)
G4cout
<<
", biasing only primaries "
;
79
else
G4cout
<<
", biasing primary and secondary tracks "
;
80
if
(
fBiasOnlyOnce
)
G4cout
<<
", biasing only once per track "
;
81
else
G4cout
<<
", biasing several times per track "
;
82
G4cout
<<
" . "
<<
G4endl
;
83
}
84
85
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
86
87
void
GB04BOptrBremSplitting::StartTracking
(
const
G4Track
*
/* track */
)
88
{
89
// -- reset the number of times the brem. splitting was applied:
90
fNInteractions
= 0;
91
}
92
93
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
94
95
G4VBiasingOperation
*
96
GB04BOptrBremSplitting::
97
ProposeFinalStateBiasingOperation
(
const
G4Track
*
track
,
98
const
G4BiasingProcessInterface
*
/* callingProcess */
)
99
{
100
// -- Check if biasing of primary particle only is requested. If so, and
101
// -- if particle is not a primary one, don't ask for biasing:
102
if
(
fBiasPrimaryOnly
&& ( track->
GetParentID
() !=0 ) )
return
0;
103
// -- Check if brem. splitting should be applied only once to the track,
104
// -- and if so, and if brem. splitting already occured, don't ask for biasing:
105
if
(
fBiasOnlyOnce
&& (
fNInteractions
> 0 ) )
return
0;
106
107
// -- Count the number of times the brem. splitting is applied:
108
fNInteractions
++;
109
// -- Return the brem. splitting operation:
110
return
fBremSplittingOperation
;
111
}
112
113
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
biasing
GB04
src
GB04BOptrBremSplitting.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:02
using
1.8.2 with
ECCE GitHub integration