Classes | Typedefs | Functions | Variables
ND_DataMC_Comp_Systs_header.h File Reference
#include "CAFAna/Analysis/Plots.h"
#include "CAFAna/Analysis/Style.h"
#include "CAFAna/Core/Binning.h"
#include "CAFAna/Core/Spectrum.h"
#include "CAFAna/Core/Var.h"
#include "CAFAna/Core/SpectrumLoader.h"
#include "CAFAna/Vars/HistAxes.h"
#include "3FlavorAna/Vars/NumuVars.h"
#include "CAFAna/Vars/PPFXWeights.h"
#include "Utilities/rootlogon.C"
#include "TCanvas.h"
#include "TGraph.h"
#include "TGaxis.h"
#include "TLegend.h"
#include "TLegendEntry.h"
#include <iostream>
#include <string>
#include <sstream>
#include <fstream>
#include <iomanip>

Go to the source code of this file.

Classes

class  Tangible< T >
 
class  DataMCPair
 

Typedefs

typedef Tangible< CutSelection
 
typedef Tangible< HistAxisTangibleAxis
 

Functions

const Var kBinWidthWeight ([](const caf::SRProxy *sr){const double Enu=kCCE(sr); if(Enu< 0.75) return 0.1/0.75;if(Enu >=0.75 &&Enu< 1) return 0.1/0.25;if(Enu >=1 &&Enu< 2) return 0.1/0.1;if(Enu >=2 &&Enu< 3) return 0.1/0.25;if(Enu >=3 &&Enu< 4) return 0.1/0.5;if(Enu >=4 &&Enu< 5) return 0.1/1;else return 1.;})
 
void CenterTitles ()
 
DataMCPairfindPair (std::vector< DataMCPair > &list, std::vector< std::string > keys)
 Return an iterator if all keys are found in only one entry. More...
 
void WriteBlurb (const DataMCPair &pair, std::string dir, std::string name, std::string extra="", std::string beginning="")
 

Variables

const int DataCol = kBlack
 
const int DataMar = kFullCircle
 
const int FullPred = kViolet - 5
 
const int PredErr = kViolet - 9
 
const int WrongSi = kGreen - 6
 
const int TotalBkg = kGray + 1
 

Typedef Documentation

Definition at line 86 of file ND_DataMC_Comp_Systs_header.h.

Definition at line 87 of file ND_DataMC_Comp_Systs_header.h.

Function Documentation

void CenterTitles ( )

Definition at line 49 of file ND_DataMC_Comp_Systs_header.h.

References ana::CenterTitles().

49  {
50  for(const auto& obj:*(gPad->GetListOfPrimitives())) {
51 
52  if(obj->InheritsFrom("TH1")) CenterTitles((TH1*)obj);
53  }
54 }
void CenterTitles()
DataMCPair* findPair ( std::vector< DataMCPair > &  list,
std::vector< std::string keys 
)

Return an iterator if all keys are found in only one entry.

Assume we're going to find it, innocent until guilty

Definition at line 428 of file ND_DataMC_Comp_Systs_header.h.

References om::cout, allTimeWatchdog::endl, HTMLTools::entry(), modifyFHiCL::found, it, and findDuplicateFiles::key.

430 {
431  int nFound = 0;
432 
433  std::vector<DataMCPair>::iterator it = list.end();
434 
435  for(std::vector<DataMCPair>::iterator entry = list.begin();
436  entry != list.end();
437  ++entry)
438  {
439  /// Assume we're going to find it, innocent until guilty
440  bool found = true;
441  for(const auto& key:keys)
442  {
443  std::cout << entry->ShortName() << " " << key << " " << found << std::endl;
444  std::cout << (entry->ShortName().find(key) == std::string::npos) << " " << entry->ShortName().find(key) << " " << std::string::npos << std::endl;
445  // If any key is not present, this isn't the one.
446  if(entry->ShortName().find(key) == std::string::npos)
447  {
448 
449  found = false;
450  std::cout << entry->ShortName() << " " << key << " " << found << " " <<entry->ShortName().find(key) << std::endl;
451  break;
452 
453  }
454 
455  }
456  if(found)
457  {
458  it = entry;
459  nFound += 1;
460  }
461 
462  }
463  std::cout << "nFound: "<< nFound << std::endl;
464  if(nFound == 0) throw "Failed to find match.";
465  if(nFound > 1) throw "Found too many matches.";
466 
467  return &(*it);
468 }
set< int >::iterator it
OStream cout
Definition: OStream.cxx:6
def entry(str)
Definition: HTMLTools.py:26
const Var kBinWidthWeight ( [] (const caf::SRProxy *sr){const double Enu=kCCE(sr); if(Enu< 0.75) return 0.1/0.75;if(Enu >=0.75 &&Enu< 1) return 0.1/0.25;if(Enu >=1 &&Enu< 2) return 0.1/0.1;if(Enu >=2 &&Enu< 3) return 0.1/0.25;if(Enu >=3 &&Enu< 4) return 0.1/0.5;if(Enu >=4 &&Enu< 5) return 0.1/1;else return 1.;}  )
void WriteBlurb ( const DataMCPair pair,
std::string  dir,
std::string  name,
std::string  extra = "",
std::string  beginning = "" 
)

Definition at line 471 of file ND_DataMC_Comp_Systs_header.h.

References ana::Tangible< T >::fBlurb, ana::DataMCPair::fSel, and confusionMatrixTree::out.

473 {
474  std::ofstream out(dir + name);
475  out << pair.fAxis.fBlurb << pair.fSel.fBlurb << extra;
476 }
const XML_Char * name
Definition: expat.h:151
std::string fBlurb
Definition: DataMCPair.h:46
Selection fSel
Definition: DataMCPair.h:182
TDirectory * dir
Definition: macro.C:5

Variable Documentation

const int DataCol = kBlack
const int DataMar = kFullCircle
const int FullPred = kViolet - 5
const int PredErr = kViolet - 9
const int TotalBkg = kGray + 1

Definition at line 33 of file ND_DataMC_Comp_Systs_header.h.

Referenced by DataMCPair::DrawLegend(), and DataMCPair::DrawMCBkg().

const int WrongSi = kGreen - 6

Definition at line 32 of file ND_DataMC_Comp_Systs_header.h.

Referenced by DataMCPair::DrawLegend(), and DataMCPair::DrawWrong().