Skip to content

Commit 5a02db6

Browse files
author
Jack Smedley
committed
Iitialize G4ReweightManager as static so only one G4RunManager is started
1 parent 0be9ee4 commit 5a02db6

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

sbncode/SBNEventWeight/Calculators/Geant4/Geant4WeightCalc.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class Geant4WeightCalc : public WeightCalc {
6464
unsigned fNsims; //!< Number of multisims
6565
int fPdg; //!< PDG value for particles that a given weight calculator should apply to. Note that for now this module can only handle weights for one particle species at a time.
6666
// float fXSUncertainty; //!< Flat cross section uncertainty
67-
G4ReweightManager *fRWManager; //!< "holds the run manager and creates the detector" according to the commit message (?)
6867
G4ReweighterFactory fRWFactory; //!< Base class to handle all Geant4Reweighters
6968
G4Reweighter *fReweighter; //!< Geant4Reweighter -- this is what provides the weights
7069
G4ReweightParameterMaker *fParMaker;
@@ -130,8 +129,8 @@ void Geant4WeightCalc::Configure(fhicl::ParameterSet const& p,
130129

131130
// Configure G4Reweighter
132131
fParMaker = new G4ReweightParameterMaker( FitParSets, true , fPdg ); //TODO:Do we want check_overlap? Maybe a fcl switch?
133-
fRWManager = new G4ReweightManager( {fMaterial} ); //Constructor asks for a vector, but SBN only cares about one material
134-
fReweighter = fRWFactory.BuildReweighter(fPdg, &FracsFile, fParMaker->GetFSHists(), fMaterial, fRWManager, fParMaker->GetElasticHist() );
132+
static G4ReweightManager* RWManager = new G4ReweightManager( {fMaterial} ); //Constructor asks for a vector, but SBN only cares about one material
133+
fReweighter = fRWFactory.BuildReweighter(fPdg, &FracsFile, fParMaker->GetFSHists(), fMaterial, RWManager, fParMaker->GetElasticHist() );
135134

136135
// Make output trees to save things for quick and easy validation
137136
art::ServiceHandle<art::TFileService> tfs;

sbncode/SBNEventWeight/jobs/geant4/eventweight_geant4_sbn.fcl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ sbn_eventweight_geant4: {
2424
min_weight: 0.0
2525
max_weight: 100
2626

27-
weight_functions_reint: [ reinteractions_piplus] #, reinteractions_piminus, reinteractions_proton ]
27+
weight_functions_reint: [ reinteractions_piplus , reinteractions_piminus, reinteractions_proton ]
2828

2929
reinteractions_piplus: {
3030
type: Geant4

0 commit comments

Comments
 (0)