TuningSysts2020.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "CAFAna/Core/Loaders.h"
4 #include <TObjString.h>
5 #include "CAFAna/Core/Cut.h"
6 #include "CAFAna/Core/ISyst.h"
7 #include "CAFAna/Systs/Systs.h"
8 #include "MECTuningUtils.h"
9 //#include "MECTuningUtils2020.h"
10 
11 // Place here std::vector of ISyst (or derived) to include in your Prediction // MinuitFitter
12 // in the 2020 tuning/fitter scripts
13 
14 namespace ana
15 {
16 
17 //============================================================
18 // Q3Q0 normalization bins
19 //============================================================
20 
21  std::vector<std::unique_ptr<const CompNormSyst>> systsQ3Q0(
22  int nbinsQ3=20,
23  float fitMinQ3 =0.0,
24  float fitMaxQ3=1.0,
25  int nbinsQ0=16,
26  float fitMinQ0=0.0,
27  float fitMaxQ0=0.8,
28  Cut cut = GetCutIsFitMEC( false ) //isRHC
29  )
30  {
31  float binWidthQ3 = ( fitMaxQ3 - fitMinQ3 ) / nbinsQ3;
32  float binWidthQ0 = ( fitMaxQ0 - fitMinQ0 ) / nbinsQ0;
33  std::vector<std::unique_ptr<const CompNormSyst>> ret;
34  std::vector<Q3Q0Bin> binsQ3Q0;
35  for ( int i = 0; i < nbinsQ3; ++i )
36  {
37  for ( int j = 0; j < nbinsQ0; ++j )
38  {
39  double q3 = fitMinQ3 + binWidthQ3 * ( i + 0.5 );
40  double q0 = fitMinQ0 + binWidthQ0 * ( j + 0.5 );
41  if ( q3 * q3 < q0 * q0 ) continue;
42  Q3Q0Bin b;
43  b.loQ3 = q3 - binWidthQ3 / 2;
44  b.hiQ3 = q3 + binWidthQ3 / 2;
45  b.loQ0 = q0 - binWidthQ0 / 2;
46  b.hiQ0 = q0 + binWidthQ0 / 2;
47  binsQ3Q0.push_back( b );
48  double sig_scale = 1.0;
49  //double sig_scale = ( q3 < 0.5 && q0 < 0.2 ) ? 2.0 : 1.0;
50  ret.emplace_back( std::make_unique<CompNormSyst>( Q3Q0CutFactory( b.loQ3, b.hiQ3, b.loQ0, b.hiQ0 )
51  && cut, sig_scale ) );
52  }
53  }
54  return ret;
55  }
56 
57 //===============================================================================================================
58 // Valencia MEC 2D Gaussian Enhancement
59 //===============================================================================================================
60 
61  std::vector<const ISyst*> systs_params_gauss()
62  {
63  return std::vector<const ISyst*>
64  {
65  new MECGaussEnhSyst( kGauss2DNorm , "Norm" ),
66  new MECGaussEnhSyst( kGauss2DMeanQ0 , "MeanQ0" ),
67  new MECGaussEnhSyst( kGauss2DMeanQ3 , "MeanQ3" ),
68  new MECGaussEnhSyst( kGauss2DSigmaQ0, "SigmaQ0" ),
69  new MECGaussEnhSyst( kGauss2DSigmaQ3, "SigmaQ3" ),
70  new MECGaussEnhSyst( kGauss2DCorr , "Corr" )
71  };
72  }
73 
74 // Adding Minos RES suppression.
75  std::vector<const ISyst*> systs_params_gauss_supp()
76  {
77  return std::vector<const ISyst*>
78  {
79  new MECGaussEnhSyst( kGauss2DNorm , "Norm" ),
80  new MECGaussEnhSyst( kGauss2DMeanQ0 , "MeanQ0" ),
81  new MECGaussEnhSyst( kGauss2DMeanQ3 , "MeanQ3" ),
82  new MECGaussEnhSyst( kGauss2DSigmaQ0, "SigmaQ0" ),
83  new MECGaussEnhSyst( kGauss2DSigmaQ3, "SigmaQ3" ),
84  new MECGaussEnhSyst( kGauss2DCorr , "Corr" ),
85  new MinosResSuppSyst( kMinosResSuppNorm, "Norm" ),
86  new MinosResSuppSyst( kMinosResSuppQ0 , "Q0" ),
88  };
89  }
90 
91  std::vector<const ISyst*> systs_params_double_gauss()
92  {
93  return std::vector<const ISyst*>
94  {
95  new MECDoubleGaussEnhSyst( kGauss2DNorm_1 , "Norm_1" ),
96  new MECDoubleGaussEnhSyst( kGauss2DMeanQ0_1 , "MeanQ0_1" ),
97  new MECDoubleGaussEnhSyst( kGauss2DMeanQ3_1 , "MeanQ3_1" ),
98  new MECDoubleGaussEnhSyst( kGauss2DSigmaQ0_1, "SigmaQ0_1" ),
99  new MECDoubleGaussEnhSyst( kGauss2DSigmaQ3_1, "SigmaQ3_1" ),
100  new MECDoubleGaussEnhSyst( kGauss2DCorr_1 , "Corr_1" ),
101  new MECDoubleGaussEnhSyst( kGauss2DNorm_2 , "Norm_2" ),
102  new MECDoubleGaussEnhSyst( kGauss2DMeanQ0_2 , "MeanQ0_2" ),
103  new MECDoubleGaussEnhSyst( kGauss2DMeanQ3_2 , "MeanQ3_2" ),
104  new MECDoubleGaussEnhSyst( kGauss2DSigmaQ0_2, "SigmaQ0_2" ),
105  new MECDoubleGaussEnhSyst( kGauss2DSigmaQ3_2, "SigmaQ3_2" ),
106  new MECDoubleGaussEnhSyst( kGauss2DCorr_2 , "Corr_2" ),
107  };
108  }
109 
110  std::vector<const ISyst*> systs_params_double_gauss_extra()
111  {
112  return std::vector<const ISyst*>
113  {
114  new MECDoubleGaussEnhSyst( kGauss2DNorm_1 , "Norm_1" ),
115  new MECDoubleGaussEnhSyst( kGauss2DMeanQ0_1 , "MeanQ0_1" ),
116  new MECDoubleGaussEnhSyst( kGauss2DMeanQ3_1 , "MeanQ3_1" ),
117  new MECDoubleGaussEnhSyst( kGauss2DSigmaQ0_1, "SigmaQ0_1" ),
118  new MECDoubleGaussEnhSyst( kGauss2DSigmaQ3_1, "SigmaQ3_1" ),
119  new MECDoubleGaussEnhSyst( kGauss2DCorr_1 , "Corr_1" ),
120  new MECDoubleGaussEnhSyst( kGauss2DNorm_2 , "Norm_2" ),
121  new MECDoubleGaussEnhSyst( kGauss2DMeanQ0_2 , "MeanQ0_2" ),
122  new MECDoubleGaussEnhSyst( kGauss2DMeanQ3_2 , "MeanQ3_2" ),
123  new MECDoubleGaussEnhSyst( kGauss2DSigmaQ0_2, "SigmaQ0_2" ),
124  new MECDoubleGaussEnhSyst( kGauss2DSigmaQ3_2, "SigmaQ3_2" ),
125  new MECDoubleGaussEnhSyst( kGauss2DCorr_2 , "Corr_2" ),
126  new MECDoubleGaussEnhSyst( kBaseline, "Baseline" )
127  };
128  }
129 }
std::vector< const ISyst * > systs_params_double_gauss_extra()
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
std::vector< const ISyst * > systs_params_double_gauss()
std::vector< std::unique_ptr< const CompNormSyst > > systsQ3Q0(int nbinsQ3=20, float fitMinQ3=0.0, float fitMaxQ3=1.0, int nbinsQ0=16, float fitMinQ0=0.0, float fitMaxQ0=0.8, Cut cut=GetCutIsFitMEC(false))
std::vector< const ISyst * > systs_params_gauss()
Cut Q3Q0CutFactory(float loQ3, float hiQ3, float loQ0, float hiQ0)
const double j
Definition: BetheBloch.cxx:29
const Cut cut
Definition: exporter_fd.C:30
const Cut GetCutIsFitMEC(const bool isRHC)
const hit & b
Definition: hits.cxx:21
const NOvARwgtSyst kRPACCQESuppSyst2018("RPAShapesupp2018","RPA shape: low-Q^{2} suppression (2018)", novarwgt::kRPACCQESuppSyst2018)
Definition: RPASysts.h:14
std::vector< const ISyst * > systs_params_gauss_supp()