All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CAFAna/Cuts/TruthCuts.h
Go to the documentation of this file.
1 #pragma once
2 
4 
5 #include "sbnanaobj/StandardRecord/Proxy/FwdDeclare.h"
6 
7 namespace ana
8 {
9  extern const Cut kHasMatchedNu;
10 
11  /// \brief Is this a Neutral %Current event?
12  ///
13  /// In this case the selection function is simple enough that we can include
14  /// it inline as a lambda function.
15  extern const Cut kIsNC;
16 
17  extern const Cut kIsCC;
18 
19  //----------------------------------------------------------------------
20  /// Helper for defining true CC event cuts
21  class CCFlavSel
22  {
23  public:
24  CCFlavSel(int pdg, int pdgorig) : fPdg(pdg), fPdgOrig(pdgorig)
25  {
26  }
27 
28  bool operator()(const caf::SRSliceProxy* slc) const;
29  protected:
30  int fPdg, fPdgOrig;
31  };
32 
33  /// Helper for defining true CC event cuts
34  class NCFlavOrig
35  {
36  public:
37  NCFlavOrig(int pdgorig) : fPdgOrig(pdgorig)
38  {
39  }
40 
41  bool operator()(const caf::SRSliceProxy* slc) const;
42  protected:
43  int fPdgOrig;
44  };
45 
46  // Finally, the function argument to the Cut constructor can be a "functor"
47  // object (one with operator()). This allows similar logic but with different
48  // constants to be easily duplicated.
49 
50  /// Select CC \f$ \nu_\mu\to\nu_e \f$
51  const Cut kIsNueApp (CCFlavSel(12, 14));
52  /// Select CC \f$ \nu_\mu\to\nu_\mu \f$
53  const Cut kIsNumuCC (CCFlavSel(14, 14));
54  /// Select CC \f$ \nu_e\to\nu_e \f$
55  const Cut kIsBeamNue(CCFlavSel(12, 12));
56  /// Select CC \f$ \nu_e\to\nu_\mu \f$
57  const Cut kIsNumuApp(CCFlavSel(14, 12));
58  /// Select CC \f$ \nu_\mu\to\nu_\tau \f$
59  const Cut kIsTauFromMu(CCFlavSel(16, 14));
60  /// Select CC \f$ \nu_e\to\nu_\tau \f$
61  const Cut kIsTauFromE(CCFlavSel(16, 12));
62 
63 
64  // NC from Numu
65  const Cut kIsNCFromNumu(NCFlavOrig(14));
66  // NC from Nue
67  const Cut kIsNCFromNue(NCFlavOrig(12));
68 
69  /// Is this truly an antineutrino?
70  extern const Cut kIsAntiNu;
71 }
const Cut kIsNumuCC(CCFlavSel(14, 14))
Select CC .
const Cut kIsNC([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.isnc;})
Is this a Neutral Current event?
var pdg
Definition: selectors.fcl:14
const Cut kIsBeamNue(CCFlavSel(12, 12))
Select CC .
const Cut kIsNumuApp(CCFlavSel(14, 12))
Select CC .
const Cut kIsCC([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.iscc;})
process_name opflashCryoW ana
bool operator()(const caf::SRSliceProxy *slc) const
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
const Cut kIsTauFromE(CCFlavSel(16, 12))
Select CC .
const Cut kIsNCFromNue(NCFlavOrig(12))
const Cut kIsTauFromMu(CCFlavSel(16, 14))
Select CC .
const Cut kIsNCFromNumu(NCFlavOrig(14))
const Cut kHasMatchedNu([](const caf::SRSliceProxy *slc){return slc->truth.index >=0;})
Helper for defining true CC event cuts.
CCFlavSel(int pdg, int pdgorig)
bool operator()(const caf::SRSliceProxy *slc) const
Helper for defining true CC event cuts.
Template for Cut and SpillCut.
Definition: Cut.h:16
const Cut kIsAntiNu([](const caf::SRSliceProxy *slc){return kHasMatchedNu(slc)&&slc->truth.pdg< 0;})
Is this truly an antineutrino?
const Cut kIsNueApp(CCFlavSel(12, 14))
Select CC .