CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

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

Definition at line 142 of file SideBandSubtraction.cc.

Referenced by SideBandSubtract::printResults().

143 {
144  TCanvas genericCanvas;
145  plot->Draw("E1P0");
146  outname = outname + ".eps";
147  genericCanvas.SaveAs(outname.c_str());
148  outname.replace(outname.size()-3,3,"gif");
149  genericCanvas.SaveAs(outname.c_str());
150 }
static void setHistOptions ( TH1F *  histo,
string  name,
string  title,
string  axis_label 
)
static

Definition at line 70 of file SideBandSubtraction.cc.

Referenced by SideBandSubtract::doSubtraction().

71 {
72 
73  histo->SetName(name.c_str());
74  histo->SetTitle(title.c_str());
75  if(axis_label == "GeV/c^2")
76  axis_label = "Mass (" + axis_label + ")";
77  if(axis_label == "GeV/c")
78  axis_label = "Momentum (" + axis_label + ")";
79  histo->GetXaxis()->SetTitle(axis_label.c_str());
80 }
template<class T >
std::string stringify ( const T t)
inline

Definition at line 45 of file SideBandSubtraction.cc.

References python.connectstrParser::o.

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

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