Skip to content

Commit

Permalink
adding function for custom PU weighting
Browse files Browse the repository at this point in the history
  • Loading branch information
awhitbeck committed Feb 23, 2017
1 parent 13ebbaf commit 1ecd05e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/definitions.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#include "TRandom.h"
#include "TLorentzVector.h"
#include "TH1F.h"
#include "TFile.h"

// constants
// ==============================================
double bbtagCut = 0.4;
TFile* puWeightFile = new TFile("PileupHistograms_0121_69p2mb_pm4p6.root");
TH1F* puWeightHist = (TH1F*) puWeightFile->Get("pu_weights_down");
// ==============================================

double CalcdPhi( double phi1 , double phi2 ){
Expand Down Expand Up @@ -42,7 +46,6 @@ template<typename ntupleType>void ntupleBranchStatus(ntupleType* ntuple){
/******************************************************************/
/* - - - - - - - - - - - - cut flow function - - - - - - - - - - */
/******************************************************************/

template<typename ntupleType> bool cutFlow_none(ntupleType* ntuple){
return true;
}
Expand Down Expand Up @@ -88,6 +91,14 @@ template<typename ntupleType> double dRweights(ntupleType* ntuple){
double intercept,slope;
return 1./(min(ntuple->HT,900.)*slope+intercept);
}
template<typename ntupleType> double customPUweights(ntupleType* ntuple){
int nVtx = ntuple->NVtx;
return puWeightHist->GetBinContent(puWeightHist->FindBin(nVtx));
}
template<typename ntupleType> double dRweights(ntupleType* ntuple){
double intercept,slope;
return 1./(min(ntuple->HT,900.)*slope+intercept);
}

template<typename ntupleType> double GJets0p4Weights(ntupleType* ntuple){
if( ntuple->GenHT > 100. && ntuple->GenHT < 200. )
Expand Down

0 comments on commit 1ecd05e

Please sign in to comment.