TruthVars.h
Go to the documentation of this file.
1 #pragma once
2 
3 // miscellaneous truth vars that are not analysis-specific
4 
5 #include "CAFAna/Core/Var.h"
6 
7 namespace ana
8 {
9  // dumb oscillation
10  extern const Var kWOscDumb;
11  extern const NuTruthVar kWOscDumb_NT;
12 
13  /// weight all 'MEC' events to 0. leave everything else alone.
15  const Var kDytmanMEC_Disable = VarFromNuTruthVar(kDytmanMEC_DisableST, 1);
16 
17  /// identity of struck nucleon, or in case of MEC, NN pair
18  extern const NuTruthVar kHitNuc_NT;
19  const Var kHitNuc = VarFromNuTruthVar(kHitNuc_NT, 0);
20 
21  extern const NuTruthVar kTrueW_NT;
22  const Var kTrueW = VarFromNuTruthVar(kTrueW_NT);
23 
24  //---------------------------------------------------------------------------------
25  /// True square of four-momentum transfer
26  extern const NuTruthVar kTrueQ2_NT;
27  const Var kTrueQ2 = VarFromNuTruthVar(kTrueQ2_NT, -5);
28 
29  //---------------------------------------------------------------------------------
30  /// True energy transfer (q0 = 0th component of four-momentum transfer)
31  extern const NuTruthVar kTrueQ0_NT;
32  const Var kTrueQ0 = VarFromNuTruthVar(kTrueQ0_NT, -5);
33 
34 
35  //---------------------------------------------------------------------------------
36  /// True magnitude of three-momentum transfer
37  extern const NuTruthVar kTrueQ3_NT;
38  const Var kTrueQ3 = VarFromNuTruthVar(kTrueQ3_NT, -5);
39 
40  //---------------------------------------------------------------------------------
41  /// MINERvA "true Eavail" (used in 2p2h xsec)
42  extern const NuTruthVar kTrueEavail_NT;
43  const Var kTrueEavail = VarFromNuTruthVar(kTrueEavail_NT, -5);
44 
45  //---------------------------------------------------------------------------------
46  /// True PDG code
47  extern const NuTruthVar kTruePDG_NT;
48  const Var kTruePDG = VarFromNuTruthVar(kTruePDG_NT, -5);
49 
50  //---------------------------------------------------------------------------------
51  /// True "parton shower z" (leading hadron energy / total hadron energy)
53  const Var kTruePartonZ = VarFromNuTruthVar(kTruePartonZ_NT, -1);
54 
55 
56 }
const Var kTruePDG
Definition: TruthVars.h:48
Cuts and Vars for the 2020 FD DiF Study.
Definition: vars.h:6
const NuTruthVar kHitNuc_NT([](const caf::SRNeutrinoProxy *sr){return int(sr->hitnuc);})
identity of struck nucleon, or in case of MEC, NN pair
Definition: TruthVars.h:18
const Var kTrueEavail
Definition: TruthVars.h:43
const NuTruthVar kTrueQ0_NT([](const caf::SRNeutrinoProxy *nu){return nu->y *nu->E;})
True energy transfer (q0 = 0th component of four-momentum transfer)
Definition: TruthVars.h:31
const NuTruthVar kTruePartonZ_NT([](const caf::SRNeutrinoProxy *nu){double totalE=0;double leadingHadE=0;for(const auto &part:nu->prim){if(abs(part.pdg)< 100||abs(part.pdg) > 1000000) continue;auto hadE=(part.pdg==2212||part.pdg==2112)?((part.p.Gamma()-1)*part.p.E):static_cast< float >(part.p.E);if(hadE > leadingHadE) leadingHadE=hadE;totalE+=hadE;}if(totalE<=0) return-1.;return leadingHadE/totalE;})
True PDG code.
Definition: TruthVars.h:52
const NuTruthVar kTrueQ3_NT([](const caf::SRNeutrinoProxy *nu){return sqrt(nu->q2+util::sqr(kTrueQ0_NT(nu)));})
True magnitude of three-momentum transfer.
Definition: TruthVars.h:37
const Var kTrueQ0
Definition: TruthVars.h:32
const NuTruthVar kTruePDG_NT([](const caf::SRNeutrinoProxy *nu){return nu->pdg;})
True PDG code.
Definition: TruthVars.h:47
const Var kTrueQ2
Definition: TruthVars.h:27
const Var kHitNuc
Definition: TruthVars.h:19
const NuTruthVar kTrueW_NT([](const caf::SRNeutrinoProxy *nu){if(std::isnan(1.*nu->W2)) return-5.f;return float(sqrt(nu->W2));})
Definition: TruthVars.h:21
const Var kTrueQ3
Definition: TruthVars.h:38
const NuTruthVar kWOscDumb_NT([](const caf::SRNeutrinoProxy *nu){return nu->woscdumb;})
Definition: TruthVars.h:11
const Var kWOscDumb([](const caf::SRProxy *sr){if(sr->mc.nnu==0) return 0.f;return float(sr->mc.nu[0].woscdumb);})
Definition: TruthVars.h:10
Var VarFromNuTruthVar(const NuTruthVar &stv, double _default)
Definition: Var.cxx:7
const Var kTruePartonZ
Definition: TruthVars.h:53
const Var kDytmanMEC_Disable
Definition: TruthVars.h:15
const NuTruthVar kTrueEavail_NT([](const caf::SRNeutrinoProxy *nu){double eAvail=0;for(const auto &particle:nu->prim){double particle_Eavail=0;if(particle.pdg==2212||abs(particle.pdg)==211){double gamma=particle.p.Gamma();particle_Eavail=(gamma-1)/gamma *particle.p.E;}else if(particle.pdg==111 or abs(particle.pdg)==11 or particle.pdg==22) particle_Eavail=particle.p.E;else if(particle.pdg >=2000000000){}else if(particle.pdg >=1000000000){}else if(particle.pdg >=2000 &&particle.pdg!=2212 &&particle.pdg!=2112){particle_Eavail=particle.p.E-0.9382;}else if(particle.pdg<=-2000){particle_Eavail=particle.p.E+0.9382;}else if(particle.pdg!=2112 &&(abs(particle.pdg)< 11||abs(particle.pdg) > 16)){particle_Eavail=particle.p.E;}eAvail+=particle_Eavail;}return eAvail;})
MINERvA "true Eavail" (used in 2p2h xsec)
Definition: TruthVars.h:42
const Var kTrueW
Definition: TruthVars.h:22
const NuTruthVar kTrueQ2_NT([](const caf::SRNeutrinoProxy *nu){return nu->q2;})
True square of four-momentum transfer.
Definition: TruthVars.h:26
const NuTruthVar kDytmanMEC_DisableST([](const caf::SRNeutrinoProxy *nu){if(nu->mode!=caf::kMEC) return 1.;return 0.;})
weight all &#39;MEC&#39; events to 0. leave everything else alone.
Definition: TruthVars.h:14