ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/OSUT3Analysis/AnaTools/src/PUWeight.cc
Revision: 1.1
Committed: Fri Nov 23 11:25:00 2012 UTC (12 years, 5 months ago) by ahart
Content type: text/plain
Branch: MAIN
CVS Tags: V00-00-01
Log Message:
First commit of the PUWeight class.

File Contents

# User Rev Content
1 ahart 1.1 #include "OSUT3Analysis/AnaTools/interface/PUWeight.h"
2    
3     PUWeight::PUWeight (const string &puFile, const string &dataPU, const string &mcPU)
4     {
5     TFile *fin = TFile::Open (puFile.c_str ());
6     TH1D *mc = (TH1D *) fin->Get (mcPU.c_str ());
7     puWeight_ = (TH1D *) fin->Get (dataPU.c_str ());
8     mc->SetDirectory (0);
9     puWeight_->SetDirectory (0);
10     mc->Scale (puWeight_->Integral () / mc->Integral ());
11     puWeight_->Divide (mc);
12     fin->Close ();
13     delete mc;
14     }
15    
16     PUWeight::~PUWeight ()
17     {
18     delete puWeight_;
19     }