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

Reweighting GENIE coherent neutrino-nucleus cross sections. More...

#include <GReWeightNuXSecCOH.h>

Inheritance diagram for genie::rew::GReWeightNuXSecCOH:
genie::rew::GReWeightI

Public Member Functions

 GReWeightNuXSecCOH ()
 
 ~GReWeightNuXSecCOH ()
 
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 RewCC (bool tf)
 
void RewNC (bool tf)
 
void SetMaPath (string p)
 
void SetR0Path (string p)
 
- Public Member Functions inherited from genie::rew::GReWeightI
virtual ~GReWeightI ()
 

Private Member Functions

void Init (void)
 

Private Attributes

XSecAlgorithmIfXSecModel
 
RegistryfXSecModelConfig
 
bool fRewNue
 reweight nu_e? More...
 
bool fRewNuebar
 reweight nu_e_bar? More...
 
bool fRewNumu
 reweight nu_mu? More...
 
bool fRewNumubar
 reweight nu_mu_bar? More...
 
bool fRewCC
 reweight CC? More...
 
bool fRewNC
 reweight NC? More...
 
string fMaPath
 M_{A} path in config Registry. More...
 
string fR0Path
 R_{0} path in config Registry. More...
 
double fMaTwkDial
 
double fMaDef
 
double fMaCurr
 
double fR0TwkDial
 
double fR0Def
 
double fR0Curr
 

Additional Inherited Members

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

Detailed Description

Reweighting GENIE coherent neutrino-nucleus cross sections.

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 40 of file GReWeightNuXSecCOH.h.

Constructor & Destructor Documentation

GReWeightNuXSecCOH::GReWeightNuXSecCOH ( )

Definition at line 47 of file GReWeightNuXSecCOH.cxx.

48 {
49  this->Init();
50 }
GReWeightNuXSecCOH::~GReWeightNuXSecCOH ( )

Definition at line 52 of file GReWeightNuXSecCOH.cxx.

53 {
54 
55 }

Member Function Documentation

double GReWeightNuXSecCOH::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 120 of file GReWeightNuXSecCOH.cxx.

121 {
122  Interaction * interaction = event.Summary();
123 
124  bool is_coh = interaction->ProcInfo().IsCoherent();
125  if(!is_coh) return 1.;
126 
127  bool tweaked =
128  (TMath::Abs(fMaTwkDial) > controls::kASmallNum) ||
129  (TMath::Abs(fR0TwkDial) > controls::kASmallNum);
130  if(!tweaked) return 1.0;
131 
132  bool is_cc = interaction->ProcInfo().IsWeakCC();
133  bool is_nc = interaction->ProcInfo().IsWeakNC();
134  if(is_cc && !fRewCC) return 1.;
135  if(is_nc && !fRewNC) return 1.;
136 
137  int nupdg = interaction->InitState().ProbePdg();
138  if(nupdg==kPdgNuMu && !fRewNumu ) return 1.;
139  if(nupdg==kPdgAntiNuMu && !fRewNumubar) return 1.;
140  if(nupdg==kPdgNuE && !fRewNue ) return 1.;
141  if(nupdg==kPdgAntiNuE && !fRewNuebar ) return 1.;
142 
143  interaction->KinePtr()->UseSelectedKinematics();
144 
145  double old_xsec = event.DiffXSec();
146  double old_weight = event.Weight();
147  double new_xsec = fXSecModel->XSec(interaction, kPSxyfE);
148  double new_weight = old_weight * (new_xsec/old_xsec);
149 
150  interaction->KinePtr()->ClearRunningValues();
151 
152  return new_weight;
153 }
bool fRewNuebar
reweight nu_e_bar?
bool IsWeakCC(void) const
const int kPdgNuE
Definition: PDGCodes.h:25
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.
const int kPdgAntiNuE
Definition: PDGCodes.h:26
const int kPdgNuMu
Definition: PDGCodes.h:27
Summary information for an interaction.
Definition: Interaction.h:53
void UseSelectedKinematics(void)
Definition: Kinematics.cxx:369
bool IsWeakNC(void) const
int ProbePdg(void) const
Definition: InitialState.h:54
static const double kASmallNum
Definition: Controls.h:40
const int kPdgAntiNuMu
Definition: PDGCodes.h:28
bool fRewNumubar
reweight nu_mu_bar?
const InitialState & InitState(void) const
Definition: Interaction.h:66
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:67
void ClearRunningValues(void)
Definition: Kinematics.cxx:357
bool IsCoherent(void) const
void GReWeightNuXSecCOH::Init ( void  )
private

Definition at line 155 of file GReWeightNuXSecCOH.cxx.

156 {
157  AlgId id("genie::ReinSehgalCOHPiPXSec","Default");
158 
159  AlgFactory * algf = AlgFactory::Instance();
160  Algorithm * alg = algf->AdoptAlgorithm(id);
161 
162  fXSecModel = dynamic_cast<XSecAlgorithmI*>(alg);
164 
166 //LOG("ReW", pNOTICE) << *fXSecModelConfig;
167 
168  this->RewNue (true);
169  this->RewNuebar (true);
170  this->RewNumu (true);
171  this->RewNumubar(true);
172  this->RewCC (true);
173  this->RewNC (true);
174 
175  this->SetMaPath("Ma");
176  this->SetR0Path("Ro");
177 
178  fMaTwkDial = 0.;
180  fMaCurr = fMaDef;
181  fR0TwkDial = 0.;
183  fR0Curr = fR0Def;
184 }
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
void AdoptSubstructure(void)
Definition: Algorithm.cxx:287
Algorithm * AdoptAlgorithm(const AlgId &algid) const
Definition: AlgFactory.cxx:127
Algorithm ID (algorithm name + configuration set name)
Definition: AlgId.h:35
static AlgFactory * Instance()
Definition: AlgFactory.cxx:75
string fMaPath
M_{A} path in config Registry.
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
string fR0Path
R_{0} path in config Registry.
The GENIE Algorithm Factory.
Definition: AlgFactory.h:40
bool GReWeightNuXSecCOH::IsHandled ( GSyst_t  syst)
virtual

does the current weight calculator handle the input nuisance param?

Implements genie::rew::GReWeightI.

Definition at line 57 of file GReWeightNuXSecCOH.cxx.

58 {
59  bool handle;
60 
61  switch(syst) {
62  case ( kXSecTwkDial_MaCOHpi ) :
63  case ( kXSecTwkDial_R0COHpi ) :
64  handle = true;
65  break;
66  default:
67  handle = false;
68  break;
69  }
70  return handle;
71 }
tweak R0 for COH pion production
Definition: GSyst.h:67
tweak Ma for COH pion production
Definition: GSyst.h:66
void GReWeightNuXSecCOH::Reconfigure ( void  )
virtual

propagate updated nuisance parameter values to actual MC, etc

Implements genie::rew::GReWeightI.

Definition at line 97 of file GReWeightNuXSecCOH.cxx.

98 {
100 
101  double fracerr_ma = fracerr->OneSigmaErr(kXSecTwkDial_MaCOHpi);
102  double fracerr_r0 = fracerr->OneSigmaErr(kXSecTwkDial_R0COHpi);
103 
104  fMaCurr = fMaDef * (1. + fMaTwkDial * fracerr_ma);
105  fR0Curr = fR0Def * (1. + fR0TwkDial * fracerr_r0);
106 
107  fMaCurr = TMath::Max(0., fMaCurr );
108  fR0Curr = TMath::Max(0., fR0Curr );
109 
111 
112  r.Set(fMaPath, fMaCurr);
113  r.Set(fR0Path, fR0Curr);
114 
115  fXSecModel->Configure(r);
116 
117 //LOG("ReW", pDEBUG) << *fXSecModel;
118 }
double OneSigmaErr(GSyst_t syst, int sign=0) const
virtual void Configure(const Registry &config)
Configure the algorithm.
Definition: Algorithm.cxx:70
tweak R0 for COH pion production
Definition: GSyst.h:67
string fMaPath
M_{A} path in config Registry.
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
tweak Ma for COH pion production
Definition: GSyst.h:66
static GSystUncertainty * Instance(void)
string fR0Path
R_{0} path in config Registry.
void Set(RgIMapPair entry)
Definition: Registry.cxx:281
void GReWeightNuXSecCOH::Reset ( void  )
virtual

set all nuisance parameters to default values

Implements genie::rew::GReWeightI.

Definition at line 87 of file GReWeightNuXSecCOH.cxx.

88 {
89  fMaTwkDial = 0.;
90  fMaCurr = fMaDef;
91  fR0TwkDial = 0.;
92  fR0Curr = fR0Def;
93 
94  this->Reconfigure();
95 }
void Reconfigure(void)
propagate updated nuisance parameter values to actual MC, etc
void genie::rew::GReWeightNuXSecCOH::RewCC ( bool  tf)
inline

Definition at line 58 of file GReWeightNuXSecCOH.h.

58 { fRewCC = tf; }
Definition: tf_graph.h:23
void genie::rew::GReWeightNuXSecCOH::RewNC ( bool  tf)
inline

Definition at line 59 of file GReWeightNuXSecCOH.h.

59 { fRewNC = tf; }
Definition: tf_graph.h:23
void genie::rew::GReWeightNuXSecCOH::RewNue ( bool  tf)
inline

Definition at line 54 of file GReWeightNuXSecCOH.h.

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

Definition at line 55 of file GReWeightNuXSecCOH.h.

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

Definition at line 56 of file GReWeightNuXSecCOH.h.

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

Definition at line 57 of file GReWeightNuXSecCOH.h.

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

Definition at line 60 of file GReWeightNuXSecCOH.h.

60 { fMaPath = p; }
p
Definition: test.py:228
string fMaPath
M_{A} path in config Registry.
void genie::rew::GReWeightNuXSecCOH::SetR0Path ( string  p)
inline

Definition at line 61 of file GReWeightNuXSecCOH.h.

61 { fR0Path = p; }
p
Definition: test.py:228
string fR0Path
R_{0} path in config Registry.
void GReWeightNuXSecCOH::SetSystematic ( GSyst_t  syst,
double  val 
)
virtual

update the value for the specified nuisance param

Implements genie::rew::GReWeightI.

Definition at line 73 of file GReWeightNuXSecCOH.cxx.

74 {
75  switch(syst) {
76  case ( kXSecTwkDial_MaCOHpi ) :
77  fMaTwkDial = twk_dial;
78  break;
79  case ( kXSecTwkDial_R0COHpi ) :
80  fR0TwkDial = twk_dial;
81  break;
82  default:
83  break;
84  }
85 }
tweak R0 for COH pion production
Definition: GSyst.h:67
tweak Ma for COH pion production
Definition: GSyst.h:66

Member Data Documentation

double genie::rew::GReWeightNuXSecCOH::fMaCurr
private

Definition at line 80 of file GReWeightNuXSecCOH.h.

double genie::rew::GReWeightNuXSecCOH::fMaDef
private

Definition at line 79 of file GReWeightNuXSecCOH.h.

string genie::rew::GReWeightNuXSecCOH::fMaPath
private

M_{A} path in config Registry.

Definition at line 76 of file GReWeightNuXSecCOH.h.

double genie::rew::GReWeightNuXSecCOH::fMaTwkDial
private

Definition at line 78 of file GReWeightNuXSecCOH.h.

double genie::rew::GReWeightNuXSecCOH::fR0Curr
private

Definition at line 83 of file GReWeightNuXSecCOH.h.

double genie::rew::GReWeightNuXSecCOH::fR0Def
private

Definition at line 82 of file GReWeightNuXSecCOH.h.

string genie::rew::GReWeightNuXSecCOH::fR0Path
private

R_{0} path in config Registry.

Definition at line 77 of file GReWeightNuXSecCOH.h.

double genie::rew::GReWeightNuXSecCOH::fR0TwkDial
private

Definition at line 81 of file GReWeightNuXSecCOH.h.

bool genie::rew::GReWeightNuXSecCOH::fRewCC
private

reweight CC?

Definition at line 74 of file GReWeightNuXSecCOH.h.

bool genie::rew::GReWeightNuXSecCOH::fRewNC
private

reweight NC?

Definition at line 75 of file GReWeightNuXSecCOH.h.

bool genie::rew::GReWeightNuXSecCOH::fRewNue
private

reweight nu_e?

Definition at line 70 of file GReWeightNuXSecCOH.h.

bool genie::rew::GReWeightNuXSecCOH::fRewNuebar
private

reweight nu_e_bar?

Definition at line 71 of file GReWeightNuXSecCOH.h.

bool genie::rew::GReWeightNuXSecCOH::fRewNumu
private

reweight nu_mu?

Definition at line 72 of file GReWeightNuXSecCOH.h.

bool genie::rew::GReWeightNuXSecCOH::fRewNumubar
private

reweight nu_mu_bar?

Definition at line 73 of file GReWeightNuXSecCOH.h.

XSecAlgorithmI* genie::rew::GReWeightNuXSecCOH::fXSecModel
private

Definition at line 67 of file GReWeightNuXSecCOH.h.

Registry* genie::rew::GReWeightNuXSecCOH::fXSecModelConfig
private

Definition at line 68 of file GReWeightNuXSecCOH.h.


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