ncpi0HistoGrid2.C
Go to the documentation of this file.
1 // Do a proper prediction, with all the components included
2 
3 #ifdef __CINT__
4 void ncpi0HistoGrid2()
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//////
35 /////////////////////////
36 
37 using namespace ana;
38 
39 
40 
42 
43 {
44 
45  /*********************************************************************************************************************/
46 
47  //Enviroment variables and wildcards work (MC)
48  //const std::string MC = "single_cafs_04_26_2018_flat_1M_fix";
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 MC = "single_cafs_04_26_2018_genielike_1M_fix";
51  const std::string MC = "CVN_Prong_Prod4_ND_NuMI_MC_2view_Genielike_FlatFlux_CAFs";
52 
53  //Enviroment variable and wildcard work (DATA)
54  //const std::string Numi = "prod_caf_R17-03-01-prod3reco.d_nd_numi_fhc_full_v1_goodruns";
55  const std::string Numi = "CVN_Prong_Prod4_ND_NuMI_Data_2view_Genielike_FlatFlux_CAFs";
56  /*********************************************************************************************************************/
57 
58  //Create loader for each 'data' type
59 
60  SpectrumLoader mcloader(MC);
62 
63  /*********************************************************************************************************************/
64 
65  ///////////Data////////////
66 
67  ////////////Spectrum CVN Analysis Invariant Mass (Data)////////////////////////////
68 
69  ///////////// Invariant Mass /////////////////////////
70 
71  ///////////// w/No Cuts just 2prongs & (mass variable) //////////
72 
73  Spectrum ndNumiMassdataNoCuts("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,dataloader,kPi0RecoMassData ,kPreSelectDataNoCuts);
74 
75  ///////////// w/Selection(Fid + containment + 2prongs) & (RECO mass variable) //////////
76 
77  Spectrum ndNumiMassdataPreSel("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,dataloader,kPi0RecoMassData ,kPreSelectData);
78 
79  ///////////// w/Selection(Fid + containment + 2 prong + remID) & (RECO mass variable) //////////
80 
81  Spectrum ndNumiMassdataRem("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,dataloader,kPi0RecoMassData ,kPreSelectData2);
82 
83  ///////////// w/Selection(Fid + containment + 2 prong + remID + 1 prong cvn gamma id > 0.7) & (RECO mass variable) //////////
84 
85  Spectrum ndNumiMassdataCVN("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,dataloader,kPi0RecoMassData ,kPreSelectData3);
86 
87 
88  //////////// w/ Selection & (Fid + containment + 2 prong + remID + 1 prong cvn gamma id > 0.7 & prong 2 gamma id >0.9)& (RECO mass variable) ///////////
89  Spectrum ndNumiMassdata2CVN("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,dataloader,kPi0RecoMassData ,k2ProngPreSel2CVNData);
90 
91  /*********************************************************************************************************************/
92 
93  ///////////// CVN ANALYSIS 2 PRONG DATA /////////////////////////
94 
95  ///////////// w/Selection(Fid + containment + 2prongs) (RemID Variable) //////////
96 
97  Spectrum ndNumiRemIDData("RemID",RemIDbins,dataloader,kRemIDPR ,kPreSelectData);
98 
99  ///////////// w/Selection(Fid + containment + 2prongs + RemID + & (variable 1prongs photonID)) //////////
100 
101  Spectrum ndNumiCVN2PRData("Prong CVN Gamma ID",PCIDbins,dataloader, k2ViewCVN1gamma,kPreSelectData2);
102 
103  ///////////// w/Selection(Fid + containment + 2prongs + RemID & (variable 2prongs photonID)) //////////
104 
105  Spectrum ndNumi2CVN2PRData("Prong 2 CVN Gamma ID ",PCIDbins,dataloader, k2ViewCVN2gamma,kPreSelectData2);
106 
107  ///////////// w/Selection(Fid + containment + 2prongs + RemID + 1 prong cvn gamma id > 0.7 & (variable 2prongs photonID)) //////////
108 
109  Spectrum ndNumiCVN2PData("Prong 2 CVN Gamma ID ",PCIDbins,dataloader, k2ViewCVN2gamma,kPreSelectData3);
110 
111 
112  /*********************************************************************************************************************/
113 
114  ///////////MC///////////////
115 
116  /////////2 prong event spectrum analysis/////////////
117 
118  /////RECO Pi0 MASS///////////
119 
120  ///w/"NO CUTS" (just 2prongs) & (variable reco mass variable)///
121  Spectrum ndNoCuts("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass, NoCut2prong);
122  Spectrum ndNoCutCCNonPi0("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass, kIsCCNonPi02PNoCut);
123  Spectrum ndNoCutNCNonPi0("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass, kIsNCNonPi02PNoCut);
124  Spectrum ndNoCutNCPi0("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass, kIsNCPi02PNoCut);
125  Spectrum ndNoCutNCPi0L("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass, kIsNCPi0L2PNoCut);
126  Spectrum ndNoCutCCPi0("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass, kIsCCPi02PNoCut);
127 
128 
129  ///w/Prel + remID + Prong 1 >0.1 & prong 2 CVN >0.7 cuts & (reco mass variable)///
130  Spectrum ndMC("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass, kPreSelect);
131  Spectrum ndMC3P("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass,k2ProngPreSel2CVN);
132  //Spectrum ndNCMCSig("Prong 3 Photon ID",PCIDbins,mcloader,k2ViewCVN3gamma,kPreSelSig2P);
133  Spectrum ndNCPi0("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass,kIsNCPi02P);
134  Spectrum ndNCPi0L("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass,kIsNCPi0L2P);
135  Spectrum ndCCPi0("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass,kIsCCPi02P);
136  Spectrum ndNCNonPi0("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass, kIsNCNonPi02P);
137  Spectrum ndCCNonPi0("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass, kIsCCNonPi02P);
138 
139  ///w/Prel + remID + Prong 1 >0.1 cuts & (reco mass variable)///
140  Spectrum ndMC1Cut("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass, kPreSelect);
141  Spectrum ndMC3P1Cut("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass,k2ProngPreSelCVN);
142  //Spectrum ndNCMCSig("Prong 3 Photon ID",PCIDbins,mcloader,k2ViewCVN3gamma,kPreSelSig2P);
143  Spectrum ndNCPi01Cut("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass,kIsNCPi02P2);
144  Spectrum ndNCPi0L1Cut("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass,kIsNCPi0L2P2);
145  Spectrum ndCCPi01Cut("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins, mcloader,kPi0RecoMass,kIsCCPi02P2);
146  Spectrum ndNCNonPi01Cut("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass, kIsNCNonPi02P2);
147  Spectrum ndCCNonPi01Cut("#pi^{0} Reconstructed Mass [GeV]",Pi0Massbins,mcloader,kPi0RecoMass, kIsCCNonPi02P2);
148 
149 
150  /// TRUE ENERGY PI0 (Highest Energy Pi0)///////
151  /// w/Presel & (kTruePi0En Variable)/////
152  Spectrum ndMC3PPrel("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,k2ProngPreSel);
153  Spectrum ndNCPi0Prel("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsNCPi02PRem);
154  Spectrum ndNCPi0LPrel("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsNCPi0L2PRem);
155  Spectrum ndCCPi0Prel("#pi^{0} True Energy [GeV]",Pi0Enbins, mcloader,kTruePi0En,kIsCCPi02PRem);
156  Spectrum ndNCNonPi0Prel("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En, kIsNCNonPi02PRem);
157  Spectrum ndCCNonPi0Prel("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsCCNonPi02PRem);
158 
159  /// w/Presel+ RemID & (kTruePi0En Variable)/////
160  Spectrum ndMC3PPrelR("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,k2ProngPreSelR);
161  Spectrum ndNCPi0PrelR("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsNCPi02PR);
162  Spectrum ndNCPi0LPrelR("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsNCPi0L2PR);
163  Spectrum ndCCPi0PrelR("#pi^{0} True Energy [GeV]",Pi0Enbins, mcloader,kTruePi0En,kIsCCPi02PR);
164  Spectrum ndNCNonPi0PrelR("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En, kIsNCNonPi02PR);
165  Spectrum ndCCNonPi0PrelR("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsCCNonPi02PR);
166 
167  /// w/Presel+ RemID & Prong 1 CVN cuts (kTruePi0En Variable)/////
168  Spectrum ndMC3PPrelCVN("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,k2ProngPreSelCVN);
169  Spectrum ndNCPi0PrelCVN("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsNCPi02P2);
170  Spectrum ndCCPi0PrelCVN("#pi^{0} True Energy [GeV]",Pi0Enbins, mcloader,kTruePi0En,kIsCCPi02P2);
171  Spectrum ndNCNonPi0PrelCVN("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En, kIsNCNonPi02P2);
172  Spectrum ndNCPi0LPrelCVN("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsNCPi0L2P2);
173  Spectrum ndCCNonPi0PrelCVN("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsCCNonPi02P2);
174 
175  /// w/Presel+ RemID & Prong 1 & 2 CVN cuts (kTruePi0En Variable)/////
176  Spectrum ndMC3PPrelCVN2Cuts("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,k2ProngPreSel2CVN);
177  Spectrum ndNCPi0PrelCVN2Cuts("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsNCPi02P);
178  Spectrum ndCCPi0PrelCVN2Cuts("#pi^{0} True Energy [GeV]",Pi0Enbins, mcloader,kTruePi0En,kIsCCPi02P);
179  Spectrum ndNCNonPi0PrelCVN2Cuts("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En, kIsNCNonPi02P);
180  Spectrum ndNCPi0LPrelCVN2Cuts("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsNCPi0L2P);
181  Spectrum ndCCNonPi0PrelCVN2Cuts("#pi^{0} True Energy [GeV]",Pi0Enbins,mcloader,kTruePi0En,kIsCCNonPi02P);
182 
183 
184  /////CVN ANALYSIS 2 PRONG///////
185 
186  /// w/Presel & (RemID Variable)/////
187  Spectrum ndMC3PRem("RemID",RemIDbins,mcloader,kRemIDPR,k2ProngPreSel);
188  Spectrum ndNCPi0Rem("RemID",RemIDbins,mcloader,kRemIDPR,kIsNCPi02PRem);
189  Spectrum ndCCPi0Rem("RemID",RemIDbins, mcloader,kRemIDPR,kIsCCPi02PRem);
190  Spectrum ndNCNonPi0Rem("RemID",RemIDbins,mcloader,kRemIDPR, kIsNCNonPi02PRem);
191  Spectrum ndNCPi0LRem("RemID",RemIDbins,mcloader,kRemIDPR,kIsNCPi0L2PRem);
192  Spectrum ndCCNonPi0Rem("RemID",RemIDbins,mcloader,kRemIDPR,kIsCCNonPi02PRem);
193 
194  /////w/Prel + remID + Prong 1 CVN cuts & (variable 2prongs photonID)////////////////////
195  Spectrum ndCVNMC3P("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma,k2ProngPreSelCVN);
196  Spectrum ndCVNNCPi0("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma,kIsNCPi02P2);
197  Spectrum ndCVNCCPi0("Prong 2 CVN Gamma ID ",PCIDbins, mcloader, k2ViewCVN2gamma,kIsCCPi02P2);
198  Spectrum ndCVNNCNonPi0("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma, kIsNCNonPi02P2);
199  Spectrum ndCVNNCPi0L("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma,kIsNCPi0L2P2);
200  Spectrum ndCVNCCNonPi0("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma, kIsCCNonPi02P2);
201 
202  /////w/Presel + remID cuts & (variable 1 prong photons ID) ////////////////////
203  Spectrum ndCVNMC3PR("Prong CVN Gamma ID",PCIDbins,mcloader, k2ViewCVN1gamma,k2ProngPreSelR);
204  Spectrum ndCVNNCPi0R("Prong CVN Gamma ID",PCIDbins,mcloader, k2ViewCVN1gamma,kIsNCPi02PR);
205  Spectrum ndCVNCCPi0R("Prong CVN Gamma ID",PCIDbins, mcloader, k2ViewCVN1gamma,kIsCCPi02PR);
206  Spectrum ndCVNNCNonPi0R("Prong CVN Gamma ID",PCIDbins,mcloader, k2ViewCVN1gamma, kIsNCNonPi02PR);
207  Spectrum ndCVNNCPi0LR("Prong CVN Gamma ID",PCIDbins,mcloader, k2ViewCVN1gamma,kIsNCPi0L2PR);
208  Spectrum ndCVNCCNonPi0R("Prong CVN Gamma ID",PCIDbins,mcloader, k2ViewCVN1gamma, kIsCCNonPi02PR);
209 
210  /////w/Presel + remID cuts & (variable 2 prong photons ID) ////////////////////
211  Spectrum nd2CVNMC3PR("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma,k2ProngPreSelR);
212  Spectrum nd2CVNNCPi0R("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma,kIsNCPi02PR);
213  Spectrum nd2CVNCCPi0R("Prong 2 CVN Gamma ID ",PCIDbins, mcloader, k2ViewCVN2gamma,kIsCCPi02PR);
214  Spectrum nd2CVNNCNonPi0R("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma, kIsNCNonPi02PR);
215  Spectrum nd2CVNNCPi0LR("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma,kIsNCPi0L2PR);
216  Spectrum nd2CVNCCNonPi0R("Prong 2 CVN Gamma ID ",PCIDbins,mcloader, k2ViewCVN2gamma, kIsCCNonPi02PR);
217 
218 
219  /////2 D Plot of the True Pi0 Energy vs. Invariant Mass w/Prel + RemID + Prong 1 & 2 CVN Cuts
220 
221  Spectrum nd2dplot2prong("#pi^{0} True Energy [GeV] vs. #pi^{0} Reconstructed Mass [GeV]",mcloader,Pi0Massbins,kPi0RecoMass,Pi0Enbins,kTruePi0En,k2ProngPreSel2CVN);
222 
223 
224  /*********************************************************************************************************************/
225 
226  // Once all spectra are registered, loop through input files, extracting variable values and filling histograms.
227  //Total POT is accumulated and used to set spectra POT.
228 
229  mcloader.Go();
230  dataloader.Go();
231 
232 
233 
234  /*********************************************************************************************************************/
235 
236  ///saving root file//
237 
238  TFile *out = new TFile("new2pngvariable_prod4_03GeV_Cuts_1CVN_07_2CVN_09_WITHDATA_2view.root","RECREATE");
239  //ndNumi.SaveTo(out->mkdir("ndNumi"));
240  //ndNCMCSig.SaveTo(out->mkdir("ndNCMCSig"));
241 
242  ////////RECO MASSSS//////////////////
243  ///////reco masss with & "NO CUT" (3prong only)////////
244  ndNoCuts.SaveTo(out->mkdir("ndNoCuts"));
245  ndNoCutCCNonPi0.SaveTo(out->mkdir("ndNoCutCCNonPi0"));
246  ndNoCutNCNonPi0.SaveTo(out->mkdir("ndNoCutNCNonPi0"));
247  ndNoCutNCPi0.SaveTo(out->mkdir("ndNoCutNCPi0"));
248  ndNoCutNCPi0L.SaveTo(out->mkdir("ndNoCutNCPi0L"));
249  ndNoCutCCPi0.SaveTo(out->mkdir("ndNoCutCCPi0"));
250 
251  ///////reco masss with & Presel+ Remid+ prong 1&2 CVN cut////////
252  ndMC.SaveTo(out->mkdir("ndMC"));
253  ndMC3P.SaveTo(out->mkdir("ndMC3P"));
254  ndNCPi0.SaveTo(out->mkdir("ndNCPi0"));
255  ndCCPi0.SaveTo(out->mkdir("ndCCPi0"));
256  ndNCNonPi0.SaveTo(out->mkdir("ndNCNonPi0"));
257  ndNCPi0L.SaveTo(out->mkdir("ndNCPi0L"));
258  ndCCNonPi0.SaveTo(out->mkdir("ndCCNonPi0"));
259 
260  ///////reco masss with & Presel+ Remid+ prong 1 CVN cut////////
261  ndMC1Cut.SaveTo(out->mkdir("ndMC1Cut"));
262  ndMC3P1Cut.SaveTo(out->mkdir("ndMC3P1Cut"));
263  ndNCPi01Cut.SaveTo(out->mkdir("ndNCPi01Cut"));
264  ndCCPi01Cut.SaveTo(out->mkdir("ndCCPi01Cut"));
265  ndNCNonPi01Cut.SaveTo(out->mkdir("ndNCNonPi01Cut"));
266  ndNCPi0L1Cut.SaveTo(out->mkdir("ndNCPi0L1Cut"));
267  ndCCNonPi01Cut.SaveTo(out->mkdir("ndCCNonPi01Cut"));
268 
269  ////////////////////CVN Analysis//////////////////////////////
270 
271  //////2 prong cvn variable & Presel+ Remid+ prong 1 CVN cut///////////
272  ndCVNMC3P.SaveTo(out->mkdir("ndCVNMC3P"));
273  ndCVNNCNonPi0.SaveTo(out->mkdir("ndCVNNCNonPi0"));
274  ndCVNNCPi0L.SaveTo(out->mkdir("ndCVNNCPi0L"));
275  ndCVNNCPi0.SaveTo(out->mkdir("ndCVNNCPi0"));
276  ndCVNCCPi0.SaveTo(out->mkdir("ndCVNCCPi0"));
277  ndCVNCCNonPi0.SaveTo(out->mkdir("ndCVNCCNonPi0"));
278 
279  //////1 prongCVN photon variable & Presel + remid cut ///////////
280  ndCVNMC3PR.SaveTo(out->mkdir("ndCVNMC3PR"));
281  ndCVNNCPi0R.SaveTo(out->mkdir("ndCVNNCPi0R"));
282  ndCVNCCPi0R.SaveTo(out->mkdir("ndCVNCCPi0R"));
283  ndCVNNCNonPi0R.SaveTo(out->mkdir("ndCVNNCNonPi0R"));
284  ndCVNNCPi0LR.SaveTo(out->mkdir("ndCVNNCPi0LR"));
285  ndCVNCCNonPi0R.SaveTo(out->mkdir("ndCVNCCNonPi0R"));
286 
287  //////2 prong CVN photon variable & Presel + remid cut ///////////
288  nd2CVNMC3PR.SaveTo(out->mkdir("nd2CVNMC3PR"));
289  nd2CVNNCPi0R.SaveTo(out->mkdir("nd2CVNNCPi0R"));
290  nd2CVNCCPi0R.SaveTo(out->mkdir("nd2CVNCCPi0R"));
291  nd2CVNNCNonPi0R.SaveTo(out->mkdir("nd2CVNNCNonPi0R"));
292  nd2CVNNCPi0LR.SaveTo(out->mkdir("nd2CVNNCPi0LR"));
293  nd2CVNCCNonPi0R.SaveTo(out->mkdir("nd2CVNCCNonPi0R"));
294 
295 
296  //////RemID & w/ PreSel + 2 prong events cut ////////
297  ndMC3PRem.SaveTo(out->mkdir("ndMC3PRem"));
298  ndNCPi0Rem.SaveTo(out->mkdir("ndNCPi0Rem"));
299  ndCCPi0Rem.SaveTo(out->mkdir("ndCCPi0Rem"));
300  ndNCNonPi0Rem.SaveTo(out->mkdir("ndNCNonPi0Rem"));
301  ndNCPi0LRem.SaveTo(out->mkdir("ndNCPi0LRem"));
302  ndCCNonPi0Rem.SaveTo(out->mkdir("ndCCNonPi0Rem"));
303 
304  //////TRUE ENERGY///////////////////////////////////////
305 
306  ///// Highest True Pi0 Energy & w/Presel + 2 prong events cut /////
307 
308  ndMC3PPrel.SaveTo(out->mkdir("ndMC3PPrel"));
309  ndNCPi0Prel.SaveTo(out->mkdir("ndNCPi0Prel"));
310  ndCCPi0Prel.SaveTo(out->mkdir("ndCCPi0Prel"));
311  ndNCNonPi0Prel.SaveTo(out->mkdir("ndNCNonPi0Prel"));
312  ndNCPi0LPrel.SaveTo(out->mkdir("ndNCPi0LPrel"));
313  ndCCNonPi0Prel.SaveTo(out->mkdir("ndCCNonPi0Prel"));
314 
315  ///// Highest True Pi0 Energy & w/Presel + RemID + 2 prong events cut /////
316  ndMC3PPrelR.SaveTo(out->mkdir("ndMC3PPrelR"));
317  ndNCPi0PrelR.SaveTo(out->mkdir("ndNCPi0PrelR"));
318  ndCCPi0PrelR.SaveTo(out->mkdir("ndCCPi0PrelR"));
319  ndNCNonPi0PrelR.SaveTo(out->mkdir("ndNCNonPi0PrelR"));
320  ndNCPi0LPrelR.SaveTo(out->mkdir("ndNCPi0LPrelR"));
321  ndCCNonPi0PrelR.SaveTo(out->mkdir("ndCCNonPi0PrelR"));
322 
323  ///// Highest True Pi0 Energy & w/Presel + RemID + prong 1 CVN + 2 prong events cut /////
324  ndMC3PPrelCVN.SaveTo(out->mkdir("ndMC3PPrelCVN"));
325  ndNCPi0PrelCVN.SaveTo(out->mkdir("ndNCPi0PrelCVN"));
326  ndCCPi0PrelCVN.SaveTo(out->mkdir("ndCCPi0PrelCVN"));
327  ndNCNonPi0PrelCVN.SaveTo(out->mkdir("ndNCNonPi0PrelCVN"));
328  ndNCPi0LPrelCVN.SaveTo(out->mkdir("ndNCPi0LPrelCVN"));
329  ndCCNonPi0PrelCVN.SaveTo(out->mkdir("ndCCNonPi0PrelCVN"));
330 
331  ///// Highest True Pi0 Energy & w/Presel + RemID + prong 1&2 CVN + 2 prong events cut /////
332  ndMC3PPrelCVN2Cuts.SaveTo(out->mkdir("ndMC3PPrelCVN2Cuts"));
333  ndNCPi0PrelCVN2Cuts.SaveTo(out->mkdir("ndNCPi0PrelCVN2Cuts"));
334  ndCCPi0PrelCVN2Cuts.SaveTo(out->mkdir("ndCCPi0PrelCVN2Cuts"));
335  ndNCNonPi0PrelCVN2Cuts.SaveTo(out->mkdir("ndNCNonPi0PrelCVN2Cuts"));
336  ndNCPi0LPrelCVN2Cuts.SaveTo(out->mkdir("ndNCPi0LPrelCVN2Cuts"));
337  ndCCNonPi0PrelCVN2Cuts.SaveTo(out->mkdir("ndCCNonPi0PrelCVN2Cuts"));
338 
339  ////2D Plots 2 prong///////
340 
341  nd2dplot2prong.SaveTo(out->mkdir("nd2dplot2prong"));
342 
343  /////DATA////////////////////////////
344  //////INVARIANT MASS DATA/////
345  ndNumiMassdataNoCuts.SaveTo(out->mkdir("ndNumiMassdataNoCuts"));
346  ndNumiMassdataPreSel.SaveTo(out->mkdir("ndNumiMassdataPreSel"));
347  ndNumiMassdataRem.SaveTo(out->mkdir("ndNumiMassdataRem"));
348  ndNumiMassdataCVN.SaveTo(out->mkdir("ndNumiMassdataCVN"));
349  ndNumiMassdata2CVN.SaveTo(out->mkdir("ndNumiMassdata2CVN"));
350  ///CVN ANALYSIS DATA////////
351  ndNumiRemIDData.SaveTo(out->mkdir("ndNumiRemIDData"));
352  ndNumiCVN2PRData.SaveTo(out->mkdir("ndNumiCVN2PRData"));
353  ndNumi2CVN2PRData.SaveTo(out->mkdir("ndNumi2CVN2PRData"));
354  ndNumiCVN2PData.SaveTo(out->mkdir("ndNumiCVN2PData"));
355 
356  std::cout<<"\nOutput saved to " << out->GetName()<<std::endl;
357 
358 
359  out->Close();
360 
361  return;
362 
363 }
364 
365 #endif
366 
const Var kPi0RecoMass([](const caf::SRProxy *sr){float pi0mass;float dotproduct;if(sr->vtx.nelastic==0) return 0.0f;if(sr->mc.nnu==0) return 0.0f;if(sr->mc.nu[0].prim.size()==0) return 0.0f;if(sr->vtx.elastic[0].fuzzyk.npng< 2) return float(-1);dotproduct=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.dir.Unit().Dot(sr->vtx.elastic[0].fuzzyk.png[1].shwlid.dir.Unit());pi0mass=sqrt((2 *(sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE *sr->vtx.elastic[0].fuzzyk.png[1].shwlid.calE))*(1-dotproduct));return pi0mass;})
const Binning Pi0Enbins
Definition: ncpi0Bins.h:32
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Cut kIsNCNonPi02P
Definition: ncpi0Cuts.h:873
const Cut kIsNCPi02P2
Definition: ncpi0Cuts.h:902
const Cut kIsCCPi02PRem
Definition: ncpi0Cuts.h:910
const Cut k2ProngPreSel2CVNData
Definition: ncpi0Cuts.h:1261
const Cut kIsNCPi0L2P
Definition: ncpi0Cuts.h:894
const Var kPi0RecoMassData([](const caf::SRProxy *sr){float pi0mass;float dotproduct;if(sr->vtx.nelastic==0) return 0.0f; if(sr->vtx.elastic[0].fuzzyk.npng< 2) return float(-1);dotproduct=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.dir.Unit().Dot(sr->vtx.elastic[0].fuzzyk.png[1].shwlid.dir.Unit());pi0mass=sqrt((2 *(sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE *sr->vtx.elastic[0].fuzzyk.png[1].shwlid.calE))*(1-dotproduct));return pi0mass;})
const Cut kIsNCNonPi02P2
Definition: ncpi0Cuts.h:878
const Cut kIsCCNonPi02PRem
Definition: ncpi0Cuts.h:882
const Var kRemIDPR([](const caf::SRProxy *sr){return sr->sel.remid.pid;})
const Cut k2ProngPreSel
Definition: ncpi0Cuts.h:863
const Cut kIsNCNonPi02PRem
Definition: ncpi0Cuts.h:883
const Cut kIsNCPi02PNoCut
Definition: ncpi0Cuts.h:886
const Cut kIsCCPi02PR
Definition: ncpi0Cuts.h:907
const Var kTruePi0En([](const caf::SRProxy *sr){float en=-99;int nbofprim=sr->mc.nu[0].prim.size();for(int i=0;i< nbofprim;i++){if(sr->mc.nu[0].prim[i].pdg==111 &&(sr->mc.nu[0].prim[i].p.E) > en){en=sr->mc.nu[0].prim[i].p.E;}}return en;})
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const Cut kIsNCPi0L2P2
Definition: ncpi0Cuts.h:901
void ncpi0HistoGrid2()
const Cut kIsCCNonPi02P2
Definition: ncpi0Cuts.h:877
const Cut kIsCCPi02P
Definition: ncpi0Cuts.h:897
const Cut k2ProngPreSelR
Definition: ncpi0Cuts.h:866
const Cut k2ProngPreSelCVN
Definition: ncpi0Cuts.h:865
const Cut kIsCCPi02P2
Definition: ncpi0Cuts.h:903
const Cut kIsCCPi02PNoCut
Definition: ncpi0Cuts.h:888
const Cut kIsNCNonPi02PNoCut
Definition: ncpi0Cuts.h:885
const Binning Pi0Massbins
Definition: ncpi0Bins.h:28
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
const Cut kIsNCPi0L2PRem
Definition: ncpi0Cuts.h:909
const Binning PCIDbins
Definition: ncpi0Bins.h:24
const Cut kPreSelectData2
Definition: ncpi0Cuts.h:1259
OStream cout
Definition: OStream.cxx:6
const Cut k2ProngPreSel2CVN
Definition: ncpi0Cuts.h:864
const Cut kPreSelectData3
Definition: ncpi0Cuts.h:1260
const Cut kIsNCPi0L2PR
Definition: ncpi0Cuts.h:906
const Cut kPreSelect
3 prong analysis cuts////
Definition: ncpi0Cuts.h:796
const Var k2ViewCVN2gamma([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return 0.f;if(sr->vtx.elastic[0].fuzzyk.npng< 2) return float(-1);return float(sr->vtx.elastic[0].fuzzyk.png[1].cvnpart2View.photonid);})
const Cut kIsCCNonPi02P
Definition: ncpi0Cuts.h:870
const Cut kIsCCNonPi02PNoCut
Definition: ncpi0Cuts.h:884
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
const Cut kPreSelectDataNoCuts
Definition: ncpi0Cuts.h:1257
const Cut kIsCCNonPi02PR
Definition: ncpi0Cuts.h:880
const Var k2ViewCVN1gamma([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return 0.f;if(sr->vtx.elastic[0].fuzzyk.npng< 1) return float(-1);return float(sr->vtx.elastic[0].fuzzyk.png[0].cvnpart2View.photonid);})
const Cut kIsNCPi02PRem
Definition: ncpi0Cuts.h:908
const Cut kIsNCPi0L2PNoCut
Definition: ncpi0Cuts.h:912
const Binning RemIDbins
Definition: ncpi0Bins.h:8
const Cut kIsNCNonPi02PR
Definition: ncpi0Cuts.h:881
const Cut NoCut2prong
2 prong analysis cuts ///
Definition: ncpi0Cuts.h:862
const Cut kIsNCPi02PR
Definition: ncpi0Cuts.h:905
const Cut kPreSelectData
Definition: ncpi0Cuts.h:1258
enum BeamMode string