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 
11 
12 class TH1D;
13 
14 namespace ana
15 {
16  extern const Cut kIsRHC;
17 
18  // Return the run number
19  extern const Var kRun;
20 
21  // Return the subrun number
22  extern const Var kSubrun;
23 
24  // Return the cycle number (MC only)
25  extern const Var kCycle;
26 
27  // Return the event number
28  extern const Var kEvt;
29 
30  // Return the slice number
31  extern const Var kSlc;
32 
33  /// See docdb 23597
35 
36  /// \f$ \nu_e \f$ PID
37  extern const Var kLEM;
38 
39  /// \f$ \nu_e \f$ PID
40  extern const Var kLID;
41 
42  /// \f$ \nu_e \f$ PID
43  extern const Var kRVP;
44 
45  /// \f$ \nu_e \f$ PID
46  extern const Var kCVNe;
47 
48  extern const Var kCVNe_looseptp;
49  extern const Var kCVNe_oldpresel;
50 
51  /// 2018 nue PID
52  extern const Var kCVNSSe;
53 
54  /// \f$ \nu_\mu \f$ PID
55  extern const Var kCVNm;
56 
57  extern const Var kCVNm_looseptp;
58  extern const Var kCVNm_oldpresel;
59 
60  /// \f$ \nu_\tau \f$ PID
61  extern const Var kCVNt;
62 
63  /// \f$ \nu_nc \f$ PID
64  extern const Var kCVNnc;
65 
66  /// \f$ e- elastic scattering PID - I don't know what the e elastic number is for the final state labels.
67  // Leaving this commented out for now...
68  // const Var kCVNeel([](const caf::SRProxy* sr){ return sr->sel.cvn.output[???]; });
69  /// \f$ cosmic PID - use this for the final state era of >= prod4 files.
70  extern const Var kCVNcos_looseptp;
71  extern const Var kCVNcos_oldpresel;
72 
73  /// The result of CosVeto
74  extern const Var kCosVeto;
75 
76  /// Summed calorimetric energy of all hits in slice, uncorrected
77  /** As of revision 9885 (2014-06-29), the CalE scale correction is applied in
78  CAFMaker, not CAFAna. For cafs produced with tags after June 29, 2014,
79  use this variable instead. */
80  extern const Var kCaloE;
81 
82  extern const Var kMeanTime;
83 
84  /// Number of SlcME's assoc with slice
85  extern const Var kNMichels;
86 
87  extern const Var kNHit;
88 
89  extern const Var kLongestProng;
90 
91  /// \f$ \nu_\mu \f$ PID
92  extern const Var kRemID;
93 
94  /// True neutrino energy
95  extern const NuTruthVar kTrueE_NT;
96  extern const Var kTrueE;
97 
98  /// Neutrino interaction mode
99  extern const Var kMode;
100 
101  ///True neutrino ancestor (off-target) pT
102  extern const Var kTruetpT;
103 
104  ///True neutrino ancestor (off-target) pz
105  extern const Var kTruetpz;
106 
107  //True parton Z - energy of most energetic hadron divided by the energy of the hadronic system.
108  extern const Var kPartonZ;
109 
111  {
112  public:
114  double operator() (const caf::SRProxy* sr) const;
115  protected:
116  void InitializeMinervaND() const;
117  mutable TH1D* fRatiosm[4] = {0};
118  };
119 
121  {
122  public:
124  double operator() (const caf::SRProxy* sr) const;
125  protected:
126  void InitializeMippNA49NOvAND() const;
127  mutable TH1D* fRatiosn[4] = {0};
128  };
130  {
131  public:
133  double operator() (const caf::SRProxy* sr) const;
134  protected:
135  void InitializeMippNA49NOvAFD() const;
136  mutable TH1D* fRatiosf[4] = {0};
137  };
138 
139  const Var kNDMinervaRwtVar = Var(GetWtMinervaND());//Minerva wt only for ND
140 
141  const Var kNDMippNA49NOvARwtVar = Var(GetWtMippNA49NOvAND());//MiPP+NA49 FROM NOVA wts only for ND
142  const Var kFDMippNA49NOvARwtVar = Var(GetWtMippNA49NOvAFD());//Mipp+Na49 From NOvA wts only for FD
143  const Var kMippNA49NOvARwtVar = kNDMippNA49NOvARwtVar * kFDMippNA49NOvARwtVar;
144 
145 } // namespace
void InitializeMinervaND() const
Definition: Vars.cxx:186
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:99
const Var kLEM
PID
Definition: Vars.cxx:26
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const NuTruthVar kTrueE_NT([](const caf::SRNeutrinoProxy *sr){return float(sr->E);})
True neutrino energy.
Definition: Vars.h:95
double operator()(const caf::SRProxy *sr) const
Definition: Vars.cxx:158
const Var kSlc
Definition: Vars.cxx:24
const Var kCVNnc
PID
Definition: Vars.cxx:44
const Var kCVNe
PID
Definition: Vars.cxx:35
double CalibrationBugCorrectionFactor(const caf::SRHeaderProxy &hdr)
See docdb 23597.
Definition: Vars.cxx:141
Proxy for caf::StandardRecord.
Definition: SRProxy.h:2108
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:108
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:102
const Var kLID
PID
Definition: Vars.cxx:27
const Var kCVNt
PID
Definition: Vars.cxx:43
_Var< caf::SRProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:74
const Var kFDMippNA49NOvARwtVar
Definition: Vars.h:142
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:85
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:89
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:105
const Var kNHit
Definition: Vars.cxx:71
const Var kNDMippNA49NOvARwtVar
Definition: Vars.h:141
caf::StandardRecord * sr
const Var kNDMinervaRwtVar
Definition: Vars.h:139
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:52
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:85
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:16
TH1D * fRatiosm[4]
Definition: Vars.h:117
const Var kRVP
PID
Definition: Vars.cxx:28
const Var kCVNcos_oldpresel
Definition: Vars.cxx:48
const Var kMippNA49NOvARwtVar
Definition: Vars.h:143
const Var kRun
Definition: Vars.cxx:20
const Var kCVNe_oldpresel
Definition: Vars.cxx:37
const Var kCVNm
PID
Definition: Vars.cxx:39
const Var kCVNe_looseptp
Definition: Vars.cxx:36