angle.C
Go to the documentation of this file.
1 // Do a proper prediction, with all the components included
2 
3 #ifdef __CINT__
4 void angle()
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 "ncpi0Bins.h"
33 #include "ncpi0Cuts.h"
34 #include "ncpi0Vars.h"
35 /////////////////////////
36 
37 using namespace ana;
38 
39 void angle()
40 
41 {
42 
43 const std::string MC = "dataset_def_name_newest_snapshot prod_caf_R17-03-01-prod3reco.d_nd_genie_nonswap_fhc_nova_v08_full_v1";
44 
45 
46 SpectrumLoader mcloader(MC);
47 
48 Spectrum angle("Reco #theta_{beam} [Deg.]", BeamAnglebins, mcloader,kRecoPi0BeamAngle , kIsSignal01L && kIsPreSel && kNpCVN1gammaID && kNpCVN2gammaID);
49 
50 Spectrum angletrue("True #theta_{beam} [Deg.]", BeamAnglebins, mcloader, kTrueBeamTheta , kIsSignal01L && kIsPreSel && kNpCVN1gammaID && kNpCVN2gammaID);
51 
52 mcloader.Go();
53 
54 TFile *out = new TFile("1d_angledistributions.root","RECREATE");
55 
56  angle.SaveTo(out->mkdir("angle"));
57  angletrue.SaveTo(out->mkdir("angletrue"));
58 
59 
60  std::cout<<"\nOutput saved to " << out->GetName()<<std::endl;
61  out->Close();
62 
63  return;
64 
65 }
66 
67 #endif
void angle()
Definition: angle.C:39
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kRecoPi0BeamAngle([](const caf::SRProxy *sr) ->float{if(sr->vtx.nelastic==0) return-1000.0f;if(sr->mc.nnu==0) return-1000.0f;assert(sr->mc.nnu==1);if(sr->mc.nu[0].prim.size()==0) return-1000.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-1000.0f;if(sr->vtx.elastic[0].fuzzyk.npng >2) return-1000.0f;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-1000.0f;TVector3 beamDirND=NuMIBeamDirection(caf::kNEARDET);TVector3 dir1, dir2, prongdir;float beamtheta=-1000.0f;float theta=-1000.0f;if(sr->vtx.elastic[0].fuzzyk.npng==2){dir1=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.dir;dir2=sr->vtx.elastic[0].fuzzyk.png[1].shwlid.dir;prongdir=dir1+dir2;beamtheta=prongdir.Angle(beamDirND);theta=beamtheta *360./(2 *TMath::Pi());}return theta;})
const Var kTrueBeamTheta
Definition: ncpi0Vars.h:684
const Cut kIsSignal01L
FIDUCIAL OPTIMIZATION ANALYSIS 2 PRONG TOTAL PRESELECTION CUTS///.
Definition: ncpi0Cuts.h:1092
const Binning BeamAnglebins
Definition: ncpi0Bins.h:47
Representation of a spectrum in any variable, with associated POT.
Definition: Spectrum.h:40
const Cut kNpCVN2gammaID([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;double prPID=sr->vtx.elastic[0].fuzzyk.png[1].cvnpart.photonid;if(prPID >=0.9) return true;return false;})
virtual void Go() override
Load all the registered spectra.
void SaveTo(TDirectory *dir, const std::string &name) const
Definition: Spectrum.cxx:506
const Cut kNpCVN1gammaID([](const caf::SRProxy *sr){if(sr->vtx.nelastic==0) return false;if(sr->vtx.elastic[0].fuzzyk.npng==0) return false;double prPID=sr->vtx.elastic[0].fuzzyk.png[0].cvnpart.photonid;if(prPID >=0.7) return true;return false;})
const Cut kIsPreSel
Definition: ncpi0Cuts.h:1099
OStream cout
Definition: OStream.cxx:6
Collaborates with Spectrum and OscillatableSpectrum to fill spectra from CAF files.
enum BeamMode string