NusVars.h
Go to the documentation of this file.
1 #pragma once
2 
3 // Vars used in Nus analysis Data/MC and validation
4 // No duplicates, please
5 
6 #include "CAFAna/Core/Var.h"
7 
8 namespace ana
9 {
10 
11  // useful for defining front/back of detector
12  const double NDL = -191.;
13  const double NDR = 192.;
14  const double NDB = -187.;
15  const double NDT = 194.;
16  const double NDF = 0.;
17  const double NDE = 1270.;
18 
19  const double FDL = -758.;
20  const double FDR = 765.;
21  const double FDB = -749.;
22  const double FDT = 765.;
23  const double FDF = 0.;
24  const double FDE = 5962.;
25 
26  // --------------------------------------------------------
27  // 2020 selection Vars
28  // --------------------------------------------------------
29  extern const Var kIsElastic;
30  extern const Var kNFuzzyProng;
31  extern const Var kNContPlanes;
32 
33  // three possible tunes of the CVN
34  // the one chosen for the FHC analysis is kCVNnc_looseptp
35  // naming convention of vars follows that of nue and numu
36  extern const Var kCVNnc_looseptp;
37  extern const Var kCVNnc_oldpresel;
38 
39  // additionally defining variables for BDT
40  extern const Var kNSliceHits;
41  extern const Var kShwNHitX;
42  extern const Var kShwNHitY;
43  extern const Var kShwNHitXMinY;
44  extern const Var kShwDirY;
45  extern const Var kNShwLid;
46  extern const Var kNMipHit;
47 
48  // possible vars to drop
49  extern const Var kShwNHitXPlusY;
50  extern const Var kShwNHitXOverY;
51 
52  // in addition use kNHitsPerPlane,
53  // kPartPtp, kShwGap, kShwWidth, kShwCalE
54  // kShwLen
55 
56  // --------------------------------------------------------
57  // Energy Vars
58  // --------------------------------------------------------
59 
60  // Nus17 reconstructed (visible) energy - see docdb 17797 and 17985
61 
62  extern const Var kNus17Energy;
63  extern const Var kNus18Energy;
64  extern const Var kNus20Energy;
65 
66  // --------------------------------------------------------
67  // Other Vars
68  // --------------------------------------------------------
69 
70  /// NC Cosmic Rejection (G)BDT variables
71  extern const Var kNCCosRej;
72  extern const Var kNCCosRejG;
73 
74  extern const Var kPartPtp;
75 
76  extern const Var kDistTop;
77 
78  extern const Var kMinDistFace;
79 
80  extern const Var kClosestSlcTime;
81  extern const Var kClosestSlcMinDist;
82  extern const Var kClosestSlcMinTop;
83 
84  //---------------------------------------------------------------------------------
85  // Nus18 kaon
87  const Var kNus18BeamWeightP = VarFromNuTruthVar(kNus18BeamWeightP_NT, 1);
88 
90  const Var kNus18BeamWeightM = VarFromNuTruthVar(kNus18BeamWeightM_NT, 1);
91 
92  //---------------------------------------------------------------------------------
93  //---------------------------------------------------------------------------------
94  // Nus18 tau
95  extern const NuTruthVar kFDTauWgtM_NT;
96  const Var kFDTauWgtM = VarFromNuTruthVar(kFDTauWgtM_NT, 1);
97 
98  extern const NuTruthVar kFDTauWgtP_NT;
99  const Var kFDTauWgtP = VarFromNuTruthVar(kFDTauWgtP_NT, 1);
100 
101 }//namespace
const double NDT
Definition: NusCuts.cxx:12
const Var kPartPtp([](const caf::SRProxy *sr){if(std::isnan(1.*sr->sel.nuecosrej.partptp)|| std::isinf(1.*sr->sel.nuecosrej.partptp)) return-5.f;return float(sr->sel.nuecosrej.partptp);})
Definition: NusVars.h:74
const Var kShwDirY
Definition: NusVars.cxx:21
const NuTruthVar kNus18BeamWeightP_NT([](const caf::SRNeutrinoProxy *nu){if(abs(nu->beam.ptype)==321||nu->beam.ptype==310||nu->beam.ptype==311||nu->beam.ptype==130) return 1.3;return 1.;})
Definition: NusVars.h:86
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const Var kNus18Energy([](const caf::SRProxy *sr){bool h_FHC=sr->spill.isFHC;bool h_RHC=sr->spill.isRHC;double cale=sr->slc.calE;double recoE=0.;if(h_FHC &&sr->hdr.det==caf::kFARDET) recoE=FDscaleCalE18 *cale;else if(h_FHC &&sr->hdr.det==caf::kNEARDET) recoE=NDscaleCalE18 *cale;else if(h_RHC &&sr->hdr.det==caf::kFARDET) recoE=FDscaleCalE18RHC *cale;else if(h_RHC &&sr->hdr.det==caf::kNEARDET) recoE=NDscaleCalE18RHC *cale;return recoE;})
Definition: NusVars.h:63
const Var kShwNHitX
Definition: NusVars.cxx:19
const Var kDistTop([](const caf::SRProxy *sr){return std::min(sr->sel.nuecosrej.starttop, sr->sel.nuecosrej.stoptop);})
Definition: NusVars.h:76
const Var kNus18BeamWeightM
Definition: NusVars.h:90
const Var kIsElastic
Definition: NusVars.cxx:11
const Var kShwNHitXOverY([](const caf::SRProxy *sr){double hitRatio=(double) sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx/(double) sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity;return hitRatio;})
Definition: NusVars.h:50
const double NDR
Definition: NusCuts.cxx:10
const Var kNus20Energy([](const caf::SRProxy *sr){if(sr->hdr.det!=caf::kNEARDET &&sr->hdr.det!=caf::kFARDET) return(double) sr->slc.calE;double pars[4][6]={{1.049, 0.795, 0.8409, 0.17, 0.82,-1.00},{1.025, 0.797, 0.9162, 0.53,-0.26,-1.48},{1.000, 1.000, 1.0000, 0.00, 0.00, 0.00},{1.000, 1.000, 1.0000, 0.00, 0.00, 0.00}};int detCur=(sr->hdr.det==caf::kFARDET)+((sr->spill.isRHC)<< 1);double e_EM=ana::kEME_2020(sr);double e_Had=ana::kHADE_2020(sr);double e_Cal=sr->slc.calE;return(e_EM/pars[detCur][0]+e_Had/pars[detCur][1])/(pars[detCur][2]+pars[detCur][3]*std::pow(e_Cal+pars[detCur][4], 2)*std::exp(pars[detCur][5]*e_Cal));})
Definition: NusVars.h:64
const double FDE
Definition: NusCuts.cxx:21
const Var kNCCosRejG
Definition: NusVars.cxx:96
const Var kNContPlanes
Definition: NusVars.cxx:13
const Var kMinDistFace([](const caf::SRProxy *sr){const caf::SRNueCosRejProxy &cr=sr->sel.nuecosrej;float mindist=10000.;mindist=std::min(mindist, std::min(cr.starteast, cr.stopeast));mindist=std::min(mindist, std::min(cr.startwest, cr.stopwest));mindist=std::min(mindist, std::min(cr.starttop, cr.stoptop));mindist=std::min(mindist, std::min(cr.startbottom, cr.stopbottom));mindist=std::min(mindist, std::min(cr.startfront, cr.stopfront));mindist=std::min(mindist, std::min(cr.startback, cr.stopback));return(mindist > 9999.?(float)-5.:mindist);})
Definition: NusVars.h:78
const Var kNus18BeamWeightP
Definition: NusVars.h:87
const double NDL
Definition: NusCuts.cxx:9
_Var< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:74
const Var kNFuzzyProng
Definition: NusVars.cxx:12
const Var kNus17Energy([](const caf::SRProxy *sr){double cale=sr->slc.calE;double recoE=0.;if(sr->hdr.det==caf::kFARDET) recoE=FDscaleCalE17 *cale;if(sr->hdr.det==caf::kNEARDET) recoE=NDscaleCalE17 *cale;return recoE;})
Definition: NusVars.h:62
const double FDF
Definition: NusCuts.cxx:20
const NuTruthVar kFDTauWgtM_NT([](const caf::SRNeutrinoProxy *nu){if(abs(nu->pdg)==16 &&nu->iscc) return 0.4;return 1.;})
Definition: NusVars.h:95
const NuTruthVar kNus18BeamWeightM_NT([](const caf::SRNeutrinoProxy *nu){if(abs(nu->beam.ptype)==321||nu->beam.ptype==310||nu->beam.ptype==311||nu->beam.ptype==130) return 0.7;return 1.;})
Definition: NusVars.h:89
const Var kNMipHit
Definition: NusVars.cxx:23
const double FDT
Definition: NusCuts.cxx:19
const double FDR
Definition: NusCuts.cxx:17
const Var kNSliceHits
Definition: NusVars.cxx:18
const NuTruthVar kFDTauWgtP_NT([](const caf::SRNeutrinoProxy *nu){if(abs(nu->pdg)==16 &&nu->iscc) return 1.6;return 1.;})
Definition: NusVars.h:98
const Var kClosestSlcMinTop([](const caf::SRProxy *sr){return(float) sr->slc.closestsliceminfromtop;})
Definition: NusVars.h:82
const Var kCVNnc_oldpresel
Definition: NusVars.cxx:15
const Var kClosestSlcMinDist([](const caf::SRProxy *sr){return(float) sr->slc.closestslicemindist;})
Definition: NusVars.h:81
const double NDF
Definition: NusCuts.cxx:13
const Var kShwNHitXPlusY([](const caf::SRProxy *sr){double nHits=sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx+sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity;return nHits;})
Definition: NusVars.h:49
const Var kNShwLid
Definition: NusVars.cxx:22
const Var kCVNnc_looseptp
Definition: NusVars.cxx:14
Var VarFromNuTruthVar(const NuTruthVar &stv, double _default)
Definition: Var.cxx:7
const double NDB
Definition: NusCuts.cxx:11
const Var kShwNHitXMinY([](const caf::SRProxy *sr){double nHits=sr->vtx.elastic.fuzzyk.png[0].shwlid.nhitx-sr->vtx.elastic.fuzzyk.png[0].shwlid.nhity;return nHits;})
Definition: NusVars.h:43
const double FDL
Definition: NusCuts.cxx:16
const Var kShwNHitY
Definition: NusVars.cxx:20
const Var kFDTauWgtP
Definition: NusVars.h:99
const Var kFDTauWgtM
Definition: NusVars.h:96
const double NDE
Definition: NusCuts.cxx:14
const double FDB
Definition: NusCuts.cxx:18
const Var kNCCosRej
NC Cosmic Rejection (G)BDT variables.
Definition: NusVars.cxx:95
const Var kClosestSlcTime([](const caf::SRProxy *sr){return(float) sr->slc.closestslicetime;})
Definition: NusVars.h:80