CMS 3D CMS Logo

Typedefs | Functions | Variables

CMSSW_4_4_3_patch1/src/Validation/RecoTau/plugins/DQMHistPlotter.cc File Reference

#include "Validation/RecoTau/plugins/DQMHistPlotter.h"
#include "Validation/RecoTau/plugins/dqmAuxFunctions.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DQMServices/Core/interface/DQMStore.h"
#include "FWCore/ServiceRegistry/interface/Service.h"
#include "DQMServices/Core/interface/MonitorElement.h"
#include <TCanvas.h>
#include <TPad.h>
#include <TPostScript.h>
#include <TStyle.h>
#include <TROOT.h>
#include <TMath.h>
#include <iostream>
#include "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Typedefs

typedef std::pair< TH1
*, std::string > 
histoDrawEntry

Functions

template<class T >
void checkCfgDef (const std::string &cfgEntryName, std::map< std::string, T > &def, int &errorFlag, const std::string &defType, const std::string &drawJobName)
template<class T >
void checkCfgDefs (const std::vector< std::string > &cfgEntryNames, std::map< std::string, T > &def, int &errorFlag, const std::string &defType, const std::string &drawJobName)
 DEFINE_FWK_MODULE (DQMHistPlotter)
void drawHistograms (const std::list< histoDrawEntry > &histogramList, bool &isFirstHistogram)
bool find_vstring (const std::vector< std::string > &vs, const std::string &s)
template<class T >
const TfindCfgDef (const std::string &cfgEntryName, std::map< std::string, T > &def, const std::string &defType, const std::string &drawJobName)

Variables

const int defaultCanvasSizeX = 800
const int defaultCanvasSizeY = 600
const bool defaultDoOverlayPlots = false
const std::string defaultDrawOption = ""
const std::string defaultDrawOptionLegend = "lpf"
const int defaultFillColor = 0
const int defaultFillStyle = 1001
const int defaultLabelBorderSize = 0
const int defaultLabelFillColor = 0
const std::string defaultLabelOptions = "brNDC"
const double defaultLabelPosX = 0.66
const double defaultLabelPosY = 0.82
const double defaultLabelSizeX = 0.26
const double defaultLabelSizeY = 0.10
const int defaultLabelTextAlign = 22
const double defaultLabelTextAngle = 0.
const int defaultLabelTextColor = 1
const double defaultLabelTextSize = 0.05
const int defaultLegendBorderSize = 0
const int defaultLegendFillColor = 0
const std::string defaultLegendHeader = ""
const std::string defaultLegendOptions = "brNDC"
const double defaultLegendPosX = 0.50
const double defaultLegendPosY = 0.55
const double defaultLegendSizeX = 0.39
const double defaultLegendSizeY = 0.34
const int defaultLineColor = 0
const int defaultLineStyle = 1
const int defaultLineWidth = 2
const int defaultMarkerColor = 1
const int defaultMarkerSize = 1
const int defaultMarkerStyle = 2
const double defaultMaxX = -1.
const double defaultMaxY_linear = -1.
const double defaultMaxY_log = -1.
const double defaultMinX = -1.
const double defaultMinY_linear = 0.
const double defaultMinY_log = 1.e-2
const double defaultScaleFactor = 1.
const double defaultXaxisTitleOffset = 1.0
const double defaultXaxisTitleSize = 0.05
const double defaultYaxisMaximumScaleFactor_linear = 1.6
const double defaultYaxisMaximumScaleFactor_log = 5.e+2
const double defaultYaxisTitleOffset = 1.0
const double defaultYaxisTitleSize = 0.05
const std::string defaultYscale = yScale_linear
const std::string drawOption_eBand = "eBand"
const std::string drawOptionSeparator = "#.#"
const std::string type_bsmMC = "bsmMC"
const std::string type_Data = "Data"
const std::string type_smMC = "smMC"
const std::string type_smSumMC = "smSumMC"
const int verbosity = 0
const std::string yScale_linear = "linear"
const std::string yScale_log = "log"

Typedef Documentation

typedef std::pair<TH1*, std::string> histoDrawEntry

Definition at line 136 of file DQMHistPlotter.cc.


Function Documentation

template<class T >
void checkCfgDef ( const std::string &  cfgEntryName,
std::map< std::string, T > &  def,
int &  errorFlag,
const std::string &  defType,
const std::string &  drawJobName 
)

Definition at line 100 of file DQMHistPlotter.cc.

Referenced by checkCfgDefs().

{
  if ( def.find(cfgEntryName) == def.end() ) {
    edm::LogError ("checkCfgDef") << " " << defType << " = " << cfgEntryName << " undefined, needed by drawJob = " << drawJobName << " !!";
    errorFlag = 1;
  }
}
template<class T >
void checkCfgDefs ( const std::vector< std::string > &  cfgEntryNames,
std::map< std::string, T > &  def,
int &  errorFlag,
const std::string &  defType,
const std::string &  drawJobName 
)

Definition at line 110 of file DQMHistPlotter.cc.

References checkCfgDef().

{
  for ( std::vector<std::string>::const_iterator cfgEntryName = cfgEntryNames.begin();
        cfgEntryName != cfgEntryNames.end(); ++cfgEntryName ) {
    checkCfgDef(*cfgEntryName, def, errorFlag, defType, drawJobName);
  }
}
DEFINE_FWK_MODULE ( DQMHistPlotter  )
void drawHistograms ( const std::list< histoDrawEntry > &  histogramList,
bool &  isFirstHistogram 
)

Definition at line 138 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::endRun().

{
  for ( std::list<histoDrawEntry>::const_iterator it = histogramList.begin();
        it != histogramList.end(); ++it ) {
    std::string drawOption = ( isFirstHistogram ) ? it->second : std::string(it->second).append("same");
    it->first->Draw(drawOption.data());
    isFirstHistogram = false;
  }
}
bool find_vstring ( const std::vector< std::string > &  vs,
const std::string &  s 
)

Definition at line 152 of file DQMHistPlotter.cc.

References asciidump::s.

Referenced by DQMHistPlotter::DQMHistPlotter().

{
  for ( std::vector<std::string>::const_iterator it = vs.begin();
        it != vs.end(); ++it ) {
    if ( (*it) == s ) return true;
  }
  return false;
}
template<class T >
const T* findCfgDef ( const std::string &  cfgEntryName,
std::map< std::string, T > &  def,
const std::string &  defType,
const std::string &  drawJobName 
)

Definition at line 120 of file DQMHistPlotter.cc.

References NULL.

{
  typename std::map<std::string, T>::const_iterator it = def.find(cfgEntryName);
  if ( it != def.end() ) {
    return &(it->second);
  } else {
    edm::LogError ("findCfgDef") << " " << defType << " = " << cfgEntryName << " undefined, needed by drawJob = " << drawJobName << " !!";
    return NULL;
  } 
}

Variable Documentation

const int defaultCanvasSizeX = 800

Definition at line 92 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::DQMHistPlotter().

const int defaultCanvasSizeY = 600

Definition at line 93 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::DQMHistPlotter().

const bool defaultDoOverlayPlots = false

Definition at line 89 of file DQMHistPlotter.cc.

const std::string defaultDrawOption = ""
const std::string defaultDrawOptionLegend = "lpf"
const int defaultFillColor = 0
const int defaultFillStyle = 1001
const int defaultLabelBorderSize = 0

Definition at line 67 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const int defaultLabelFillColor = 0

Definition at line 68 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const std::string defaultLabelOptions = "brNDC"

Definition at line 66 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const double defaultLabelPosX = 0.66

Definition at line 62 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const double defaultLabelPosY = 0.82

Definition at line 63 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const double defaultLabelSizeX = 0.26

Definition at line 64 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const double defaultLabelSizeY = 0.10

Definition at line 65 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const int defaultLabelTextAlign = 22

Definition at line 71 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const double defaultLabelTextAngle = 0.

Definition at line 72 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const int defaultLabelTextColor = 1

Definition at line 69 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const double defaultLabelTextSize = 0.05

Definition at line 70 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLabel::cfgEntryLabel().

const int defaultLegendBorderSize = 0

Definition at line 58 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLegend::cfgEntryLegend().

const int defaultLegendFillColor = 0

Definition at line 59 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLegend::cfgEntryLegend().

const std::string defaultLegendHeader = ""

Definition at line 56 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLegend::cfgEntryLegend().

const std::string defaultLegendOptions = "brNDC"

Definition at line 57 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryLegend::cfgEntryLegend().

const double defaultLegendPosX = 0.50
const double defaultLegendPosY = 0.55
const double defaultLegendSizeX = 0.39
const double defaultLegendSizeY = 0.34
const int defaultLineColor = 0
const int defaultLineStyle = 1
const int defaultLineWidth = 2
const int defaultMarkerColor = 1
const int defaultMarkerSize = 1
const int defaultMarkerStyle = 2
const double defaultMaxX = -1.
const double defaultMaxY_linear = -1.
const double defaultMaxY_log = -1.
const double defaultMinX = -1.
const double defaultMinY_linear = 0.

Definition at line 37 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisY::cfgEntryAxisY().

const double defaultMinY_log = 1.e-2

Definition at line 38 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisY::cfgEntryAxisY().

const double defaultScaleFactor = 1.

Definition at line 24 of file DQMHistPlotter.cc.

const double defaultXaxisTitleOffset = 1.0

Definition at line 33 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisX::cfgEntryAxisX().

const double defaultXaxisTitleSize = 0.05

Definition at line 34 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisX::cfgEntryAxisX().

Definition at line 46 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisY::applyTo().

const double defaultYaxisMaximumScaleFactor_log = 5.e+2

Definition at line 47 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisY::applyTo().

const double defaultYaxisTitleOffset = 1.0

Definition at line 44 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisY::cfgEntryAxisY().

const double defaultYaxisTitleSize = 0.05

Definition at line 45 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisY::cfgEntryAxisY().

const std::string defaultYscale = yScale_linear

Definition at line 43 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::cfgEntryAxisY::cfgEntryAxisY().

const std::string drawOption_eBand = "eBand"

Definition at line 86 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::endRun().

const std::string drawOptionSeparator = "#.#"

Definition at line 95 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::DQMHistPlotter().

const std::string type_bsmMC = "bsmMC"

Definition at line 26 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::DQMHistPlotter(), and DQMHistPlotter::endRun().

const std::string type_Data = "Data"

Definition at line 28 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::DQMHistPlotter(), and DQMHistPlotter::endRun().

const std::string type_smMC = "smMC"

Definition at line 25 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::DQMHistPlotter(), and DQMHistPlotter::endRun().

const std::string type_smSumMC = "smSumMC"

Definition at line 27 of file DQMHistPlotter.cc.

Referenced by DQMHistPlotter::DQMHistPlotter(), and DQMHistPlotter::endRun().

const int verbosity = 0

Definition at line 97 of file DQMHistPlotter.cc.

const std::string yScale_linear = "linear"

Definition at line 41 of file DQMHistPlotter.cc.

const std::string yScale_log = "log"