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

Reweighting non-resonance background level. More...

#include <GReWeightNonResonanceBkg.h>

Inheritance diagram for genie::rew::GReWeightNonResonanceBkg:
genie::rew::GReWeightI

Public Member Functions

 GReWeightNonResonanceBkg ()
 
 ~GReWeightNonResonanceBkg ()
 
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 SetWminCut (double W)
 
- Public Member Functions inherited from genie::rew::GReWeightI
virtual ~GReWeightI ()
 

Private Member Functions

void Init (void)
 

Private Attributes

double fWmin
 W_{min} cut. Reweight only events with W < W_{min}. More...
 
map< GSyst_t, double > fRTwkDial
 
map< GSyst_t, double > fRDef
 
map< GSyst_t, double > fRCurr
 

Additional Inherited Members

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

Detailed Description

Reweighting non-resonance background level.

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 34 of file GReWeightNonResonanceBkg.h.

Constructor & Destructor Documentation

GReWeightNonResonanceBkg::GReWeightNonResonanceBkg ( )

Definition at line 44 of file GReWeightNonResonanceBkg.cxx.

45 {
46  this->Init();
47 }
GReWeightNonResonanceBkg::~GReWeightNonResonanceBkg ( )

Definition at line 49 of file GReWeightNonResonanceBkg.cxx.

50 {
51 
52 }

Member Function Documentation

double GReWeightNonResonanceBkg::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 138 of file GReWeightNonResonanceBkg.cxx.

139 {
140  Interaction * interaction = event.Summary();
141 
142  bool is_dis = interaction->ProcInfo().IsDeepInelastic();
143  if(!is_dis) return 1.;
144 
145  bool selected = true;
146  double W = interaction->Kine().W(selected);
147  bool in_transition = (W<fWmin);
148  if(!in_transition) return 1.;
149 
150  int probe = interaction->InitState().ProbePdg();
151  int hitnuc = interaction->InitState().Tgt().HitNucPdg();
152  InteractionType_t itype = interaction->ProcInfo().InteractionTypeId();
153 
154  int nhadmult = 0;
155  int nnuc = 0;
156  int npi = 0;
157 
158  GHepParticle * p = 0;
159  TIter event_iter(&event);
160  while ( (p = dynamic_cast<GHepParticle *>(event_iter.Next())) ) {
161 
162  int pdgc = p->Pdg();
163  int imom = p->FirstMother();
164  if(imom == -1) continue;
165 
166  GHepParticle * mom = event.Particle(imom);
167  if(!mom) continue;
168 
169  if(mom->Pdg() == kPdgHadronicSyst)
170  {
171  nhadmult++;
172  if ( pdg::IsNucleon(pdgc) ) { nnuc++; }
173  if ( pdg::IsPion (pdgc) ) { npi++; }
174  }
175  }//p
176 
177  if(nhadmult < 2 || nhadmult > 3) return 1.;
178  if(nnuc != 1) return 1.;
179 
180  GSyst_t syst = GSyst::RBkg(itype, probe, hitnuc, npi);
181  if(syst == kNullSystematic) return 1.;
182 
183  double curr = fRCurr[syst];
184  double def = fRDef[syst];
185 
186  if(def>0. && curr>=0.) {
187  double wght = curr / def;
188  return wght;
189  }
190 
191  return 1.;
192 }
double W(bool selected=false) const
Definition: Kinematics.cxx:167
bool IsPion(int pdgc)
Definition: PDGUtils.cxx:296
static GSyst_t RBkg(InteractionType_t itype, int probe, int hitnuc, int npi)
Definition: GSyst.h:499
InteractionType_t InteractionTypeId(void) const
int HitNucPdg(void) const
Definition: Target.cxx:311
bool IsNucleon(int pdgc)
Definition: PDGUtils.cxx:316
int Pdg(void) const
Definition: GHepParticle.h:64
int FirstMother(void) const
Definition: GHepParticle.h:67
Summary information for an interaction.
Definition: Interaction.h:53
const Kinematics & Kine(void) const
Definition: Interaction.h:68
int ProbePdg(void) const
Definition: InitialState.h:54
An enumeration of systematic parameters.
bool IsDeepInelastic(void) const
Definition: ProcessInfo.cxx:98
p
Definition: test.py:228
double fWmin
W_{min} cut. Reweight only events with W < W_{min}.
const InitialState & InitState(void) const
Definition: Interaction.h:66
const ProcessInfo & ProcInfo(void) const
Definition: Interaction.h:67
const Target & Tgt(void) const
Definition: InitialState.h:56
const int kPdgHadronicSyst
Definition: PDGCodes.h:181
enum genie::EInteractionType InteractionType_t
STDHEP-like event record entry that can fit a particle or a nucleus.
Definition: GHepParticle.h:40
void GReWeightNonResonanceBkg::Init ( void  )
private

Definition at line 194 of file GReWeightNonResonanceBkg.cxx.

195 {
196  this->SetWminCut(2.0*units::GeV);
197 
198  // Get the default parameters
199  AlgConfigPool * conf_pool = AlgConfigPool::Instance();
200  Registry * user_config = conf_pool->GlobalParameterList();
201 
202  fRDef.insert(map<GSyst_t,double>::value_type(
203  kXSecTwkDial_RvpCC1pi, user_config->GetDouble("DIS-HMultWgt-vp-CC-m2" )));
204  fRDef.insert(map<GSyst_t,double>::value_type(
205  kXSecTwkDial_RvpCC2pi, user_config->GetDouble("DIS-HMultWgt-vp-CC-m3" )));
206  fRDef.insert(map<GSyst_t,double>::value_type(
207  kXSecTwkDial_RvpNC1pi, user_config->GetDouble("DIS-HMultWgt-vp-NC-m2" )));
208  fRDef.insert(map<GSyst_t,double>::value_type(
209  kXSecTwkDial_RvpNC2pi, user_config->GetDouble("DIS-HMultWgt-vp-NC-m3" )));
210  fRDef.insert(map<GSyst_t,double>::value_type(
211  kXSecTwkDial_RvnCC1pi, user_config->GetDouble("DIS-HMultWgt-vn-CC-m2" )));
212  fRDef.insert(map<GSyst_t,double>::value_type(
213  kXSecTwkDial_RvnCC2pi, user_config->GetDouble("DIS-HMultWgt-vn-CC-m3" )));
214  fRDef.insert(map<GSyst_t,double>::value_type(
215  kXSecTwkDial_RvnNC1pi, user_config->GetDouble("DIS-HMultWgt-vn-NC-m2" )));
216  fRDef.insert(map<GSyst_t,double>::value_type(
217  kXSecTwkDial_RvnNC2pi, user_config->GetDouble("DIS-HMultWgt-vn-NC-m3" )));
218  fRDef.insert(map<GSyst_t,double>::value_type(
219  kXSecTwkDial_RvbarpCC1pi, user_config->GetDouble("DIS-HMultWgt-vbp-CC-m2")));
220  fRDef.insert(map<GSyst_t,double>::value_type(
221  kXSecTwkDial_RvbarpCC2pi, user_config->GetDouble("DIS-HMultWgt-vbp-CC-m3")));
222  fRDef.insert(map<GSyst_t,double>::value_type(
223  kXSecTwkDial_RvbarpNC1pi, user_config->GetDouble("DIS-HMultWgt-vbp-NC-m2")));
224  fRDef.insert(map<GSyst_t,double>::value_type(
225  kXSecTwkDial_RvbarpNC2pi, user_config->GetDouble("DIS-HMultWgt-vbp-NC-m3")));
226  fRDef.insert(map<GSyst_t,double>::value_type(
227  kXSecTwkDial_RvbarnCC1pi, user_config->GetDouble("DIS-HMultWgt-vbn-CC-m2")));
228  fRDef.insert(map<GSyst_t,double>::value_type(
229  kXSecTwkDial_RvbarnCC2pi, user_config->GetDouble("DIS-HMultWgt-vbn-CC-m3")));
230  fRDef.insert(map<GSyst_t,double>::value_type(
231  kXSecTwkDial_RvbarnNC1pi, user_config->GetDouble("DIS-HMultWgt-vbn-NC-m2")));
232  fRDef.insert(map<GSyst_t,double>::value_type(
233  kXSecTwkDial_RvbarnNC2pi, user_config->GetDouble("DIS-HMultWgt-vbn-NC-m3")));
234 
236  for( ; it != fRDef.end(); ++it) {
237  fRCurr.insert(map<GSyst_t,double>::value_type(it->first, it->second));
238  }
239 }
tweak the 1pi non-RES bkg in the RES region, for v+p CC
Definition: GSyst.h:69
tweak the 1pi non-RES bkg in the RES region, for v+p NC
Definition: GSyst.h:71
A singleton class holding all configuration registries built while parsing all loaded XML configurati...
Definition: AlgConfigPool.h:41
tweak the 1pi non-RES bkg in the RES region, for vbar+n CC
Definition: GSyst.h:81
RgDbl GetDouble(RgKey key) const
Definition: Registry.cxx:488
tweak the 2pi non-RES bkg in the RES region, for vbar+p NC
Definition: GSyst.h:80
intermediate_table::const_iterator const_iterator
tweak the 2pi non-RES bkg in the RES region, for vbar+n NC
Definition: GSyst.h:84
tweak the 1pi non-RES bkg in the RES region, for v+n CC
Definition: GSyst.h:73
tweak the 2pi non-RES bkg in the RES region, for v+n CC
Definition: GSyst.h:74
tweak the 2pi non-RES bkg in the RES region, for vbar+n CC
Definition: GSyst.h:82
tweak the 1pi non-RES bkg in the RES region, for vbar+p CC
Definition: GSyst.h:77
tweak the 2pi non-RES bkg in the RES region, for v+p NC
Definition: GSyst.h:72
Registry * GlobalParameterList(void) const
tweak the 2pi non-RES bkg in the RES region, for v+n NC
Definition: GSyst.h:76
A registry. Provides the container for algorithm configuration parameters.
Definition: Registry.h:66
tweak the 1pi non-RES bkg in the RES region, for v+n NC
Definition: GSyst.h:75
tweak the 2pi non-RES bkg in the RES region, for vbar+p CC
Definition: GSyst.h:78
tweak the 1pi non-RES bkg in the RES region, for vbar+p NC
Definition: GSyst.h:79
static const double GeV
Definition: Units.h:29
tweak the 2pi non-RES bkg in the RES region, for v+p CC
Definition: GSyst.h:70
tweak the 1pi non-RES bkg in the RES region, for vbar+n NC
Definition: GSyst.h:83
static AlgConfigPool * Instance()
bool GReWeightNonResonanceBkg::IsHandled ( GSyst_t  syst)
virtual

does the current weight calculator handle the input nuisance param?

Implements genie::rew::GReWeightI.

Definition at line 54 of file GReWeightNonResonanceBkg.cxx.

55 {
56  bool handle;
57 
58  switch(syst) {
59  case ( kXSecTwkDial_RvpCC1pi ) :
60  case ( kXSecTwkDial_RvpCC2pi ) :
61  case ( kXSecTwkDial_RvpNC1pi ) :
62  case ( kXSecTwkDial_RvpNC2pi ) :
63  case ( kXSecTwkDial_RvnCC1pi ) :
64  case ( kXSecTwkDial_RvnCC2pi ) :
65  case ( kXSecTwkDial_RvnNC1pi ) :
66  case ( kXSecTwkDial_RvnNC2pi ) :
67  case ( kXSecTwkDial_RvbarpCC1pi ) :
68  case ( kXSecTwkDial_RvbarpCC2pi ) :
69  case ( kXSecTwkDial_RvbarpNC1pi ) :
70  case ( kXSecTwkDial_RvbarpNC2pi ) :
71  case ( kXSecTwkDial_RvbarnCC1pi ) :
72  case ( kXSecTwkDial_RvbarnCC2pi ) :
73  case ( kXSecTwkDial_RvbarnNC1pi ) :
74  case ( kXSecTwkDial_RvbarnNC2pi ) :
75 
76  handle = true;
77  break;
78 
79  default:
80  handle = false;
81  break;
82  }
83 
84  return handle;
85 }
tweak the 1pi non-RES bkg in the RES region, for v+p CC
Definition: GSyst.h:69
tweak the 1pi non-RES bkg in the RES region, for v+p NC
Definition: GSyst.h:71
tweak the 1pi non-RES bkg in the RES region, for vbar+n CC
Definition: GSyst.h:81
tweak the 2pi non-RES bkg in the RES region, for vbar+p NC
Definition: GSyst.h:80
tweak the 2pi non-RES bkg in the RES region, for vbar+n NC
Definition: GSyst.h:84
tweak the 1pi non-RES bkg in the RES region, for v+n CC
Definition: GSyst.h:73
tweak the 2pi non-RES bkg in the RES region, for v+n CC
Definition: GSyst.h:74
tweak the 2pi non-RES bkg in the RES region, for vbar+n CC
Definition: GSyst.h:82
tweak the 1pi non-RES bkg in the RES region, for vbar+p CC
Definition: GSyst.h:77
tweak the 2pi non-RES bkg in the RES region, for v+p NC
Definition: GSyst.h:72
tweak the 2pi non-RES bkg in the RES region, for v+n NC
Definition: GSyst.h:76
tweak the 1pi non-RES bkg in the RES region, for v+n NC
Definition: GSyst.h:75
tweak the 2pi non-RES bkg in the RES region, for vbar+p CC
Definition: GSyst.h:78
tweak the 1pi non-RES bkg in the RES region, for vbar+p NC
Definition: GSyst.h:79
tweak the 2pi non-RES bkg in the RES region, for v+p CC
Definition: GSyst.h:70
tweak the 1pi non-RES bkg in the RES region, for vbar+n NC
Definition: GSyst.h:83
void GReWeightNonResonanceBkg::Reconfigure ( void  )
virtual

propagate updated nuisance parameter values to actual MC, etc

Implements genie::rew::GReWeightI.

Definition at line 125 of file GReWeightNonResonanceBkg.cxx.

126 {
128 
130  for( ; it != fRTwkDial.end(); ++it) {
131  GSyst_t syst = it->first;
132  double twk_dial = it->second;
133  double curr = fRDef[syst] * (1 + twk_dial * fracerr->OneSigmaErr(syst));
134  fRCurr[syst] = TMath::Max(0.,curr);
135  }
136 }
intermediate_table::iterator iterator
double OneSigmaErr(GSyst_t syst, int sign=0) const
An enumeration of systematic parameters.
static GSystUncertainty * Instance(void)
void GReWeightNonResonanceBkg::Reset ( void  )
virtual

set all nuisance parameters to default values

Implements genie::rew::GReWeightI.

Definition at line 115 of file GReWeightNonResonanceBkg.cxx.

116 {
118  for( ; it != fRTwkDial.end(); ++it) {
119  it->second = 0.;
120  }
121 
122  this->Reconfigure();
123 }
void Reconfigure(void)
propagate updated nuisance parameter values to actual MC, etc
intermediate_table::iterator iterator
void GReWeightNonResonanceBkg::SetSystematic ( GSyst_t  syst,
double  val 
)
virtual

update the value for the specified nuisance param

Implements genie::rew::GReWeightI.

Definition at line 87 of file GReWeightNonResonanceBkg.cxx.

88 {
89  switch(syst) {
90  case ( kXSecTwkDial_RvpCC1pi ) :
91  case ( kXSecTwkDial_RvpCC2pi ) :
92  case ( kXSecTwkDial_RvpNC1pi ) :
93  case ( kXSecTwkDial_RvpNC2pi ) :
94  case ( kXSecTwkDial_RvnCC1pi ) :
95  case ( kXSecTwkDial_RvnCC2pi ) :
96  case ( kXSecTwkDial_RvnNC1pi ) :
97  case ( kXSecTwkDial_RvnNC2pi ) :
98  case ( kXSecTwkDial_RvbarpCC1pi ) :
99  case ( kXSecTwkDial_RvbarpCC2pi ) :
100  case ( kXSecTwkDial_RvbarpNC1pi ) :
101  case ( kXSecTwkDial_RvbarpNC2pi ) :
102  case ( kXSecTwkDial_RvbarnCC1pi ) :
103  case ( kXSecTwkDial_RvbarnCC2pi ) :
104  case ( kXSecTwkDial_RvbarnNC1pi ) :
105  case ( kXSecTwkDial_RvbarnNC2pi ) :
106 
107  fRTwkDial[syst] = twk_dial;
108  break;
109 
110  default:
111  break;
112  }
113 }
tweak the 1pi non-RES bkg in the RES region, for v+p CC
Definition: GSyst.h:69
tweak the 1pi non-RES bkg in the RES region, for v+p NC
Definition: GSyst.h:71
tweak the 1pi non-RES bkg in the RES region, for vbar+n CC
Definition: GSyst.h:81
tweak the 2pi non-RES bkg in the RES region, for vbar+p NC
Definition: GSyst.h:80
tweak the 2pi non-RES bkg in the RES region, for vbar+n NC
Definition: GSyst.h:84
tweak the 1pi non-RES bkg in the RES region, for v+n CC
Definition: GSyst.h:73
tweak the 2pi non-RES bkg in the RES region, for v+n CC
Definition: GSyst.h:74
tweak the 2pi non-RES bkg in the RES region, for vbar+n CC
Definition: GSyst.h:82
tweak the 1pi non-RES bkg in the RES region, for vbar+p CC
Definition: GSyst.h:77
tweak the 2pi non-RES bkg in the RES region, for v+p NC
Definition: GSyst.h:72
tweak the 2pi non-RES bkg in the RES region, for v+n NC
Definition: GSyst.h:76
tweak the 1pi non-RES bkg in the RES region, for v+n NC
Definition: GSyst.h:75
tweak the 2pi non-RES bkg in the RES region, for vbar+p CC
Definition: GSyst.h:78
tweak the 1pi non-RES bkg in the RES region, for vbar+p NC
Definition: GSyst.h:79
tweak the 2pi non-RES bkg in the RES region, for v+p CC
Definition: GSyst.h:70
tweak the 1pi non-RES bkg in the RES region, for vbar+n NC
Definition: GSyst.h:83
void genie::rew::GReWeightNonResonanceBkg::SetWminCut ( double  W)
inline

Definition at line 48 of file GReWeightNonResonanceBkg.h.

48 { fWmin = W; }
double fWmin
W_{min} cut. Reweight only events with W < W_{min}.

Member Data Documentation

map<GSyst_t, double> genie::rew::GReWeightNonResonanceBkg::fRCurr
private

Definition at line 58 of file GReWeightNonResonanceBkg.h.

map<GSyst_t, double> genie::rew::GReWeightNonResonanceBkg::fRDef
private

Definition at line 57 of file GReWeightNonResonanceBkg.h.

map<GSyst_t, double> genie::rew::GReWeightNonResonanceBkg::fRTwkDial
private

Definition at line 56 of file GReWeightNonResonanceBkg.h.

double genie::rew::GReWeightNonResonanceBkg::fWmin
private

W_{min} cut. Reweight only events with W < W_{min}.

Definition at line 54 of file GReWeightNonResonanceBkg.h.


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