15void BmnHist::DrawRef(unique_ptr<TCanvas>& canGemStrip, vector<PadInfo*>* canGemStripPads)
17 DrawRef(canGemStrip.get(), canGemStripPads);
22 for (
size_t iPad = 0; iPad < canPads->size(); iPad++) {
23 TPad* pad =
static_cast<TPad*
>(
can->cd(iPad + 1));
24 PadInfo* info = canPads->at(iPad);
25 if ((!pad) || (!info))
47 maxy = info->
current->GetBinContent(info->
current->GetMaximumBin());
50 maxy = TMath::Max(maxy, info->
ref->GetMaximum() * info->
current->Integral() / info->
ref->Integral());
52 maxy = TMath::Max(maxy, info->
ref->GetMaximum());
55 if (info->
aux.size()) {
56 for (
size_t it = 0; it < info->
aux.size(); it++) {
57 auto h_aux = info->
aux.at(it);
58 maxy = TMath::Max(maxy, h_aux->GetBinContent(h_aux->GetMaximumBin()));
60 if (info->
aux[0]->Integral() > 0)
61 info->
aux[0]->SetMaximum(1.2 * maxy);
64 if (info->
current->Integral() > 0)
65 info->
current->SetMaximum(1.2 * maxy);
69 info->
ref->DrawNormalized((info->
opt +
"same").c_str(), info->
current->Integral());
71 info->
ref->Draw((info->
opt +
"same").c_str());
74 for (
size_t it = 0; it < info->
aux.size(); it++) {
75 auto h = info->
aux.at(it);
77 TString opt = (it || info->
current) ?
"same " :
"";
78 if (it < info->auxOpt.size())
79 opt += info->
auxOpt.at(it);
91 info->
temp->GetDirectory()->cd();
93 (info->
opt +
" goff").c_str());
103 vector<PadInfo*> canPads,
104 vector<TString> Names)
111 printf(
"Loading ref histos\n");
112 TFile*
refFile =
new TFile(FullName,
"read");
113 if (
refFile->IsOpen() ==
false) {
114 printf(
"Cannot open file %s !\n", FullName.Data());
117 TString refName = Form(
"ref%06d_",
refID);
118 for (
size_t iPad = 0; iPad < canPads.size(); iPad++) {
124 TString name = info->
current->GetName();
128 tempH =
static_cast<TH1*
>(
refFile->Get(refName + fTitle +
"_hists/" + refName + name));
130 tempH =
static_cast<TH1*
>(
refFile->Get(fTitle +
"_hists/" + name));
133 printf(
"Cannot load %s !\n", name.Data());
136 info->
ref =
static_cast<TH1*
>(tempH->Clone(refName + name));
137 info->
ref->SetLineColor(kRed);
138 info->
ref->SetDirectory(0);
139 printf(
"Loaded %s \n", info->
ref->GetName());
150 info->current->Reset();
153 for (
auto& h : info->aux)
170 TVirtualPad* pad = info->padPtr;
197 h->SetTitleSize(0.07,
"XY");
198 h->SetLabelSize(0.07,
"XY");
199 h->GetXaxis()->SetTitleColor(kOrange + 10);
200 h->GetXaxis()->SetTitleOffset(0.7);
201 h->GetXaxis()->SetTitleSize(0.06);
202 h->GetYaxis()->SetTitleColor(kOrange + 10);
203 h->GetYaxis()->SetTitleOffset(0.6);
static void DrawRef(unique_ptr< TCanvas > &canGemStrip, vector< PadInfo * > *canGemStripPads)
static void DrawPad(TVirtualPad *pad, PadInfo *info)
static BmnStatus DrawPadFromTree(BmnPadBranch *br)
static void ResetPadTree(BmnPadBranch *br)
static void FillPad(PadInfo *info, TTree *tree)
static void SetHistStyleTH1(TH1 *h)
static BmnStatus FillPadFromTree(BmnPadBranch *br, TTree *tree)
static BmnStatus LoadRefRun(Int_t refID, TString FullName, TString fTitle, vector< PadInfo * > canPads, vector< TString > Names)
BmnHist(Int_t periodID=7, BmnSetup setup=kBMNSETUP)
vector< BmnPadBranch * > & GetBranchesRef()
Storage for pad content and it's options.