All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CRUMBS_helper.h
Go to the documentation of this file.
1 const Cut kNonUnambiguousSlice([](const caf::SRSliceProxy *slc)
2  {
3  return !slc->is_clear_cosmic;
4  });
5 
7  {
8  for(auto const &slc : sr->slc)
9  {
10  if(!slc.is_clear_cosmic) return true;
11  }
12 
13  return false;
14  });
15 
16 const Var kCRUMBSScore = SIMPLEVAR(crumbs_result.score);
17 
18 const SpillVar kBestCRUMBSScore([](const caf::SRSpillProxy *sr) -> double
19  {
20  double bestValue = -std::numeric_limits<double>::max();
21 
22  for(auto const &slc : sr->slc)
23  {
24  if(!slc.is_clear_cosmic)
25  {
26  if(slc.crumbs_result.score > bestValue)
27  bestValue = slc.crumbs_result.score;
28  }
29  }
30 
31  return bestValue;
32  });
33 
34 const SpillVar kBestCRUMBSSliceID([](const caf::SRSpillProxy *sr) -> double
35  {
36  unsigned id = 0;
37  unsigned bestId = std::numeric_limits<unsigned>::max();
38  double bestValue = -std::numeric_limits<double>::max();
39 
40  for(auto const &slc : sr->slc)
41  {
42  if(!slc.is_clear_cosmic)
43  {
44  if(slc.crumbs_result.score > bestValue)
45  {
46  bestValue = slc.crumbs_result.score;
47  bestId = id;
48  }
49  }
50  ++id;
51  }
52 
53  return bestId;
54  });
55 
56 const SpillVar kBestCRUMBSSliceNTracks([](const caf::SRSpillProxy *sr) -> float
57  {
58  return sr->slc[kBestCRUMBSSliceID(sr)].reco.ntrk;
59  });
60 
61 const Cut kCRUMBSCut([](const caf::SRSliceProxy *slc)
62  {
63  return slc->crumbs_result.score > -0.05;
64  });
65 
67  {
68  return sr->slc[kBestCRUMBSSliceID(sr)].crumbs_result.score > -0.05;
69  });
const SpillVar kBestCRUMBSScore([](const caf::SRSpillProxy *sr) -> double{double bestValue=-std::numeric_limits< double >::max();for(auto const &slc:sr->slc){if(!slc.is_clear_cosmic){bestValue=slc.crumbs_result.score;}}return bestValue;})
const Cut kCRUMBSCut([](const caf::SRSliceProxy *slc){return slc->crumbs_result.score >-0.05;})
const SpillVar kBestCRUMBSSliceID([](const caf::SRSpillProxy *sr) -> double{unsigned id=0;unsigned bestId=std::numeric_limits< unsigned >::max();double bestValue=-std::numeric_limits< double >::max();for(auto const &slc:sr->slc){if(!slc.is_clear_cosmic){if(slc.crumbs_result.score > bestValue){bestValue=slc.crumbs_result.score;bestId=id;}}++id;}return bestId;})
const SpillCut kBestCRUMBSSliceCut([](const caf::SRSpillProxy *sr){return sr->slc[kBestCRUMBSSliceID(sr)].crumbs_result.score >-0.05;})
const SpillCut kHasNonUnambiguousSlice([](const caf::SRSpillProxy *sr){for(auto const &slc:sr->slc){if(!slc.is_clear_cosmic) return true;}return false;})
caf::Proxy< caf::SRSlice > SRSliceProxy
Definition: EpilogFwd.h:2
_Var< caf::SRSliceProxy > Var
Representation of a variable to be retrieved from a caf::StandardRecord object.
Definition: Var.h:73
_Var< caf::SRSpillProxy > SpillVar
Equivalent of Var acting on caf::SRSpill.
Definition: Var.h:76
_Cut< caf::SRSliceProxy > Cut
Definition: Cut.h:95
caf::Proxy< caf::StandardRecord > SRSpillProxy
Definition: EpilogFwd.h:3
_Cut< caf::SRSpillProxy > SpillCut
Equivalent of Cut acting on caf::SRSpill. For use in spill-by-spill data quality cuts.
Definition: Cut.h:99
const SpillVar kBestCRUMBSSliceNTracks([](const caf::SRSpillProxy *sr) -> float{return sr->slc[kBestCRUMBSSliceID(sr)].reco.ntrk;})
#define SIMPLEVAR(CAFNAME)
For Vars where literally all you need is a single CAF variable.
Definition: Var.h:82
const Cut kNonUnambiguousSlice([](const caf::SRSliceProxy *slc){return!slc->is_clear_cosmic;})
const Var kCRUMBSScore
Definition: CRUMBS_helper.h:16