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

Reweight GENIE NC resonance neutrino-production cross section. Basically a clone of the corresponding CC code. More...

#include <GReWeightNuXSecNCRES.h>

Inheritance diagram for genie::rew::GReWeightNuXSecNCRES:
genie::rew::GReWeightI

Public Member Functions

 GReWeightNuXSecNCRES ()
 
 ~GReWeightNuXSecNCRES ()
 
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 SetMode (int mode)
 
void SetMaPath (string p)
 
void SetMvPath (string p)
 
void RewNue (bool tf)
 
void RewNuebar (bool tf)
 
void RewNumu (bool tf)
 
void RewNumubar (bool tf)
 
- Public Member Functions inherited from genie::rew::GReWeightI
virtual ~GReWeightI ()
 

Static Public Attributes

static const int kModeMaMv = 0
 
static const int kModeNormAndMaMvShape = 1
 

Private Member Functions

void Init (void)
 
double CalcWeightNorm (const EventRecord &event)
 
double CalcWeightMaMvShape (const EventRecord &event)
 
double CalcWeightMaMv (const EventRecord &event)
 

Private Attributes

XSecAlgorithmIfXSecModelDef
 default model More...
 
XSecAlgorithmIfXSecModel
 tweaked model More...
 
RegistryfXSecModelConfig
 config in tweaked model More...
 
int fMode
 0: Ma/Mv, 1: Norm and MaShape/MvShape More...
 
string fMaPath
 M_{A} path in configuration. More...
 
string fMvPath
 M_{V} path in configuration. More...
 
bool fRewNue
 reweight nu_e NC? More...
 
bool fRewNuebar
 reweight nu_e_bar NC? More...
 
bool fRewNumu
 reweight nu_mu NC? More...
 
bool fRewNumubar
 reweight nu_mu_bar NC? More...
 
double fNormTwkDial
 
double fNormDef
 
double fNormCurr
 
double fMaTwkDial
 
double fMaDef
 
double fMaCurr
 
double fMvTwkDial
 
double fMvDef
 
double fMvCurr
 

Additional Inherited Members

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

Detailed Description

Reweight GENIE NC resonance neutrino-production cross section. Basically a clone of the corresponding CC code.

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

Jim Dobson <J.Dobson07 imperial.ac.uk> Imperial College London

Aug 1, 2009

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 41 of file GReWeightNuXSecNCRES.h.

Constructor & Destructor Documentation

GReWeightNuXSecNCRES::GReWeightNuXSecNCRES ( )

Definition at line 52 of file GReWeightNuXSecNCRES.cxx.

53 {
54  this->Init();
55 }
GReWeightNuXSecNCRES::~GReWeightNuXSecNCRES ( )

Definition at line 57 of file GReWeightNuXSecNCRES.cxx.

58 {
59 
60 }

Member Function Documentation

double GReWeightNuXSecNCRES::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 161 of file GReWeightNuXSecNCRES.cxx.

162 {
163  bool is_res = event.Summary()->ProcInfo().IsResonant();
164  bool is_nc = event.Summary()->ProcInfo().IsWeakNC();
165  if(!is_res || !is_nc) return 1.;
166 
167  int nupdg = event.Probe()->Pdg();
168  if(nupdg==kPdgNuMu && !fRewNumu ) return 1.;
169  if(nupdg==kPdgAntiNuMu && !fRewNumubar) return 1.;
170  if(nupdg==kPdgNuE && !fRewNue ) return 1.;
171  if(nupdg==kPdgAntiNuE && !fRewNuebar ) return 1.;
172 
173  if(fMode==kModeMaMv) {
174  double wght = this->CalcWeightMaMv(event);
175  return wght;
176  }
177  else
179  double wght =
180  this->CalcWeightNorm (event) *
181  this->CalcWeightMaMvShape (event);
182  return wght;
183  }
184 
185  return 1.;
186 }
bool fRewNuebar
reweight nu_e_bar NC?
const int kPdgNuE
Definition: PDGCodes.h:25
double CalcWeightNorm(const EventRecord &event)
const int kPdgAntiNuE
Definition: PDGCodes.h:26
const int kPdgNuMu
Definition: PDGCodes.h:27
double CalcWeightMaMv(const EventRecord &event)
int fMode
0: Ma/Mv, 1: Norm and MaShape/MvShape
bool fRewNumubar
reweight nu_mu_bar NC?
double CalcWeightMaMvShape(const EventRecord &event)
const int kPdgAntiNuMu
Definition: PDGCodes.h:28
double GReWeightNuXSecNCRES::CalcWeightMaMv ( const EventRecord event)
private

Definition at line 235 of file GReWeightNuXSecNCRES.cxx.

236 {
237  bool tweaked =
238  (TMath::Abs(fMaTwkDial) > controls::kASmallNum) ||
239  (TMath::Abs(fMvTwkDial) > controls::kASmallNum);
240  if(!tweaked) return 1.0;
241 
242  Interaction * interaction = event.Summary();
243 
244  interaction->KinePtr()->UseSelectedKinematics();
245 
246  double old_xsec = event.DiffXSec();
247  double old_weight = event.Weight();
248  double new_xsec = fXSecModel->XSec(interaction, kPSWQ2fE);
249  double new_weight = old_weight * (new_xsec/old_xsec);
250 
251  interaction->KinePtr()->ClearRunningValues();
252 
253  return new_weight;
254 }
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.
Summary information for an interaction.
Definition: Interaction.h:53
void UseSelectedKinematics(void)
Definition: Kinematics.cxx:369
static const double kASmallNum
Definition: Controls.h:40
XSecAlgorithmI * fXSecModel
tweaked model
void ClearRunningValues(void)
Definition: Kinematics.cxx:357
double GReWeightNuXSecNCRES::CalcWeightMaMvShape ( const EventRecord event)
private

Definition at line 256 of file GReWeightNuXSecNCRES.cxx.

257 {
258  bool tweaked =
259  (TMath::Abs(fMaTwkDial) > controls::kASmallNum) ||
260  (TMath::Abs(fMvTwkDial) > controls::kASmallNum);
261  if(!tweaked) return 1.0;
262 
263  Interaction * interaction = event.Summary();
264 
265  interaction->KinePtr()->UseSelectedKinematics();
266 
267  double old_xsec = event.DiffXSec();
268  double old_weight = event.Weight();
269  double new_xsec = fXSecModel->XSec(interaction, kPSWQ2fE);
270  double new_weight = old_weight * (new_xsec/old_xsec);
271 
272 //LOG("ReW", pDEBUG) << "differential cross section (old) = " << old_xsec;
273 //LOG("ReW", pDEBUG) << "differential cross section (new) = " << new_xsec;
274 //LOG("ReW", pDEBUG) << "event generation weight = " << old_weight;
275 //LOG("ReW", pDEBUG) << "new weight = " << new_weight;
276 
277 //double old_integrated_xsec = event.XSec();
278  double old_integrated_xsec = fXSecModelDef -> Integral(interaction);
279  double twk_integrated_xsec = fXSecModel -> Integral(interaction);
280  assert(twk_integrated_xsec > 0);
281  new_weight *= (old_integrated_xsec/twk_integrated_xsec);
282 
283 //LOG("ReW", pDEBUG) << "integrated cross section (old) = " << old_integrated_xsec;
284 //LOG("ReW", pDEBUG) << "integrated cross section (twk) = " << twk_integrated_xsec;
285 //LOG("ReW", pDEBUG) << "new weight (normalized to const integral) = " << new_weight;
286 
287  interaction->KinePtr()->ClearRunningValues();
288 
289  return new_weight;
290 }
XSecAlgorithmI * fXSecModelDef
default model
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.
Summary information for an interaction.
Definition: Interaction.h:53
void UseSelectedKinematics(void)
Definition: Kinematics.cxx:369
static const double kASmallNum
Definition: Controls.h:40
XSecAlgorithmI * fXSecModel
tweaked model
void ClearRunningValues(void)
Definition: Kinematics.cxx:357
double GReWeightNuXSecNCRES::CalcWeightNorm ( const EventRecord event)
private

Definition at line 226 of file GReWeightNuXSecNCRES.cxx.

227 {
228  bool tweaked = (TMath::Abs(fNormTwkDial) > controls::kASmallNum);
229  if(!tweaked) return 1.0;
230 
231  double wght = fNormCurr;
232  return wght;
233 }
static const double kASmallNum
Definition: Controls.h:40
void GReWeightNuXSecNCRES::Init ( void  )
private

Definition at line 188 of file GReWeightNuXSecNCRES.cxx.

189 {
190  AlgId id("genie::ReinSehgalRESPXSec","Default");
191 
192  AlgFactory * algf = AlgFactory::Instance();
193 
194  Algorithm * algdef = algf->AdoptAlgorithm(id);
195  fXSecModelDef = dynamic_cast<XSecAlgorithmI*>(algdef);
197 
198  Algorithm * alg = algf->AdoptAlgorithm(id);
199  fXSecModel = dynamic_cast<XSecAlgorithmI*>(alg);
201 
203 //LOG("ReW", pNOTICE) << *fXSecModelConfig;
204 
206 
207  this->RewNue (true);
208  this->RewNuebar (true);
209  this->RewNumu (true);
210  this->RewNumubar(true);
211 
212  this->SetMaPath("Ma");
213  this->SetMvPath("Mv");
214 
215  fNormTwkDial = 0.;
216  fNormDef = 1.;
218  fMaTwkDial = 0.;
220  fMaCurr = fMaDef;
221  fMvTwkDial = 0.;
223  fMvCurr = fMvDef;
224 }
virtual const Registry & GetConfig(void) const
Get configuration registry.
Definition: Algorithm.h:63
Cross Section Calculation Interface.
Registry * fXSecModelConfig
config in tweaked model
XSecAlgorithmI * fXSecModelDef
default model
Algorithm abstract base class.
Definition: Algorithm.h:48
RgDbl GetDouble(RgKey key) const
Definition: Registry.cxx:488
void AdoptSubstructure(void)
Definition: Algorithm.cxx:287
Algorithm * AdoptAlgorithm(const AlgId &algid) const
Definition: AlgFactory.cxx:127
string fMvPath
M_{V} path in configuration.
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
XSecAlgorithmI * fXSecModel
tweaked model
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
string fMaPath
M_{A} path in configuration.
bool GReWeightNuXSecNCRES::IsHandled ( GSyst_t  syst)
virtual

does the current weight calculator handle the input nuisance param?

Implements genie::rew::GReWeightI.

Definition at line 62 of file GReWeightNuXSecNCRES.cxx.

63 {
64  bool handle;
65 
66  switch(syst) {
67 
68  case ( kXSecTwkDial_NormNCRES ) :
69  case ( kXSecTwkDial_MaNCRESshape ) :
70  case ( kXSecTwkDial_MvNCRESshape ) :
72  handle = true;
73  } else {
74  handle = false;
75  }
76  break;
77 
78  case ( kXSecTwkDial_MaNCRES ) :
79  case ( kXSecTwkDial_MvNCRES ) :
80  if(fMode==kModeMaMv) {
81  handle = true;
82  } else {
83  handle = false;
84  }
85  break;
86 
87  default:
88  handle = false;
89  break;
90  }
91 
92  return handle;
93 }
int fMode
0: Ma/Mv, 1: Norm and MaShape/MvShape
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:64
tweak NCRES normalization
Definition: GSyst.h:60
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 in shape only (normalized to constant integral) ...
Definition: GSyst.h:61
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 in shape only (normalized to constant integral) ...
Definition: GSyst.h:62
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:63
void GReWeightNuXSecNCRES::Reconfigure ( void  )
virtual

propagate updated nuisance parameter values to actual MC, etc

Implements genie::rew::GReWeightI.

Definition at line 128 of file GReWeightNuXSecNCRES.cxx.

129 {
131 
132  if(fMode==kModeMaMv) {
133  double fracerr_ma = fracerr->OneSigmaErr(kXSecTwkDial_MaNCRES);
134  double fracerr_mv = fracerr->OneSigmaErr(kXSecTwkDial_MvNCRES);
135  fMaCurr = fMaDef * (1. + fMaTwkDial * fracerr_ma);
136  fMvCurr = fMvDef * (1. + fMvTwkDial * fracerr_mv);
137  }
138  else
140  double fracerr_norm = fracerr->OneSigmaErr(kXSecTwkDial_NormNCRES);
141  double fracerr_mash = fracerr->OneSigmaErr(kXSecTwkDial_MaNCRESshape);
142  double fracerr_mvsh = fracerr->OneSigmaErr(kXSecTwkDial_MvNCRESshape);
143  fNormCurr = fNormDef * (1. + fNormTwkDial * fracerr_norm);
144  fMaCurr = fMaDef * (1. + fMaTwkDial * fracerr_mash);
145  fMvCurr = fMvDef * (1. + fMvTwkDial * fracerr_mvsh);
146  }
147 
148  fNormCurr = TMath::Max(0., fNormCurr);
149  fMaCurr = TMath::Max(0., fMaCurr );
150  fMvCurr = TMath::Max(0., fMvCurr );
151 
153 
154  r.Set(fMaPath, fMaCurr);
155  r.Set(fMvPath, fMvCurr);
156  fXSecModel->Configure(r);
157 
158 //LOG("ReW, pDEBUG) << *fXSecModel;
159 }
Registry * fXSecModelConfig
config in tweaked model
int fMode
0: Ma/Mv, 1: Norm and MaShape/MvShape
double OneSigmaErr(GSyst_t syst, int sign=0) const
virtual void Configure(const Registry &config)
Configure the algorithm.
Definition: Algorithm.cxx:70
string fMvPath
M_{V} path in configuration.
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:64
tweak NCRES normalization
Definition: GSyst.h:60
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
XSecAlgorithmI * fXSecModel
tweaked model
static GSystUncertainty * Instance(void)
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 in shape only (normalized to constant integral) ...
Definition: GSyst.h:61
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 in shape only (normalized to constant integral) ...
Definition: GSyst.h:62
void Set(RgIMapPair entry)
Definition: Registry.cxx:281
string fMaPath
M_{A} path in configuration.
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:63
void GReWeightNuXSecNCRES::Reset ( void  )
virtual

set all nuisance parameters to default values

Implements genie::rew::GReWeightI.

Definition at line 116 of file GReWeightNuXSecNCRES.cxx.

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

Definition at line 61 of file GReWeightNuXSecNCRES.h.

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

Definition at line 62 of file GReWeightNuXSecNCRES.h.

62 { fRewNuebar = tf; }
bool fRewNuebar
reweight nu_e_bar NC?
Definition: tf_graph.h:23
void genie::rew::GReWeightNuXSecNCRES::RewNumu ( bool  tf)
inline

Definition at line 63 of file GReWeightNuXSecNCRES.h.

63 { fRewNumu = tf; }
Definition: tf_graph.h:23
void genie::rew::GReWeightNuXSecNCRES::RewNumubar ( bool  tf)
inline

Definition at line 64 of file GReWeightNuXSecNCRES.h.

64 { fRewNumubar = tf; }
Definition: tf_graph.h:23
bool fRewNumubar
reweight nu_mu_bar NC?
void genie::rew::GReWeightNuXSecNCRES::SetMaPath ( string  p)
inline

Definition at line 59 of file GReWeightNuXSecNCRES.h.

59 { fMaPath = p; }
p
Definition: test.py:228
string fMaPath
M_{A} path in configuration.
void genie::rew::GReWeightNuXSecNCRES::SetMode ( int  mode)
inline

Definition at line 58 of file GReWeightNuXSecNCRES.h.

58 { fMode = mode; }
int fMode
0: Ma/Mv, 1: Norm and MaShape/MvShape
void genie::rew::GReWeightNuXSecNCRES::SetMvPath ( string  p)
inline

Definition at line 60 of file GReWeightNuXSecNCRES.h.

60 { fMvPath = p; }
string fMvPath
M_{V} path in configuration.
p
Definition: test.py:228
void GReWeightNuXSecNCRES::SetSystematic ( GSyst_t  syst,
double  val 
)
virtual

update the value for the specified nuisance param

Implements genie::rew::GReWeightI.

Definition at line 95 of file GReWeightNuXSecNCRES.cxx.

96 {
97  if(!this->IsHandled(syst)) return;
98 
99  switch(syst) {
100  case ( kXSecTwkDial_NormNCRES ) :
101  fNormTwkDial = twk_dial;
102  break;
103  case ( kXSecTwkDial_MaNCRESshape ) :
104  case ( kXSecTwkDial_MaNCRES ) :
105  fMaTwkDial = twk_dial;
106  break;
107  case ( kXSecTwkDial_MvNCRESshape ) :
108  case ( kXSecTwkDial_MvNCRES ) :
109  fMvTwkDial = twk_dial;
110  break;
111  default:
112  break;
113  }
114 }
bool IsHandled(GSyst_t syst)
does the current weight calculator handle the input nuisance param?
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:64
tweak NCRES normalization
Definition: GSyst.h:60
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 in shape only (normalized to constant integral) ...
Definition: GSyst.h:61
tweak Mv NCRES, affects d2sigma(NCRES)/dWdQ2 in shape only (normalized to constant integral) ...
Definition: GSyst.h:62
tweak Ma NCRES, affects d2sigma(NCRES)/dWdQ2 both in shape and normalization
Definition: GSyst.h:63

Member Data Documentation

double genie::rew::GReWeightNuXSecNCRES::fMaCurr
private

Definition at line 89 of file GReWeightNuXSecNCRES.h.

double genie::rew::GReWeightNuXSecNCRES::fMaDef
private

Definition at line 88 of file GReWeightNuXSecNCRES.h.

string genie::rew::GReWeightNuXSecNCRES::fMaPath
private

M_{A} path in configuration.

Definition at line 78 of file GReWeightNuXSecNCRES.h.

double genie::rew::GReWeightNuXSecNCRES::fMaTwkDial
private

Definition at line 87 of file GReWeightNuXSecNCRES.h.

int genie::rew::GReWeightNuXSecNCRES::fMode
private

0: Ma/Mv, 1: Norm and MaShape/MvShape

Definition at line 77 of file GReWeightNuXSecNCRES.h.

double genie::rew::GReWeightNuXSecNCRES::fMvCurr
private

Definition at line 92 of file GReWeightNuXSecNCRES.h.

double genie::rew::GReWeightNuXSecNCRES::fMvDef
private

Definition at line 91 of file GReWeightNuXSecNCRES.h.

string genie::rew::GReWeightNuXSecNCRES::fMvPath
private

M_{V} path in configuration.

Definition at line 79 of file GReWeightNuXSecNCRES.h.

double genie::rew::GReWeightNuXSecNCRES::fMvTwkDial
private

Definition at line 90 of file GReWeightNuXSecNCRES.h.

double genie::rew::GReWeightNuXSecNCRES::fNormCurr
private

Definition at line 86 of file GReWeightNuXSecNCRES.h.

double genie::rew::GReWeightNuXSecNCRES::fNormDef
private

Definition at line 85 of file GReWeightNuXSecNCRES.h.

double genie::rew::GReWeightNuXSecNCRES::fNormTwkDial
private

Definition at line 84 of file GReWeightNuXSecNCRES.h.

bool genie::rew::GReWeightNuXSecNCRES::fRewNue
private

reweight nu_e NC?

Definition at line 80 of file GReWeightNuXSecNCRES.h.

bool genie::rew::GReWeightNuXSecNCRES::fRewNuebar
private

reweight nu_e_bar NC?

Definition at line 81 of file GReWeightNuXSecNCRES.h.

bool genie::rew::GReWeightNuXSecNCRES::fRewNumu
private

reweight nu_mu NC?

Definition at line 82 of file GReWeightNuXSecNCRES.h.

bool genie::rew::GReWeightNuXSecNCRES::fRewNumubar
private

reweight nu_mu_bar NC?

Definition at line 83 of file GReWeightNuXSecNCRES.h.

XSecAlgorithmI* genie::rew::GReWeightNuXSecNCRES::fXSecModel
private

tweaked model

Definition at line 74 of file GReWeightNuXSecNCRES.h.

Registry* genie::rew::GReWeightNuXSecNCRES::fXSecModelConfig
private

config in tweaked model

Definition at line 75 of file GReWeightNuXSecNCRES.h.

XSecAlgorithmI* genie::rew::GReWeightNuXSecNCRES::fXSecModelDef
private

default model

Definition at line 73 of file GReWeightNuXSecNCRES.h.

const int GReWeightNuXSecNCRES::kModeMaMv = 0
static

Definition at line 44 of file GReWeightNuXSecNCRES.h.

const int GReWeightNuXSecNCRES::kModeNormAndMaMvShape = 1
static

Definition at line 45 of file GReWeightNuXSecNCRES.h.


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