ND_DataMC_Comp_Systs.C
Go to the documentation of this file.
1 // Fills spectra for systematic error band. Makes both pot norm with full syst band and area norm with shape only syst band
2 // have to manually make nd_syst_plots directory before running
3 
4 bool IsFHC=false; // Global variable for whether I am running over FHC or RHC?
5 bool Bless=true; // Global variable for whether I am running blessing plots?
6 
8 
9 #include "CAFAna/Cuts/Cuts.h"
14 #include "CAFAna/Cuts/SpillCuts.h"
15 #include "CAFAna/Core/Var.h"
17 #include "CAFAna/Systs/Systs.h"
24 
25 #include "TFile.h"
26 #include "TSystem.h"
28 
29 using namespace ana;
30 
31 ////////////////////////////////////////
32 // Making a text file for blessing:
34  // Determine output name, and caption.
35  std::string FNa = OutDir + OutName + ".txt";
36 
37  // Replace underscores in the canvas name
38  while (OutName.find("_") != std::string::npos) OutName.replace(OutName.find("_"),1," ");
39  // Add a string about it being a cut level.
40  if (OutName.find("Qual") != std::string::npos) OutName.insert(OutName.find(" Qual"), ", Cut level:");
41  // Add a string about it being a cut level.
42  if (OutName.find("pot") != std::string::npos) OutName.replace(OutName.find(" pot"),4,". With POT normalisation.");
43  // Add a string about it being a cut level.
44  if (OutName.find("area") != std::string::npos) OutName.replace(OutName.find(" area"),5,". With Area normalisation.");
45  // Add a string about the Horn current.
46  if (OutName.find("fhc") != std::string::npos) OutName.replace(OutName.find(" fhc"),4,", in Neutrino mode");
47  if (OutName.find("rhc") != std::string::npos) OutName.replace(OutName.find(" rhc"),4,", in Antineutrino mode");
48 
49  std::string Cap = "Plot showing the number of ND NuMi events in #nu_{#mu} Ana18 for variable: " + OutName;
50  std::cout << "\nFile name: " << FNa << "\n\tCaption: " << Cap << std::endl;
51  // Write to file.
52  std::ofstream TxtOut ( FNa.c_str(), std::ofstream::out );
53  TxtOut << Cap;
54  TxtOut.close();
55  // Done.
56  return;
57 }
58 
59 ////////////////////////////////////////
60 // Main class function:
61 void ND_DataMC_Comp_Systs( bool fhc = true, bool Set1Vars = true, bool IsTest=false, bool IsOnGrid=true, bool Weight18 = true, bool Prod4Cut = true, bool FullCuts = false ) {
62 
63  // Set my global Horn Current variable...
64  IsFHC = fhc;
65 
66  std::string sFHC_RHC = (IsFHC == true ? "fhc" :"rhc" );
67  std::string sVarSet = (Set1Vars == true ? "Set1" : "Set2" );
68  std::string sWeight = (Weight18 == true ? "wgt2018" :"wgt2017" );
69  std::string sProd4 = (Prod4Cut == true ? "CutProd4":"CutProd3");
70  std::string sAllCut = (FullCuts == true ? "_AllCuts": "" );
71 
72  std::cout << "\n\nLots of input parameters, so I'm going to write them out now....;"
73  << "\n\t IsFHC " << (IsFHC ==true ? "true --> Run in FHC " :"false --> Run in RHC" ) << " ==> sFHC_RHC is " << sFHC_RHC
74  << "\n\t Set1Vars " << (Set1Vars ==true ? "true --> Making first 9 plots" :"false --> Making second 9 plots" ) << " ==> sVarSet is " << sVarSet
75  << "\n\t IsTest " << (IsTest ==true ? "true --> Short run use CAFs" :"false --> Long run use Concat" )
76  << "\n\t Weight18 " << (Weight18 ==true ? "true --> Run using 2018 XSecs" :"false --> Run using 2017 XSecs" ) << " ==> sWeight is " << sWeight
77  << "\n\t Prod4Cut " << (Prod4Cut ==true ? "true --> Using Prod4 Cuts" :"false --> Using Prod3 Cuts" ) << " ==> sProd4 is " << sProd4
78  << "\n\t FullCuts " << (FullCuts ==true ? "true --> Running all cuts" :"false --> Only running full cuts" ) << " ==> sAllCut is " << sAllCut
79  << "\n\n" << std::endl;
80 
81  ////////////////////////////////////////
82  // Get stuff for the hadEFrac Cut:
83  ////////////////////////////////////////
84  // Which file I want to load?
85  // Diana's original files
86  std::string fdspecfile = "/pnfs/nova/persistent/analysis/numu/Ana2018/official/Quantiles/quantiles__"+sFHC_RHC+"_full__numu2018.root";
87 
88  std::cerr << "\nI want to load file " << fdspecfile << "\n" << std::endl;
89 
90  TFile* inFile = TFile::Open( pnfs2xrootd(fdspecfile).c_str() );
91  TH2 *FDSpec2D = (TH2*)inFile->FindObjectAny( "FDSpec2D" ); //TString("FD_full_") + TString(sFHC_RHC) );
92  // How many quantiles?
93  const int NHadEFracQuantiles = 4; // defines how many divisions of hadEFrac are used
94  // Make my cuts.
95  //std::vector<Cut> HadEFracQuantCuts = QuantileAndPIDCutsFromTH2(FDSpec2D, kNumuCCOptimisedAxis, kHadEFracAxis, NHadEFracQuantiles, IsFHC);
96  std::vector<Cut> HadEFracQuantCuts = QuantileCutsFromTH2(FDSpec2D, kNumuCCOptimisedAxis, kHadEFracAxis, NHadEFracQuantiles);
97  ////////////////////////////////////////
98  // Define Axes and cuts.
99  ////////////////////////////////////////
100 
101  int NumBins = 25;
102 
103  const HistAxis EnergyAxis ( "Reconstructed Muon Energy (GeV)" , Binning::Simple( NumBins , 0 , 5 ) , kMuE );
104  const HistAxis MuonEPerHit ( "Muon energy per hit in track" , Binning::Simple( NumBins , 0.01, 0.03) , kTrkEPerNHit);
105  const HistAxis LengthAxis ( "Length of Primary Track (m)" , Binning::Simple( NumBins , 0 , 16 ) , kTrkLength );
106  const HistAxis HadEAxis ( "Hadronic Energy (GeV)" , Binning::Simple( NumBins , 0 , 3 ) , kHadE );
107  const HistAxis HadEFracAxis( "Hadronic Energy Fraction" , Binning::Simple( NumBins , 0 , 1.01) , kHadEFrac );
108  const HistAxis HadEFracHRes( "Hadronic Energy Fraction" , Binning::Simple( 250 , 0 , 1.01) , kHadEFrac );
109  const HistAxis HadEPerHit ( "Hadronic energy per hit in slice" , Binning::Simple( NumBins , 0 , 0.04) , kHadEPerNHit);
110  const HistAxis NHitsInSlc ( "Number of hits in the slice" , Binning::Simple( NumBins , 0 , 300 ) , kNHit );
111  const HistAxis NHitsKalTr ( "Number of hits in Kalman track" , Binning::Simple( NumBins , 0 , 300 ) , kTrkNhits );
112  const HistAxis CosNuMiAxis ( "Kalman Track Cos #theta_{NuMI}" , Binning::Simple( NumBins , 0 , 1.01) , kCosNumi );
113  const HistAxis pTpAxis ( "p_{T}/p" , Binning::Simple( NumBins , 0 , 1.01) , kNumuMuonPtP);
114  const HistAxis CVN2017Axis ( "CVN NuMu 2017 score" , Binning::Simple( NumBins , 0 , 1.01) , kCVNm2017 );
115  const HistAxis CVN2018Axis ( "CVN NuMu score" , Binning::Simple( NumBins , 0 , 1.01) , kCVNm );
116  const HistAxis ReMIDAxis ( "ReMId score" , kRemidBinning , kRemID );
117  const HistAxis ReMIDFrac ( "RemID fraction of planes" , kRemidBinning , kReMIdMeasFrac);
118  const HistAxis ReMIDScat ( "ReMId Scattering angle" , Binning::Simple( NumBins ,-0.25, 0.25) , kReMIdScatLLH );
119  const HistAxis ReMIDdEdx ( "ReMId dE/dx" , Binning::Simple( NumBins ,-0.5 , 0.5 ) ,kReMIdDEDxLLH );
120 
121  std::vector<Cut> TieredCuts;
122  std::vector<std::string> CutNames;
123  if (Prod4Cut) {
124  CutNames.emplace_back("Qual_Cont_PID"); TieredCuts.emplace_back(kNumuQuality && kNumuContainND2017 && kNumuPID2018);
125  } else {
126  CutNames.emplace_back("Qual_Cont_PID"); TieredCuts.emplace_back(kNumuQuality && kNumuContainND2017 && kNumuPID2017);
127  }
128  if (FullCuts) {
129  CutNames.emplace_back("Qual_Cont"); TieredCuts.emplace_back(kNumuQuality && kNumuContainND2017);
130  CutNames.emplace_back("Qual"); TieredCuts.emplace_back(kNumuQuality);
131  CutNames.emplace_back("NoCut"); TieredCuts.emplace_back(kNoCut);
132  }
133  ////////////////////////////////////////
134  // Now make the plots....
135  ////////////////////////////////////////
136  gStyle->SetMarkerStyle(kFullCircle);
137  TGaxis::SetMaxDigits(3);
138 
139  // --- Configure the definition to use.
140  // By default set loaders empty so that it breaks.
141  std::string fnameNDMC = ""; // Dataset name for MC
142  std::string fnameNDData = ""; // Dataset name for Data
143  // If test.
144  if (IsTest) {
145  if (IsFHC) {
146  fnameNDMC = "karlwarb_ND_FHC_MC"; //"prod_caf_R17-11-14-prod4reco.e_nd_genie_nonswap_rhc_nova_v08_full_v1";
147  fnameNDData = "karlwarb_ND_FHC_Data";//"prod_caf_R17-09-05-prod4recopreview.f_nd_numi_rhc_full_v1_addShortSimpleCVN_goodruns";
148  } else {
149  fnameNDMC = "karlwarb_ND_RHC_MC";
150  fnameNDData = "karlwarb_ND_RHC_Data";
151  }
152  } else {
153  // If for running for realsies.
154  if (IsFHC) {
155  fnameNDMC = "prod_sumdecaf_R17-11-14-prod4reco.d_nd_genie_nonswap_fhc_nova_v08_full_v1_numu2018_stride22";
156  //fnameNDMC = "prod_sumdecaf_R17-11-14-prod4reco.d_nd_genie_nonswap_fhc_nova_v08_full_v1_numu2018_lim1";
157  fnameNDData = "prod_sumdecaf_R17-09-05-prod4recopreview.f_nd_numi_fhc_full_v1_addShortSimpleCVN_goodruns_numu2018";
158  } else {
159  fnameNDMC = "prod_sumdecaf_R17-11-14-prod4reco.e_nd_genie_nonswap_rhc_nova_v08_full_v1_numu2018_stride14";
160  //fnameNDMC = "prod_sumdecaf_R17-11-14-prod4reco.e_nd_genie_nonswap_rhc_nova_v08_full_v1_numu2018_lim1";
161  fnameNDData = "prod_sumdecaf_R17-09-05-prod4recopreview.f_nd_numi_rhc_full_v1_addShortSimpleCVN_goodruns_numu2018";
162  }
163  }
164  // --- Set the output directory.
165  std::string fnameODir = "NDComp_"+sFHC_RHC+"_"+sVarSet+"_"+sWeight+"_"+sProd4+sAllCut; // Name of the output directory
166  if (IsTest) fnameODir += "_Test";
167 
168  std::cout << "\n\n ODir is " << fnameODir << ", I loaded cuts from " << fdspecfile
169  << "\n\t fnameNDMC is " << fnameNDMC
170  << "\n\t fnameNDData is " << fnameNDData
171  << "\n\n" << std::endl;
172 
173  // --- Set the Loaders, along with spill cuts.
174  SpectrumLoader loaderMC(fnameNDMC);
175  SpectrumLoader loaderData(fnameNDData);
177  loaderData.SetSpillCut(kStandardSpillCuts);
178 
179  // --- Make sure that my directory exists...
180  fnameODir += "/";
181  if (IsOnGrid) fnameODir = "";
182  else gSystem -> MakeDirectory( fnameODir.c_str() );
183 
184  // --- Load the systematics
185  std::vector<const ISyst*> systs = getAllDirectNumuSysts2018();
186 
187  std::cout << "\n\nsysts has size " << systs.size() << " compared to 2017 systs which has size " << getAllDirectNumuSysts2017().size() << "\n\n" << std::endl;
188 
189  // --- Make a vector of "Selections" which are a combination of Quantile && Tiered cuts.
190  std::vector<Selection> selections;
191  for (size_t cuts=0; cuts < TieredCuts.size(); ++cuts) {
192  for (size_t quant=0; quant < HadEFracQuantCuts.size(); ++quant) {
193  // --- Want no quantile cut selections too.
194  if (quant == 0) {
195  selections.emplace_back( TieredCuts[cuts], sFHC_RHC+"_"+CutNames[cuts]+"_QuantAll",
196  "Selected events pass "+CutNames[cuts]+" all quantiles");
197  }
198  selections.emplace_back( TieredCuts[cuts] && HadEFracQuantCuts[quant], sFHC_RHC+"_"+CutNames[cuts]+"_Quant"+std::to_string(quant+1),
199  "Selected events pass "+CutNames[cuts]+" quantile "+std::to_string(quant+1)+".");
200  }
201  }
202 
203  // --- Make a vector of "TangibleAxis" which have the axis and variables for which I want to make spectra.
204  std::cerr << "About to fill variables" << std::endl;
205  std::vector<TangibleAxis> variables;
206  variables.emplace_back( kNumuCCOptimisedAxis, "NuMuE", "CC energy estimator.");
207  if (Set1Vars) {
208  variables.emplace_back( EnergyAxis , "MuonEnergy" , "Reconstructed Muon Energy (GeV)" );
209  variables.emplace_back( MuonEPerHit , "MuEPerHit" , "Muon energy per hit in track" );
210  variables.emplace_back( HadEAxis , "HadroEnergy", "Hadronic Energy (GeV)" );
211  variables.emplace_back( HadEFracAxis, "HadEFrac" , "Hadronic Energy Fraction" );
212  variables.emplace_back( HadEPerHit , "HadEPerHit" , "Hadronic energy per hit in slice");
213  variables.emplace_back( LengthAxis , "KalTrackLen", "Length of Primary Track (m)" );
214  variables.emplace_back( NHitsInSlc , "NHitsInSlc" , "Number of hits in the slice" );
215  variables.emplace_back( CosNuMiAxis , "TrkCosNuMi" , "Kalman Track Cos #theta_{NuMI}" );
216  variables.emplace_back( pTpAxis , "pTpNuMi" , "p_{T}/p" );
217  } else {
218  variables.emplace_back( HadEFracHRes, "HadEFacHRes", "Hadronic Energy Fraction" );
219  variables.emplace_back( NHitsKalTr , "NHitsKalTr" , "Number of hits in Kalman track" );
220  variables.emplace_back( CosNuMiAxis , "TrkCosNuMi" , "Kalman Track Cos #theta_{NuMI}" );
221  variables.emplace_back( CVN2017Axis , "CVNNuMu2017", "CVN NuMu 2017 score" );
222  variables.emplace_back( CVN2018Axis , "CVNNuMu2018", "CVN NuMu score" );
223  variables.emplace_back( ReMIDAxis , "ReMIdScore" , "ReMId score" );
224  variables.emplace_back( ReMIDFrac , "ReMIdFrac" , "RemID fraction of planes" );
225  variables.emplace_back( ReMIDScat , "ReMIdScatt" , "ReMId Scattering angle" );
226  variables.emplace_back( ReMIDdEdx , "ReMIddEdx" , "ReMId dE/dx" );
227  }
228  std::cerr << "Variables has size " << variables.size() << std::endl;
229 
230  // --- What is my weight going to be for the spectra?
231  //Var MyWeight = kXSecCVWgt2018 * kPPFXFluxCVWgt;
233  if (!Weight18) MyWeight = kXSecCVWgt2017 * kPPFXFluxCVWgt;
234 
235  std::vector<DataMCPair> pairs;
236 
237  Cut WrongSign = kIsNu;
238  if (fhc) WrongSign = kIsAntiNu;
239 
240  pairs.reserve(selections.size() * variables.size());
241  for(const auto& sel:selections){
242  for(const auto& variable:variables){
243  pairs.emplace_back(sel, variable, loaderData, loaderMC, systs, MyWeight, !kIsNumuCC, WrongSign );
244  }
245  }
246 
247  std::cerr << "Filling my things..." << std::endl;
248 
249  loaderMC.Go();
250  loaderData.Go();
251 
252  std::vector<TCanvas*> cans;
253 
254  std::cerr << "Filled my things" << std::endl;
255 
256 
257  for(const auto& pair:pairs) {
258 
259  std::string Name_POT = pair.ShortName()+"_allSysts_pot";
260  std::string Name_Area = pair.ShortName()+"_allSysts_area";
261  std::cout << "\nNow looking pairs, " << pair.ShortName() << " - POT " << Name_POT << ", Area " << Name_Area << ", it has purity " << pair.Purity() << std::endl;
262 
263  // --- First make the POT Normalised plots.
264  cans.push_back( new TCanvas( Name_POT.c_str(),Name_POT.c_str() ) );
265  pair.OverlayDataMCSyst();
266  WriteBlurb(pair, fnameODir,
267  std::string(cans.back()->GetName())+".txt",
268  "Full systematic band shown. ",
269  "Near detector data/MC comparison for numu Ana2018." );
270 
271  // ---- Next make the Area Normalised plots.
272  cans.push_back( new TCanvas( Name_Area.c_str(), Name_Area.c_str() ) );
273  pair.OverlayDataMCSystNorm();
274  WriteBlurb(pair, fnameODir,
275  std::string(cans.back()->GetName())+".txt",
276  std::string("Each systematically shifted histogram (both up and down) ")
277  +std::string("is normalized to the area of the MC distribution, ")
278  +std::string("then summed in quadrature." ),
279  "Near detector data/MC comparison for numu Ana2018." );
280 
281  }
282 
283  // Open a file to save all of the canvases to.
284  std::string OutFileName = fnameODir + "NearDet_DataMC_Comp_Systs.root";
285  TFile *OutFile = new TFile( OutFileName.c_str(), "RECREATE" );
286  OutFile->cd();
287 
288  for(const auto& can:cans) {
289  can->cd();
290  Preliminary();
291  // -- Set the corner label
292  std::string Str = "Neutrino beam";
293  if (!IsFHC) Str = "Antineutrino beam";
294  TLatex* CornLab = new TLatex(.15, .93, Str.c_str());
295  CornLab->SetTextColor(kGray+1);
296  CornLab->SetNDC();
297  CornLab->SetTextSize (2/30.);
298  CornLab->SetTextAlign(11);
299  CornLab->Draw();
300  //can -> SetLeftMargin(0.13);
301  std::string CanNa = fnameODir + can->GetName() + ".pdf";
302  can->SaveAs ( CanNa.c_str() );
303  can->Write ( can->GetName() );
304  MakeTextFile( can->GetName(), fnameODir );
305  }
306 }
307 
const Var kHadE
Definition: NumuVars.h:23
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kReMIdScatLLH
Definition: NumuVars.cxx:555
std::vector< SystGroupDef > systs
Definition: syst_header.h:385
const Binning kRemidBinning
Binning for plotting remid attractively.
Definition: Binning.cxx:80
const Var kPPFXFluxCVWgt
Definition: PPFXWeights.h:16
const Cut kNumuContainND2017([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.nshwlid;++i){TVector3 start=sr->vtx.elastic.fuzzyk.png[i].shwlid.start;TVector3 stop=sr->vtx.elastic.fuzzyk.png[i].shwlid.stop;if(std::min(start.X(), stop.X())< -180.0) return false;if(std::max(start.X(), stop.X()) > 180.0) return false;if(std::min(start.Y(), stop.Y())< -180.0) return false;if(std::max(start.Y(), stop.Y()) > 180.0) return false;if(std::min(start.Z(), stop.Z())< 20.0) return false;if(std::max(start.Z(), stop.Z()) > 1525.0) return false;}if(sr->trk.kalman.ntracks< 1) return false;for(unsigned int i=0;i< sr->trk.kalman.ntracks;++i){if(i==sr->trk.kalman.idxremid) continue;else if(sr->trk.kalman.tracks[i].start.Z() > 1275||sr->trk.kalman.tracks[i].stop.Z() > 1275) return false;}return(sr->trk.kalman.ntracks > sr->trk.kalman.idxremid &&sr->slc.firstplane > 1 &&sr->slc.lastplane< 212 &&sr->trk.kalman.tracks[0].start.Z()< 1100 &&(sr->trk.kalman.tracks[0].stop.Z()< 1275 ||sr->sel.contain.kalyposattrans< 55) &&sr->sel.contain.kalfwdcellnd > 5 &&sr->sel.contain.kalbakcellnd > 10);})
Definition: NumuCuts2017.h:11
bool IsFHC
const HistAxis kHadEFracAxis("E_{had.} / E_{#nu}", Binning::Simple(200, 0, 1), kHadEFrac)
HistAxis that implements Hadronic Energy fraction binning used by L.Vinton to derive Hadronic Energy ...
Definition: HistAxes.h:30
const Cut kIsAntiNu([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return sr->mc.nu[0].pdg< 0;})
Is this truly an antineutrino?
Definition: TruthCuts.h:53
OStream cerr
Definition: OStream.cxx:7
void SetSpillCut(const SpillCut &cut)
std::string pnfs2xrootd(std::string loc, bool unauth)
Definition: UtilsExt.cxx:237
const Var kTrkEPerNHit([](const caf::SRProxy *sr){return(sr->trk.kalman.tracks[0].calE/sr->trk.kalman.tracks[0].nhit);})
const Var kReMIdMeasFrac
Definition: NumuVars.cxx:557
void MakeTextFile(std::string OutName, std::string OutDir)
const Var kTrkLength([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return-5.f;return sr->trk.kalman.tracks[0].len/100;})
Definition: NumuVars.h:65
const Var kHadEPerNHit([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return 0.0f;int nHit=sr->slc.nhit-sr->trk.kalman.tracks[0].nhit;if(nHit<=0) return 0.0f;float hadE=sr->energy.numu.hadcalE;return hadE/nHit;})
Definition: NumuVars.h:63
const Cut kIsNu([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return false;assert(sr->mc.nnu==1);return sr->mc.nu[0].pdg > 0;})
Definition: TruthCuts.h:54
std::vector< const ISyst * > getAllDirectNumuSysts2018()
Definition: NumuSysts.cxx:114
ifstream inFile
Definition: AnaPlotMaker.h:34
const Var kRemID
PID
Definition: Vars.cxx:81
const Var kHadEFrac
Definition: NumuVars.h:24
std::string OutDir
const Var kNHit
Definition: Vars.cxx:71
const Var kNumuMuonPtP([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks > 0 &&sr->trk.kalman.idxremid!=999){if(sr->hdr.det==1){double Zbeam=sr->trk.kalman.tracks[0].dir.Dot(beamDirND);double ptp=sqrt(1-Zbeam *Zbeam);return(float) ptp;}if(sr->hdr.det==2){double Zbeam=sr->trk.kalman.tracks[0].dir.Dot(beamDirFD);double ptp=sqrt(1-Zbeam *Zbeam);return(float) ptp;}}return-5.f;})
Definition: NumuVars.h:49
bool Bless
virtual void Go() override
Load all the registered spectra.
const Cut kNumuPID2017([](const caf::SRProxy *sr){return(sr->sel.remid.pid > 0.5 &&sr->sel.cvn.numuid > 0.5);})
Definition: NumuCuts2017.h:27
list cans
Definition: canMan.py:12
const HistAxis kNumuCCOptimisedAxis("Reconstructed Neutrino Energy (GeV)", kNumuCCEOptimisedBinning, kCCE)
HistAxis that implements optimised numuCCE from L. Vinton. See docdb 16332. This was close to &#39;custC&#39;...
Definition: HistAxes.h:24
void Preliminary()
OStream cout
Definition: OStream.cxx:6
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Cut kNumuPID2018([](const caf::SRProxy *sr){std::cout<< "ERROR::kNumuPID2018, cutting on both cvnProd3Train and cvn2017."<< " Neither branch exists anymore. Returning False."<< std::endl;abort();return false;})
Definition: NumuCuts2018.h:22
void ND_DataMC_Comp_Systs(bool fhc=true, bool Set1Vars=true, bool IsTest=false, bool IsOnGrid=true, bool Weight18=true, bool Prod4Cut=true, bool FullCuts=false)
std::vector< Cut > QuantileCutsFromTH2(TH2 *quantileHist, const HistAxis &independentAxis, const HistAxis &quantileAxis, const unsigned int &numQuantiles, const bool verbose)
: Do the same as the QuantileCuts function but taking in the TH2 instead of making it...
const unsigned int NumBins
const Var kReMIdDEDxLLH
Definition: NumuVars.cxx:556
const SpillCut kStandardSpillCuts
Apply this unless you&#39;re doing something special.
Definition: SpillCuts.h:49
std::vector< const ISyst * > getAllDirectNumuSysts2017()
Get a vector of all the numu group systs.
Definition: NumuSysts.cxx:169
TFile * OutFile
std::string to_string(ModuleType mt)
Definition: ModuleType.h:32
const Cut kNumuQuality
Definition: NumuCuts.h:18
const Var kXSecCVWgt2017
Definition: XsecTunes.h:37
const Var kMuE
Definition: NumuVars.h:22
const Var kCVNm
PID
Definition: Vars.cxx:39
static Binning Simple(int n, double lo, double hi, const std::vector< std::string > &labels={})
Definition: Binning.cxx:107
const Cut kNoCut
The simplest possible cut: pass everything, used as a default.
Definition: Cut.h:109
const Var kCosNumi([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks > 0 &&sr->trk.kalman.idxremid!=999){if(sr->hdr.det==1){return sr->trk.kalman.tracks[0].dir.Dot(beamDirND);}if(sr->hdr.det==2){return sr->trk.kalman.tracks[0].dir.Dot(beamDirFD);}}return-5.f;})
Definition: NumuVars.h:43
const Var kTrkNhits([](const caf::SRProxy *sr){if(sr->trk.kalman.ntracks< 1) return 65535;return int(sr->trk.kalman.tracks[0].nhit);})
Definition: NumuVars.h:59
const Var kXSecCVWgt2018RPAFix_noDIS
Definition: XsecTunes.h:57
void WriteBlurb(const DataMCPair &pair, std::string dir, std::string name, std::string extra="", std::string beginning="")
std::vector< std::string > CutNames
Definition: MakeCutFlow.C:49
enum BeamMode string