Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:20:34

0001 #include "Style.h"
0002 
0003 void Draw_hitmap(int runnum=732, const bool bSAVE=false){
0004 
0005   gStyle->SetOptStat(0);
0006 
0007   const int nstave = 4;
0008   const int nchip = 9;
0009 
0010   TFile *infile = new TFile(Form("MvtxPrototype2Eval-%08d-0200.root",runnum),"read");
0011   assert(infile);
0012 
0013   TH2D *h2d_hit[nstave];
0014 
0015   for (int is=0; is<nstave; is++){
0016     h2d_hit[is] = (TH2D*)infile->Get(Form("h2d_hit_stave%d",is));
0017     assert(h2d_hit[is])
0018   }
0019 
0020   TCanvas *c1 = new TCanvas("c1", "c1", 300*nchip, 150*nstave);
0021   c1->Divide(1,nstave);
0022 
0023   for (int istave=0; istave<nstave; istave++){
0024     c1->cd(istave + 1);
0025     SetPadStyle();
0026     gPad->SetRightMargin(0.01);
0027     gPad->SetTopMargin(0.05);
0028 
0029     htmp = (TH1D*)h2d_hit[istave];
0030     SetHistoStyle("COL","ROW","", 0.07, 0.06);
0031     h2d_hit[istave]->Draw("box");
0032 
0033     TLatex *tex = new TLatex(100,400,Form("Stave%d", istave));
0034     tex->SetTextSize(0.07);
0035     tex->Draw();
0036   }
0037 
0038   if (bSAVE){
0039     c1->cd();
0040     c1->SaveAs(Form("./20190503/hitmap_%08d.pdf", runnum));
0041   }
0042 }