Skip to content

Commit

Permalink
fix ratio for profiles, also note: profiles do work with Add, just no…
Browse files Browse the repository at this point in the history
…t with data-driven bkg reweighting
  • Loading branch information
kpedro88 committed Apr 23, 2015
1 parent 95a48cc commit 7c17d9a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion KCode/KSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#include <TROOT.h>
#include <TFile.h>
#include <TH1.h>
#include <TH2.h>
#include <TProfile.h>
#include <THStack.h>

//STL headers
Expand Down Expand Up @@ -497,7 +499,11 @@ class KSetRatio: public KSet {
hsim0->SetBinError(b,0);
}

hrat->Divide(hdata,hsim0);
if(hrat->InheritsFrom(TProfile::Class())) {
hrat = static_cast<TProfile*>(hrat)->ProjectionX();
hrat->Divide(static_cast<TProfile*>(hdata)->ProjectionX(),static_cast<TProfile*>(hsim0)->ProjectionX());
}
else hrat->Divide(hdata,hsim0);
Color_t color;
localOpt->Get("color",color);
//formatting
Expand Down

0 comments on commit 7c17d9a

Please sign in to comment.