3 #include <calobase/TowerInfoDefs.h>
17 R__LOAD_LIBRARY(libcalo_reco.so)
23 gSystem->Load(
"libg4dst.so");
31 int runList[] = {21796, 21615, 21599, 21598, 21518, 21520};
36 TCanvas *
c =
new TCanvas(
"c1",
"c1",0,50,1400,1000);
38 TPad** pad_arr =
new TPad*[nRuns];
40 for (
int i=0;
i<nRuns;
i++)
48 for (
int i=0;
i<nRuns;
i++)
51 std::cout <<
"Starting run " << runnumber <<
"; setting recoConsts\n";
57 std::cout <<
"Could not get Dead Map for CDB. Detector: " <<
"CEMC" << std::endl;
64 std::cout <<
"No CDB TTree found from url " << url << std::endl;
68 std::cout <<
"Creating hist " << Form(
"h_deadmap_%d", runnumber) <<
"\n";
69 hists[
i] =
new TH2F(Form(
"h_deadmap_%d", runnumber),
70 Form(
"Dead Tower Map - Run %d;i#phi;i#eta", runnumber),
71 phibins, -0.5, 255.5, etabins, -0.5, 95.5);
72 hists[
i]->SetStats(0);
82 if (status > 0) isDead = 1.0;
83 hists[
i]->Fill(iphi, ieta, isDead);
87 std::cout <<
"Drawing hist " << Form(
"h_deadmap_%d", runnumber) <<
"\n";
88 hists[
i]->Draw(
"colz");
91 std::cout <<
"Final plotting, saving plot\n";
93 c->SaveAs(
"emcal_deadmaps_QMruns.pdf(");
96 TH2F* h_nDeadRuns =
new TH2F(
"h_nDeadRuns",
97 "Number of Bad Runs by Tower;i#phi;i#eta",
98 phibins, -0.5, 255.5, etabins, -0.5, 95.5);
99 h_nDeadRuns->SetStats(0);
100 for (
int i=0;
i<nRuns;
i++) {
101 h_nDeadRuns->Add(hists[
i]);
105 h_nDeadRuns->Draw(
"colz");
107 c->SaveAs(
"emcal_deadmaps_QMruns.pdf");
110 for (
int i=0;
i<3;
i++) {
111 morehists[
i] =
new TH2F(Form(
"h_more_%d", (
i+1)),
112 Form(
"Towers Dead in %d or More Runs;i#phi;i#eta", (
i+2)),
113 phibins, -0.5, 255.5, etabins, -0.5, 95.5);
114 morehists[
i]->SetStats(0);
116 for (
int k=0;
k<etabins;
k++) {
117 int globalbin = h_nDeadRuns->GetBin(
j,
k);
118 float fillvalue = 0.001;
119 if (h_nDeadRuns->GetBinContent(globalbin) >= (
i+2)) fillvalue = 1;
120 morehists[
i]->Fill(
j,
k, fillvalue);
126 morehists[0]->Draw(
"colz");
127 c->SaveAs(
"emcal_deadmaps_QMruns.pdf");
129 morehists[1]->Draw(
"colz");
130 c->SaveAs(
"emcal_deadmaps_QMruns.pdf");
132 morehists[2]->Draw(
"colz");
133 c->SaveAs(
"emcal_deadmaps_QMruns.pdf)");