1 #include "../CommonTools.h"
3 #include <sPhenixStyle.C>
5 TCanvas*
Draw( TFile* qa_file_new, TFile* qa_file_ref,
const TString&
hist_name_prefix,
const TString& tag );
13 TFile *reff = TFile::Open(reffile.c_str());
14 TFile *newf = TFile::Open(newfile.c_str());
27 TFile *outfilef =
new TFile(outfile.c_str(),
"recreate");
42 TCanvas*
Draw( TFile* qa_file_new, TFile* qa_file_ref,
const TString&
hist_name_prefix,
const TString& tag )
45 const TString
prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
47 auto cv =
new TCanvas(
48 TString(
"QA_Draw_Tpc_") + tag + TString(
"_") + hist_name_prefix,
49 TString(
"QA_Draw_Tpc_") + tag + TString(
"_") + hist_name_prefix,
57 auto hnew =
static_cast<TH1*
>( qa_file_new->GetObjectChecked( Form(
"%s%s_%i", prefix.Data(), tag.Data(), region ),
"TH1" ) );
58 hnew->Scale( 1./hnew->GetEntries() );
62 auto href = qa_file_ref ?
static_cast<TH1*
>( qa_file_ref->GetObjectChecked( Form(
"%s%s_%i", prefix.Data(), tag.Data(), region ),
"TH1" ) ) :
nullptr;
65 href->Scale( 1./href->GetEntries() );
81 TCanvas*
Draw_eff( TFile* qa_file_new, TFile* qa_file_ref,
const TString& hist_name_prefix,
const TString& tag )
84 const TString prefix = TString(
"h_") + hist_name_prefix + TString(
"_");
86 auto cv =
new TCanvas(
87 TString(
"QA_Draw_Tpc_") + tag + TString(
"_") + hist_name_prefix,
88 TString(
"QA_Draw_Tpc_") + tag + TString(
"_") + hist_name_prefix,
92 auto hnew0 =
static_cast<TH1*
>( qa_file_new->GetObjectChecked( Form(
"%s%s_0", prefix.Data(), tag.Data()),
"TH1" ) );
93 auto hnew1 =
static_cast<TH1*
>( qa_file_new->GetObjectChecked( Form(
"%s%s_1", prefix.Data(), tag.Data()),
"TH1" ) );
95 hnew1->Divide(hnew1, hnew0, 1, 1,
"B");
99 auto href0 = qa_file_ref ?
static_cast<TH1*
>( qa_file_ref->GetObjectChecked( Form(
"%s%s_0", prefix.Data(), tag.Data()),
"TH1" ) ) :
nullptr;
100 auto href1 = qa_file_ref ?
static_cast<TH1*
>( qa_file_ref->GetObjectChecked( Form(
"%s%s_1", prefix.Data(), tag.Data()),
"TH1" ) ) :
nullptr;
103 href1->Divide(href1, href0, 1, 1,
"B");
104 href1->SetMinimum(0);