FairRoot/PandaRoot
Classes | Macros | Functions
PndMvaTools.h File Reference
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <limits>
#include "TFile.h"
#include "TTree.h"

Go to the source code of this file.

Classes

struct  ClassifierOutPuts
 
struct  ROCPoints
 

Macros

#define PND_MVA_TOOLS_H
 

Functions

void Produce_ROC (std::vector< ClassifierOutPuts > &input, std::string const &SigName, std::string const &BgName, size_t sigCnt, size_t bgCnt, std::vector< ROCPoints > &Roc)
 
void print (std::vector< ClassifierOutPuts > const &OutPutList)
 
void print (std::map< std::string, float > const &ClsMapOut)
 
std::map< std::string, size_t > * readEvents (char const *infile, std::vector< std::string > const &varNames, std::vector< std::string > const &classNames, std::vector< std::pair< std::string, std::vector< float > * > > &Outcontainer)
 
void printRoc (std::vector< ROCPoints > const &RocList)
 
void WriteRocToFile (std::string const &FileName, std::vector< ROCPoints > const &RocList)
 

Macro Definition Documentation

#define PND_MVA_TOOLS_H

Definition at line 10 of file PndMvaTools.h.

Function Documentation

void print ( std::vector< ClassifierOutPuts > const &  OutPutList)

Print the list of classifier outputs.

Parameters
OutPutListThe list of outputs created by a classifier.
void print ( std::map< std::string, float > const &  ClsMapOut)

Print the output map.

Parameters
ClsMapOutThe map to print.
void printRoc ( std::vector< ROCPoints > const &  RocList)

Print list of ROC objects.

Parameters
RocListThe list of ROC points
void Produce_ROC ( std::vector< ClassifierOutPuts > &  input,
std::string const &  SigName,
std::string const &  BgName,
size_t  sigCnt,
size_t  bgCnt,
std::vector< ROCPoints > &  Roc 
)

Function to produce ROC curve. This will work if the classifier can produce probs or scores.

Parameters
inputVector containing classifier outputs for a given test data set. Note that this parameter will be modified (sorted).
SigNameSignal name.
BgNameBackground name.
sigCntNumber of signal events.
bgCntNumber of background events.
RocThe list of ROC points (output var).
std::map<std::string, size_t>* readEvents ( char const *  infile,
std::vector< std::string > const &  varNames,
std::vector< std::string > const &  classNames,
std::vector< std::pair< std::string, std::vector< float > * > > &  Outcontainer 
)

Reads the event data from the inputfile.

Parameters
inFileThe input file.
varNamesName of the parameters (branches per tree).
classNamesName of the labels to read.
OutcontainerOutput is stored here.
void WriteRocToFile ( std::string const &  FileName,
std::vector< ROCPoints > const &  RocList 
)

Write the list of ROC objects in a file.

Parameters
FileNameThe name of the file to write into.
RocListThe list of the ROC poits to write.