CMS 3D CMS Logo

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 "TH2F.h"
12 #include "TArrayF.h"
13 #include "TObjArray.h"
14 #include "TCanvas.h"
15 #include "TFile.h"
16 class TStyle;
17 
18 #include <iostream>
19 #include <string>
20 #include <sstream>
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,
28  TArrayF& theNormalizedArray,
29  TArrayF& theLeftOfBinArray,
30  TArrayF& theBinWidthArray);
31 
32  double IntegrateArray(const TArrayF& theArray, const TArrayF& theBinWidth);
33 
34  void PrintHistos(const std::string& psFile, const std::string& epsFile, const std::string& gifFile);
35 
36  void PrintCanvasHistos(TCanvas* canvas,
37  const std::string& psFile,
38  const std::string& epsFile,
39  const std::string& gifFile);
40 
41  TObjArray getHistArray(TFile* histoFile, const std::string& baseName);
42 
43  std::string flavour(const int& flav);
44 
45  bool flavourIsD(const int& flav);
46  bool flavourIsU(const int& flav);
47  bool flavourIsS(const int& flav);
48  bool flavourIsC(const int& flav);
49  bool flavourIsB(const int& flav);
50  bool flavourIsG(const int& flav);
51  bool flavourIsDUS(const int& flav);
52  bool flavourIsDUSG(const int& flav);
53  bool flavourIsNI(const int& flav);
54 
56 
57  int findBinClosestYValue(const TH1F*, const float& yVal, const float& yLow, const float& yHigh);
58 
59  std::vector<int> findBinClosestYValueAtFixedZ(const TH2F*,
60  const float& yVal,
61  const float& yLow,
62  const float& yHigh,
63  const TH2F*,
64  const std::vector<double>& zVal);
65 
66  TStyle* setTDRStyle();
67 
68  void tdrGrid(const bool& gridOn);
69 
70  void fixOverlay();
71 
72  std::string itos(const int& i); // convert int to string
73 
74 } // namespace RecoBTag
75 #endif
RecoBTag::flavourIsNI
bool flavourIsNI(const int &flav)
Definition: Tools.cc:192
RecoBTag::setTDRStyle
TStyle * setTDRStyle()
Definition: Tools.cc:343
svgfig.canvas
def canvas(*sub, **attr)
Definition: svgfig.py:482
mps_fire.i
i
Definition: mps_fire.py:428
RecoBTag::PrintHistos
void PrintHistos(const std::string &psFile, const std::string &epsFile, const std::string &gifFile)
RecoBTag::checkCreateDirectory
int checkCreateDirectory(const std::string &)
Definition: Tools.cc:199
histoFile
TFile * histoFile
Definition: hcalCalib.cc:42
RecoBTag::HistoBinWidth
double HistoBinWidth(const TH1F *theHisto, const int &iBin)
Definition: Tools.cc:18
RecoBTag::IntegrateArray
double IntegrateArray(const TArrayF &theArray, const TArrayF &theBinWidth)
Definition: Tools.cc:87
RecoBTag::findBinClosestYValue
int findBinClosestYValue(const TH1F *, const float &yVal, const float &yLow, const float &yHigh)
Definition: Tools.cc:225
RecoBTag::flavourIsU
bool flavourIsU(const int &flav)
Definition: Tools.cc:183
RecoBTag::flavourIsC
bool flavourIsC(const int &flav)
Definition: Tools.cc:185
RecoBTag::flavourIsB
bool flavourIsB(const int &flav)
Definition: Tools.cc:186
RecoBTag::flavourIsDUS
bool flavourIsDUS(const int &flav)
Definition: Tools.cc:189
RecoBTag::itos
std::string itos(const int &i)
Definition: Tools.cc:501
RecoBTag::getHistArray
TObjArray getHistArray(TFile *histoFile, const std::string &baseName)
Definition: Tools.cc:141
RecoBTag::tdrGrid
void tdrGrid(const bool &gridOn)
Definition: Tools.cc:490
RecoBTag
Definition: Tools.h:22
RecoBTag::findBinClosestYValueAtFixedZ
std::vector< int > findBinClosestYValueAtFixedZ(const TH2F *, const float &yVal, const float &yLow, const float &yHigh, const TH2F *, const std::vector< double > &zVal)
Definition: Tools.cc:278
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RecoBTag::fixOverlay
void fixOverlay()
Definition: Tools.cc:499
RecoBTag::flavour
std::string flavour(const int &flav)
Definition: Tools.cc:161
RecoBTag::PrintCanvasHistos
void PrintCanvasHistos(TCanvas *canvas, const std::string &psFile, const std::string &epsFile, const std::string &gifFile)
Definition: Tools.cc:100
RecoBTag::flavourIsS
bool flavourIsS(const int &flav)
Definition: Tools.cc:184
RecoBTag::flavourIsDUSG
bool flavourIsDUSG(const int &flav)
Definition: Tools.cc:190
RecoBTag::HistoToNormalizedArrays
void HistoToNormalizedArrays(const TH1F *theHisto, TArrayF &theNormalizedArray, TArrayF &theLeftOfBinArray, TArrayF &theBinWidthArray)
Definition: Tools.cc:55
RecoBTag::flavourIsG
bool flavourIsG(const int &flav)
Definition: Tools.cc:187
RecoBTag::IntegrateHistogram
double IntegrateHistogram(const TH1F *theHisto)
Definition: Tools.cc:35
RecoBTag::flavourIsD
bool flavourIsD(const int &flav)
Definition: Tools.cc:182