NCPi0FitVars.cxx
Go to the documentation of this file.
2 
4 
6 
7 namespace ana
8 {
9 
10 float TAKEPol6_biasHM(float kepol6_biasHM){
11 
12 
13  double p0 = -8.82852;
14  double p1 = 1.04303;
15  double p2 = -0.0668286;
16  double p3 = 0.0029157;
17  double p4 = -7.75003e-05;
18  double p5 = 1.19991e-06;
19  double p6 = -1.02259e-08;
20  double p7 = 4.44068e-11;
21  double p8 = -7.66607e-14;
22 
23  float KEPol6_biasHM=0.0;
24  if (kepol6_biasHM < 0.0) return 0.0;
25 
26  KEPol6_biasHM= kepol6_biasHM -(p0 + p1*kepol6_biasHM + p2*kepol6_biasHM*kepol6_biasHM + p3*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM + p4*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM + p5*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM + p6*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM + p7*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM + p8*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM*kepol6_biasHM) ;
27 
28  return KEPol6_biasHM;
29  }
30 
31 const Var kCorrRecoPi0TE([](const caf::SRProxy *sr)
32  {
33  if(!sr->vtx.elastic.IsValid) return 0.0f;
34  if(sr->vtx.elastic.fuzzyk.nshwlid==0) return 0.0f;
35  if(sr->vtx.elastic.fuzzyk.npng==0) return 0.0f;
36 
37  float totEn;
38 
39  float kepol6_biasHM;
40  float Png1En=0.0f;
41  float Png2En=0.0f;
42  float KEPol6_biasHM=0.0f;
43 
44  if(sr->vtx.elastic.fuzzyk.npng==2){
45  Png1En=sr->vtx.elastic.fuzzyk.png[0].shwlid.calE;
46  Png2En=sr->vtx.elastic.fuzzyk.png[1].shwlid.calE;
47  totEn=(Png1En+Png2En);
48 
49  kepol6_biasHM= totEn;
50  if(kepol6_biasHM < 0.0) return 0.0f;
51  KEPol6_biasHM=TAKEPol6_biasHM(kepol6_biasHM);
52 
53  }
54 
55  return KEPol6_biasHM;
56  });
57 
58 const Var kCorrAngle([](const caf::SRProxy *sr) -> float
59  {
60  if(!sr->vtx.elastic.IsValid) return 0.0f;
61  if(sr->vtx.elastic.fuzzyk.nshwlid==0) return 0.0f;
62  if(sr->vtx.elastic.fuzzyk.npng==0) return 0.0f;
63  if(sr->vtx.elastic.fuzzyk.npng>2) return -1000.0f;
64  if(sr->mc.nnu == 0) return -1000.0f;
65  assert(sr->mc.nnu==1);
66  if(sr->mc.nu[0].prim.size() == 0) return -1000.0f;
67 
68  float kepol6_biasHM;
69  float KEPol6_biasHM=0.0f;
70  TVector3 beamDirND = NuMIBeamDirection(caf::kNEARDET); //returns unit vector
71  TVector3 dir1, dir2, prongdir;
72  float beamtheta=-1000.0f;
73  float theta=-1000.0f;
74 
75  if(sr->vtx.elastic.fuzzyk.npng==2){
76  dir1=sr->vtx.elastic.fuzzyk.png[0].shwlid.dir;
77  dir2=sr->vtx.elastic.fuzzyk.png[1].shwlid.dir;
78  prongdir=dir1+dir2;
79 
80  // beamtheta=prongdir.Unit().Dot(beamDirND.Unit()); //returns Cos theta
81  beamtheta=prongdir.Angle(beamDirND);
82  theta = beamtheta * 360./(2*3.14159);
83 
84  kepol6_biasHM= theta;
85  if(kepol6_biasHM < 0.0) return 0.0f;
86  KEPol6_biasHM=TAKEPol6_biasHM(kepol6_biasHM);
87 
88  }
89 
90  return KEPol6_biasHM;
91  });
92 
93 }
caf::Proxy< size_t > npng
Definition: SRProxy.h:2038
caf::Proxy< unsigned int > nshwlid
Definition: SRProxy.h:2040
Near Detector underground.
Definition: SREnums.h:10
caf::Proxy< caf::SRFuzzyK > fuzzyk
Definition: SRProxy.h:2059
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2126
caf::Proxy< std::vector< caf::SRNeutrino > > nu
Definition: SRProxy.h:618
caf::Proxy< short int > nnu
Definition: SRProxy.h:617
const Var kCorrRecoPi0TE([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return 0.0f;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return 0.0f;if(sr->vtx.elastic.fuzzyk.npng==0) return 0.0f;float totEn;float kepol6_biasHM;float Png1En=0.0f;float Png2En=0.0f;float KEPol6_biasHM=0.0f;if(sr->vtx.elastic.fuzzyk.npng==2){Png1En=sr->vtx.elastic.fuzzyk.png[0].shwlid.calE;Png2En=sr->vtx.elastic.fuzzyk.png[1].shwlid.calE;totEn=(Png1En+Png2En);kepol6_biasHM=totEn;if(kepol6_biasHM< 0.0) return 0.0f;KEPol6_biasHM=TAKEPol6_biasHM(kepol6_biasHM);}return KEPol6_biasHM;})
Definition: NCPi0FitVars.h:9
caf::Proxy< caf::SRElastic > elastic
Definition: SRProxy.h:2118
caf::Proxy< std::vector< caf::SRFuzzyKProng > > png
Definition: SRProxy.h:2043
const Var kCorrAngle([](const caf::SRProxy *sr) -> float{if(!sr->vtx.elastic.IsValid) return 0.0f;if(sr->vtx.elastic.fuzzyk.nshwlid==0) return 0.0f;if(sr->vtx.elastic.fuzzyk.npng==0) return 0.0f;if(sr->vtx.elastic.fuzzyk.npng >2) 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;float kepol6_biasHM;float KEPol6_biasHM=0.0f;TVector3 beamDirND=NuMIBeamDirection(caf::kNEARDET);TVector3 dir1, dir2, prongdir;float beamtheta=-1000.0f;float theta=-1000.0f;if(sr->vtx.elastic.fuzzyk.npng==2){dir1=sr->vtx.elastic.fuzzyk.png[0].shwlid.dir;dir2=sr->vtx.elastic.fuzzyk.png[1].shwlid.dir;prongdir=dir1+dir2;beamtheta=prongdir.Angle(beamDirND);theta=beamtheta *360./(2 *3.14159);kepol6_biasHM=theta;if(kepol6_biasHM< 0.0) return 0.0f;KEPol6_biasHM=TAKEPol6_biasHM(kepol6_biasHM);}return KEPol6_biasHM;})
Definition: NCPi0FitVars.h:10
caf::StandardRecord * sr
const TVector3 beamDirND
caf::Proxy< caf::SRTruthBranch > mc
Definition: SRProxy.h:2138
caf::Proxy< bool > IsValid
Definition: SRProxy.h:2058
assert(nhit_max >=nhit_nbins)
TVector3 NuMIBeamDirection(caf::Det_t det)
Average direction of NuMI neutrinos in a given detector This function is a copy of geo::GeometryBase:...
Definition: Utilities.cxx:329
float TAKEPol6_biasHM(float kepol6_biasHM)
caf::Proxy< caf::SRVertexBranch > vtx
Definition: SRProxy.h:2146