Classes | Namespaces | Functions | Variables
NCPi0SemiIncVars.h File Reference
#include "CAFAna/Vars/Vars.h"
#include "CAFAna/Core/HistAxis.h"
#include "StandardRecord/Proxy/SRProxy.h"
#include "CAFAna/Core/Binning.h"
#include "NDAna/ncpi0_SemiInclusive/NCPi0SemiIncBins.h"
#include "NDAna/ncpi0_SemiInclusive/NCPi0SemiIncCuts.h"
#include "NDAna/ncpi0_SemiInclusive/NDNCPi0Xsec.h"
#include "NDAna/ncpi0_SemiInclusive/NCPi0FitVars.h"
#include "TH2.h"
#include "TMath.h"
#include "TH1.h"
#include "TAxis.h"
#include "TVector3.h"
#include "TParticlePDG.h"
#include "TLorentzVector.h"

Go to the source code of this file.

Classes

struct  ana::mHistAxisDef
 
struct  ana::mHistAxisSTDef
 

Namespaces

 ana
 Cuts and Vars for the 2020 FD DiF Study.
 

Functions

const Var ana::kVtxX ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-1000.0f;if(sr->vtx.nelastic==0) return-1000.0f;return(float) sr->vtx.elastic[0].vtx.x;})
 
const Var ana::kVtxY ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-1000.0f;if(sr->vtx.nelastic==0) return-1000.0f;return(float) sr->vtx.elastic[0].vtx.y;})
 
const Var ana::kVtxZ ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-1000.0f;if(sr->vtx.nelastic==0) return-1000.0f;return(float) sr->vtx.elastic[0].vtx.z;})
 
const Var ana::kNumOfPngs ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;assert(sr->mc.nnu==1);if(sr->vtx.nelastic==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-10.0f;return(float) sr->vtx.elastic[0].fuzzyk.npng;})
 
const Var ana::kRemid ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;assert(sr->mc.nnu==1);if(sr->vtx.nelastic==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-10.0f;float rem=sr->sel.remid.pid;return rem;})
 
const Var ana::kPi0RecoMass ([](const caf::SRProxy *sr){float pi0mass=0.135;float dotproduct;if(sr->vtx.nelastic==0) return-10.0f;if(sr->mc.nnu==0) return-10.0f;assert(sr->mc.nnu==1);if(sr->mc.nu[0].prim.size()==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng >2) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==2){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 Var ana::kPng1Energy ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;if(sr->vtx.nelastic==0) return-10.0f;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng >2) return-10.0f;float pngen=0.;if(sr->vtx.elastic[0].fuzzyk.npng==2){pngen=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE;}return pngen;})
 
const Var ana::kPng2Energy ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;if(sr->vtx.nelastic==0) return-10.0f;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng >2) return-10.0f;float pngen=0.;if(sr->vtx.elastic[0].fuzzyk.npng==2){pngen=sr->vtx.elastic[0].fuzzyk.png[1].shwlid.calE;}return pngen;})
 
const Var ana::kOpeningAngle ([](const caf::SRProxy *sr){float dotproduct=0.;if(sr->vtx.nelastic==0) return-10.0f;if(sr->mc.nnu==0) return-10.0f;assert(sr->mc.nnu==1);if(sr->mc.nu[0].prim.size()==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng >2) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==2){dotproduct=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.dir.Unit().Dot(sr->vtx.elastic[0].fuzzyk.png[1].shwlid.dir.Unit());}return dotproduct;})
 
const Var ana::kSlcEnergy ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;assert(sr->mc.nnu==1);if(sr->vtx.nelastic==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-10.0f;float slcen=sr->slc.calE;return slcen;})
 
const Var ana::khadEnergy ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return-10.0f;if(sr->vtx.nelastic==0) return-10.0f;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return-10.0f;if(sr->vtx.elastic[0].fuzzyk.npng >2) return-10.0f;float slcen=sr->slc.calE;float totEn;float haden=0.;float Png1En=-99;float Png2En=-99;if(sr->vtx.elastic[0].fuzzyk.npng==2){Png1En=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE;Png2En=sr->vtx.elastic[0].fuzzyk.png[1].shwlid.calE;totEn=(Png1En+Png2En);haden=slcen-totEn;}return haden;})
 
const Var ana::kRecoPi0KE ([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return 0.0f;if(sr->vtx.nelastic==0) return 0.0f;assert(sr->mc.nnu==1);if(sr->vtx.elastic[0].fuzzyk.nshwlid==0) return 0.0f;if(sr->vtx.elastic[0].fuzzyk.npng==0) return 0.0f;float MassOfPi0=0.135;float totEn=0.0f;float RecoKE=0.0f;float Png1En=0.0f;float Png2En=0.0f;if(sr->vtx.elastic[0].fuzzyk.npng==2){Png1En=sr->vtx.elastic[0].fuzzyk.png[0].shwlid.calE;Png2En=sr->vtx.elastic[0].fuzzyk.png[1].shwlid.calE;totEn=(Png1En+Png2En);RecoKE=(totEn-MassOfPi0);}return RecoKE;})
 
const NuTruthVar ana::kTruePi0KEST ([](const caf::SRNeutrinoProxy *nu){float MassOfPi0=0.135;float kinetic=0.0f;float en=0.0f;int nbofprim=nu->prim.size();for(int i=0;i< nbofprim;i++){if(nu->prim[i].pdg==111){en=nu->prim[i].p.E;kinetic=en-MassOfPi0;}}return kinetic;})
 
const Var ana::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=0.;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.Unit().Dot(beamDirND.Unit());}return beamtheta;})
 
const NuTruthVar ana::kTruePi0BeamAngleST ([](const caf::SRNeutrinoProxy *nu) ->float{int nprims=nu->prim.size();float beamtheta=-1000.0f;for(int iprim=0;iprim< nprims;iprim++){if(nu->prim[iprim].pdg==111){TVector3 piondir=nu->prim[iprim].p.Vect();TVector3 beamDirND=NuMIBeamDirection(caf::kNEARDET);beamtheta=piondir.Unit().Dot(beamDirND.Unit());}}return beamtheta;})
 
const Var ana::kRecoBeamTheta ([](const caf::SRProxy *sr) ->float{if(sr->vtx.nelastic==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;float theta=0.;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 NuTruthVar ana::kTrueBeamThetaST ([](const caf::SRNeutrinoProxy *nu) ->float{int nprims=nu->prim.size();float beamtheta=-10.0f;float theta=-10.0f;for(int iprim=0;iprim< nprims;iprim++){if(nu->prim[iprim].pdg==111){TVector3 piondir=nu->prim[iprim].p.Vect();TVector3 beamDirND=NuMIBeamDirection(caf::kNEARDET);beamtheta=piondir.Angle(beamDirND);theta=beamtheta *360./(2 *TMath::Pi());}}return theta;})
 
const NuTruthVar ana::kTrueNuEnergyST ([](const caf::SRNeutrinoProxy *nu){return nu->E;})
 
const NuTruthVar ana::kSigUpST ([](const caf::SRNeutrinoProxy *nu){float MassOfPi0=0.135;float kinetic=0.0f;float en=0.0f;int nbOfPi=0;int nbofprim=nu->prim.size();for(int i=0;i< nbofprim;i++){if(nu->prim[i].pdg==111){nbOfPi++;en=nu->prim[i].p.E;kinetic=en-MassOfPi0;}}if(((nu->pdg==14 &&nu->pdgorig==14)||(nu->pdg==12 &&nu->pdgorig==12))&&(nu->iscc==0)&&(kinetic >0.1)) return 1.10;else return 1.;})
 
const NuTruthVar ana::kSigHighWtST ([](const caf::SRNeutrinoProxy *nu){float MassOfPi0=0.135;float kinetic=0.0f;float en=0.0f;int nbOfPi=0;int nbofprim=nu->prim.size();for(int i=0;i< nbofprim;i++){if(nu->prim[i].pdg==111){nbOfPi++;en=nu->prim[i].p.E;kinetic=en-MassOfPi0;}}double wt=1.1+(kinetic *0.11);if(((nu->pdg==14 &&nu->pdgorig==14)||(nu->pdg==12 &&nu->pdgorig==12))&&(nu->iscc==0)&&(kinetic >0.1)) return wt;else return 1.;})
 
const NuTruthVar ana::kBkgUpST ([](const caf::SRNeutrinoProxy *nu){float MassOfPi0=0.135;float kinetic=0.0f;float en=0.0f;int nbOfPi=0;int nbofprim=nu->prim.size();for(int i=0;i< nbofprim;i++){if(nu->prim[i].pdg==111){nbOfPi++;en=nu->prim[i].p.E;kinetic=en-MassOfPi0;}}if(!(((nu->pdg==14 &&nu->pdgorig==14)||(nu->pdg==12 &&nu->pdgorig==12))&&(nu->iscc==0)&&(kinetic >0.1))) return 1.1;else return 1.;})
 

Variables

const Var ana::kTrueNuEnergy = VarFromNuTruthVar(kTrueNuEnergyST)
 
const Var ana::kTruePi0KE = VarFromSpillTruthVar(kTruePi0KEST)
 
const Var ana::kTruePi0BeamAngle = VarFromSpillTruthVar(kTruePi0BeamAngleST)
 
const Var ana::kResEn = kTruePi0KE- kRecoPi0KE
 
const Var ana::kCorrResEn = kTruePi0KE- kCorrRecoPi0KE
 
const Var ana::kResolutionAngle = kTruePi0BeamAngle-kRecoPi0BeamAngle
 
const int ana::kAllVars = 19
 
const mHistAxisDef ana::vars_cutFlow [kAllVars]
 
const int ana::kEnAngVars = 4
 
const mHistAxisDef ana::analysis_vars [6]
 
const mHistAxisDef ana::analysis_vars_anabins [kEnAngVars]
 
const mHistAxisDef ana::analysis_vars_unf [kEnAngVars]
 
const mHistAxisSTDef ana::nu_truth_axis [5]
 
const Var ana::kSigUp = VarFromNuTruthVar(kSigUpST)
 
const Var ana::kSigHighWt = VarFromNuTruthVar(kSigHighWtST)