Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:09:46

0001 //
0002 //
0003 // TOOLS declarations
0004 //
0005 //
0006 
0007 #ifndef Tools_H
0008 #define Tools_H
0009 
0010 #include "TH1F.h"
0011 #include "TH2F.h"
0012 #include "TArrayF.h"
0013 #include "TObjArray.h"
0014 #include "TCanvas.h"
0015 #include "TFile.h"
0016 class TStyle;
0017 
0018 #include <iostream>
0019 #include <string>
0020 #include <sstream>
0021 
0022 namespace RecoBTag {
0023   double HistoBinWidth(const TH1F* theHisto, const int& iBin);
0024 
0025   double IntegrateHistogram(const TH1F* theHisto);
0026 
0027   void HistoToNormalizedArrays(const TH1F* theHisto,
0028                                TArrayF& theNormalizedArray,
0029                                TArrayF& theLeftOfBinArray,
0030                                TArrayF& theBinWidthArray);
0031 
0032   double IntegrateArray(const TArrayF& theArray, const TArrayF& theBinWidth);
0033 
0034   void PrintHistos(const std::string& psFile, const std::string& epsFile, const std::string& gifFile);
0035 
0036   void PrintCanvasHistos(TCanvas* canvas,
0037                          const std::string& psFile,
0038                          const std::string& epsFile,
0039                          const std::string& gifFile);
0040 
0041   TObjArray getHistArray(TFile* histoFile, const std::string& baseName);
0042 
0043   std::string flavour(const int& flav);
0044 
0045   bool flavourIsD(const int& flav);
0046   bool flavourIsU(const int& flav);
0047   bool flavourIsS(const int& flav);
0048   bool flavourIsC(const int& flav);
0049   bool flavourIsB(const int& flav);
0050   bool flavourIsG(const int& flav);
0051   bool flavourIsDUS(const int& flav);
0052   bool flavourIsDUSG(const int& flav);
0053   bool flavourIsNI(const int& flav);
0054 
0055   int checkCreateDirectory(const std::string&);
0056 
0057   int findBinClosestYValue(const TH1F*, const float& yVal, const float& yLow, const float& yHigh);
0058 
0059   std::vector<int> findBinClosestYValueAtFixedZ(const TH2F*,
0060                                                 const float& yVal,
0061                                                 const float& yLow,
0062                                                 const float& yHigh,
0063                                                 const TH2F*,
0064                                                 const std::vector<double>& zVal);
0065 
0066   TStyle* setTDRStyle();
0067 
0068   void tdrGrid(const bool& gridOn);
0069 
0070   void fixOverlay();
0071 
0072   std::string itos(const int& i);  // convert int to string
0073 
0074 }  // namespace RecoBTag
0075 #endif