File indexing completed on 2023-03-17 10:38:30
0001 #ifndef DrawIteration_h
0002 #define DrawIteration_h
0003
0004
0005
0006 #include <vector>
0007 #include <map>
0008
0009 #include "TString.h"
0010 #include "TFile.h"
0011 #include "TGraph.h"
0012
0013
0014
0015 class DrawIteration{
0016 public:
0017 DrawIteration(unsigned int =0, const bool =false);
0018 ~DrawIteration();
0019
0020 void yAxisFixed(const bool yAxis){yAxisFixed_ = yAxis;}
0021
0022 void drawIteration(unsigned int =0, unsigned int =99999);
0023 void drawResult();
0024
0025 void addSystematics();
0026 void addCmsText(const TString&);
0027
0028 void addInputFile(const TString&, const TString&);
0029 void outputDirectory(const TString&);
0030
0031 private:
0032 struct ExtremeValues{
0033 ExtremeValues(const double minApe, const double maxApe, const double maxAbsCorr):
0034 minimumApe(minApe), maximumApe(maxApe), maxAbsCorrection(maxAbsCorr){}
0035 const double minimumApe;
0036 const double maximumApe;
0037 const double maxAbsCorrection;
0038 };
0039
0040 struct SectorValues{
0041 SectorValues(){}
0042 std::map<unsigned int, std::string*> m_sectorName;
0043 std::map<unsigned int, std::vector<double> > m_sectorValueX;
0044 std::map<unsigned int, std::vector<double> > m_sectorValueY;
0045 };
0046
0047 SectorValues getSectorValues(TFile*);
0048 ExtremeValues getGraphs(const std::string, unsigned int, unsigned int);
0049 void drawCorrections(const std::string&, const ExtremeValues&, const std::string&);
0050 void printFinalValues(unsigned int, unsigned int);
0051 void clear();
0052
0053 std::vector<std::vector<std::string> > arrangeHists();
0054 std::vector<std::string> pixelHist();
0055 std::vector<std::string> barrelHist();
0056 std::vector<std::string> tibHist();
0057 std::vector<std::string> tobHist();
0058 std::vector<std::string> endcapHist();
0059 std::vector<std::string> tidHist();
0060 std::vector<std::string> tecHist();
0061 TString associateLabel(const std::string&);
0062 unsigned int sectorNumber(const std::string&);
0063 void drawFinals(const std::string&);
0064 bool createResultHist(TH1*&, const std::vector<std::string>&, const std::string&, SectorValues&, unsigned int);
0065
0066 const TString* outpath_;
0067 TFile* file_;
0068 const bool overlayMode_;
0069 bool yAxisFixed_;
0070
0071 SectorValues sectorValues_;
0072
0073 std::vector<TGraph*> v_graphApeX_;
0074 std::vector<TGraph*> v_graphCorrectionX_;
0075 std::vector<TGraph*> v_graphApeY_;
0076 std::vector<TGraph*> v_graphCorrectionY_;
0077
0078 std::vector<std::vector<std::string> > v_resultHist_;
0079 bool systematics_;
0080 TString cmsText_;
0081
0082 struct Input{
0083 Input(TString name, TString legend): fileName(name), legendEntry(legend), file(0){}
0084
0085 TString fileName;
0086 TString legendEntry;
0087 TFile* file;
0088
0089 SectorValues sectorValues;
0090 };
0091
0092 std::vector<Input*> v_input_;
0093 };
0094
0095
0096
0097
0098
0099 #endif
0100
0101
0102
0103