Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:13:11

0001 #ifndef BTagDifferentialPlot_H
0002 #define BTagDifferentialPlot_H
0003 
0004 // #include "BTagPlotPrintC.h"
0005 
0006 #include "TH1F.h"
0007 #include "TCanvas.h"
0008 
0009 #include <vector>
0010 #include <string>
0011 
0012 #include "DQMOffline/RecoB/interface/EtaPtBin.h"
0013 #include "DQMOffline/RecoB/interface/JetTagPlotter.h"
0014 #include "DQMServices/Core/interface/DQMStore.h"
0015 
0016 class BTagDifferentialPlot {
0017 public:
0018   typedef dqm::legacy::DQMStore DQMStore;
0019   typedef dqm::legacy::MonitorElement MonitorElement;
0020 
0021   enum ConstVarType { constPT, constETA };
0022 
0023   BTagDifferentialPlot(double bEff, const ConstVarType& constVariable, const std::string& tagName, unsigned int mc);
0024 
0025   ~BTagDifferentialPlot();
0026 
0027   void addBinPlotter(std::shared_ptr<JetTagPlotter> aPlotter) { theBinPlotters.push_back(aPlotter); }
0028 
0029   void process(DQMStore::IBooker& ibook);
0030 
0031   void epsPlot(const std::string& name);
0032 
0033   void psPlot(const std::string& name);
0034 
0035   void plot(TCanvas& theCanvas);
0036 
0037   void plot(const std::string& name, const std::string& ext);
0038 
0039   //   void print() const;
0040 
0041   TH1F* getDifferentialHistoB_d() { return theDifferentialHistoB_d->getTH1F(); }
0042   TH1F* getDifferentialHistoB_u() { return theDifferentialHistoB_u->getTH1F(); }
0043   TH1F* getDifferentialHistoB_s() { return theDifferentialHistoB_s->getTH1F(); }
0044   TH1F* getDifferentialHistoB_c() { return theDifferentialHistoB_c->getTH1F(); }
0045   TH1F* getDifferentialHistoB_b() { return theDifferentialHistoB_b->getTH1F(); }
0046   TH1F* getDifferentialHistoB_g() { return theDifferentialHistoB_g->getTH1F(); }
0047   TH1F* getDifferentialHistoB_ni() { return theDifferentialHistoB_ni->getTH1F(); }
0048   TH1F* getDifferentialHistoB_dus() { return theDifferentialHistoB_dus->getTH1F(); }
0049   TH1F* getDifferentialHistoB_dusg() { return theDifferentialHistoB_dusg->getTH1F(); }
0050   TH1F* getDifferentialHistoB_pu() { return theDifferentialHistoB_pu->getTH1F(); }
0051 
0052 private:
0053   void setVariableName();
0054 
0055   void bookHisto(DQMStore::IBooker& ibook);
0056 
0057   void fillHisto();
0058   std::pair<double, double> getMistag(const double& fixedBEfficiency, TH1F* effPurHist);
0059 
0060   // the fixed b-efficiency(later: allow more than one) for which the misids have to be plotted
0061   double fixedBEfficiency;
0062 
0063   // flag if processing should be skipped
0064   bool noProcessing;
0065   bool processed;
0066 
0067   ConstVarType constVar;
0068   // the name for the variable with constant value
0069   std::string constVariableName;
0070   // the name of the variable to be plotted on the x-axis(e.g. "eta", "pt")
0071   std::string diffVariableName;
0072 
0073   // value of the constant variable(lower/upper edge of interval)
0074   std::pair<double, double> constVariableValue;
0075 
0076   // the common name to describe histograms
0077   std::string commonName;
0078 
0079   // the input
0080   std::vector<std::shared_ptr<JetTagPlotter>> theBinPlotters;
0081 
0082   // the histo to create/fill
0083   MonitorElement* theDifferentialHistoB_d;
0084   MonitorElement* theDifferentialHistoB_u;
0085   MonitorElement* theDifferentialHistoB_s;
0086   MonitorElement* theDifferentialHistoB_c;
0087   MonitorElement* theDifferentialHistoB_b;
0088   MonitorElement* theDifferentialHistoB_g;
0089   MonitorElement* theDifferentialHistoB_ni;
0090   MonitorElement* theDifferentialHistoB_dus;
0091   MonitorElement* theDifferentialHistoB_dusg;
0092   MonitorElement* theDifferentialHistoB_pu;
0093 
0094   //flavour histograms choice
0095   unsigned int mcPlots_;
0096 };
0097 
0098 #endif