GReWeightNuXSecNC.cxx
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*
3  Copyright (c) 2003-2017, GENIE Neutrino MC Generator Collaboration
4  For the full text of the license visit http://copyright.genie-mc.org
5  or see $GENIE/LICENSE
6 
7  Authors: Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
8  University of Liverpool & STFC Rutherford Appleton Lab
9 
10  Jim Dobson <J.Dobson07 \at imperial.ac.uk>
11  Imperial College London
12 
13  For the class documentation see the corresponding header file.
14 
15  Important revisions after version 2.0.0 :
16  @ May 25, 2010 - CA
17  First included in v2.7.1.
18 
19 */
20 //____________________________________________________________________________
21 
22 #include <cassert>
23 
24 #include <TMath.h>
25 
26 #include "Conventions/Controls.h"
27 #include "EVGCore/EventRecord.h"
29 #include "Messenger/Messenger.h"
30 #include "PDG/PDGCodes.h"
32 #include "ReWeight/GSystSet.h"
34 
35 using namespace genie;
36 using namespace genie::rew;
37 
38 //_______________________________________________________________________________________
40 {
41  this->Init();
42 }
43 //_______________________________________________________________________________________
45 {
46 
47 }
48 //_______________________________________________________________________________________
50 {
51  switch(syst) {
52  case ( kXSecTwkDial_NC ) :
53  return true;
54  break;
55  default:
56  return false;
57  break;
58  }
59  return false;
60 }
61 //_______________________________________________________________________________________
62 void GReWeightNuXSecNC::SetSystematic(GSyst_t syst, double twk_dial)
63 {
64  if(!this->IsHandled(syst)) return;
65 
66  switch(syst) {
67  case ( kXSecTwkDial_NC ) :
68  fNCTwkDial = twk_dial;
69  break;
70  default:
71  return;
72  break;
73  }
74 }
75 //_______________________________________________________________________________________
77 {
78  fNCTwkDial = 0.;
79 }
80 //_______________________________________________________________________________________
82 {
83  fNCTwkDial = TMath::Max(0., fNCTwkDial);
84 }
85 //_______________________________________________________________________________________
87 {
88  bool tweaked = (TMath::Abs(fNCTwkDial) > controls::kASmallNum);
89  if(!tweaked) return 1.;
90 
91  Interaction * interaction = event.Summary();
92  bool is_nc = interaction->ProcInfo().IsWeakNC();
93  if(!is_nc) return 1.;
94 
95  bool is_qel = event.Summary()->ProcInfo().IsQuasiElastic();
96  if(is_qel && !fRewQE) return 1.;
97 
98  bool is_res = event.Summary()->ProcInfo().IsResonant();
99  if(is_res && !fRewRES) return 1.;
100 
101  bool is_dis = event.Summary()->ProcInfo().IsDeepInelastic();
102  if(is_dis && !fRewDIS) return 1.;
103 
104  int nupdg = interaction->InitState().ProbePdg();
105  if(nupdg==kPdgNuMu && !fRewNumu ) return 1.;
106  if(nupdg==kPdgAntiNuMu && !fRewNumubar) return 1.;
107  if(nupdg==kPdgNuE && !fRewNue ) return 1.;
108  if(nupdg==kPdgAntiNuE && !fRewNuebar ) return 1.;
109 
110  return fNCTwkDial;
111 }
112 //_______________________________________________________________________________________
114 {
115  fNCTwkDial = 0.;
116 
117  this->RewNue (true);
118  this->RewNuebar (true);
119  this->RewNumu (true);
120  this->RewNumubar (true);
121 
122  this->RewQE (true );
123  this->RewRES (false); // assume GReWeightNuXSecNCRES is going to be your 1st choice
124  this->RewDIS (false); // assume GReWeightNuXSecDIS is going to be your 1st choice
125 
126 }
127 //_______________________________________________________________________________________
128 
129 
void SetSystematic(GSyst_t syst, double val)
update the value for the specified nuisance param
const int kPdgNuE
Definition: PDGCodes.h:25
#include "Numerical/GSFunc.h"
Definition: AlgCmp.h:26
bool IsHandled(GSyst_t syst)
does the current weight calculator handle the input nuisance param?
bool fRewDIS
reweight NC DIS?
const int kPdgAntiNuE
Definition: PDGCodes.h:26
bool fRewRES
reweight NC RES?
const int kPdgNuMu
Definition: PDGCodes.h:27
Summary information for an interaction.
Definition: Interaction.h:53
bool IsWeakNC(void) const
double fNCTwkDial
tweaking dial
bool fRewQE
reweight NC elastic?
int ProbePdg(void) const
Definition: InitialState.h:54
bool fRewNumu
reweight nu_mu?
static const double kASmallNum
Definition: Controls.h:40
An enumeration of systematic parameters.
const int kPdgAntiNuMu
Definition: PDGCodes.h:28
void Reset(void)
set all nuisance parameters to default values
Generated Event Record. It is a GHepRecord object that can accept / be visited by EventRecordVisitorI...
Definition: EventRecord.h:38
void Reconfigure(void)
propagate updated nuisance parameter values to actual MC, etc
double CalcWeight(const EventRecord &event)
calculate a weight for the input event using the current nuisance param values
const InitialState & InitState(void) const
Definition: Interaction.h:66
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:67
bool fRewNuebar
reweight nu_e_bar?
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
Event finding and building.
bool fRewNumubar
reweight nu_mu_bar?