Skip to content

Commit c30d8d1

Browse files
mastbaumJack Smedley
authored andcommitted
geant4reweight interface updates + generic sbn fcls
1 parent 5ede08a commit c30d8d1

8 files changed

Lines changed: 273 additions & 9 deletions

File tree

sbncode/SBNEventWeight/App/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
cet_build_plugin(SBNEventWeight art::module
22
LIBRARIES
3-
sbnobj::Common_SBNEventWeight sbncode_SBNEventWeight_Base
3+
sbnobj::Common_SBNEventWeight
4+
sbncode_SBNEventWeight_Base
45
sbncode_SBNEventWeight_Calculators_CrossSection
5-
sbncode_SBNEventWeight_Calculators_BNBFlux nusimdata::SimulationBase
6+
sbncode_SBNEventWeight_Calculators_BNBFlux
7+
sbncode_SBNEventWeight_Calculators_Geant4
8+
nusimdata::SimulationBase
69
ROOT::Geom)
710

811
cet_build_plugin(SystToolsEventWeight art::module

sbncode/SBNEventWeight/Calculators/Geant4/Geant4WeightCalc.cxx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,8 @@ class Geant4WeightCalc : public WeightCalc {
9393
DECLARE_WEIGHTCALC(Geant4WeightCalc)
9494
};
9595

96-
} // namespace evwgh
97-
98-
} // namespace sbn
9996

100-
void sbn::evwgh::Geant4WeightCalc::Configure(fhicl::ParameterSet const& p,
97+
void Geant4WeightCalc::Configure(fhicl::ParameterSet const& p,
10198
CLHEP::HepRandomEngine& engine)
10299
{
103100
std::cout << "Using Geant4WeightCalc for reinteraction weights" << std::endl;
@@ -225,8 +222,7 @@ void sbn::evwgh::Geant4WeightCalc::Configure(fhicl::ParameterSet const& p,
225222
}
226223

227224

228-
std::vector<float>
229-
sbn::evwgh::Geant4WeightCalc::GetWeight(art::Event& e, size_t itruth ) {
225+
std::vector<float> Geant4WeightCalc::GetWeight(art::Event& e, size_t itruth ) {
230226

231227
// Get event/run/subrun numbers for output
232228
run_num = e.run();
@@ -486,4 +482,8 @@ return weight;
486482

487483
}
488484

489-
REGISTER_WEIGHTCALC(sbn::evwgh::Geant4WeightCalc)
485+
REGISTER_WEIGHTCALC(Geant4WeightCalc)
486+
487+
} // namespace evwgh
488+
489+
} // namespace sbn

sbncode/SBNEventWeight/jobs/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ install_source()
55
add_subdirectory(SystTools)
66
add_subdirectory(genie)
77
add_subdirectory(flux)
8+
add_subdirectory(geant4)
89

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
install_fhicl()
2+
3+
FILE(GLOB fcl_files *.fcl)
4+
5+
install_source( EXTRAS ${fcl_files} )
6+
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
##########################################################
2+
## Hadron reinteraction uncertainties
3+
##
4+
## References:
5+
##
6+
## * K. Duffy, Pion Secondary Interaction Systematics (from GEANTReweight), DocDB 25379
7+
## * J. Calcutt, GEANTReweight documentation DocDB 25084, repository https://cdcvs.fnal.gov/redmine/projects/geant4reweight/repository
8+
##
9+
## From MicroBooNE, ubsim UBOONE_SUITE_v08_00_00_69
10+
## (uBooNE author: Kirsty Duffy (kduffy@fnal.gov))
11+
##
12+
##########################################################
13+
14+
#include "piplus_reweight_parameters.fcl"
15+
#include "piminus_reweight_parameters.fcl"
16+
#include "proton_reweight_parameters.fcl"
17+
18+
geant4weight_sbn: {
19+
module_type: "SBNEventWeight"
20+
AllowMissingTruth: true
21+
min_weight: 0.0
22+
max_weight: 100
23+
24+
weight_functions_reint: [ reinteractions_piplus, reinteractions_piminus, reinteractions_proton ]
25+
26+
reinteractions_piplus: {
27+
type: Geant4
28+
random_seed: 58
29+
parameters: @local::PiPlusParameters
30+
mode: multisim
31+
number_of_multisims: 1000
32+
fracsfile: "$SBNDATA_DIR/systematics/reint/g4_fracs_piplus.root"
33+
xsecfile: "$SBNDATA_DIR/systematics/reint/g4_cross_section_piplus.root"
34+
makeoutputtree: false
35+
pdg_to_reweight: 211
36+
debug: false
37+
}
38+
39+
reinteractions_piminus: {
40+
type: Geant4
41+
random_seed: 59
42+
parameters: @local::PiMinusParameters
43+
mode: multisim
44+
number_of_multisims: 1000
45+
fracsfile: "$SBNDATA_DIR/systematics/reint/g4_fracs_piminus.root"
46+
xsecfile: "$SBNDATA_DIR/systematics/reint/g4_cross_section_piminus.root"
47+
makeoutputtree: false
48+
pdg_to_reweight: -211
49+
debug: false
50+
}
51+
52+
reinteractions_proton: {
53+
type: Geant4
54+
random_seed: 60
55+
parameters: @local::ProtonParameters
56+
mode: multisim
57+
number_of_multisims: 1000
58+
fracsfile: "$SBNDATA_DIR/systematics/reint/g4_fracs_proton.root"
59+
xsecfile: "$SBNDATA_DIR/systematics/reint/g4_cross_section_proton.root"
60+
makeoutputtree: false
61+
pdg_to_reweight: 2212
62+
debug: false
63+
}
64+
}
65+
66+
###
67+
# Reweighting parameters should be defined as
68+
#
69+
# TheParameters: [
70+
# {
71+
# Cut: "reac"
72+
# Name: "fReacLow"
73+
# Range: [10., 200.]
74+
# Nominal: 1.0
75+
# Sigma: 0.3
76+
# },
77+
# {...}
78+
# ]
79+
#
80+
# - Range defines the energy range over which that parameter has an effect (MeV)
81+
# - Nominal is not used in "multisim" mode. In "pm1sigma" mode it defines the
82+
# nominal (around which you calculate +/- 1 sigma variations). In any other
83+
# mode, the parameter is set to the value under Nominal (so it's not really a
84+
# "nominal" value in that case, just the set value)
85+
# - Sigma defines the 1-sigma range for multisims and unisims. Currently the
86+
# code can only accept a single value for sigma, giving symmetric
87+
# uncertainty bounds: nominal-sigma and nominal+sigma
88+
# - Cut must be one of the following:
89+
# "reac" <- total inelastic scattering cross section
90+
# "abs" <- absorption cross section (pi+ and pi- only at the moment -- Oct 2019)
91+
# "cex" <- charge exchange cross section (pi+ and pi- only at the moment -- Oct 2019)
92+
# "dcex" <- double charge exchange cross section (pi+ and pi- only at the moment -- Oct 2019)
93+
# "prod" <- pion production cross section (pi+ and pi- only at the moment -- Oct 2019)
94+
# "inel" <- quasi-elastic inelastic scattering cross section (pi+ and pi- only at the moment -- Oct 2019)
95+
# "elast" <- total elastic scattering cross section
96+
# - Name can be anything you like (but should uniquely identify that parameter/
97+
# variation)
98+
###
99+
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
BEGIN_PROLOG
2+
3+
# From MicroBooNE, ubsim UBOONE_SUITE_v08_00_00_69
4+
5+
PiMinusParameters: [
6+
{
7+
Name: "fPiMinusReacLow"
8+
Cut: "reac"
9+
Range: [10., 200.]
10+
Nominal: 1
11+
Sigma: 0.2
12+
} ,
13+
{
14+
Name: "fPiMinusReacHigh"
15+
Cut: "reac"
16+
Range: [700., 2005.]
17+
Nominal: 1.0
18+
Sigma: 0.2
19+
} ,
20+
21+
{
22+
Name: "fPiMinusAbs"
23+
Cut: "abs"
24+
# Range: [200.0, 700.00]
25+
Range: [10.0, 2005.00]
26+
Nominal: 1.0
27+
Sigma: 0.2
28+
},
29+
30+
{
31+
Name: "fPiMinusCex"
32+
Cut: "cex"
33+
# Range: [200.0, 700.00]
34+
Range: [10.0, 2005.00]
35+
Nominal: 1.0
36+
Sigma: 0.2
37+
},
38+
39+
{
40+
Name: "fPiMinusDCex"
41+
Cut: "dcex"
42+
# Range: [200.0, 700.00]
43+
Range: [10.0, 2005.00]
44+
Nominal: 1.0
45+
Sigma: 0.2
46+
},
47+
48+
{
49+
Name: "fPiMinusPiProd"
50+
Cut: "prod"
51+
# Range: [200.0, 700.00]
52+
Range: [10.0, 2005.00]
53+
Nominal: 1.0
54+
Sigma: 0.2
55+
},
56+
57+
{
58+
Name: "fPiMinusElast"
59+
Cut: "elast"
60+
Range: [10.0, 2005.00]
61+
Nominal: 1.0
62+
Sigma: 0.2
63+
}
64+
]
65+
66+
END_PROLOG
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
BEGIN_PROLOG
2+
3+
# From MicroBooNE, ubsim UBOONE_SUITE_v08_00_00_69
4+
5+
PiPlusParameters: [
6+
{
7+
Name: "fPiPlusReacLow"
8+
Cut: "reac"
9+
Range: [10., 200.]
10+
Nominal: 1
11+
Sigma: 0.2
12+
} ,
13+
{
14+
Name: "fPiPlusReacHigh"
15+
Cut: "reac"
16+
Range: [700., 2005.]
17+
Nominal: 1.0
18+
Sigma: 0.2
19+
} ,
20+
21+
{
22+
Name: "fPiPlusAbs"
23+
Cut: "abs"
24+
# Range: [200.0, 700.00]
25+
Range: [10.0, 2005.00]
26+
Nominal: 1.0
27+
Sigma: 0.2
28+
},
29+
30+
{
31+
Name: "fPiPlusCex"
32+
Cut: "cex"
33+
# Range: [200.0, 700.00]
34+
Range: [10.0, 2005.00]
35+
Nominal: 1.0
36+
Sigma: 0.2
37+
},
38+
39+
{
40+
Name: "fPiPlusDCex"
41+
Cut: "dcex"
42+
# Range: [200.0, 700.00]
43+
Range: [10.0, 2005.00]
44+
Nominal: 1.0
45+
Sigma: 0.2
46+
},
47+
48+
{
49+
Name: "fPiPlusPiProd"
50+
Cut: "prod"
51+
# Range: [200.0, 700.00]
52+
Range: [10.0, 2005.00]
53+
Nominal: 1.0
54+
Sigma: 0.2
55+
},
56+
57+
{
58+
Name: "fPiPlusElast"
59+
Cut: "elast"
60+
Range: [10.0, 2005.00]
61+
Nominal: 1.0
62+
Sigma: 0.2
63+
}
64+
]
65+
66+
END_PROLOG
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
BEGIN_PROLOG
2+
3+
# From MicroBooNE, ubsim UBOONE_SUITE_v08_00_00_69
4+
5+
ProtonParameters: [
6+
{
7+
Name: "fProtonReac"
8+
Cut: "reac"
9+
Range: [10., 2005.]
10+
Nominal: 1
11+
Sigma: 0.2
12+
},
13+
14+
{
15+
Name: "fProtonElast"
16+
Cut: "elast"
17+
Range: [10.0, 2005.00]
18+
Nominal: 1.0
19+
Sigma: 0.2
20+
}
21+
]
22+
23+
END_PROLOG

0 commit comments

Comments
 (0)