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
BiasingOperation.cc
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file BiasingOperation.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
//
30
31
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
32
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
33
34
#include "
BiasingOperation.hh
"
35
#include "
G4BiasingProcessInterface.hh
"
36
#include "
G4VParticleChange.hh
"
37
#include "
G4ProtonInelasticProcess.hh
"
38
#include "
G4NeutronInelasticProcess.hh
"
39
#include "
G4PionPlusInelasticProcess.hh
"
40
#include "
G4PionMinusInelasticProcess.hh
"
41
#include "
G4HadronicParameters.hh
"
42
#include "
G4FTFModel.hh
"
43
#include "
G4LundStringFragmentation.hh
"
44
#include "
G4ExcitedStringDecay.hh
"
45
#include "
G4GeneratorPrecompoundInterface.hh
"
46
#include "
G4TheoFSGenerator.hh
"
47
#include "
G4HadronicInteractionRegistry.hh
"
48
#include "
G4VPreCompoundModel.hh
"
49
#include "
G4INCLXXInterface.hh
"
50
#include "
G4HadronInelasticDataSet.hh
"
51
52
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
53
54
BiasingOperation::BiasingOperation
(
G4String
name
) :
G4VBiasingOperation
( name ) {
55
56
// Create the inelastic processes for p , n , pi+ , pi-
57
fProtonInelasticProcess
=
new
G4ProtonInelasticProcess
;
58
fNeutronInelasticProcess
=
new
G4NeutronInelasticProcess
;
59
fPionPlusInelasticProcess
=
new
G4PionPlusInelasticProcess
;
60
fPionMinusInelasticProcess
=
new
G4PionMinusInelasticProcess
;
61
62
// Set the energy ranges
63
const
G4double
minPreco = 0.0;
64
const
G4double
maxPreco = 2.0 *
CLHEP::MeV
;
65
const
G4double
maxBERT = 12.0 *
CLHEP::GeV
;
66
const
G4double
minINCLXX = 1.0 *
CLHEP::MeV
;
67
const
G4double
minFTFP = 3.0 *
CLHEP::GeV
;
68
const
G4double
maxFTFP =
G4HadronicParameters::Instance
()->
GetMaxEnergy
();
69
70
// Create the hadronic models (to replace FTFP_BERT with "FTFP_INCLXX",
71
// keeping the same energy ranges for the transition between models).
72
// Notice that it is better to create the models here from scratch,
73
// instead of reusing the existing ones, because we might pick up the
74
// existing ones associated to the wrong particles...
75
// --- FTFP model ---
76
G4FTFModel
* theStringModel =
new
G4FTFModel
;
77
G4LundStringFragmentation
* theLund =
new
G4LundStringFragmentation
;
78
G4ExcitedStringDecay
* theStringDecay =
new
G4ExcitedStringDecay
( theLund );
79
theStringModel->
SetFragmentationModel
( theStringDecay );
80
G4GeneratorPrecompoundInterface
* thePrecoInterface =
new
G4GeneratorPrecompoundInterface
;
81
G4TheoFSGenerator
* theHighEnergyModel =
new
G4TheoFSGenerator
(
"FTFP"
);
82
theHighEnergyModel->
SetHighEnergyGenerator
( theStringModel );
83
theHighEnergyModel->
SetTransport
( thePrecoInterface );
84
theHighEnergyModel->
SetMinEnergy
( minFTFP );
85
theHighEnergyModel->
SetMaxEnergy
( maxFTFP );
86
// Preco : create a new model to be used only for INCLXX for nucleons
87
G4VPreCompoundModel
* thePreCompoundModel =
new
G4PreCompoundModel
;
88
thePreCompoundModel->
SetMinEnergy
( minPreco );
89
thePreCompoundModel->
SetMaxEnergy
( maxPreco );
90
// --- Preco ---
91
// --- INCLXX model ---
92
// The instance for nucleons:
93
G4INCLXXInterface
* theInclxxModel =
new
G4INCLXXInterface
( thePreCompoundModel );
94
theInclxxModel->
SetMinEnergy
( minINCLXX );
95
theInclxxModel->
SetMaxEnergy
( maxBERT );
// Use the same as for Bertini
96
// The instance for pions:
97
G4INCLXXInterface
* theInclxxModel_forPions =
new
G4INCLXXInterface
;
98
theInclxxModel_forPions->
SetMinEnergy
( minPreco );
99
theInclxxModel_forPions->
SetMaxEnergy
( maxBERT );
// Use the same as for Bertini
100
101
// Register the models
102
fProtonInelasticProcess
->
RegisterMe
( theHighEnergyModel );
103
fProtonInelasticProcess
->
RegisterMe
( theInclxxModel );
104
fProtonInelasticProcess
->
RegisterMe
( thePreCompoundModel );
105
fNeutronInelasticProcess
->
RegisterMe
( theHighEnergyModel );
106
fNeutronInelasticProcess
->
RegisterMe
( theInclxxModel );
107
fNeutronInelasticProcess
->
RegisterMe
( thePreCompoundModel );
108
fPionPlusInelasticProcess
->
RegisterMe
( theHighEnergyModel );
109
fPionPlusInelasticProcess
->
RegisterMe
( theInclxxModel_forPions );
110
fPionMinusInelasticProcess
->
RegisterMe
( theHighEnergyModel );
111
fPionMinusInelasticProcess
->
RegisterMe
( theInclxxModel_forPions );
112
113
// Register the cross sections: this is mandatory starting from G4 10.6
114
// because the default Gheisha inelastic cross sections have been removed.
115
// It is convenient to use the Gheisha inelastic cross sections here
116
// because they do not require any special initialization.
117
fProtonInelasticProcess
->
AddDataSet
(
new
G4HadronInelasticDataSet
);
118
fNeutronInelasticProcess
->
AddDataSet
(
new
G4HadronInelasticDataSet
);
119
fPionPlusInelasticProcess
->
AddDataSet
(
new
G4HadronInelasticDataSet
);
120
fPionMinusInelasticProcess
->
AddDataSet
(
new
G4HadronInelasticDataSet
);
121
}
122
123
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
124
125
BiasingOperation::~BiasingOperation
() {}
126
127
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
128
129
G4VParticleChange
*
BiasingOperation::
130
ApplyFinalStateBiasing
(
const
G4BiasingProcessInterface
* ,
131
const
G4Track
*
track
,
const
G4Step
*
step
,
G4bool
& ) {
132
if
( track->
GetParticleDefinition
() ==
G4Proton::Definition
() ) {
133
return
fProtonInelasticProcess
->
PostStepDoIt
( *track, *step );
134
}
else
if
( track->
GetParticleDefinition
() ==
G4Neutron::Definition
() ) {
135
return
fNeutronInelasticProcess
->
PostStepDoIt
( *track, *step );
136
}
else
if
( track->
GetParticleDefinition
() ==
G4PionPlus::Definition
() ) {
137
return
fPionPlusInelasticProcess
->
PostStepDoIt
( *track, *step );
138
}
else
if
( track->
GetParticleDefinition
() ==
G4PionMinus::Definition
() ) {
139
return
fPionMinusInelasticProcess
->
PostStepDoIt
( *track, *step );
140
}
else
{
141
G4cerr
<<
"ERROR in BiasingOperation::ApplyFinalStateBiasing : unexpected particle = "
142
<< track->
GetParticleDefinition
()->
GetParticleName
() <<
G4endl
;
143
return
0;
144
}
145
}
146
147
//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
geant4
tree
geant4-10.6-release
examples
extended
hadronic
Hadr08
src
BiasingOperation.cc
Built by
Jin Huang
. updated:
Wed Jun 29 2022 17:25:07
using
1.8.2 with
ECCE GitHub integration