Public Member Functions | Public Attributes | Private Member Functions | List of all members
Helper Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-10-20/3FlavorAna/Ana2020/SingleNuOverlay/Helper.h"

Public Member Functions

bool IsSpecial (TString const &s_Obj)
 
std::string Def (std::string const &s_Sample, std::string const &s_Condition)
 
std::string VarLabel (std::string s_DirName, bool isNice)
 
std::string CutLabel (std::string s_DirName)
 
std::string getNiceCutLabel (std::string const &s_Cut)
 
std::vector< std::string > CutFlow (std::string const &s_Selection, bool useAnaTrueECut, bool getDetailed)
 
std::vector< TLine * > PlotSpecial (TString const &s_Obj, std::string const &s_Selection, double const &yMin, double const &yMax, bool loosePresel)
 
void furtherBENBreakdown (std::map< std::string, const Cut > &map_Cuts, Cut kBaseCut)
 
const Cut Sig_Cut (std::string s_Selection)
 
const NuTruthCut Sig_NuCut (std::string s_Selection)
 
const Cut Quality_Cut (std::string s_Selection)
 
const Cut Containment_Cut (std::string s_Selection)
 
const Cut Presel_Cut (std::string s_Selection)
 
const Cut Selection_Cut (std::string s_Selection)
 
const Binning Bins (std::string s_Var)
 

Public Attributes

unsigned int fNbins
 

Private Member Functions

std::string getNiceLabel (std::string s_Var)
 
void specifyValid ()
 

Detailed Description

Definition at line 14 of file Helper.h.

Member Function Documentation

const Binning Helper::Bins ( std::string  s_Var)

Definition at line 418 of file Helper.h.

References ana::Binning::Simple().

Referenced by Analyse_OverlayStudies().

419 {
420  if((s_Var.find("kSpillCount")!=std::string::npos) || (s_Var.find("kSliceCount")!=std::string::npos)) return Binning::Simple(1, -0.5, 0.5);
421  if( s_Var.find("kPOTWeight")!=std::string::npos) return Binning::Simple(fNbins, 0., 2);
422  if((s_Var.find("kSpillPOT")!=std::string::npos) || (s_Var.find("kSpillPOT_Sp")!=std::string::npos))
423  {
424  return Binning::Simple(fNbins, 10.e12, 70.e12);
425  }
426  if( s_Var.find("kCCElong")!=std::string::npos) return Binning::Simple(fNbins, 0, 25.);
427  if( s_Var.find("kCCE")!=std::string::npos) return Binning::Simple(fNbins, 0, 5. );
428  if( s_Var.find("kMuE")!=std::string::npos) return Binning::Simple(fNbins, 0, 4.5);
429  if( s_Var.find("kHadEFrac")!=std::string::npos) return Binning::Simple(fNbins, 0, 1. );
430  if( s_Var.find("kHadE")!=std::string::npos) return Binning::Simple(fNbins, 0, 3. );
431  if( s_Var.find("kCaloE")!=std::string::npos) return Binning::Simple(fNbins, 0, 5. );
432  if( s_Var.find("kNHit")!=std::string::npos) return Binning::Simple(fNbins, 0, 300.);
433 
434  if( s_Var.find("kNueEnergy2020") !=std::string::npos) return Binning::Simple(fNbins, 0, 4.5);
435  if( s_Var.find("kNueElectronE2020") !=std::string::npos) return Binning::Simple(fNbins, 0, 4.5);
436  if( s_Var.find("kHADE2020") !=std::string::npos) return Binning::Simple(fNbins, 0, 4.5);
437  if( s_Var.find("kLongestProng") !=std::string::npos) return Binning::Simple(fNbins, 0, 800.);
438 
439  if( s_Var.find("kSlcMeanTime") !=std::string::npos ||
440  s_Var.find("kSlcStartTime") !=std::string::npos ||
441  s_Var.find("kSlcEndTime" ) !=std::string::npos) return Binning::Simple(fNbins, 216, 231);
442  if( s_Var.find("kSliceDuration")!=std::string::npos) return Binning::Simple(fNbins, 0, 250);
443  if( s_Var.find("kSlcNoiseFrac") !=std::string::npos) return Binning::Simple(fNbins, 0, 1 );
444  if( s_Var.find("kSlcEff") !=std::string::npos) return Binning::Simple(fNbins, 0, 1 );
445 
446  if( s_Var.find("kRun") !=std::string::npos) return Binning::Simple(fNbins, 10377, 13509);
447  if( s_Var.find("kSubRun")!=std::string::npos) return Binning::Simple(25, -0.5, 24.5 );
448  if( s_Var.find("kEvt") !=std::string::npos) return Binning::Simple(2601, -0.5, 2600.5);
449  if( s_Var.find("kSlc") !=std::string::npos) return Binning::Simple(fNbins, 0, 20);
450 
451  if(s_Var.find("kTrueLepE") !=std::string::npos) return Binning::Simple(fNbins, 0, 4.5);
452  if(s_Var.find("kTrueQ2") !=std::string::npos) return Binning::Simple(fNbins, 0, 4.5);
453  if(s_Var.find("kTrueW2") !=std::string::npos) return Binning::Simple(fNbins, 0, 4.5);
454  if(s_Var.find("kTrueXbj") !=std::string::npos) return Binning::Simple(fNbins, 0, 1);
455  if(s_Var.find("kTrueYbj") !=std::string::npos) return Binning::Simple(fNbins, 0, 1);
456  if(s_Var.find("kOTrueVtxX")!=std::string::npos) return Binning::Simple(fNbins, -220, 220);
457  if(s_Var.find("kOTrueVtxY")!=std::string::npos) return Binning::Simple(fNbins, -220, 220);
458  if(s_Var.find("kOTrueVtxZ")!=std::string::npos) return Binning::Simple(fNbins, -50, 1500);
459  if(s_Var.find("kMode") !=std::string::npos) return Binning::Simple(11, -0.5, 10.5);
460  if(s_Var.find("kIsCC") !=std::string::npos) return Binning::Simple(2, -0.5, 1.5);
461  if(s_Var.find("kTrueElong")!=std::string::npos) return Binning::Simple(fNbins, 0, 25.);
462  //if(s_Var.find("kTrueEben") !=std::string::npos) return Binning::Simple(fNbins, 0, 4.5);
463  if(s_Var.find("kTrueEben") !=std::string::npos) return Binning::Simple(fNbins, 0, 6.0);
464  //if(s_Var.find("kTrueE") !=std::string::npos) return Binning::Simple(fNbins, 0, 5.);
465  if(s_Var.find("kTrueE") !=std::string::npos) return Binning::Simple(fNbins, 0, 7.);
466  if(s_Var.find("kPDG") !=std::string::npos) return Binning::Simple(41, -20.5, 20.5);
467 
468  return Binning::Simple(fNbins, -100, 100);
469 }
unsigned int fNbins
Definition: Helper.h:37
const Cut Helper::Containment_Cut ( std::string  s_Selection)

Definition at line 367 of file Helper.h.

References ana::kNoCut, and ana::kNumuContainND2020.

Referenced by scheduleCuts().

368 {
369  Cut cut_Temp = kNoCut;
370 
371  if(s_Selection=="numu2020"){
372  cut_Temp = kNumuContainND2020;
373  }
374  else{
375  specifyValid();
376  }
377 
378  const Cut Containment_Cut = cut_Temp;
379  return Containment_Cut;
380 }
const Cut Containment_Cut(std::string s_Selection)
Definition: Helper.h:367
void specifyValid()
Definition: Helper.h:623
const Cut kNumuContainND2020([](const caf::SRProxy *sr){if(!sr->vtx.elastic.IsValid) return false;for(unsigned int i=0;i< sr->vtx.elastic.fuzzyk.nshwlid;++i){const caf::SRVector3DProxy &start=sr->vtx.elastic.fuzzyk.png[i].shwlid.start;const caf::SRVector3DProxy &stop=sr->vtx.elastic.fuzzyk.png[i].shwlid.stop;if(std::min(start.X(), stop.X())< -180.0) return false;if(std::max(start.X(), stop.X()) > 180.0) return false;if(std::min(start.Y(), stop.Y())< -180.0) return false;if(std::max(start.Y(), stop.Y()) > 180.0) return false;if(std::min(start.Z(), stop.Z())< 40.0) return false;if(std::max(start.Z(), stop.Z()) > 1525.0) return false;}if(sr->trk.kalman.ntracks< 1) return false;for(unsigned int i=0;i< sr->trk.kalman.ntracks;++i){if(i==sr->trk.kalman.idxremid) continue;else if(sr->trk.kalman.tracks[i].start.Z() > 1275||sr->trk.kalman.tracks[i].stop.Z() > 1275) return false;}return(sr->trk.kalman.ntracks > sr->trk.kalman.idxremid &&sr->slc.firstplane > 1 &&sr->slc.lastplane< 212 &&sr->trk.kalman.tracks[0].start.Z()< 1100 &&(sr->trk.kalman.tracks[0].stop.Z()< 1275 ||sr->sel.contain.kalyposattrans< 55) &&sr->sel.contain.kalfwdcellnd > 5 &&sr->sel.contain.kalbakcellnd > 10);})
Definition: NumuCuts2020.h:31
std::vector< std::string > Helper::CutFlow ( std::string const &  s_Selection,
bool  useAnaTrueECut,
bool  getDetailed 
)

Definition at line 284 of file Helper.h.

References om::cout, and allTimeWatchdog::endl.

Referenced by Analyse_GetEfficiency(), and Analyse_GetEfficiency_UseNEntries().

285 {
286  std::vector<std::string> vec_CutFlow;
287 
288  if(useAnaTrueECut){
289  if(s_Selection.find("numu2020")!=std::string::npos){
290  vec_CutFlow = {"over_fid_sig_ATE", "over_fid_sig_ATE_rec", "over_fid_sig_ATE_rec_qual", "over_fid_sig_ATE_rec_cont_qual", "over_fid_sig_ATE_rec_sel"};
291  }
292  else if(s_Selection.find("nue2020")!=std::string::npos){
293  vec_CutFlow = {"over_fid_sig_ATE", "over_fid_sig_ATE_rec", "over_fid_sig_ATE_rec_presel", "over_fid_sig_ATE_rec_sel"};
294  }
295  else{
296  specifyValid();
297  }
298  }
299  else{
300  if(s_Selection.find("numu2020")!=std::string::npos){
301  vec_CutFlow = {"over_fid_sig", "over_fid_sig_rec", "over_fid_sig_rec_qual", "over_fid_sig_rec_cont_qual", "over_fid_sig_rec_sel"};
302  }
303  else if(s_Selection.find("nue2020")!=std::string::npos){
304  vec_CutFlow = {"over_fid_sig", "over_fid_sig_rec", "over_fid_sig_rec_presel", "over_fid_sig_rec_sel"};
305  }
306  else{
307  specifyValid();
308  }
309  }
310 
311  if(getDetailed){
312  if(s_Selection.find("numu2020")!=std::string::npos){
313  std::cout << "THERE IS NO DETAILED NUMU BREAKDOWN" << std::endl;
314  }
315  else if(s_Selection.find("nue2020")!=std::string::npos){
316  if(!useAnaTrueECut) std::cout << "\n\nWARNING!!! DETAILED NUE BREAKDOWN ALWAYS IMPOSES THE TRUE E CUT.\n\n" << std::endl;
317 
318  std::vector<std::string> vec_AdditionalDetail = {"over_fid_sig_ATE_rec_presel_minus_fidana", "over_fid_sig_ATE_rec_presel_minus_cont", "over_fid_sig_ATE_rec_presel_minus_nhit", "over_fid_sig_ATE_rec_presel_minus_energy", "over_fid_sig_ATE_rec_presel_minus_prongl"};
319  for(auto addcut : vec_AdditionalDetail){
320  vec_CutFlow.insert(vec_CutFlow.end()-2, addcut);
321  }
322  }
323  else{
324  specifyValid();
325  }
326  }
327 
328  return vec_CutFlow;
329 }
OStream cout
Definition: OStream.cxx:6
void specifyValid()
Definition: Helper.h:623
std::string Helper::CutLabel ( std::string  s_DirName)

Definition at line 246 of file Helper.h.

Referenced by makeCanvas(), and Plotting_OverlayStudies().

247 {
248  std::string s_Cut = "";
249  if(s_DirName.find("_Sp")!=std::string::npos){
250  if(s_DirName.find("NSC")!=std::string::npos){
251  return "NSC";
252  }
253  else{
254  return "SSC";
255  }
256  }
257  unsigned first = s_DirName.find("-CUT-");
258  unsigned last = s_DirName.find("-VAR-");
259  s_Cut = s_DirName.substr(first+5, last-first-5);
260 
261  return s_Cut;
262 }
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::string Helper::Def ( std::string const &  s_Sample,
std::string const &  s_Condition 
)

Definition at line 48 of file Helper.h.

Referenced by Analyse_OverlayStudies().

48  {
49 
50  std::string s_Samdef="";
51  //MINIDEFS, TESTING OF TEST.
52  if(s_Sample=="mcdata_fhc_test_testdef")
53  s_Samdef="abooth_caf_mix_data_abooth_prod_artdaq_nd_numi_fhc_12359_v1_snapshot_goodruns_stride135_nd_genie_N1810j0211a_fhc_nonswap_3000_bn1_v1_20200122_125156_testdef";
54  else if(s_Sample=="mcmc_fhc_test_testdef")
55  s_Samdef="abooth_caf_mix_mc_abooth_prod_artdaq_R19-10-07-prod5genie.d_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1_resfix_stride573_nd_genie_N1810j0211a_fhc_nonswap_3000_bn1_v1_20200122_125156_testdef";
56  else if(s_Sample=="mcdata_fhc_ben_test_testdef")
57  s_Samdef="abooth_caf_mix_data_abooth_prod_artdaq_nd_numi_fhc_12359_v1_snapshot_goodruns_stride135_ben_nd_genie_N1810j0211a_fhc_nonswap_3000_bn1_v1_20200217_124902_testdef";
58  else if(s_Sample=="mcmc_fhc_ben_test_testdef")
59  s_Samdef="abooth_caf_mix_mc_abooth_prod_artdaq_R19-10-07-prod5genie.d_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1_resfix_stride573_ben_nd_genie_N1810j0211a_fhc_nonswap_3000_bn1_v1_20200217_124902_testdef";
60 
61  //FULL TEST DEFINITIONS.
62  if(s_Sample=="mcdata_fhc_test")
63  s_Samdef="abooth_caf_mix_data_abooth_prod_artdaq_nd_numi_fhc_12359_v1_snapshot_goodruns_stride135_nd_genie_N1810j0211a_fhc_nonswap_3000_bn1_v1_20200122_125156";
64  else if(s_Sample=="mcmc_fhc_test")
65  s_Samdef="abooth_caf_mix_mc_abooth_prod_artdaq_R19-10-07-prod5genie.d_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1_resfix_stride573_nd_genie_N1810j0211a_fhc_nonswap_3000_bn1_v1_20200122_125156";
66  else if(s_Sample=="mcdata_fhc_ben_test")
67  s_Samdef="abooth_caf_mix_data_abooth_prod_artdaq_nd_numi_fhc_12359_v1_snapshot_goodruns_stride135_ben_nd_genie_N1810j0211a_fhc_nonswap_3000_bn1_v1_20200217_124902";
68  else if(s_Sample=="mcmc_fhc_ben_test")
69  s_Samdef="abooth_caf_mix_mc_abooth_prod_artdaq_R19-10-07-prod5genie.d_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_v1_resfix_stride573_ben_nd_genie_N1810j0211a_fhc_nonswap_3000_bn1_v1_20200217_124902";
70 
71  //GRID TESTS.
72  if(s_Sample=="mcdata_fhc_gridtest")
73  s_Samdef="temp_cafs_singles_numu_fhc_mixed_with_data_metafix_limit5";
74  else if(s_Sample=="mcmc_fhc_gridtest")
75  s_Samdef="temp_cafs_old_metadata_numu_fhc_mixed_with_mc_snapshot1901165_limit5";
76  else if(s_Sample=="mcdata_fhc_nuegridtest")
77  s_Samdef="abooth_prod_caf_R19-11-18-prod5reco.m_nd_numi_fhc_full_singles_ben_data_v1_limit2";
78 
79  //OFFICIAL.
80  //NONSWAP.
81  if(s_Sample=="mcdata_fhc_nonswap")
82  s_Samdef = "prod_caf_R19-11-18-prod5reco.m_nd_numi_fhc_full_singles_numu_data_v1";
83  //s_Samdef="temp_cafs_singles_numu_fhc_mixed_with_data_metafix";
84  else if(s_Sample=="mcmc_fhc_nonswap")
85  s_Samdef="prod_caf_R19-11-18-prod5reco.m_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_singles_numu_mc_v1";
86  //s_Samdef="temp_cafs_old_metadata_numu_fhc_mixed_with_mc_snapshot1901165";
87  //s_Samdef="temp_cafs_singles_numu_fhc_mixed_with_mc_metafix";
88  else if(s_Sample=="mcdata_rhc_nonswap")
89  s_Samdef = "prod_caf_R19-11-18-prod5reco.m_nd_numi_rhc_full_singles_numu_data_v1";
90  //s_Samdef="temp_cafs_singles_numu_rhc_mixed_with_data_metafix";
91  else if(s_Sample=="mcmc_rhc_nonswap")
92  s_Samdef = "prod_caf_R19-11-18-prod5reco.m_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_singles_numu_mc_v1";
93  //s_Samdef="temp_cafs_singles_numu_rhc_mixed_with_mc_metafix";
94 
95  //BEN.
96  if(s_Sample=="mcdata_fhc_ben")
97  s_Samdef = "prod_caf_R19-11-18-prod5reco.m_nd_numi_fhc_full_singles_ben_data_v1";
98  //s_Samdef="temp_cafs_singles_ben_fhc_mixed_with_data_metafix";
99  else if(s_Sample=="mcmc_fhc_ben")
100  s_Samdef = "prod_caf_R19-11-18-prod5reco.m_nd_genie_N1810j0211a_nonswap_fhc_nova_v08_full_singles_ben_mc_v1";
101  //s_Samdef="temp_cafs_singles_ben_fhc_mixed_with_mc_metafix ";
102  else if(s_Sample=="mcdata_rhc_ben")
103  s_Samdef = "prod_caf_R19-11-18-prod5reco.m_nd_numi_rhc_full_singles_ben_data_v1";
104  //s_Samdef="temp_cafs_singles_ben_rhc_mixed_with_data_metafix";
105  else if(s_Sample=="mcmc_rhc_ben")
106  s_Samdef = "prod_caf_R19-11-18-prod5reco.m_nd_genie_N1810j0211a_nonswap_rhc_nova_v08_full_singles_ben_mc_v1";
107  //s_Samdef="temp_cafs_singles_ben_rhc_mixed_with_mc_metafix ";
108 
109  /*
110  else if(s_Sample=="datanom_fhc_test")
111  s_Samdef="";
112  else if(s_Sample=="mcnom_fhc_test")
113  s_Samdef="";
114  else if(s_Sample=="datanom_rhc_test")
115  s_Samdef="";
116  else if(s_Sample=="mcnom_rhc_test")
117  s_Samdef="";
118  */
119 
120  if(s_Condition!=""){
121  s_Samdef = "defname: " + s_Samdef + " " + s_Condition;
122  }
123 
124  return s_Samdef;
125 }
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
void Helper::furtherBENBreakdown ( std::map< std::string, const Cut > &  map_Cuts,
Cut  kBaseCut 
)
std::string Helper::getNiceCutLabel ( std::string const &  s_Cut)

Definition at line 548 of file Helper.h.

References febshutoff_auto::end, part, and febshutoff_auto::start.

Referenced by Analyse_GetEfficiency(), and Analyse_GetEfficiency_UseNEntries().

549 {
550  std::string s_NiceLabl = "";
551 
552  if((s_Cut=="over_fid_sig") || (s_Cut=="over_fid_sig_ATE")){
553  s_NiceLabl = "Overlaid";
554  }
555  else if((s_Cut=="over_fid_sig_rec") || (s_Cut=="over_fid_sig_ATE_rec")){
556  s_NiceLabl = "Sliced";
557  }
558  else if((s_Cut=="over_fid_sig_rec_qual") || (s_Cut=="over_fid_sig_ATE_rec_qual")){
559  s_NiceLabl = "Quality";
560  }
561  else if((s_Cut=="over_fid_sig_rec_cont_qual") || (s_Cut=="over_fid_sig_ATE_rec_cont_qual")){
562  s_NiceLabl = "Quality \\& Containment";
563  }
564  else if((s_Cut=="over_fid_sig_rec_presel") || (s_Cut=="over_fid_sig_ATE_rec_presel")){
565  s_NiceLabl = "Pre-selected";
566  }
567  else if((s_Cut=="over_fid_sig_rec_sel") || (s_Cut=="over_fid_sig_ATE_rec_sel")){
568  s_NiceLabl = "Selected";
569  }
570  else if((s_Cut=="special_fid_sig")){
571  s_NiceLabl = "No Cut";
572  }
573  else{
574  s_NiceLabl = s_Cut;
575  if(s_Cut.find("_")!=std::string::npos){
576  std::vector<std::string> vec_StrParts;
577  int start;
578  int end = 0;
579  while((start = s_NiceLabl.find_first_not_of("_", end)) != (signed int)std::string::npos){
580  end = s_NiceLabl.find("_", start);
581  vec_StrParts.push_back(s_NiceLabl.substr(start, end - start));
582  }
583  s_NiceLabl = "\\footnotesize ";
584  for(unsigned int part = vec_StrParts.size()-3; part < vec_StrParts.size(); part++){
585  s_NiceLabl += vec_StrParts.at(part);
586  if(part != vec_StrParts.size()-1){
587  s_NiceLabl += "\\_";
588  }
589  }
590  }
591  }
592 
593  return s_NiceLabl;
594 }
TString part[npart]
Definition: Style.C:32
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::string Helper::getNiceLabel ( std::string  s_Var)
private

Definition at line 472 of file Helper.h.

473 {
474  if(s_Var=="kSliceCount") return "Number of Slices";
475  if(s_Var=="kPOTWeight") return "Weight";
476  if(s_Var=="kSpillPOT") return "POT/Spill #times10^{12}";
477  if(s_Var=="kTrueLepE") return "True Primary Lepton Energy, (GeV)";
478  if(s_Var=="kTrueQ2") return "True Q^{2}";
479  if(s_Var=="kTrueW2") return "True W^{2}";
480  if(s_Var=="kTrueXbj") return "True Bjorken X";
481  if(s_Var=="kTrueYbj") return "True Bjorken Y";
482  if(s_Var=="kOTrueVtxX") return "True Vertex X, (cm)";
483  if(s_Var=="kOTrueVtxY") return "True Vertex Y, (cm)";
484  if(s_Var=="kOTrueVtxZ") return "True Vertex Z, (cm)";
485  if(s_Var=="kMode") return "Interaction Mode";
486  if(s_Var=="kIsCC") return "Is CC";
487  if(s_Var=="kPDG") return "Particle PDG Code. [NT]";
488  if(s_Var=="kTrueE") return "True Neutrino Energy, (GeV)";
489  if(s_Var=="kTrueEben") return "True Neutrino Energy, (GeV)";
490  if(s_Var=="kTrueElong") return "True Neutrino Energy, (GeV)";
491  if(s_Var=="kTrueElong_ben") return "True Neutrino Energy, (GeV)";
492 
493  if( s_Var=="kNHit") return "Number of Hits";
494  if( s_Var=="kNueEnergy2020") return "Reconstructed Neutrino Energy, (GeV)";
495  if( s_Var=="kNueElectronE2020") return "Electron Energy, (GeV)";
496  if( s_Var=="kHADE2020") return "Hadronic Energy, (GeV)";
497  if( s_Var=="kLongestProng") return "Longest Prong Length, (cm)";
498 
499  if(s_Var=="kSlcNoiseFrac") return "Slice Noise Fraction?";
500  if(s_Var=="kSlcNoiseFracN") return "Slice Noise Fraction Hits?";
501  if(s_Var=="kSlcNoiseFracPE") return "Slice Noise Fraction PE?";
502 
503  if(s_Var=="kCCE") return "Reconstructed Neutrino Energy, (GeV)";
504  if(s_Var=="kCCElong") return "Reconstructed Neutrino Energy, (GeV)";
505  if(s_Var=="kMuE") return "Reconstructed Muon Energy, (GeV)";
506  if(s_Var=="kHadE") return "Reconstructed Hadronic Energy, (GeV)";
507  if(s_Var=="kHadEFrac") return "Reconstructed Hadronic Energy Fraction, (GeV)";
508  if(s_Var=="kCaloE") return "Calorimetric Energy, (GeV)";
509 
510  if(s_Var=="kSlcMeanTime") return "Slice Mean Time (#mus)";
511  if(s_Var=="kSlcStartTime") return "Slice Start Time (#mus)";
512  if(s_Var=="kSlcEndTime") return "Slice End Time (#mus)";
513  if(s_Var=="kSliceDuration") return "Slice Duration (#mus)";
514  if(s_Var=="kSlcEff") return "Slice Efficiency";
515 
516  if(s_Var=="kRun") return "Run Number";
517  if(s_Var=="kEvt") return "Event Number";
518  if(s_Var=="kSlc") return "Slice Number";
519 
520 
521  if(s_Var=="kTrueLepE_Nu") return "True Primary Lepton Energy, (GeV). [NT]";
522  if(s_Var=="kTrueQ2_Nu") return "True Q^{2}. [NT]";
523  if(s_Var=="kTrueW2_Nu") return "True W^{2}. [NT]";
524  if(s_Var=="kTrueXbj_Nu") return "True Bjorken X. [NT]";
525  if(s_Var=="kTrueYbj_Nu") return "True Bjorken Y. [NT]";
526  if(s_Var=="kOTrueVtxX_Nu") return "True Vertex X, (cm). [NT]";
527  if(s_Var=="kOTrueVtxY_Nu") return "True Vertex Y, (cm). [NT]";
528  if(s_Var=="kOTrueVtxZ_Nu") return "True Vertex Z, (cm). [NT]";
529  if(s_Var=="kMode_Nu") return "Interaction Mode. [NT]";
530  if(s_Var=="kIsCC_Nu") return "Is CC. [NT]";
531  if(s_Var=="kTrueE_Nu") return "True Neutrino Energy, (GeV). [NT]";
532  if(s_Var=="kTrueEben_Nu") return "True Neutrino Energy, (GeV). [NT]";
533  if(s_Var=="kTrueElong_Nu") return "True Neutrino Energy, (GeV). [NT]";
534  if(s_Var=="kPDG_Nu") return "Particle PDG Code. [NT]";
535  if(s_Var=="kSpillPOTInNuTruth_Nu") return "POT/Spill #times10^{12}. [NT]";
536 
537  if(s_Var=="kSpillPOT_Sp") return "POT/Spill #times10^{12}. [ST]";
538  if(s_Var=="kSpillPOTRatioWeight_Sp") return "Weight. [ST]";
539  if(s_Var=="kSpillCount_Sp") return "Number of Spills";
540  if(s_Var=="kSpillPOTNSC_Sp") return "POT/Spill #times10^{12}. [ST]";
541  if(s_Var=="kSpillPOTRatioWeightNSC_Sp") return "Weight. [ST]";
542  if(s_Var=="kSpillCountNSC_Sp") return "Number of Spills";
543 
544  return "Unrecognised Var!";
545 }
bool Helper::IsSpecial ( TString const &  s_Obj)

Definition at line 128 of file Helper.h.

Referenced by makeCanvas().

129 {
130  std::vector<TString> vec_IsSpecial = {"dir_-CUT-over-VAR-kOTrueVtxX_Nu",
131  "dir_-CUT-over-VAR-kOTrueVtxY_Nu",
132  "dir_-CUT-over-VAR-kOTrueVtxZ_Nu",
133  "dir_-CUT-over-VAR-kPDG_Nu",
134  "dir_-CUT-over-VAR-kIsCC_Nu",
135  "dir_-CUT-special_overnoeff_fid_sig-VAR-kSlcEff"};
136 
137  return (std::find(vec_IsSpecial.begin(), vec_IsSpecial.end(), s_Obj) != vec_IsSpecial.end());
138 }
std::vector< TLine * > Helper::PlotSpecial ( TString const &  s_Obj,
std::string const &  s_Selection,
double const &  yMin,
double const &  yMax,
bool  loosePresel 
)

Definition at line 141 of file Helper.h.

References submit_hadd::l, make_syst_table_plots::line, and make_root_from_grid_output::pdg.

Referenced by makeCanvas().

142 {
143  bool isCC;
144  bool isNumu;
145  if(s_Selection.find("numu2020")!=std::string::npos){
146  isCC = true;
147  isNumu = true;
148  }
149  else if(s_Selection.find("nue2020")!=std::string::npos){
150  isCC = true;
151  isNumu = false;
152  }
153  else{
154  specifyValid();
155  }
156 
157  std::vector<TLine*> vec_CutLines;
158  if((s_Obj.Contains("kOTrueVtxX_Nu")) || (s_Obj.Contains("kOTrueVtxY_Nu"))){
159  double presel = loosePresel ? 220. : 180.;
160  TLine *l_low = new TLine(-1.*presel, yMin, -1.*presel, yMax);
161  TLine *l_high = new TLine( presel, yMin, presel, yMax);
162  vec_CutLines.push_back(l_low);
163  vec_CutLines.push_back(l_high);
164  }
165  else if(s_Obj.Contains("kOTrueVtxZ_Nu")){
166  double presel = loosePresel ? 0. : 25.;
167  TLine *l_low = new TLine(presel, yMin, presel, yMax);
168  TLine *l_high = new TLine( 1150., yMin, 1150., yMax);
169  vec_CutLines.push_back(l_low);
170  vec_CutLines.push_back(l_high);
171  }
172  else if(s_Obj.Contains("kPDG")){
173  double pdg = 0.;
174  if(isNumu){
175  pdg = 14.;
176  }
177  else{
178  pdg = 12.;
179  }
180  TLine *l_lowl = new TLine(-1.*pdg-0.5, yMin, -1.*pdg-0.5, yMax);
181  TLine *l_lowh = new TLine(-1.*pdg+0.5, yMin, -1.*pdg+0.5, yMax);
182  TLine *l_highl = new TLine( 1.*pdg-0.5, yMin, 1.*pdg-0.5, yMax);
183  TLine *l_highh = new TLine( 1.*pdg+0.5, yMin, 1.*pdg+0.5, yMax);
184  vec_CutLines.push_back(l_lowl);
185  vec_CutLines.push_back(l_lowh);
186  vec_CutLines.push_back(l_highl);
187  vec_CutLines.push_back(l_highh);
188  }
189  else if(s_Obj.Contains("kIsCC")){
190  double CC = 0.;
191  if(isCC){
192  CC = 1.;
193  }
194  else{
195  CC = 0.;
196  }
197  TLine *l_lowl = new TLine(-1.*CC-0.5, yMin, -1.*CC-0.5, yMax);
198  TLine *l_lowh = new TLine(-1.*CC+0.5, yMin, -1.*CC+0.5, yMax);
199  TLine *l_highl = new TLine( 1.*CC-0.5, yMin, 1.*CC-0.5, yMax);
200  TLine *l_highh = new TLine( 1.*CC+0.5, yMin, 1.*CC+0.5, yMax);
201  vec_CutLines.push_back(l_lowl);
202  vec_CutLines.push_back(l_lowh);
203  vec_CutLines.push_back(l_highl);
204  vec_CutLines.push_back(l_highh);
205  }
206  else if(s_Obj.Contains("special_fid_sig-VAR-kSlcEff")){
207  TLine *l = new TLine(0.51, yMin, 0.51, yMax);
208  vec_CutLines.push_back(l);
209  }
210 
211 
212  for(unsigned int line = 0; line < vec_CutLines.size(); line++){
213  vec_CutLines.at(line)->SetLineWidth(2);
214  vec_CutLines.at(line)->SetLineColor(kViolet-6);
215  vec_CutLines.at(line)->SetLineStyle(kDashed);
216  }
217 
218  return vec_CutLines;
219 }
Preselection Object.
Definition: FillPIDs.h:20
void specifyValid()
Definition: Helper.h:623
const Cut Helper::Presel_Cut ( std::string  s_Selection)

Definition at line 383 of file Helper.h.

References ana::kNoCut, and ana::kNue2020NDPresel.

Referenced by scheduleCuts().

384 {
385  Cut cut_Temp = kNoCut;
386 
387  if(s_Selection=="nue2020"){
388  cut_Temp = kNue2020NDPresel;
389  }
390  else{
391  specifyValid();
392  }
393 
394  const Cut Containment_Cut = cut_Temp;
395  return Containment_Cut;
396 }
const Cut Containment_Cut(std::string s_Selection)
Definition: Helper.h:367
const Cut kNue2020NDPresel
Definition: NueCuts2020.h:169
void specifyValid()
Definition: Helper.h:623
const Cut Helper::Quality_Cut ( std::string  s_Selection)

Definition at line 351 of file Helper.h.

References ana::kNoCut, and ana::kNumuQuality.

Referenced by scheduleCuts().

352 {
353  Cut cut_Temp = kNoCut;
354 
355  if(s_Selection=="numu2020"){
356  cut_Temp = kNumuQuality;
357  }
358  else{
359  specifyValid();
360  }
361 
362  const Cut Quality_Cut = cut_Temp;
363  return Quality_Cut;
364 }
const Cut Quality_Cut(std::string s_Selection)
Definition: Helper.h:351
void specifyValid()
Definition: Helper.h:623
const Cut kNumuQuality
Definition: NumuCuts.h:18
const Cut Helper::Selection_Cut ( std::string  s_Selection)

Definition at line 399 of file Helper.h.

References ana::kNoCut, ana::kNue2020ND, and ana::kNumu2020ND.

Referenced by Analyse_OverlayStudies(), and scheduleCuts().

400 {
401  Cut cut_Temp = kNoCut;
402 
403  if(s_Selection=="numu2020"){
404  cut_Temp = kNumu2020ND;
405  }
406  else if(s_Selection=="nue2020"){
407  cut_Temp = kNue2020ND;
408  }
409  else{
410  specifyValid();
411  }
412 
413  const Cut Selection_Cut = cut_Temp;
414  return Selection_Cut;
415 }
const Cut kNumu2020ND
Definition: NumuCuts2020.h:57
const Cut kNue2020ND
Definition: NueCuts2020.h:178
void specifyValid()
Definition: Helper.h:623
const Cut Selection_Cut(std::string s_Selection)
Definition: Helper.h:399
const Cut Helper::Sig_Cut ( std::string  s_Selection)

Definition at line 265 of file Helper.h.

References ana::kNoCut, ana::kTrueNueCC, and ana::kTrueNumuCC.

Referenced by Analyse_OverlayStudies(), and scheduleCuts().

266 {
267  Cut cut_Temp = kNoCut;
268 
269  if(s_Selection=="numu2020"){
270  cut_Temp = kTrueNumuCC;
271  }
272  else if(s_Selection=="nue2020"){
273  cut_Temp = kTrueNueCC;
274  }
275  else{
276  specifyValid();
277  }
278 
279  const Cut Sig_Cut = cut_Temp;
280  return Sig_Cut;
281 }
const Cut Sig_Cut(std::string s_Selection)
Definition: Helper.h:265
const Cut kTrueNueCC
Definition: OverlayCuts.cxx:74
const Cut kTrueNumuCC
Definition: OverlayCuts.cxx:65
void specifyValid()
Definition: Helper.h:623
const NuTruthCut Helper::Sig_NuCut ( std::string  s_Selection)

Definition at line 332 of file Helper.h.

References ana::kNoCut_NT, ana::kTrueNueCC_Nu, and ana::kTrueNumuCC_Nu.

Referenced by scheduleCuts().

333 {
334  NuTruthCut cut_Temp = kNoCut_NT;
335 
336  if(s_Selection=="numu2020"){
337  cut_Temp = kTrueNumuCC_Nu;
338  }
339  else if(s_Selection=="nue2020"){
340  cut_Temp = kTrueNueCC_Nu;
341  }
342  else{
343  specifyValid();
344  }
345 
346  const NuTruthCut Sig_NuCut = cut_Temp;
347  return Sig_NuCut;
348 }
const NuTruthCut kTrueNueCC_Nu([](const caf::SRNeutrinoProxy *truth){return( truth->iscc && abs(truth->pdg)==12 );})
Definition: OverlayCuts.h:25
const NuTruthCut Sig_NuCut(std::string s_Selection)
Definition: Helper.h:332
const NuTruthCut kNoCut_NT([](const caf::SRNeutrinoProxy *nu){return true;})
Definition: OverlayCuts.h:7
const NuTruthCut kTrueNumuCC_Nu([](const caf::SRNeutrinoProxy *truth){return( truth->iscc && abs(truth->pdg)==14 );})
Definition: OverlayCuts.h:22
void specifyValid()
Definition: Helper.h:623
Template for Cut and SpillCut.
Definition: Cut.h:15
void Helper::specifyValid ( )
private

Definition at line 623 of file Helper.h.

References om::cout, and allTimeWatchdog::endl.

624 {
625  std::cout << "\nPLEASE SPECIFY A VALID SELECTION\n" << std::endl;
626  std::abort();
627 
628  return;
629 }
OStream cout
Definition: OStream.cxx:6
std::string Helper::VarLabel ( std::string  s_DirName,
bool  isNice 
)

Definition at line 222 of file Helper.h.

Referenced by Analyse_GetEfficiency(), Analyse_GetEfficiency_UseNEntries(), makeCanvas(), and Plotting_OverlayStudies().

223 {
224  std::string s_Var = "";
225  if(s_DirName.find("_Sp")!=std::string::npos){
226  if(isNice){
227  return getNiceLabel(s_DirName);
228  }
229  else{
230  return s_DirName.substr(0, s_DirName.length()-3);
231  }
232  }
233  unsigned first = s_DirName.find("-VAR-");
234  unsigned last = s_DirName.length();
235  s_Var = s_DirName.substr(first+5, last-first-5);
236 
237  if(isNice){
238  return getNiceLabel(s_Var);
239  }
240  else{
241  return s_Var;
242  }
243 }
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
std::string getNiceLabel(std::string s_Var)
Definition: Helper.h:472

Member Data Documentation

unsigned int Helper::fNbins

Definition at line 37 of file Helper.h.

Referenced by Analyse_OverlayStudies().


The documentation for this class was generated from the following file: