WrongSignSysts.cxx
Go to the documentation of this file.
2 
4 
7 
8 namespace ana
9 {
14  const MyWrongSignScale kMyWrongSignScale(0.03,0.03);
15 
16  // --------------------------------------------------
17  void WrongSignScale::
18  Shift(double sigma, caf::SRProxy* sr, double& weight) const
19  {
20  bool rhc = sr->spill.isRHC;
21  bool fhc = sr->spill.isFHC;
22 
23  if(sr->mc.nnu == 0) return;
24  if(sr->mc.nu[0].pdg<0 && fhc) weight *= 1+0.3*sigma;
25  if(sr->mc.nu[0].pdg>0 && rhc) weight *= 1+0.3*sigma;
26  // do we want to apply this to all events or select cc only?
27  // do we want to weight ws in rhc only or in both beams?
28  // if(sr->mc.nu[0].iscc && sr->mc.nu[0].pdg < 0) weight *= 1+0.3*sigma;
29  }
30 
31  //-----------------------------------------------------
33  Shift(double sigma, caf::SRProxy* sr, double& weight) const
34  {
35  bool rhc = sr->spill.isRHC;
36  bool fhc = sr->spill.isFHC;
37  double nuE = kCCE(sr);
38 
39  if(sr->mc.nnu == 0) return;
40  if(sr->mc.nu[0].pdg<0 && fhc) return;
41  if(sr->mc.nu[0].pdg>0 && rhc){
42  if( nuE <= 0.75 ) weight *= 1. + 0.15*sigma;
43  else if( (nuE > 0.75) && (nuE < 1.0) ) weight *= 1. -0.20*sigma;
44  else if( (nuE >= 1.0) && (nuE < 1.2) ) weight *= 1. -0.30*sigma;
45  else if( (nuE >= 1.2) && (nuE < 1.4) ) weight *= 1. -0.15*sigma;
46  else if( (nuE >= 1.4) && (nuE < 1.7) ) weight *= 1. -0.20*sigma;
47  else if( (nuE >= 1.7) && (nuE < 2.0) ) weight *= 1. -0.60*sigma;
48  else if( (nuE >= 2.0) && (nuE < 2.25)) weight *= 1. -0.70*sigma;
49  else if( (nuE >= 2.25) && (nuE < 2.5) ) weight *= 1. -0.45*sigma;
50  else if( (nuE >= 2.5) && (nuE < 2.75)) weight *= 1. -0.15*sigma;
51  else if( (nuE >= 2.75) && (nuE < 3.0) ) weight *= 1. -0.10*sigma;
52  else if( (nuE >= 3.0) && (nuE < 3.5) ) weight *= 1. + 0.05*sigma;
53  else if( (nuE >= 3.5) && (nuE < 4.0) ) weight *= 1. + 0.15*sigma;
54  else if( (nuE >= 4.0) && (nuE < 5.0) ) weight *= 1. + 0.10*sigma;
55  }
56  }
57 
58  //-----------------------------------------------------
60  Shift(double sigma, caf::SRProxy* sr, double& weight) const
61  {
62  bool rhc = sr->spill.isRHC;
63  bool fhc = sr->spill.isFHC;
64  double nuE = kCCE(sr);
65 
66  if(sr->mc.nnu == 0) return;
67  if((sr->mc.nu[0].pdg<0 && fhc) || (sr->mc.nu[0].pdg>0 && rhc)){
68  if( nuE <= 0.75 ) weight *= 1. + 0.15*sigma;
69  else if( (nuE > 0.75) && (nuE < 1.0) ) weight *= 1. -0.20*sigma;
70  else if( (nuE >= 1.0) && (nuE < 1.2) ) weight *= 1. -0.30*sigma;
71  else if( (nuE >= 1.2) && (nuE < 1.4) ) weight *= 1. -0.15*sigma;
72  else if( (nuE >= 1.4) && (nuE < 1.7) ) weight *= 1. -0.20*sigma;
73  else if( (nuE >= 1.7) && (nuE < 2.0) ) weight *= 1. -0.60*sigma;
74  else if( (nuE >= 2.0) && (nuE < 2.25)) weight *= 1. -0.70*sigma;
75  else if( (nuE >= 2.25) && (nuE < 2.5) ) weight *= 1. -0.45*sigma;
76  else if( (nuE >= 2.5) && (nuE < 2.75)) weight *= 1. -0.15*sigma;
77  else if( (nuE >= 2.75) && (nuE < 3.0) ) weight *= 1. -0.10*sigma;
78  else if( (nuE >= 3.0) && (nuE < 3.5) ) weight *= 1. + 0.05*sigma;
79  else if( (nuE >= 3.5) && (nuE < 4.0) ) weight *= 1. + 0.15*sigma;
80  else if( (nuE >= 4.0) && (nuE < 5.0) ) weight *= 1. + 0.10*sigma;
81  }
82  }
83 
84  //-----------------------------------------------------
86  Shift(double sigma, caf::SRProxy* sr, double& weight) const
87  {
88  bool rhc = sr->spill.isRHC;
89  bool fhc = sr->spill.isFHC;
90 
91  if(sr->mc.nnu == 0) return;
92  if(sr->mc.nu[0].pdg<0 && fhc) weight *= 1+1.*sigma;
93  if(sr->mc.nu[0].pdg>0 && rhc) weight *= 1+1.*sigma;
94  }
95 
96  //-------------------------------------------------------------
98  Shift(double sigma, caf::SRProxy* sr, double& weight) const
99  {
100  bool rhc = sr->spill.isRHC;
101  bool fhc = sr->spill.isFHC;
102 
103  if(sr->mc.nnu == 0) return;
104  if(sr->mc.nu[0].pdg<0 && fhc) weight *= 1 + fScaleFHC*sigma;
105  if(sr->mc.nu[0].pdg>0 && rhc) weight *= 1 + fScaleRHC*sigma;
106  }
107 
108  // --------------------------------------------------
109  // Function to pick up reconstructued neutrino energy
110  // Assign scale acording to energy bin
111  double GetBinScaleWS(double nuE = 0.){
112 
113  double scale = 1.;
114 
115  if( nuE <= 0.75 ) scale = 0.15;
116  else if( (nuE > 0.75) && (nuE < 1.0) ) scale = -0.20;
117  else if( (nuE >= 1.0) && (nuE < 1.2) ) scale = -0.30;
118  else if( (nuE >= 1.2) && (nuE < 1.4) ) scale = -0.15;
119  else if( (nuE >= 1.4) && (nuE < 1.7) ) scale = -0.20;
120  else if( (nuE >= 1.7) && (nuE < 2.0) ) scale = -0.60;
121  else if( (nuE >= 2.0) && (nuE < 2.25)) scale = -0.70;
122  else if( (nuE >= 2.25) && (nuE < 2.5) ) scale = -0.45;
123  else if( (nuE >= 2.5) && (nuE < 2.75)) scale = -0.15;
124  else if( (nuE >= 2.75) && (nuE < 3.0) ) scale = -0.10;
125  else if( (nuE >= 3.0) && (nuE < 3.5) ) scale = 0.05;
126  else if( (nuE >= 3.5) && (nuE < 4.0) ) scale = 0.15;
127  else if( (nuE >= 4.0) && (nuE < 5.0) ) scale = 0.10;
128 
129  return scale;
130 
131  }
132 }
caf::Proxy< caf::SRSpill > spill
Definition: SRProxy.h:2102
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
const MyWrongSignScale kMyWrongSignScale(0.03, 0.03)
const WrongSignScale kWrongSignScale
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var weight
const WrongSignEnergyBinRHC kWrongSignEnergyBinRHC
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2085
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:574
caf::Proxy< short int > nnu
Definition: SRProxy.h:573
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
caf::Proxy< bool > isFHC
Definition: SRProxy.h:1331
Double_t scale
Definition: plot.C:25
const Var kCCE
Definition: NumuVars.h:21
Wrong sign scale systematic up and dn by 30%.
Definition: WrongSignSysts.h:8
caf::StandardRecord * sr
double sigma(TH1F *hist, double percentile)
const WrongSignScale100 kWrongSignScale100
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2097
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
const WrongSignEnergyBin kWrongSignEnergyBin
caf::Proxy< bool > isRHC
Definition: SRProxy.h:1332
void Shift(double sigma, caf::SRProxy *sr, double &weight) const override
Perform the systematic shift.
double GetBinScaleWS(double nuE=0.)