containmentstudy.C
Go to the documentation of this file.
1 // Do a proper prediction, with all the components included
2 
3 #ifdef __CINT__
4 void containmentstudy()
5 {
6  std::cout << "Sorry, you must run in compiled mode" << std::endl;
7 }
8 #else
9 
10 
11 ////////CAFAna libraries///
12 #include "CAFAna/Cuts/Cuts.h"
13 #include "CAFAna/Analysis/Plots.h"
14 #include "CAFAna/Core/SpectrumLoaderMockData.h"
17 #include "CAFAna/Core/Spectrum.h"
19 #include "CAFAna/Vars/Vars.h"
21 ////////////////////////////
22 
23 ////Plotting Libraries/////
24 #include "TCanvas.h"
25 #include "TH2.h"
26 #include "TH1.h"
27 #include "TFitResultPtr.h"
28 #include "TLegend.h"
29 //////////////////////////
30 
31 ///////NCPi0 Headers//////
32 #include "/nova/app/users/acedeno/tag_releaseS17-09-24/NDAna/ncpi0_Systematics/ncpi0Bins.h"
33 #include "/nova/app/users/acedeno/tag_releaseS17-09-24/NDAna/ncpi0_Systematics/ncpi0Cuts.h"
34 #include "/nova/app/users/acedeno/tag_releaseS17-09-24/NDAna/ncpi0_Systematics/ncpi0Vars.h"
35 /////////////////////////
36 
37 using namespace ana;
38 
39 
40 
42 
43 {
44 
45  /*********************************************************************************************************************/
46 
47  //Enviroment variables and wildcards work
48 
49  const std::string MC = "dataset_def_name_newest_snapshot prod_caf_R17-03-01-prod3reco.d_nd_genie_nonswap_fhc_nova_v08_full_v1";
50  //const std::string Numi = "prod_caf_R17-03-01-prod3reco.d_nd_numi_fhc_full_v1_goodruns";
51 
52  /*********************************************************************************************************************/
53 
54  //Create loader for each 'data' type
55 
56  SpectrumLoader mcloader(MC);
57  //SpectrumLoader dataloader(Numi);
58 
59  /*********************************************************************************************************************/
60 
61  Spectrum ndMC("shwlid.stop in x-dir [cm]",bins_for_vtxXY, mcloader,ContStopX , kPreSelect);
62  Spectrum ndMC3P("shwlid.stop in x-dir [cm]",bins_for_vtxXY,mcloader,ContStopX,k2ProngPreSel2CVN);
63  //Spectrum ndNCMCSig("Prong 3 Photon ID",PCIDbins,mcloader,kNpCVN3gamma,kPreSelSig2P);
64  Spectrum ndNCPi0("shwlid.stop in x-dir [cm]",bins_for_vtxXY,mcloader,ContStopX,kIsNCPi02P);
65  Spectrum ndNCPi0L("shwlid.stop in x-dir [cm]",bins_for_vtxXY,mcloader,ContStopX,kIsNCPi0L2P);
66  Spectrum ndCCPi0("shwlid.stop in x-dir [cm]",bins_for_vtxXY, mcloader, ContStopX,kIsCCPi02P);
67  Spectrum ndNCNonPi0("shwlid.stop in x-dir [cm]",bins_for_vtxXY,mcloader,ContStopX , kIsNCNonPi02P);
68  Spectrum ndCCNonPi0("shwlid.stopin x-dir [cm]",bins_for_vtxXY,mcloader,ContStopX , kIsCCNonPi02P);
69 
70 
71  Spectrum ndMCy("shwlid.stop in y-dir [cm]",bins_for_vtxXY, mcloader,ContStopY , kPreSelect);
72  Spectrum ndMC3Py("shwlid.stop in y-dir [cm]",bins_for_vtxXY,mcloader,ContStopY ,k2ProngPreSel2CVN);
73  //Spectrum ndNCMCSig("Prong 3 Photon ID",PCIDbins,mcloader,kNpCVN3gamma,kPreSelSig2P);
74  Spectrum ndNCPi0y("shwlid.stop in y-dir [cm]",bins_for_vtxXY,mcloader,ContStopY,kIsNCPi02P);
75  Spectrum ndNCPi0Ly("shwlid.stop in y-dir [cm]",bins_for_vtxXY,mcloader,ContStopY ,kIsNCPi0L2P);
76  Spectrum ndCCPi0y("shwlid.stop in y-dir [cm]",bins_for_vtxXY, mcloader, ContStopY,kIsCCPi02P);
77  Spectrum ndNCNonPi0y("shwlid.stop in y-dir [cm]",bins_for_vtxXY,mcloader,ContStopY , kIsNCNonPi02P);
78  Spectrum ndCCNonPi0y("shwlid.stop in y-dir [cm]",bins_for_vtxXY,mcloader,ContStopY , kIsCCNonPi02P);
79 
80  Spectrum ndMCz("shwlid.stop in z-dir [cm]",bins_for_vtxZ, mcloader, ContStopZ , kPreSelect);
81  Spectrum ndMC3Pz("shwlid.stopin z-dir [cm]",bins_for_vtxZ,mcloader, ContStopZ,k2ProngPreSel2CVN);
82  //Spectrum ndNCMCSig("Prong 3 Photon ID",PCIDbins,mcloader,kNpCVN3gamma,kPreSelSig2P);
83  Spectrum ndNCPi0z("shwlid.stop in z-dir [cm]",bins_for_vtxZ,mcloader, ContStopZ ,kIsNCPi02P);
84  Spectrum ndNCPi0Lz("shwlid.stop in z-dir [cm]",bins_for_vtxZ,mcloader, ContStopZ ,kIsNCPi0L2P);
85  Spectrum ndCCPi0z("shwlid.stopin z-dir [cm]",bins_for_vtxZ, mcloader, ContStopZ,kIsCCPi02P);
86  Spectrum ndNCNonPi0z("shwlid.stop in z-dir [cm]",bins_for_vtxZ,mcloader, ContStopZ, kIsNCNonPi02P);
87  Spectrum ndCCNonPi0z("shwlid.stop in z-dir [cm]",bins_for_vtxZ,mcloader, ContStopZ , kIsCCNonPi02P);
88 
89 
90  /********************************************/
91  mcloader.Go();
92  /*******************************************/
93 
94  TFile *out = new TFile("xyzcontainmentstudy1DSpectrumsApril2018.root","RECREATE");
95 
96 
97  ///////reco masss with & Presel+ Remid+ prong 1 CVN cut////////
98  ndMC.SaveTo(out->mkdir("ndMC"));
99  ndMC3P.SaveTo(out->mkdir("ndMC3P"));
100  ndNCPi0.SaveTo(out->mkdir("ndNCPi0"));
101  ndCCPi0.SaveTo(out->mkdir("ndCCPi0"));
102  ndNCNonPi0.SaveTo(out->mkdir("ndNCNonPi0"));
103  ndNCPi0L.SaveTo(out->mkdir("ndNCPi0L"));
104  ndCCNonPi0.SaveTo(out->mkdir("ndCCNonPi0"));
105 
106  ndMCy.SaveTo(out->mkdir("ndMCy"));
107  ndMC3Py.SaveTo(out->mkdir("ndMC3Py"));
108  ndNCPi0y.SaveTo(out->mkdir("ndNCPi0y"));
109  ndCCPi0y.SaveTo(out->mkdir("ndCCPi0y"));
110  ndNCNonPi0y.SaveTo(out->mkdir("ndNCNonPi0y"));
111  ndNCPi0Ly.SaveTo(out->mkdir("ndNCPi0Ly"));
112  ndCCNonPi0y.SaveTo(out->mkdir("ndCCNonPi0y"));
113 
114 
115  ndMCz.SaveTo(out->mkdir("ndMCz"));
116  ndMC3Pz.SaveTo(out->mkdir("ndMC3Pz"));
117  ndNCPi0z.SaveTo(out->mkdir("ndNCPi0z"));
118  ndCCPi0z.SaveTo(out->mkdir("ndCCPi0z"));
119  ndNCNonPi0z.SaveTo(out->mkdir("ndNCNonPi0z"));
120  ndNCPi0Lz.SaveTo(out->mkdir("ndNCPi0Lz"));
121  ndCCNonPi0z.SaveTo(out->mkdir("ndCCNonPi0z"));
122 
123 
124  std::cout<<"\nOutput saved to " << out->GetName()<<std::endl;
125 
126 
127  out->Close();
128 
129  return;
130 
131 }
132 
133 #endif
void containmentstudy()
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var ContStopZ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;if(sr->vtx.nelastic==0) return-10.0f;return float(sr->vtx.elastic[0].fuzzyk.png[0].shwlid.stop.z);})
const Cut kIsNCNonPi02P
Definition: ncpi0Cuts.h:873
const Var ContStopX([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;if(sr->vtx.nelastic==0) return-10.0f;return float(sr->vtx.elastic[0].fuzzyk.png[0].shwlid.stop.x);})
const Cut kIsNCPi0L2P
Definition: ncpi0Cuts.h:894
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const Var ContStopY([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;if(sr->vtx.nelastic==0) return-10.0f;return float(sr->vtx.elastic[0].fuzzyk.png[0].shwlid.stop.y);})
const Cut kIsCCPi02P
Definition: ncpi0Cuts.h:897
const Cut kIsNCPi02P
Definition: ncpi0Cuts.h:891
virtual void Go() override
Load all the registered spectra.
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
OStream cout
Definition: OStream.cxx:6
const Cut k2ProngPreSel2CVN
Definition: ncpi0Cuts.h:864
const Binning bins_for_vtxXY
Definition: ncpi0Bins.h:35
const Cut kPreSelect
3 prong analysis cuts////
Definition: ncpi0Cuts.h:796
const Cut kIsCCNonPi02P
Definition: ncpi0Cuts.h:870
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Binning bins_for_vtxZ
Definition: ncpi0Bins.h:39
enum BeamMode string