Vars.h
Go to the documentation of this file.
1 #pragma once
2 
3 // Specific variables. When this file gets too crowded it should be split up
4 
5 // See Cuts.h for a walkthrough of how to define this kind of object
6 
7 #include "CAFAna/Core/Var.h"
8 #include "CAFAna/Core/Cut.h"
9 #include "CAFAna/Vars/NumuEFxs.h"
10 
12 
13 class TH1D;
14 
15 namespace ana
16 {
17  extern const Cut kIsRHC;
18 
19  // Return the run number
20  extern const Var kRun;
21 
22  // Return the subrun number
23  extern const Var kSubrun;
24 
25  // Return the cycle number (MC only)
26  extern const Var kCycle;
27 
28  // Return the event number
29  extern const Var kEvt;
30 
31  // Return the slice number
32  extern const Var kSlc;
33 
34  /// See docdb 23597
36 
37  /// \f$ \nu_e \f$ PID
38  extern const Var kLEM;
39 
40  /// \f$ \nu_e \f$ PID
41  extern const Var kLID;
42 
43  /// \f$ \nu_e \f$ PID
44  extern const Var kRVP;
45 
46  /// \f$ \nu_e \f$ PID
47  extern const Var kCVNe;
48 
49  extern const Var kCVNe_looseptp;
50  extern const Var kCVNe_oldpresel;
51 
52  /// 2018 nue PID
53  extern const Var kCVNSSe;
54 
55  /// \f$ \nu_\mu \f$ PID
56  extern const Var kCVNm;
57 
58  extern const Var kCVNm_looseptp;
59  extern const Var kCVNm_oldpresel;
60 
61  /// \f$ \nu_\tau \f$ PID
62  extern const Var kCVNt;
63 
64  /// \f$ \nu_nc \f$ PID
65  extern const Var kCVNnc;
66 
67  /// \f$ e- elastic scattering PID - I don't know what the e elastic number is for the final state labels.
68  // Leaving this commented out for now...
69  // const Var kCVNeel([](const caf::SRProxy* sr){ return sr->sel.cvn.output[???]; });
70  /// \f$ cosmic PID - use this for the final state era of >= prod4 files.
71  extern const Var kCVNcos_looseptp;
72  extern const Var kCVNcos_oldpresel;
73 
74  /// The result of CosVeto
75  extern const Var kCosVeto;
76 
77  /// Summed calorimetric energy of all hits in slice, uncorrected
78  /** As of revision 9885 (2014-06-29), the CalE scale correction is applied in
79  CAFMaker, not CAFAna. For cafs produced with tags after June 29, 2014,
80  use this variable instead. */
81  extern const Var kCaloE;
82 
83  extern const Var kMeanTime;
84 
85  /// Number of SlcME's assoc with slice
86  extern const Var kNMichels;
87 
88  extern const Var kNHit;
89 
90  extern const Var kLongestProng;
91 
92  /// \f$ \nu_\mu \f$ PID
93  extern const Var kRemID;
94 
95  //Numu energy estimator for all CC events
96  const Var kCCE = kNumuE2020;
100 
101  /// Energy estimator for non quasielastic CC events
102  extern const Var kNonQEE;
103 
104  /// Energy estimator for quasielastic CC events
105  extern const Var kQEE;
106 
107  /// True neutrino energy
108  extern const NuTruthVar kTrueE_NT;
109  extern const Var kTrueE;
110 
111  /// Neutrino interaction mode
112  extern const Var kMode;
113 
114  ///True neutrino ancestor (off-target) pT
115  extern const Var kTruetpT;
116 
117  ///True neutrino ancestor (off-target) pz
118  extern const Var kTruetpz;
119 
120  //True parton Z - energy of most energetic hadron divided by the energy of the hadronic system.
121  extern const Var kPartonZ;
122 
124  {
125  public:
127  double operator() (const caf::SRProxy* sr) const;
128  protected:
129  void InitializeMinervaND() const;
130  mutable TH1D* fRatiosm[4] = {0};
131  };
132 
134  {
135  public:
137  double operator() (const caf::SRProxy* sr) const;
138  protected:
139  void InitializeMippNA49NOvAND() const;
140  mutable TH1D* fRatiosn[4] = {0};
141  };
143  {
144  public:
146  double operator() (const caf::SRProxy* sr) const;
147  protected:
148  void InitializeMippNA49NOvAFD() const;
149  mutable TH1D* fRatiosf[4] = {0};
150  };
151 
152  const Var kNDMinervaRwtVar = Var(GetWtMinervaND());//Minerva wt only for ND
153 
154  const Var kNDMippNA49NOvARwtVar = Var(GetWtMippNA49NOvAND());//MiPP+NA49 FROM NOVA wts only for ND
155  const Var kFDMippNA49NOvARwtVar = Var(GetWtMippNA49NOvAFD());//Mipp+Na49 From NOvA wts only for FD
156  const Var kMippNA49NOvARwtVar = kNDMippNA49NOvARwtVar * kFDMippNA49NOvARwtVar;
157 
158 } // namespace
const Var kHadE
Definition: Vars.h:98
void InitializeMinervaND() const
Definition: Vars.cxx:190
const Var kMode([](const caf::SRProxy *sr){return(sr->mc.nnu==0)?-1:int(sr->mc.nu[0].mode);})
Neutrino interaction mode.
Definition: Vars.h:112
const Var kNonQEE
Energy estimator for non quasielastic CC events.
Definition: Vars.cxx:83
const Var kLEM
PID
Definition: Vars.cxx:26
Cuts and Vars for the 2020 FD DiF Study.
Definition: CutFlow_header.h:5
const NuTruthVar kTrueE_NT([](const caf::SRNeutrinoProxy *sr){return float(sr->E);})
True neutrino energy.
Definition: Vars.h:108
double operator()(const caf::SRProxy *sr) const
Definition: Vars.cxx:162
const Var kSlc
Definition: Vars.cxx:24
const Var kCVNnc
PID
Definition: Vars.cxx:44
const Var kCVNe
PID
Definition: Vars.cxx:35
GenericVar< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:76
double CalibrationBugCorrectionFactor(const caf::SRHeaderProxy &hdr)
See docdb 23597.
Definition: Vars.cxx:145
Proxy for caf::StandardRecord.
Definition: SRProxy.h:1969
const Var kSubrun
Definition: Vars.cxx:21
const Var kPartonZ([](const caf::SRProxy *sr){double hadEvis=0.;double energy=-5.;if(sr->mc.nu[0].prim.size() > 0){hadEvis=sr->energy.numu.hadcalE;for(unsigned int part=0;part< sr->mc.nu[0].prim.size();part++){if(sr->mc.nu[0].prim[part].pdg==2212){double KE=sr->mc.nu[0].prim[part].p.E-938;if(energy< KE) energy=KE;}else if(sr->mc.nu[0].prim[part].pdg==2112){double KE=sr->mc.nu[0].prim[part].p.E-939.5;if(energy< KE) energy=KE;}else{if(energy< sr->mc.nu[0].prim[part].p.E) energy=sr->mc.nu[0].prim[part].p.E;}}}if(hadEvis==0) return-5.;return energy/hadEvis;})
Definition: Vars.h:121
const Var kTruetpT([](const caf::SRProxy *sr){return(sr->mc.nnu==0)?0.:util::pythag(sr->mc.nu[0].beam.tp.X(), sr->mc.nu[0].beam.tp.Y());})
True neutrino ancestor (off-target) pT.
Definition: Vars.h:115
const Var kLID
PID
Definition: Vars.cxx:27
const Var kCVNt
PID
Definition: Vars.cxx:43
const Var kNumuE2020
Definition: NumuEFxs.h:217
const Var kFDMippNA49NOvARwtVar
Definition: Vars.h:155
const Var kMeanTime
Definition: Vars.cxx:54
const Var kCosVeto
The result of CosVeto.
Definition: Vars.cxx:50
const Var kTrueE([](const caf::SRProxy *sr){return(sr->mc.nnu==0)?0.:float(sr->mc.nu[0].E);})
Definition: Vars.cxx:89
const Var kLongestProng([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return 0.f;if(sr->vtx.elastic.fuzzyk.npng==0) return 0.f;auto idx=sr->vtx.elastic.fuzzyk.longestidx;return float(sr->vtx.elastic.fuzzyk.png[idx].len);})
Definition: Vars.h:90
const Var kEvt
Definition: Vars.cxx:23
const Var kRemID
PID
Definition: Vars.cxx:81
const Var kCaloE
Summed calorimetric energy of all hits in slice, uncorrected.
Definition: Vars.cxx:52
const Var kTruetpz([](const caf::SRProxy *sr){return(sr->mc.nnu==0)?0.:float(sr->mc.nu[0].beam.tp.z);})
True neutrino ancestor (off-target) pz.
Definition: Vars.h:118
const Var kHadEFrac
Definition: Vars.h:99
const Var kNHit
Definition: Vars.cxx:71
const Var kCCE
Definition: Vars.h:96
const Var kNDMippNA49NOvARwtVar
Definition: Vars.h:154
const Var kNDMinervaRwtVar
Definition: Vars.h:152
const Var kCycle
Definition: Vars.cxx:22
const Var kCVNSSe([](const caf::SRProxy *sr){throw std::runtime_error("kCVNSSe is no longer available. Fix your macro so you don't use it.");return-5.;})
2018 nue PID
Definition: Vars.h:53
const Var kNMichels([](const caf::SRProxy *sr){int n_me=0;for(int i=0;i< (int) sr->me.nslc;i++) if(sr->me.slc[i].mid > 1. &&sr->me.slc[i].deltat > 1200.) n_me++;for(int i=0;i< (int) sr->me.nkalman;i++) if(sr->me.trkkalman[i].mid > 0. &&sr->me.trkkalman[i].deltat > 800.) n_me++;if(n_me > 2) n_me=2;return n_me;})
Number of SlcME&#39;s assoc with slice.
Definition: Vars.h:86
const Var kCVNm_looseptp
Definition: Vars.cxx:40
const Var kCVNcos_looseptp
Definition: Vars.cxx:47
const Var kCVNm_oldpresel
Definition: Vars.cxx:41
const Cut kIsRHC([](const caf::SRProxy *sr){return sr->spill.isRHC;})
Definition: Vars.h:17
Template for Cut and SpillCut.
Definition: Cut.h:15
const Var kNumuHadEFrac2020
Definition: NumuEFxs.h:218
TH1D * fRatiosm[4]
Definition: Vars.h:130
const Var kRVP
PID
Definition: Vars.cxx:28
const Var kQEE
Energy estimator for quasielastic CC events.
Definition: Vars.cxx:85
const Var kCVNcos_oldpresel
Definition: Vars.cxx:48
const Var kMippNA49NOvARwtVar
Definition: Vars.h:156
const Var kRun
Definition: Vars.cxx:20
const Var kCVNe_oldpresel
Definition: Vars.cxx:37
const Var kMuE
Definition: Vars.h:97
const Var kCVNm
PID
Definition: Vars.cxx:39
const Var kCVNe_looseptp
Definition: Vars.cxx:36
const Var kNumuMuE2020
Definition: NumuEFxs.h:198
static constexpr Double_t sr
Definition: Munits.h:164
const Var kNumuHadE2020
Definition: NumuEFxs.h:199
Template for Var and SpillVar.
Definition: Var.h:16