All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Public Attributes | List of all members
ana::SBNOsc::ROC Struct Reference

#include <ROC.h>

Classes

struct  NormalizedPrimitive
 
struct  Primitive
 

Public Member Functions

void Initialize ()
 
void Fill (const Cuts &cuts, const numu::RecoEvent &event, bool file_is_neutrino)
 
void Write () const
 
void BestCuts () const
 
void Normalize (float neutrino_scale, float cosmic_scale)
 

Public Attributes

NormalizedPrimitive crt_track_angle
 
NormalizedPrimitive crt_hit_distance
 
std::vector
< NormalizedPrimitive * > 
fAllPrimitives
 

Detailed Description

Class to handle making of ROC plots for cut values

Definition at line 18 of file ROC.h.

Member Function Documentation

void ana::SBNOsc::ROC::BestCuts ( ) const

Get the optimal cut values by S/sqrt(S+B)

Definition at line 24 of file ROC.cc.

24  {
25  for (const NormalizedPrimitive *prim: fAllPrimitives) {
26  std::cout << "Cut (" << prim->name << ") value: " << prim->BestCut() << std::endl;
27  }
28 }
std::vector< NormalizedPrimitive * > fAllPrimitives
Definition: ROC.h:79
BEGIN_PROLOG could also be cout
void ana::SBNOsc::ROC::Fill ( const Cuts cuts,
const numu::RecoEvent event,
bool  file_is_neutrino 
)

Fill the class with a reconstructed event

Parameters
eventThe RecoEvent information

Definition at line 30 of file ROC.cc.

30  {
31  for (unsigned i = 0; i < event.reco.size(); i++) {
32  const numu::RecoInteraction &reco = event.reco[i];
33  bool is_signal = reco.match.mode == numu::mCC;
34  bool is_bkg = reco.match.mode == numu::mCosmic || reco.match.mode == numu::mIntimeCosmic;
35  if (!is_signal && !is_bkg) continue; // ignore NC stuff for now
36 
37  const numu::RecoTrack &track = event.tracks.at(reco.slice.primary_track_index);
38 
39  std::array<bool, ana::SBNOsc::Cuts::nCuts> results = cuts.ProcessRecoCuts(event, i, true);
40 
41  // only apply to events that already pass flash matching
42  if (results[5] /* flashmatch */) {
43  // CRT stuff
44  if (track.crt_match.track.present) {
45  if (file_is_neutrino) crt_track_angle.FillNeutrino(is_signal, track.crt_match.track.angle);
46  else crt_track_angle.FillCosmic(is_signal, track.crt_match.track.angle);
47  }
48  else {
49  if (file_is_neutrino) crt_track_angle.FillNeverNeutrino(is_signal);
50  else crt_track_angle.FillNeverCosmic(is_signal);
51  }
52  if (track.crt_match.hit_match.present && !cuts.TimeInSpill(track.crt_match.hit_match.time)) {
53  if (file_is_neutrino) crt_hit_distance.FillNeutrino(is_signal, track.crt_match.hit_match.distance);
55  }
56  else {
57  if (file_is_neutrino) crt_hit_distance.FillNeverNeutrino(is_signal);
58  else crt_hit_distance.FillNeverCosmic(is_signal);
59  }
60  }
61  }
62 
63 }
InteractionMode mode
Mode of the interaction.
Track track
CRT Track match.
Definition: CRTMatch.h:30
NormalizedPrimitive crt_hit_distance
Definition: ROC.h:78
float distance
//!&lt; Distance from projected track to CRT Hit. Nonsense if present is false.
Definition: CRTMatch.h:26
CRTMatch crt_match
CRTMatch.
Definition: RecoTrack.h:59
bool present
Whether this CRTMatch has a matching track.
Definition: CRTMatch.h:16
TruthMatch match
Info for mathing to truth.
Definition: RecoEvent.h:42
int primary_track_index
Index of the primary track.
Definition: RecoEvent.h:27
void FillNeutrino(bool is_signal, float value)
Definition: ROC.h:56
process_name use argoneut_mc_hitfinder track
Definition: Mode.h:9
process_name standard_reco_uboone reco
void FillNeverCosmic(bool is_signal)
Definition: ROC.h:61
bool present
Whether this CRTMatch has a matching hit.
Definition: CRTMatch.h:25
void FillCosmic(bool is_signal, float value)
Definition: ROC.h:60
void FillNeverNeutrino(bool is_signal)
Definition: ROC.h:57
RecoSlice slice
Particle content of the interaction.
Definition: RecoEvent.h:39
float angle
Angle between TPC track and CRT track.
Definition: CRTMatch.h:18
NormalizedPrimitive crt_track_angle
Definition: ROC.h:77
HitMatch hit_match
CRT Hit match.
Definition: CRTMatch.h:31
void ana::SBNOsc::ROC::Initialize ( )

Initialize the class

Definition at line 5 of file ROC.cc.

5  {
6  crt_track_angle.Initialize("crt_track_angle", 0, 6, 60);
8  crt_hit_distance.Initialize("crt_hit_distance", 0, 100, 100);
10 }
NormalizedPrimitive crt_hit_distance
Definition: ROC.h:78
NormalizedPrimitive crt_track_angle
Definition: ROC.h:77
void Initialize(const std::string &name, float cut_low, float cut_high, unsigned n_bin)
Definition: ROC.cc:65
std::vector< NormalizedPrimitive * > fAllPrimitives
Definition: ROC.h:79
void ana::SBNOsc::ROC::Normalize ( float  neutrino_scale,
float  cosmic_scale 
)

Definition at line 18 of file ROC.cc.

18  {
19  for (NormalizedPrimitive *prim: fAllPrimitives) {
20  prim->Normalize(neutrino_scale, cosmic_scale);
21  }
22 }
std::vector< NormalizedPrimitive * > fAllPrimitives
Definition: ROC.h:79
void ana::SBNOsc::ROC::Write ( ) const

Write the ROC plots to disk

Definition at line 12 of file ROC.cc.

12  {
13  for (const NormalizedPrimitive *prim: fAllPrimitives) {
14  prim->Write();
15  }
16 }
std::vector< NormalizedPrimitive * > fAllPrimitives
Definition: ROC.h:79

Member Data Documentation

NormalizedPrimitive ana::SBNOsc::ROC::crt_hit_distance

Definition at line 78 of file ROC.h.

NormalizedPrimitive ana::SBNOsc::ROC::crt_track_angle

Definition at line 77 of file ROC.h.

std::vector<NormalizedPrimitive *> ana::SBNOsc::ROC::fAllPrimitives

Definition at line 79 of file ROC.h.


The documentation for this struct was generated from the following files: