CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes
RooUtil::Histograms Class Reference

#include <anautil.h>

Public Member Functions

void add2DHistogram (TString, unsigned int, float, float, TString, unsigned int, float, float, std::function< float()>, std::function< float()>)
 
void add2DVecHistogram (TString, unsigned int, float, float, TString, unsigned int, float, float, std::function< std::vector< float >()>, std::function< std::vector< float >()>, std::function< std::vector< float >()> wgt=nullptr)
 
void add2DVecHistogram (TString, std::vector< float >, TString, unsigned int, float, float, std::function< std::vector< float >()>, std::function< std::vector< float >()>, std::function< std::vector< float >()> wgt=nullptr)
 
void addHistogram (TString, unsigned int, float, float, std::function< float()>)
 
void addHistogram (TString, std::vector< float >, std::function< float()>)
 
void addVecHistogram (TString, unsigned int, float, float, std::function< std::vector< float >()>, std::function< std::vector< float >()> wgt=nullptr)
 
void addVecHistogram (TString, std::vector< float >, std::function< std::vector< float >()>, std::function< std::vector< float >()> wgt=nullptr)
 
 Histograms ()
 
 ~Histograms ()
 

Public Attributes

std::map< TString, std::tuple< unsigned int, float, float, std::function< float()> > > th1fs
 
std::map< TString, std::tuple< std::vector< float >, std::function< float()> > > th1fs_varbin
 
std::map< TString, std::tuple< unsigned int, float, float, std::function< std::vector< float >)>, std::function< std::vector< float >)> > > th1vecfs
 
std::map< TString, std::tuple< std::vector< float >, std::function< std::vector< float >)>, std::function< std::vector< float >)> > > th1vecfs_varbin
 
std::map< std::pair< TString, TString >, std::tuple< unsigned int, float, float, unsigned int, float, float, std::function< float()>, std::function< float()> > > th2fs
 
std::map< std::pair< TString, TString >, std::tuple< unsigned int, float, float, unsigned int, float, float, std::function< std::vector< float >)>, std::function< std::vector< float >)>, std::function< std::vector< float >)> > > th2vecfs
 
std::map< std::pair< TString, TString >, std::tuple< std::vector< float >, unsigned int, float, float, std::function< std::vector< float >)>, std::function< std::vector< float >)>, std::function< std::vector< float >)> > > th2vecfs_xvarbin
 

Detailed Description

Definition at line 20 of file anautil.h.

Constructor & Destructor Documentation

◆ Histograms()

Histograms::Histograms ( )

Definition at line 1097 of file anautil.cc.

1097 {}

◆ ~Histograms()

Histograms::~Histograms ( )

Definition at line 1100 of file anautil.cc.

1100 {}

Member Function Documentation

◆ add2DHistogram()

void Histograms::add2DHistogram ( TString  name,
unsigned int  n,
float  min,
float  max,
TString  namey,
unsigned int  ny,
float  miny,
float  maxy,
std::function< float()>  varxdef,
std::function< float()>  varydef 
)

Definition at line 1149 of file anautil.cc.

References RooUtil::error(), WZElectronSkims53X_cff::max, SiStripPI::min, create_idmaps::n, and mergeVDriftHistosByStation::name.

1158  {
1159  if (th2fs.find(std::make_pair(name, namey)) == th2fs.end()) {
1160  th2fs[std::make_pair(name, namey)] = std::make_tuple(n, min, max, ny, miny, maxy, varxdef, varydef);
1161  } else {
1162  error(TString::Format("histogram already exists name = %s", (name + "_v_" + namey).Data()));
1163  }
1164 }
void error(TString msg, const char *fname="", int is_error=1)
Definition: printutil.cc:44
std::map< std::pair< TString, TString >, std::tuple< unsigned int, float, float, unsigned int, float, float, std::function< float()>, std::function< float()> > > th2fs
Definition: anautil.h:35

◆ add2DVecHistogram() [1/2]

void Histograms::add2DVecHistogram ( TString  name,
unsigned int  n,
float  min,
float  max,
TString  namey,
unsigned int  ny,
float  miny,
float  maxy,
std::function< std::vector< float >()>  varxdef,
std::function< std::vector< float >()>  varydef,
std::function< std::vector< float >()>  wgt = nullptr 
)

Definition at line 1167 of file anautil.cc.

References RooUtil::error(), WZElectronSkims53X_cff::max, SiStripPI::min, create_idmaps::n, and mergeVDriftHistosByStation::name.

1177  {
1178  if (th2vecfs.find(std::make_pair(name, namey)) == th2vecfs.end()) {
1179  th2vecfs[std::make_pair(name, namey)] = std::make_tuple(n, min, max, ny, miny, maxy, varxdef, varydef, elem_wgt);
1180  } else {
1181  error(TString::Format("histogram already exists name = %s", (name + "_v_" + namey).Data()));
1182  }
1183 }
void error(TString msg, const char *fname="", int is_error=1)
Definition: printutil.cc:44
std::map< std::pair< TString, TString >, std::tuple< unsigned int, float, float, unsigned int, float, float, std::function< std::vector< float >)>, std::function< std::vector< float >)>, std::function< std::vector< float >)> > > th2vecfs
Definition: anautil.h:46

◆ add2DVecHistogram() [2/2]

void Histograms::add2DVecHistogram ( TString  name,
std::vector< float >  xboundaries,
TString  namey,
unsigned int  ny,
float  miny,
float  maxy,
std::function< std::vector< float >()>  varxdef,
std::function< std::vector< float >()>  varydef,
std::function< std::vector< float >()>  wgt = nullptr 
)

Definition at line 1186 of file anautil.cc.

References RooUtil::error(), and mergeVDriftHistosByStation::name.

1194  {
1195  if (th2vecfs_xvarbin.find(std::make_pair(name, namey)) == th2vecfs_xvarbin.end()) {
1196  th2vecfs_xvarbin[std::make_pair(name, namey)] =
1197  std::make_tuple(xboundaries, ny, miny, maxy, varxdef, varydef, elem_wgt);
1198  } else {
1199  error(TString::Format("histogram already exists name = %s", (name + "_v_" + namey).Data()));
1200  }
1201 }
void error(TString msg, const char *fname="", int is_error=1)
Definition: printutil.cc:44
std::map< std::pair< TString, TString >, std::tuple< std::vector< float >, unsigned int, float, float, std::function< std::vector< float >)>, std::function< std::vector< float >)>, std::function< std::vector< float >)> > > th2vecfs_xvarbin
Definition: anautil.h:55

◆ addHistogram() [1/2]

void Histograms::addHistogram ( TString  name,
unsigned int  n,
float  min,
float  max,
std::function< float()>  vardef 
)

Definition at line 1104 of file anautil.cc.

References RooUtil::error(), WZElectronSkims53X_cff::max, SiStripPI::min, create_idmaps::n, and mergeVDriftHistosByStation::name.

1105  {
1106  if (th1fs.find(name) == th1fs.end()) {
1107  th1fs[name] = std::make_tuple(n, min, max, vardef);
1108  } else {
1109  error(TString::Format("histogram already exists name = %s", name.Data()));
1110  }
1111 }
void error(TString msg, const char *fname="", int is_error=1)
Definition: printutil.cc:44
std::map< TString, std::tuple< unsigned int, float, float, std::function< float()> > > th1fs
Definition: anautil.h:24

◆ addHistogram() [2/2]

void Histograms::addHistogram ( TString  name,
std::vector< float >  boundaries,
std::function< float()>  vardef 
)

Definition at line 1128 of file anautil.cc.

References RooUtil::error(), and mergeVDriftHistosByStation::name.

1128  {
1129  if (th1fs_varbin.find(name) == th1fs_varbin.end()) {
1130  th1fs_varbin[name] = std::make_tuple(boundaries, vardef);
1131  } else {
1132  error(TString::Format("histogram already exists name = %s", name.Data()));
1133  }
1134 }
void error(TString msg, const char *fname="", int is_error=1)
Definition: printutil.cc:44
std::map< TString, std::tuple< std::vector< float >, std::function< float()> > > th1fs_varbin
Definition: anautil.h:23

◆ addVecHistogram() [1/2]

void Histograms::addVecHistogram ( TString  name,
unsigned int  n,
float  min,
float  max,
std::function< std::vector< float >()>  vardef,
std::function< std::vector< float >()>  wgt = nullptr 
)

Definition at line 1114 of file anautil.cc.

References RooUtil::error(), WZElectronSkims53X_cff::max, SiStripPI::min, create_idmaps::n, and mergeVDriftHistosByStation::name.

Referenced by bookDuplicateRateSet(), bookEfficiencySet(), and bookFakeRateSet().

1119  {
1120  if (th1vecfs.find(name) == th1vecfs.end()) {
1121  th1vecfs[name] = std::make_tuple(n, min, max, vardef, wgt);
1122  } else {
1123  error(TString::Format("histogram already exists name = %s", name.Data()));
1124  }
1125 }
void error(TString msg, const char *fname="", int is_error=1)
Definition: printutil.cc:44
std::map< TString, std::tuple< unsigned int, float, float, std::function< std::vector< float >)>, std::function< std::vector< float >)> > > th1vecfs
Definition: anautil.h:31

◆ addVecHistogram() [2/2]

void Histograms::addVecHistogram ( TString  name,
std::vector< float >  boundaries,
std::function< std::vector< float >()>  vardef,
std::function< std::vector< float >()>  wgt = nullptr 
)

Definition at line 1137 of file anautil.cc.

References RooUtil::error(), and mergeVDriftHistosByStation::name.

1140  {
1141  if (th1vecfs_varbin.find(name) == th1vecfs_varbin.end()) {
1142  th1vecfs_varbin[name] = std::make_tuple(boundaries, vardef, wgt);
1143  } else {
1144  error(TString::Format("histogram already exists name = %s", name.Data()));
1145  }
1146 }
std::map< TString, std::tuple< std::vector< float >, std::function< std::vector< float >)>, std::function< std::vector< float >)> > > th1vecfs_varbin
Definition: anautil.h:27
void error(TString msg, const char *fname="", int is_error=1)
Definition: printutil.cc:44

Member Data Documentation

◆ th1fs

std::map<TString, std::tuple<unsigned int, float, float, std::function<float()> > > RooUtil::Histograms::th1fs

Definition at line 24 of file anautil.h.

◆ th1fs_varbin

std::map<TString, std::tuple<std::vector<float>, std::function<float()> > > RooUtil::Histograms::th1fs_varbin

Definition at line 23 of file anautil.h.

◆ th1vecfs

std::map< TString, std::tuple<unsigned int, float, float, std::function<std::vector<float>)>, std::function<std::vector<float>)> > > RooUtil::Histograms::th1vecfs

Definition at line 31 of file anautil.h.

◆ th1vecfs_varbin

std::map<TString, std::tuple<std::vector<float>, std::function<std::vector<float>)>, std::function<std::vector<float>)> > > RooUtil::Histograms::th1vecfs_varbin

Definition at line 27 of file anautil.h.

◆ th2fs

std::map< std::pair<TString, TString>, std::tuple<unsigned int, float, float, unsigned int, float, float, std::function<float()>, std::function<float()> > > RooUtil::Histograms::th2fs

Definition at line 35 of file anautil.h.

◆ th2vecfs

std::map<std::pair<TString, TString>, std::tuple<unsigned int, float, float, unsigned int, float, float, std::function<std::vector<float>)>, std::function<std::vector<float>)>, std::function<std::vector<float>)> > > RooUtil::Histograms::th2vecfs

Definition at line 46 of file anautil.h.

◆ th2vecfs_xvarbin

std::map<std::pair<TString, TString>, std::tuple<std::vector<float>, unsigned int, float, float, std::function<std::vector<float>)>, std::function<std::vector<float>)>, std::function<std::vector<float>)> > > RooUtil::Histograms::th2vecfs_xvarbin

Definition at line 55 of file anautil.h.