CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Tools.h
Go to the documentation of this file.
1 //
2 //
3 // TOOLS declarations
4 //
5 //
6 
7 #ifndef Tools_H
8 #define Tools_H
9 
10 #include "TH1F.h"
11 #include "TArrayF.h"
12 #include "TObjArray.h"
13 #include "TCanvas.h"
14 #include "TFile.h"
15 class TStyle;
16 
17 #include<iostream>
18 #include<string>
19 #include<sstream>
20 
21 
22 namespace RecoBTag {
23  double HistoBinWidth ( const TH1F * theHisto , const int& iBin ) ;
24 
25  double IntegrateHistogram ( const TH1F * theHisto ) ;
26 
27  void HistoToNormalizedArrays ( const TH1F * theHisto , TArrayF & theNormalizedArray , TArrayF & theLeftOfBinArray , TArrayF & theBinWidthArray ) ;
28 
29  double IntegrateArray ( const TArrayF & theArray , const TArrayF & theBinWidth ) ;
30 
31  void PrintHistos ( const std::string& psFile , const std::string& epsFile , const std::string& gifFile ) ;
32 
33  void PrintCanvasHistos ( TCanvas * canvas , const std::string& psFile , const std::string& epsFile , const std::string& gifFile ) ;
34 
35  TObjArray getHistArray ( TFile * histoFile , const std::string& baseName ) ;
36 
37  std::string flavour ( const int& flav ) ;
38 
39  bool flavourIsD ( const int & flav ) ;
40  bool flavourIsU ( const int & flav ) ;
41  bool flavourIsS ( const int & flav ) ;
42  bool flavourIsC ( const int & flav ) ;
43  bool flavourIsB ( const int & flav ) ;
44  bool flavourIsG ( const int & flav ) ;
45  bool flavourIsDUS ( const int & flav ) ;
46  bool flavourIsDUSG ( const int & flav ) ;
47  bool flavourIsNI ( const int & flav ) ;
48 
49  int checkCreateDirectory ( const std::string& ) ;
50 
51  int findBinClosestYValue ( const TH1F * , const float& yVal , const float& yLow , const float& yHigh ) ;
52 
53  TStyle* setTDRStyle();
54 
55  void tdrGrid(const bool& gridOn);
56 
57  void fixOverlay();
58 
59  std::string itos(const int& i); // convert int to string
60 
61 }
62 #endif
TFile * histoFile
Definition: hcalCalib.cc:44
int i
Definition: DBlmapReader.cc:9
void PrintCanvasHistos(TCanvas *canvas, const std::string &psFile, const std::string &epsFile, const std::string &gifFile)
Definition: Tools.cc:109
bool flavourIsG(const int &flav)
Definition: Tools.cc:195
bool flavourIsNI(const int &flav)
Definition: Tools.cc:200
double IntegrateHistogram(const TH1F *theHisto)
Definition: Tools.cc:34
TStyle * setTDRStyle()
Definition: Tools.cc:287
bool flavourIsD(const int &flav)
Definition: Tools.cc:190
int findBinClosestYValue(const TH1F *, const float &yVal, const float &yLow, const float &yHigh)
Definition: Tools.cc:233
bool flavourIsC(const int &flav)
Definition: Tools.cc:193
bool flavourIsU(const int &flav)
Definition: Tools.cc:191
int checkCreateDirectory(const std::string &)
Definition: Tools.cc:205
def canvas
Definition: svgfig.py:481
TObjArray getHistArray(TFile *histoFile, const std::string &baseName)
Definition: Tools.cc:147
void tdrGrid(const bool &gridOn)
Definition: Tools.cc:434
double IntegrateArray(const TArrayF &theArray, const TArrayF &theBinWidth)
Definition: Tools.cc:93
double HistoBinWidth(const TH1F *theHisto, const int &iBin)
Definition: Tools.cc:19
void fixOverlay()
Definition: Tools.cc:443
std::string flavour(const int &flav)
Definition: Tools.cc:168
bool flavourIsB(const int &flav)
Definition: Tools.cc:194
bool flavourIsDUSG(const int &flav)
Definition: Tools.cc:198
void HistoToNormalizedArrays(const TH1F *theHisto, TArrayF &theNormalizedArray, TArrayF &theLeftOfBinArray, TArrayF &theBinWidthArray)
Definition: Tools.cc:57
bool flavourIsS(const int &flav)
Definition: Tools.cc:192
bool flavourIsDUS(const int &flav)
Definition: Tools.cc:197
std::string itos(const int &i)
Definition: Tools.cc:448
void PrintHistos(const std::string &psFile, const std::string &epsFile, const std::string &gifFile)