CMS 3D CMS Logo

Functions

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch1/src/PhysicsTools/Utilities/src/SideBandSubtraction.cc File Reference

#include "PhysicsTools/Utilities/interface/SideBandSubtraction.h"
#include <iostream>
#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

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

Definition at line 140 of file SideBandSubtraction.cc.

Referenced by SideBandSubtract::printResults().

{
  TCanvas genericCanvas;
  plot->Draw("E1P0");
  outname = outname + ".eps";
  genericCanvas.SaveAs(outname.c_str());
  outname.replace(outname.size()-3,3,"gif");
  genericCanvas.SaveAs(outname.c_str());
}
static void setHistOptions ( TH1F *  histo,
string  name,
string  title,
string  axis_label 
) [static]

Definition at line 68 of file SideBandSubtraction.cc.

Referenced by SideBandSubtract::doSubtraction().

{

  histo->SetName(name.c_str());
  histo->SetTitle(title.c_str());
  if(axis_label == "GeV/c^2")
    axis_label = "Mass (" + axis_label + ")";
  if(axis_label == "GeV/c")
    axis_label = "Momentum (" + axis_label + ")";
  histo->GetXaxis()->SetTitle(axis_label.c_str());
}
template<class T >
std::string stringify ( const T t) [inline]

Definition at line 43 of file SideBandSubtraction.cc.

References python::connectstrParser::o.

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

{
  std::ostringstream o;
  if (!(o << t))
    return "err";
  return o.str();
}