CMS 3D CMS Logo

Functions
SideBandSubtraction.cc File Reference
#include "PhysicsTools/Utilities/interface/SideBandSubtraction.h"
#include <iostream>
#include <ios>
#include <fstream>
#include <cstdlib>
#include <sstream>
#include <TCanvas.h>
#include <TFile.h>
#include <TF1.h>
#include <TH1F.h>
#include <TString.h>
#include <TKey.h>
#include <TClass.h>
#include <RooFitResult.h>
#include <RooRealVar.h>
#include <RooAbsPdf.h>
#include <RooDataSet.h>
#include <RooPlot.h>

Go to the source code of this file.

Functions

static void print_histo (TH1F *plot, string outname)
 
static void setHistOptions (TH1F *histo, string name, string title, string axis_label)
 
template<class T >
std::string stringify (const T &t)
 

Function Documentation

◆ print_histo()

static void print_histo ( TH1F *  plot,
string  outname 
)
static

Definition at line 142 of file SideBandSubtraction.cc.

References DeadROCCounter_Phase1::outname, and plotFactory::plot.

Referenced by SideBandSubtract::printResults().

142  {
143  TCanvas genericCanvas;
144  plot->Draw("E1P0");
145  outname = outname + ".eps";
146  genericCanvas.SaveAs(outname.c_str());
147  outname.replace(outname.size() - 3, 3, "gif");
148  genericCanvas.SaveAs(outname.c_str());
149 }

◆ setHistOptions()

static void setHistOptions ( TH1F *  histo,
string  name,
string  title,
string  axis_label 
)
static

Definition at line 68 of file SideBandSubtraction.cc.

References timingPdfMaker::histo, Skims_PA_cff::name, and runGCPTkAlMap::title.

Referenced by SideBandSubtract::doSubtraction().

68  {
69  histo->SetName(name.c_str());
70  histo->SetTitle(title.c_str());
71  if (axis_label == "GeV/c^2")
72  axis_label = "Mass (" + axis_label + ")";
73  if (axis_label == "GeV/c")
74  axis_label = "Momentum (" + axis_label + ")";
75  histo->GetXaxis()->SetTitle(axis_label.c_str());
76 }

◆ stringify()

template<class T >
std::string stringify ( const T t)
inline

Definition at line 45 of file SideBandSubtraction.cc.

References EcalTangentSkim_cfg::o, and submitPVValidationJobs::t.

Referenced by SideBandSubtract::addSideBandRegion(), SideBandSubtract::addSignalRegion(), and SideBandSubtract::saveResults().

45  {
46  std::ostringstream o;
47  if (!(o << t))
48  return "err";
49  return o.str();
50 }