Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Draw_hitmap.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file Draw_hitmap.C
1 #include "Style.h"
2 
3 void Draw_hitmap(int runnum=732, const bool bSAVE=false){
4 
5  gStyle->SetOptStat(0);
6 
7  const int nstave = 4;
8  const int nchip = 9;
9 
10  TFile *infile = new TFile(Form("MvtxPrototype2Eval-%08d-0200.root",runnum),"read");
11  assert(infile);
12 
13  TH2D *h2d_hit[nstave];
14 
15  for (int is=0; is<nstave; is++){
16  h2d_hit[is] = (TH2D*)infile->Get(Form("h2d_hit_stave%d",is));
17  assert(h2d_hit[is])
18  }
19 
20  TCanvas *c1 = new TCanvas("c1", "c1", 300*nchip, 150*nstave);
21  c1->Divide(1,nstave);
22 
23  for (int istave=0; istave<nstave; istave++){
24  c1->cd(istave + 1);
25  SetPadStyle();
26  gPad->SetRightMargin(0.01);
27  gPad->SetTopMargin(0.05);
28 
29  htmp = (TH1D*)h2d_hit[istave];
30  SetHistoStyle("COL","ROW","", 0.07, 0.06);
31  h2d_hit[istave]->Draw("box");
32 
33  TLatex *tex = new TLatex(100,400,Form("Stave%d", istave));
34  tex->SetTextSize(0.07);
35  tex->Draw();
36  }
37 
38  if (bSAVE){
39  c1->cd();
40  c1->SaveAs(Form("./20190503/hitmap_%08d.pdf", runnum));
41  }
42 }