Public Member Functions | Private Member Functions | Private Attributes | List of all members
genie::rew::GReWeightNuXSecNCEL Class Reference

Reweighting NCEL GENIE neutrino cross sections. More...

#include <GReWeightNuXSecNCEL.h>

Inheritance diagram for genie::rew::GReWeightNuXSecNCEL:
genie::rew::GReWeightI

Public Member Functions

 GReWeightNuXSecNCEL ()
 
 ~GReWeightNuXSecNCEL ()
 
bool IsHandled (GSyst_t syst)
 does the current weight calculator handle the input nuisance param? More...
 
void SetSystematic (GSyst_t syst, double val)
 update the value for the specified nuisance param More...
 
void Reset (void)
 set all nuisance parameters to default values More...
 
void Reconfigure (void)
 propagate updated nuisance parameter values to actual MC, etc More...
 
double CalcWeight (const EventRecord &event)
 calculate a weight for the input event using the current nuisance param values More...
 
void RewNue (bool tf)
 
void RewNuebar (bool tf)
 
void RewNumu (bool tf)
 
void RewNumubar (bool tf)
 
void SetMaPath (string p)
 
void SetEtaPath (string p)
 
- Public Member Functions inherited from genie::rew::GReWeightI
virtual ~GReWeightI ()
 

Private Member Functions

void Init (void)
 

Private Attributes

XSecAlgorithmIfXSecModelDef
 default model More...
 
XSecAlgorithmIfXSecModel
 tweaked model More...
 
RegistryfXSecModelConfig
 config in tweaked model More...
 
bool fRewNue
 reweight nu_e CC? More...
 
bool fRewNuebar
 reweight nu_e_bar CC? More...
 
bool fRewNumu
 reweight nu_mu CC? More...
 
bool fRewNumubar
 reweight nu_mu_bar CC? More...
 
string fMaPath
 M_{A} path in config Registry. More...
 
string fEtaPath
 eta path in config Registry More...
 
double fMaTwkDial
 
double fMaDef
 
double fMaCurr
 
double fEtaTwkDial
 
double fEtaDef
 
double fEtaCurr
 

Additional Inherited Members

- Protected Member Functions inherited from genie::rew::GReWeightI
 GReWeightI ()
 

Detailed Description

Reweighting NCEL GENIE neutrino cross sections.

Author
Costas Andreopoulos <costas.andreopoulos stfc.ac.uk> University of Liverpool & STFC Rutherford Appleton Lab

Nov 25, 2010

Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 42 of file GReWeightNuXSecNCEL.h.

Constructor & Destructor Documentation

GReWeightNuXSecNCEL::GReWeightNuXSecNCEL ( )

Definition at line 43 of file GReWeightNuXSecNCEL.cxx.

44 {
45  this->Init();
46 }
GReWeightNuXSecNCEL::~GReWeightNuXSecNCEL ( )

Definition at line 48 of file GReWeightNuXSecNCEL.cxx.

49 {
50 #ifdef _G_REWEIGHT_NCEL_DEBUG_
51  fTestFile->cd();
52  fTestNtp ->Write();
53  fTestFile->Close();
54  delete fTestFile;
55 #endif
56 }

Member Function Documentation

double GReWeightNuXSecNCEL::CalcWeight ( const EventRecord event)
virtual

calculate a weight for the input event using the current nuisance param values

Implements genie::rew::GReWeightI.

Definition at line 122 of file GReWeightNuXSecNCEL.cxx.

123 {
124  Interaction * interaction = event.Summary();
125 
126  bool is_qe = interaction->ProcInfo().IsQuasiElastic();
127  bool is_nc = interaction->ProcInfo().IsWeakNC();
128  if(!is_qe || !is_nc) return 1.;
129 
130  int nupdg = event.Probe()->Pdg();
131  if(nupdg==kPdgNuMu && !fRewNumu ) return 1.;
132  if(nupdg==kPdgAntiNuMu && !fRewNumubar) return 1.;
133  if(nupdg==kPdgNuE && !fRewNue ) return 1.;
134  if(nupdg==kPdgAntiNuE && !fRewNuebar ) return 1.;
135 
136  bool tweaked_ma = (TMath::Abs(fMaTwkDial ) > controls::kASmallNum);
137  bool tweaked_eta = (TMath::Abs(fEtaTwkDial) > controls::kASmallNum);
138  bool tweaked = tweaked_ma || tweaked_eta;
139  if(!tweaked) return 1.0;
140 
141  interaction->KinePtr()->UseSelectedKinematics();
142  interaction->SetBit(kIAssumeFreeNucleon);
143 
144  double old_xsec = event.DiffXSec();
145  double old_weight = event.Weight();
146  double new_xsec = fXSecModel->XSec(interaction, kPSQ2fE);
147  double new_weight = old_weight * (new_xsec/old_xsec);
148 
149 //LOG("ReW", pDEBUG) << "differential cross section (old) = " << old_xsec;
150 //LOG("ReW", pDEBUG) << "differential cross section (new) = " << new_xsec;
151 //LOG("ReW", pDEBUG) << "event generation weight = " << old_weight;
152 //LOG("ReW", pDEBUG) << "new weight = " << new_weight;
153 
154 #ifdef _G_REWEIGHT_NCEL_DEBUG_
155  double E = interaction->InitState().ProbeE(kRfHitNucRest);
156  double Q2 = interaction->Kine().Q2(true);
157  fTestNtp->Fill(E,Q2,new_weight);
158 #endif
159 
160  interaction->KinePtr()->ClearRunningValues();
161  interaction->ResetBit(kIAssumeFreeNucleon);
162 
163  return new_weight;
164 }
bool fRewNumu
reweight nu_mu CC?
const int kPdgNuE
Definition: PDGCodes.h:25
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:642
Kinematics * KinePtr(void) const
Definition: Interaction.h:73
virtual double XSec(const Interaction *i, KinePhaseSpace_t k=kPSfE) const =0
Compute the cross section for the input interaction.
bool IsQuasiElastic(void) const
Definition: ProcessInfo.cxx:88
const int kPdgAntiNuE
Definition: PDGCodes.h:26
const int kPdgNuMu
Definition: PDGCodes.h:27
XSecAlgorithmI * fXSecModel
tweaked model
bool fRewNuebar
reweight nu_e_bar CC?
Summary information for an interaction.
Definition: Interaction.h:53
void UseSelectedKinematics(void)
Definition: Kinematics.cxx:369
bool IsWeakNC(void) const
const Kinematics & Kine(void) const
Definition: Interaction.h:68
static const double kASmallNum
Definition: Controls.h:40
const int kPdgAntiNuMu
Definition: PDGCodes.h:28
const UInt_t kIAssumeFreeNucleon
Definition: Interaction.h:46
const InitialState & InitState(void) const
Definition: Interaction.h:66
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:67
double Q2(bool selected=false) const
Definition: Kinematics.cxx:135
void ClearRunningValues(void)
Definition: Kinematics.cxx:357
double ProbeE(RefFrame_t rf) const
bool fRewNumubar
reweight nu_mu_bar CC?
void GReWeightNuXSecNCEL::Init ( void  )
private

Definition at line 166 of file GReWeightNuXSecNCEL.cxx.

167 {
168  AlgId id("genie::AhrensNCELPXSec","Default");
169 
170  AlgFactory * algf = AlgFactory::Instance();
171 
172  Algorithm * algdef = algf->AdoptAlgorithm(id);
173  fXSecModelDef = dynamic_cast<XSecAlgorithmI*>(algdef);
175 
176  Algorithm * alg = algf->AdoptAlgorithm(id);
177  fXSecModel = dynamic_cast<XSecAlgorithmI*>(alg);
179 
181 //LOG("ReW", pDEBUG) << *fXSecModelConfig;
182 
183  this->RewNue (true);
184  this->RewNuebar (true);
185  this->RewNumu (true);
186  this->RewNumubar(true);
187 
188  this->SetMaPath ("Ma");
189  this->SetEtaPath("Eta");
190 
191  fMaTwkDial = 0.;
193  fMaCurr = fMaDef;
194  fEtaTwkDial = 0.;
196  fEtaCurr = fEtaDef;
197 
198 #ifdef _G_REWEIGHT_NCEL_DEBUG_
199  fTestFile = new TFile("./ncel_reweight_test.root","recreate");
200  fTestNtp = new TNtupleD("testntp","","E:Q2:wght");
201 #endif
202 }
virtual const Registry & GetConfig(void) const
Get configuration registry.
Definition: Algorithm.h:63
Cross Section Calculation Interface.
Algorithm abstract base class.
Definition: Algorithm.h:48
RgDbl GetDouble(RgKey key) const
Definition: Registry.cxx:488
Registry * fXSecModelConfig
config in tweaked model
XSecAlgorithmI * fXSecModel
tweaked model
XSecAlgorithmI * fXSecModelDef
default model
string fEtaPath
eta path in config Registry
void AdoptSubstructure(void)
Definition: Algorithm.cxx:287
Algorithm * AdoptAlgorithm(const AlgId &algid) const
Definition: AlgFactory.cxx:127
string fMaPath
M_{A} path in config Registry.
Algorithm ID (algorithm name + configuration set name)
Definition: AlgId.h:35
static AlgFactory * Instance()
Definition: AlgFactory.cxx:75
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
bool GReWeightNuXSecNCEL::IsHandled ( GSyst_t  syst)
virtual

does the current weight calculator handle the input nuisance param?

Implements genie::rew::GReWeightI.

Definition at line 58 of file GReWeightNuXSecNCEL.cxx.

59 {
60  bool handle;
61  switch(syst) {
62  case ( kXSecTwkDial_MaNCEL ) : handle = true; break;
63  case ( kXSecTwkDial_EtaNCEL ) : handle = true; break;
64  default:
65  handle = false;
66  break;
67  }
68  return handle;
69 }
tweak NCEL strange axial form factor eta, affects dsigma(NCEL)/dQ2 both in shape and normalization ...
Definition: GSyst.h:47
tweak Ma NCEL, affects dsigma(NCEL)/dQ2 both in shape and normalization
Definition: GSyst.h:46
void GReWeightNuXSecNCEL::Reconfigure ( void  )
virtual

propagate updated nuisance parameter values to actual MC, etc

Implements genie::rew::GReWeightI.

Definition at line 97 of file GReWeightNuXSecNCEL.cxx.

98 {
100 
101  int sign_matwk = utils::rew::Sign(fMaTwkDial );
102  int sign_etatwk = utils::rew::Sign(fEtaTwkDial);
103 
104  double fracerr_ma = fracerr->OneSigmaErr(kXSecTwkDial_MaNCEL, sign_matwk );
105  double fracerr_eta = fracerr->OneSigmaErr(kXSecTwkDial_EtaNCEL, sign_etatwk);
106 
107  fMaCurr = fMaDef * (1. + fMaTwkDial * fracerr_ma);
108  fEtaCurr = fEtaDef * (1. + fEtaTwkDial * fracerr_eta);
109 
110  fMaCurr = TMath::Max(0., fMaCurr );
111  fEtaCurr = TMath::Max(0., fEtaCurr );
112 
114 
115  r.Set(fMaPath, fMaCurr );
116  r.Set(fEtaPath, fEtaCurr);
117  fXSecModel->Configure(r);
118 
119 //LOG("ReW, pDEBUG) << *fXSecModel;
120 }
tweak NCEL strange axial form factor eta, affects dsigma(NCEL)/dQ2 both in shape and normalization ...
Definition: GSyst.h:47
tweak Ma NCEL, affects dsigma(NCEL)/dQ2 both in shape and normalization
Definition: GSyst.h:46
Registry * fXSecModelConfig
config in tweaked model
XSecAlgorithmI * fXSecModel
tweaked model
double OneSigmaErr(GSyst_t syst, int sign=0) const
virtual void Configure(const Registry &config)
Configure the algorithm.
Definition: Algorithm.cxx:70
string fEtaPath
eta path in config Registry
string fMaPath
M_{A} path in config Registry.
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
static GSystUncertainty * Instance(void)
void Set(RgIMapPair entry)
Definition: Registry.cxx:281
int Sign(double twkdial)
void GReWeightNuXSecNCEL::Reset ( void  )
virtual

set all nuisance parameters to default values

Implements genie::rew::GReWeightI.

Definition at line 87 of file GReWeightNuXSecNCEL.cxx.

void genie::rew::GReWeightNuXSecNCEL::RewNue ( bool  tf)
inline

Definition at line 56 of file GReWeightNuXSecNCEL.h.

56 { fRewNue = tf; }
Definition: tf_graph.h:23
void genie::rew::GReWeightNuXSecNCEL::RewNuebar ( bool  tf)
inline

Definition at line 57 of file GReWeightNuXSecNCEL.h.

57 { fRewNuebar = tf; }
Definition: tf_graph.h:23
bool fRewNuebar
reweight nu_e_bar CC?
void genie::rew::GReWeightNuXSecNCEL::RewNumu ( bool  tf)
inline

Definition at line 58 of file GReWeightNuXSecNCEL.h.

58 { fRewNumu = tf; }
bool fRewNumu
reweight nu_mu CC?
Definition: tf_graph.h:23
void genie::rew::GReWeightNuXSecNCEL::RewNumubar ( bool  tf)
inline

Definition at line 59 of file GReWeightNuXSecNCEL.h.

59 { fRewNumubar = tf; }
Definition: tf_graph.h:23
bool fRewNumubar
reweight nu_mu_bar CC?
void genie::rew::GReWeightNuXSecNCEL::SetEtaPath ( string  p)
inline

Definition at line 61 of file GReWeightNuXSecNCEL.h.

61 { fEtaPath = p; }
string fEtaPath
eta path in config Registry
p
Definition: test.py:228
void genie::rew::GReWeightNuXSecNCEL::SetMaPath ( string  p)
inline

Definition at line 60 of file GReWeightNuXSecNCEL.h.

60 { fMaPath = p; }
string fMaPath
M_{A} path in config Registry.
p
Definition: test.py:228
void GReWeightNuXSecNCEL::SetSystematic ( GSyst_t  syst,
double  val 
)
virtual

update the value for the specified nuisance param

Implements genie::rew::GReWeightI.

Definition at line 71 of file GReWeightNuXSecNCEL.cxx.

72 {
73  if(!this->IsHandled(syst)) return;
74 
75  switch(syst) {
76  case ( kXSecTwkDial_MaNCEL ) :
77  fMaTwkDial = twk_dial;
78  break;
79  case ( kXSecTwkDial_EtaNCEL ) :
80  fEtaTwkDial = twk_dial;
81  break;
82  default:
83  break;
84  }
85 }
tweak NCEL strange axial form factor eta, affects dsigma(NCEL)/dQ2 both in shape and normalization ...
Definition: GSyst.h:47
bool IsHandled(GSyst_t syst)
does the current weight calculator handle the input nuisance param?
tweak Ma NCEL, affects dsigma(NCEL)/dQ2 both in shape and normalization
Definition: GSyst.h:46

Member Data Documentation

double genie::rew::GReWeightNuXSecNCEL::fEtaCurr
private

Definition at line 82 of file GReWeightNuXSecNCEL.h.

double genie::rew::GReWeightNuXSecNCEL::fEtaDef
private

Definition at line 81 of file GReWeightNuXSecNCEL.h.

string genie::rew::GReWeightNuXSecNCEL::fEtaPath
private

eta path in config Registry

Definition at line 76 of file GReWeightNuXSecNCEL.h.

double genie::rew::GReWeightNuXSecNCEL::fEtaTwkDial
private

Definition at line 80 of file GReWeightNuXSecNCEL.h.

double genie::rew::GReWeightNuXSecNCEL::fMaCurr
private

Definition at line 79 of file GReWeightNuXSecNCEL.h.

double genie::rew::GReWeightNuXSecNCEL::fMaDef
private

Definition at line 78 of file GReWeightNuXSecNCEL.h.

string genie::rew::GReWeightNuXSecNCEL::fMaPath
private

M_{A} path in config Registry.

Definition at line 75 of file GReWeightNuXSecNCEL.h.

double genie::rew::GReWeightNuXSecNCEL::fMaTwkDial
private

Definition at line 77 of file GReWeightNuXSecNCEL.h.

bool genie::rew::GReWeightNuXSecNCEL::fRewNue
private

reweight nu_e CC?

Definition at line 71 of file GReWeightNuXSecNCEL.h.

bool genie::rew::GReWeightNuXSecNCEL::fRewNuebar
private

reweight nu_e_bar CC?

Definition at line 72 of file GReWeightNuXSecNCEL.h.

bool genie::rew::GReWeightNuXSecNCEL::fRewNumu
private

reweight nu_mu CC?

Definition at line 73 of file GReWeightNuXSecNCEL.h.

bool genie::rew::GReWeightNuXSecNCEL::fRewNumubar
private

reweight nu_mu_bar CC?

Definition at line 74 of file GReWeightNuXSecNCEL.h.

XSecAlgorithmI* genie::rew::GReWeightNuXSecNCEL::fXSecModel
private

tweaked model

Definition at line 68 of file GReWeightNuXSecNCEL.h.

Registry* genie::rew::GReWeightNuXSecNCEL::fXSecModelConfig
private

config in tweaked model

Definition at line 69 of file GReWeightNuXSecNCEL.h.

XSecAlgorithmI* genie::rew::GReWeightNuXSecNCEL::fXSecModelDef
private

default model

Definition at line 67 of file GReWeightNuXSecNCEL.h.


The documentation for this class was generated from the following files: