Public Member Functions | Private Attributes | List of all members
ana::MECDoubleGaussEnhSyst Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N21-02-24/CAFAna/Systs/MECTuningSysts.h"

Inheritance diagram for ana::MECDoubleGaussEnhSyst:
ana::ISyst ana::ISyst

Public Member Functions

 MECDoubleGaussEnhSyst (const MECDoubleGaussEnhParam &shift_param, const std::string &shift_param_name, const GaussParams &init_params)
 
void Shift (double sigma, caf::SRProxy *sr, double &weight) const override
 Perform the systematic shift. More...
 
 MECDoubleGaussEnhSyst (const MECDoubleGaussEnhParam &shift_param, const std::string &shift_param_name)
 
void Shift (double sigma, caf::SRProxy *sr, double &weight) const override
 Perform the systematic shift. More...
 
virtual const std::stringShortName () const final
 The name printed out to the screen. More...
 
virtual const std::stringLatexName () const final
 The name used on plots (ROOT's TLatex syntax) More...
 
virtual void TruthShift (double sigma, caf::SRNeutrinoProxy *nu, double &weight) const
 
virtual bool IsGenieReweight () const
 GENIE reweights can only provide +/-1,2sigma. More...
 

Private Attributes

const MECDoubleGaussEnhParam fShiftParam
 
const GaussParams fInitParams
 

Detailed Description

Definition at line 190 of file MECTuningSysts.h.

Constructor & Destructor Documentation

ana::MECDoubleGaussEnhSyst::MECDoubleGaussEnhSyst ( const MECDoubleGaussEnhParam shift_param,
const std::string shift_param_name,
const GaussParams init_params 
)
inline

Definition at line 193 of file MECTuningSysts.h.

194  : ISyst( "MECDoubleGaussEnhSyst" + shift_param_name, "MEC 2D Gauss Syst " + shift_param_name ),
195  fShiftParam( shift_param ), fInitParams( init_params)
196  {}
const GaussParams fInitParams
const MECDoubleGaussEnhParam fShiftParam
ISyst(const std::string &shortName, const std::string &latexName)
Definition: ISyst.cxx:10
ana::MECDoubleGaussEnhSyst::MECDoubleGaussEnhSyst ( const MECDoubleGaussEnhParam shift_param,
const std::string shift_param_name 
)
inline

Definition at line 999 of file MECTuningUtils.h.

1000  : ISyst( "MECDoubleGaussEnhSyst" + shift_param_name, "MEC 2D Gauss Syst " + shift_param_name ),
1001  fShiftParam( shift_param )
1002  {}
const MECDoubleGaussEnhParam fShiftParam
ISyst(const std::string &shortName, const std::string &latexName)
Definition: ISyst.cxx:10

Member Function Documentation

virtual bool ana::ISyst::IsGenieReweight ( ) const
inlinevirtualinherited

GENIE reweights can only provide +/-1,2sigma.

Reimplemented in ana::SummedSyst.

Definition at line 56 of file ISyst.h.

56 {return false;}
virtual const std::string& ana::ISyst::LatexName ( ) const
inlinefinalvirtualinherited

The name used on plots (ROOT's TLatex syntax)

Definition at line 30 of file ISyst.h.

References ana::ISyst::fLatexName, ana::ISyst::Shift(), sigma(), sr, and ana::weight.

Referenced by ana::PredictionInterp::DebugPlotColz(), GetGENIEShiftLabels(), ana::NuISyst::SaveTo(), SystsGENIEAna(), and WriteSystName().

30 {return fLatexName;}
std::string fLatexName
Definition: ISyst.h:60
void ana::MECDoubleGaussEnhSyst::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const
inlineoverridevirtual

Perform the systematic shift.

Override this function if your systematic depends on non-SRNeutrino quantities. If it is SRNeutrino-only, implement the other function, and let this default forward to you when necessary.

Parameters
sigmaNumber of sigma to shift record by
srThe record to inspect and alter
weightScale this weight for reweighting systematics

Reimplemented from ana::ISyst.

Definition at line 197 of file MECTuningSysts.h.

References ana::CalcMECDoubleGaussEnh(), caf::kMEC, ana::kTrueQ0, ana::kTrueQ2, ana::kTrueQ3, caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nnu, caf::Proxy< caf::SRTruthBranch >::nu, and genie::utils::kinematics::Q2().

198  {
199  // if ( !kIsNumuCC( sr ) || sr->mc.nu[0].mode != caf::kMEC ) return;
200  if ( sr->mc.nnu < 1) return;
201  if ( !(sr->mc.nu[0].iscc) || sr->mc.nu[0].mode != caf::kMEC ) return;
202  // This will work for Empirical MEC. Will it also work for Valencia MEC?
203  double q0 = kTrueQ0( sr );
204  double q3 = kTrueQ3( sr );
205  double Q2 = kTrueQ2( sr );
206  double wgt_nominal = CalcMECDoubleGaussEnh( q0, q3, Q2, fShiftParam, 0 , fInitParams );
207  double wgt_shift = CalcMECDoubleGaussEnh( q0, q3, Q2, fShiftParam, sigma , fInitParams );
208  weight *= wgt_shift / wgt_nominal;
209  if (wgt_nominal <= 0 ) weight = 0;
210 
211  }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
const Var weight
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
const Var kTrueQ0
Definition: TruthVars.h:32
const Var kTrueQ2
Definition: TruthVars.h:27
const Var kTrueQ3
Definition: TruthVars.h:38
double CalcMECDoubleGaussEnh(const double q0, const double q3, const double Q2, const MECDoubleGaussEnhParam shift_param, const double shift_sigma, const GaussParams initialParams)
double sigma(TH1F *hist, double percentile)
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
const GaussParams fInitParams
const MECDoubleGaussEnhParam fShiftParam
void ana::MECDoubleGaussEnhSyst::Shift ( double  sigma,
caf::SRProxy sr,
double &  weight 
) const
inlineoverridevirtual

Perform the systematic shift.

Override this function if your systematic depends on non-SRNeutrino quantities. If it is SRNeutrino-only, implement the other function, and let this default forward to you when necessary.

Parameters
sigmaNumber of sigma to shift record by
srThe record to inspect and alter
weightScale this weight for reweighting systematics

Reimplemented from ana::ISyst.

Definition at line 1003 of file MECTuningUtils.h.

References ana::CalcMECDoubleGaussEnh(), om::cout, allTimeWatchdog::endl, caf::kMEC, ana::kTrueQ0, ana::kTrueQ2, ana::kTrueQ3, caf::Proxy< caf::StandardRecord >::mc, caf::Proxy< caf::SRTruthBranch >::nnu, caf::Proxy< caf::SRTruthBranch >::nu, and genie::utils::kinematics::Q2().

1004  {
1005 // if ( !kIsNumuCC( sr ) || sr->mc.nu[0].mode != caf::kMEC ) return;
1006  if ( sr->mc.nnu < 1) return;
1007  if ( !(sr->mc.nu[0].iscc) || sr->mc.nu[0].mode != caf::kMEC ) return;
1008  // This will work for Empirical MEC. Will it also work for Valencia MEC?
1009  double q0 = kTrueQ0( sr );
1010  double q3 = kTrueQ3( sr );
1011  double Q2 = kTrueQ2( sr );
1012  double wgt_nominal = CalcMECDoubleGaussEnh( q0, q3, Q2, fShiftParam, 0 );
1013  double wgt_shift = CalcMECDoubleGaussEnh( q0, q3, Q2, fShiftParam, sigma );
1014  weight *= wgt_shift / wgt_nominal;
1015  if (wgt_nominal <= 0 ) weight = 0;
1016  std::cout<<"The weight here is "weight<<std::endl;
1017 
1018  }
double Q2(const Interaction *const i)
Definition: KineUtils.cxx:991
const Var weight
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
const Var kTrueQ0
Definition: TruthVars.h:32
const Var kTrueQ2
Definition: TruthVars.h:27
const Var kTrueQ3
Definition: TruthVars.h:38
double CalcMECDoubleGaussEnh(const double q0, const double q3, const double Q2, const MECDoubleGaussEnhParam shift_param, const double shift_sigma, const GaussParams initialParams)
double sigma(TH1F *hist, double percentile)
OStream cout
Definition: OStream.cxx:6
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
const MECDoubleGaussEnhParam fShiftParam
virtual const std::string& ana::ISyst::ShortName ( ) const
inlinefinalvirtualinherited
virtual void ana::ISyst::TruthShift ( double  sigma,
caf::SRNeutrinoProxy nu,
double &  weight 
) const
inlinevirtualinherited

For systematics that deal only with the neutrino truth and not any reconstruction/PID details. Systematics defined this way will work on nuTree-derived spectra too (e.g. denominators of efficiencies).

Reimplemented in ana::BeamSyst, demo::DemoSyst1, ana::GenericSystComponentScale< T >, ana::GenericSystComponentScale< T >, ana::GenericSystComponentScale< T >, ana::ReinteractionSyst, and ana::NOvARwgtSyst.

Definition at line 46 of file ISyst.h.

Referenced by ana::ISyst::Shift().

49  {
50  // Implement this function if your systematic depends only
51  // SRNeutrino. Left blank by default, since systematics using other
52  // information can do nothing sensible to the nuTree.
53  }

Member Data Documentation

const GaussParams ana::MECDoubleGaussEnhSyst::fInitParams
private

Definition at line 214 of file MECTuningSysts.h.

const MECDoubleGaussEnhParam ana::MECDoubleGaussEnhSyst::fShiftParam
private

Definition at line 213 of file MECTuningSysts.h.


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