1 #include "/phenix/u/shlim/Style.h"
7 const int nColor[4] = {1, 2, 4, 8};
10 double cut_val = 2.0e-4;
17 else if (
runnumber==121 ) cut_val = 1e10;
19 TFile *
infile =
new TFile(Form(
"MvtxQAHisto-%08d-%04d.root",
runnumber,segnumber),
"read");
23 TH1F *h1d_hit_per_evt[4];
26 TH1F *h1d_hit_trk_x[4];
27 TH1F *h1d_hit_trk_y[4];
34 for (
int ichip=0; ichip<4; ichip++){
35 h2d_hit[ichip] = (TH2F*)infile->Get(Form(
"h2d_hit_chip%d",ichip));
36 h2d_hit_trk[ichip] = (TH2F*)infile->Get(Form(
"h2d_hit_trk_chip%d",ichip));
37 h1d_hit_per_evt[ichip] = (TH1F*)infile->Get(Form(
"h1d_hit_per_evt_chip%d",ichip));
39 h1d_hit_x[ichip] = (TH1F*)h2d_hit[ichip]->ProjectionX(Form(
"h1d_hit_x_chip%d",ichip));
40 h1d_hit_y[ichip] = (TH1F*)h2d_hit[ichip]->
ProjectionY(Form(
"h1d_hit_y_chip%d",ichip));
41 h1d_hit_x[ichip]->SetLineColor(1);
42 h1d_hit_y[ichip]->SetLineColor(1);
44 h1d_hit_trk_x[ichip] = (TH1F*)h2d_hit_trk[ichip]->ProjectionX(Form(
"h1d_hit_trk_x_chip%d",ichip));
45 h1d_hit_trk_y[ichip] = (TH1F*)h2d_hit_trk[ichip]->
ProjectionY(Form(
"h1d_hit_trk_y_chip%d",ichip));
46 h1d_hit_trk_x[ichip]->SetLineColor(1);
47 h1d_hit_trk_y[ichip]->SetLineColor(1);
49 h1d_rate[ichip] =
new TH1F(Form(
"h1d_rate_chip%d",ichip),
"",5000,0.000005,0.1);
52 h1d_hit_norm = (TH1F*)infile->Get(
"h1d_hit_norm");
58 sprintf(fname,
"hotmap/hotmap_testbeam_%08d.txt",
runnumber);
63 TCanvas *c1 =
new TCanvas(
"c1",
"c1",150*1.1*4,150*4);
66 for (
int ichip=0; ichip<4; ichip++){
69 double norm = h1d_hit_norm->Integral();
70 cout <<
"CHIP: " << ichip <<
", EVT: " << norm << endl;
76 htmp = (TH1F*)h2d_hit[ichip];
78 htmp->GetXaxis()->SetLabelSize(0.08);
82 h2d_hit_cut[ichip] = (TH2F*)h2d_hit[ichip]->Clone(Form(
"h2d_hit_cut_%d",ichip));
84 for (
int ix=0; ix<h1d_hit_x[ichip]->GetNbinsX(); ix++){
85 for (
int iy=0; iy<h1d_hit_y[ichip]->GetNbinsX(); iy++){
87 if ( h2d_hit[ichip]->GetBinContent(ix+1,iy+1)<1 )
continue;
89 double val = h2d_hit[ichip]->GetBinContent(ix+1,iy+1)/
norm;
90 h1d_rate[ichip]->Fill(val);
93 h2d_hit_cut[ichip]->SetBinContent(ix+1,iy+1,0);
101 fpar << ichip <<
" 0 " << ichip <<
" " << ix <<
" " << iy << endl;
115 htmp = (TH1F*)h1d_rate[ichip];
117 htmp->SetMinimum(0.5);
118 htmp->GetXaxis()->SetLabelSize(0.08);
121 TLine *
line =
new TLine(cut_val, 0.5, cut_val,
htmp->GetMaximum());
122 line->SetLineWidth(2);
128 TH1F *
h1 = (TH1F*)h2d_hit_cut[ichip]->ProjectionX(Form(
"h1d_hit_cut_x_%d",ichip));
131 htmp->GetXaxis()->SetLabelSize(0.08);
137 h1 = (TH1F*)h2d_hit_cut[ichip]->
ProjectionY(Form(
"h1d_hit_cut_y_%d",ichip));
140 htmp->GetXaxis()->SetLabelSize(0.08);
143 cout <<
"N BAD CH: " << nbad[ichip] << endl;
152 TCanvas *c3 =
new TCanvas(
"c3",
"c3",200*1.1*2,200*2);
155 for (
int ichip=0; ichip<4; ichip++){
160 htmp = (TH1F*)gPad->DrawFrame(0,5,10,1.5*h1d_clus_size_x[ichip]->GetMaximum());
163 h1d_clus_size_x[ichip]->Draw(
"same");
164 h1d_clus_size_z[ichip]->Draw(
"same");