00001
#include "BEMCPlotsPresenter.h"
00002
#include <iostream>
00003
using namespace std;
00004
#include <TH1F.h>
00005
#include <TH2F.h>
00006
#include <TCanvas.h>
00007
#include <TLine.h>
00008
#include <TArrow.h>
00009
#include <TLatex.h>
00010
#include <TString.h>
00011
#include <TBox.h>
00012
#include <TEnv.h>
00013
00014
#include <GenericFile.h>
00015
00016
#include <StEmcUtil/database/StEmcDecoder.h>
00017
00018
#include "BEMCPlotsNames.h"
00019
#include "StRoot/StEmcPool/StBEMCPlots/BemcTwMask.h"
00020
00021
#define min(A, B) (((A) < (B)) ? (A) : (B))
00022
#define max(A, B) (((A) > (B)) ? (A) : (B))
00023
00024
00025
StEmcDecoder *BEMCDecoderPresenter = 0;
00026 Bool_t useDecoderForBoundaries =
false;
00027
00028
00029
00030 TH1 *GetHisto(FileType &fd,
const char *name) {
00031
00032 TH1 *hist = 0;
00033
00034 hist = fd.file() ? (TH1 *)fd.Get(name, 0) : 0;
00035
if (hist) hist->SetDirectory(0);
00036
00037
00038
00039
00040
return hist;
00041 }
00042
00043
00044
void BEMCPlotsPresenter::displayStatus(FileType file, TPad *pad,
int mDebug) {
00045
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00046
00047
if (!pad)
return;
00048 pad->Clear();
00049 pad->cd(0);
00050
00051 TH2F *Hist_TDC_status = (TH2F*)GetHisto(file, Hist_TDC_statusName);
00052
if (!Hist_TDC_status || (mDebug >= 2)) cout <<
"Hist_TDC_status = " << Hist_TDC_status << endl;
00053 TH2F *Hist_SMD_status = (TH2F*)GetHisto(file, Hist_SMD_statusName);
00054
if (!Hist_SMD_status || (mDebug >= 2)) cout <<
"Hist_SMD_status = " << Hist_SMD_status << endl;
00055 TH2F *Hist_PSD_status = (TH2F*)GetHisto(file, Hist_PSD_statusName);
00056
if (!Hist_PSD_status || (mDebug >= 2)) cout <<
"Hist_PSD_status = " << Hist_PSD_status << endl;
00057 TH1F *Hist_BTOW_Corruption = (TH1F*)GetHisto(file, Hist_BTOW_CorruptionName);
00058
if (!Hist_BTOW_Corruption || (mDebug >= 2)) cout <<
"Hist_BTOW_Corruption = " << Hist_BTOW_Corruption << endl;
00059
00060 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00061 c->Draw();
00062 c->cd(0);
00063 c->Divide(2, 2, 0.001, 0.001);
00064
00065 c->cd(1);
00066
if (Hist_TDC_status) {
00067 Hist_TDC_status->Draw(
"H COLZ");
00068 }
00069 c->cd(2);
00070
if (Hist_SMD_status) {
00071 Hist_SMD_status->Draw(
"H COLZ");
00072 }
00073 c->cd(3);
00074
if (Hist_PSD_status) {
00075 Hist_PSD_status->Draw(
"H COLZ");
00076 }
00077 c->cd(4);
00078
if (Hist_BTOW_Corruption) {
00079 Hist_BTOW_Corruption->Draw(
"H COLZ");
00080 }
00081
00082
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00083 }
00084
00085
00086
void BEMCPlotsPresenter::displayTowers(FileType file, TPad *pad,
int mDebug) {
00087
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00088
00089
if (!pad)
return;
00090 pad->Clear();
00091 pad->cd(0);
00092
00093 TH2F *Hist_btow_spectra_1 = (TH2F*)GetHisto(file, Hist_btow_spectra_1Name);
00094
if (!Hist_btow_spectra_1 || (mDebug >= 2)) cout <<
"Hist_btow_spectra_1 = " << Hist_btow_spectra_1 << endl;
00095 TH2F *Hist_btow_spectra_2 = (TH2F*)GetHisto(file, Hist_btow_spectra_2Name);
00096
if (!Hist_btow_spectra_2 || (mDebug >= 2)) cout <<
"Hist_btow_spectra_2 = " << Hist_btow_spectra_2 << endl;
00097 TH2F *Hist_btow_spectra_3 = (TH2F*)GetHisto(file, Hist_btow_spectra_3Name);
00098
if (!Hist_btow_spectra_3 || (mDebug >= 2)) cout <<
"Hist_btow_spectra_3 = " << Hist_btow_spectra_3 << endl;
00099
00100 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00101 c->Draw();
00102 c->cd(0);
00103 c->Divide(1, 3, 0.001, 0.001);
00104
00105 c->cd(1);
00106
if (Hist_btow_spectra_1) {
00107 Hist_btow_spectra_1->Draw(
"H COLZ");
00108 }
00109 c->cd(2);
00110
if (Hist_btow_spectra_2) {
00111 Hist_btow_spectra_2->Draw(
"H COLZ");
00112 }
00113 c->cd(3);
00114
if (Hist_btow_spectra_3) {
00115 Hist_btow_spectra_3->Draw(
"H COLZ");
00116 }
00117
00118
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00119 }
00120
00121
00122
void BEMCPlotsPresenter::displaySMDPSD(FileType file, TPad *pad,
int mDebug) {
00123
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00124
00125
if (!pad)
return;
00126 pad->Clear();
00127 pad->cd(0);
00128
00129 TH1F *Hist_smd_spectra = (TH1F*)GetHisto(file, Hist_smd_spectraName);
00130
if (!Hist_smd_spectra || (mDebug >= 2)) cout <<
"Hist_smd_spectra = " << Hist_smd_spectra << endl;
00131 TH1F *Hist_smd_spectraNonZS = (TH1F*)GetHisto(file, Hist_smd_spectraNonZSName);
00132
if (!Hist_smd_spectraNonZS || (mDebug >= 2)) cout <<
"Hist_smd_spectraNonZS = " << Hist_smd_spectraNonZS << endl;
00133 TH2F *Hist_smd_capacitor = (TH2F*)GetHisto(file, Hist_smd_capacitorName);
00134
if (!Hist_smd_capacitor || (mDebug >= 2)) cout <<
"Hist_smd_capacitor = " << Hist_smd_capacitor << endl;
00135 TH2F *Hist_smd_sum = (TH2F*)GetHisto(file, Hist_smd_sumName);
00136
if (!Hist_smd_sum || (mDebug >= 2)) cout <<
"Hist_smd_sum = " << Hist_smd_sum << endl;
00137 TH1F *Hist_psd_spectra = (TH1F*)GetHisto(file, Hist_psd_spectraName);
00138
if (!Hist_psd_spectra || (mDebug >= 2)) cout <<
"Hist_psd_spectra = " << Hist_psd_spectra << endl;
00139 TH1F *Hist_psd_spectraNonZS = (TH1F*)GetHisto(file, Hist_psd_spectraNonZSName);
00140
if (!Hist_psd_spectraNonZS || (mDebug >= 2)) cout <<
"Hist_psd_spectraNonZS = " << Hist_psd_spectraNonZS << endl;
00141 TH2F *Hist_psd_capacitor = (TH2F*)GetHisto(file, Hist_psd_capacitorName);
00142
if (!Hist_psd_capacitor || (mDebug >= 2)) cout <<
"Hist_psd_capacitor = " << Hist_psd_capacitor << endl;
00143 TH2F *Hist_psd_sum = (TH2F*)GetHisto(file, Hist_psd_sumName);
00144
if (!Hist_psd_sum || (mDebug >= 2)) cout <<
"Hist_psd_sum = " << Hist_psd_sum << endl;
00145
00146 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00147 c->Draw();
00148 c->cd(0);
00149 c->Divide(2, 3, 0.001, 0.001);
00150
00151 c->cd(1);
00152
if (Hist_smd_spectra) {
00153 Hist_smd_spectra->Draw(
"H COLZ");
00154 }
00155
if (Hist_smd_spectraNonZS) {
00156 Hist_smd_spectraNonZS->SetLineColor(kRed);
00157 Hist_smd_spectraNonZS->Draw(
"SAME H COLZ");
00158 }
00159 c->cd(2);
00160
if (Hist_psd_spectra) {
00161 Hist_psd_spectra->Draw(
"H COLZ");
00162 }
00163
if (Hist_psd_spectraNonZS) {
00164 Hist_psd_spectraNonZS->SetLineColor(kRed);
00165 Hist_psd_spectraNonZS->Draw(
"SAME H COLZ");
00166 }
00167 c->cd(3);
00168
if (Hist_smd_capacitor) {
00169 Hist_smd_capacitor->Draw(
"H COLZ");
00170 }
00171 c->cd(4);
00172
if (Hist_psd_capacitor) {
00173 Hist_psd_capacitor->Draw(
"H COLZ");
00174 }
00175 c->cd(5);
00176
if (Hist_smd_sum) {
00177 Hist_smd_sum->Draw(
"H COLZ");
00178 }
00179 c->cd(6);
00180
if (Hist_psd_sum) {
00181 Hist_psd_sum->Draw(
"H COLZ");
00182 }
00183
00184
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00185 }
00186
00187
00188
void BEMCPlotsPresenter::displayTrigger(FileType file, TPad *pad,
int mDebug) {
00189
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00190
00191
if (!pad)
return;
00192 pad->Clear();
00193 pad->cd(0);
00194
00195 TH2F *Hist_HTMAX_spectra = (TH2F*)GetHisto(file, Hist_HTMAX_spectraName);
00196
if (!Hist_HTMAX_spectra || (mDebug >= 2)) cout <<
"Hist_HTMAX_spectra = " << Hist_HTMAX_spectra << endl;
00197 TH2F *Hist_PAMAX_spectra = (TH2F*)GetHisto(file, Hist_PAMAX_spectraName);
00198
if (!Hist_PAMAX_spectra || (mDebug >= 2)) cout <<
"Hist_PAMAX_spectra = " << Hist_PAMAX_spectra << endl;
00199 TH1F *Hist_HTMAX_dist = (TH1F*)GetHisto(file, Hist_HTMAX_distName);
00200
if (!Hist_HTMAX_dist || (mDebug >= 2)) cout <<
"Hist_HTMAX_dist = " << Hist_HTMAX_dist << endl;
00201 TH1F *Hist_PAMAX_dist = (TH1F*)GetHisto(file, Hist_PAMAX_distName);
00202
if (!Hist_PAMAX_dist || (mDebug >= 2)) cout <<
"Hist_PAMAX_dist = " << Hist_PAMAX_dist << endl;
00203
00204 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00205 c->Draw();
00206 c->cd(0);
00207 c->Divide(2, 2, 0.001, 0.001);
00208
00209 c->cd(1);
00210
if (Hist_HTMAX_spectra) {
00211 Hist_HTMAX_spectra->Draw(
"H COLZ");
00212 }
00213 c->cd(2);
00214
if (Hist_PAMAX_spectra) {
00215 Hist_PAMAX_spectra->Draw(
"H COLZ");
00216 }
00217 c->cd(3);
00218
if (Hist_HTMAX_dist) {
00219 Hist_HTMAX_dist->Draw(
"H COLZ");
00220 }
00221 c->cd(4);
00222
if (Hist_PAMAX_dist) {
00223 Hist_PAMAX_dist->Draw(
"H COLZ");
00224 }
00225
00226
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00227 }
00228
00229
00230
void BEMCPlotsPresenter::displayJet(FileType file, TPad *pad,
int mDebug) {
00231
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00232
00233
if (!pad)
return;
00234 pad->Clear();
00235 pad->cd(0);
00236
00237 TH2F *Hist_JET_ped = (TH2F*)GetHisto(file, Hist_JET_pedName);
00238
if (!Hist_JET_ped || (mDebug >= 2)) cout <<
"Hist_JET_ped = " << Hist_JET_ped << endl;
00239 TH2F *Hist_JET_spectra = (TH2F*)GetHisto(file, Hist_JET_spectraName);
00240
if (!Hist_JET_spectra || (mDebug >= 2)) cout <<
"Hist_JET_spectra = " << Hist_JET_spectra << endl;
00241 TH2F *Hist_JETMAX_spectra = (TH2F*)GetHisto(file, Hist_JETMAX_spectraName);
00242
if (!Hist_JETMAX_spectra || (mDebug >= 2)) cout <<
"Hist_JETMAX_spectra = " << Hist_JETMAX_spectra << endl;
00243 TH1F *Hist_JETMAX_dist = (TH1F*)GetHisto(file, Hist_JETMAX_distName);
00244
if (!Hist_JETMAX_dist || (mDebug >= 2)) cout <<
"Hist_JETMAX_dist = " << Hist_JETMAX_dist << endl;
00245
00246 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00247 c->Draw();
00248 c->cd(0);
00249 c->Divide(2, 2, 0.001, 0.001);
00250
00251 c->cd(1);
00252
if (Hist_JET_ped) {
00253 Hist_JET_ped->Draw(
"H COLZ");
00254 }
00255 c->cd(2);
00256
if (Hist_JET_spectra) {
00257 Hist_JET_spectra->Draw(
"H COLZ");
00258 }
00259 c->cd(3);
00260
if (Hist_JETMAX_spectra) {
00261 Hist_JETMAX_spectra->Draw(
"H COLZ");
00262 }
00263 c->cd(4);
00264
if (Hist_JETMAX_dist) {
00265 Hist_JETMAX_dist->Draw(
"H COLZ");
00266 }
00267
00268
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00269 }
00270
00271
00272
void BEMCPlotsPresenter::displayRawAdc(FileType file, TPad *pad,
bool psd, Int_t mDebug) {
00273
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00274
00275
00276
bool twMaskFound=
false;
00277 BemcTwMask *twMask =
new BemcTwMask();
00278
const Char_t *bemcTwMaskFilename=(gEnv->GetValue(
"Online.bemcStatus",
"bemcStatus.txt"));
00279
00280 twMaskFound=useBtowMask(bemcTwMaskFilename, twMask);
00281
00282 TH2F *HistRawAdc1 = (TH2F*)GetHisto(file, psd ? HistRawAdcPsd1Name : HistRawAdc1Name);
00283
if (!HistRawAdc1 || (mDebug >= 2)) cout <<
"HistRawAdc1 = " << HistRawAdc1 << endl;
00284 TH2F *HistRawAdc2 = (TH2F*)GetHisto(file, psd ? HistRawAdcPsd2Name : HistRawAdc2Name);
00285
if (!HistRawAdc2 || (mDebug >= 2)) cout <<
"HistRawAdc2 = " << HistRawAdc2 << endl;
00286 TH2F *HistRawAdc3 = (TH2F*)GetHisto(file, psd ? HistRawAdcPsd3Name : HistRawAdc3Name);
00287
if (!HistRawAdc3 || (mDebug >= 2)) cout <<
"HistRawAdc3 = " << HistRawAdc3 << endl;
00288 TH2F *HistRawAdc4 = (TH2F*)GetHisto(file, psd ? HistRawAdcPsd4Name : HistRawAdc4Name);
00289
if (!HistRawAdc4 || (mDebug >= 2)) cout <<
"HistRawAdc4 = " << HistRawAdc4 << endl;
00290
00291
if (!pad)
return;
00292 pad->Clear();
00293 pad->cd(0);
00294
00295 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00296 c->Draw();
00297 c->cd(0);
00298 c->Divide(1, 4, 0.001, 0.001);
00299
00300
00301 Int_t linesColor = 16;
00302 Int_t crateMinSoftId[] = {4661, 2421, 2581, 2741, 2901, 3061, 3221, 3381, 3541, 3701, 3861, 4021, 4181, 4341, 4501, 2181, 2021, 1861, 1701, 1541, 1381, 1221, 1061, 901, 741, 581, 421, 261, 101, 1};
00303 Int_t crateMaxSoftId[] = {4800, 2580, 2740, 2900, 3060, 3220, 3380, 3540, 3700, 3860, 4020, 4180, 4340, 4500, 4660, 2340, 2180, 2020, 1860, 1700, 1540, 1380, 1220, 1060, 900, 740, 580, 420, 260, 100};
00304 Int_t pmtbxMinSoftId[] = {2261, 2181, 2101, 2021, 1941, 1861, 1781, 1701, 1621, 1541, 1461, 1381, 1301, 1221, 1141, 1061, 981, 901, 821, 741, 661, 581, 501, 421, 341, 261, 181, 101, 21, 2341,
00305 4661, 4741, 2421, 2501, 2581, 2661, 2741, 2821, 2901, 2981, 3061, 3141, 3221, 3301, 3381, 3461, 3541, 3621, 3701, 3781, 3861, 3941, 4021, 4101, 4181, 4261, 4341, 4421, 4501, 4581
00306
00307 };
00308 Int_t pmtbxMaxSoftId[] = {2340, 2260, 2180, 2100, 2020, 1940, 1860, 1780, 1700, 1620, 1540, 1460, 1380, 1300, 1220, 1140, 1060, 980, 900, 820, 740, 660, 580, 500, 420, 340, 260, 180, 100, 2400,
00309 4740, 4800, 2500, 2580, 2660, 2740, 2820, 2900, 2980, 3060, 3140, 3220, 3300, 3380, 3460, 3540, 3620, 3700, 3780, 3860, 3940, 4020, 4100, 4180, 4260, 4340, 4420, 4500, 4580, 4660
00310
00311 };
00312
if (useDecoderForBoundaries && BEMCDecoderPresenter) {
00313
for (Int_t crate = 0;crate < 30;crate++) {
00314 crateMinSoftId[crate] = 4800;
00315 crateMaxSoftId[crate] = 1;
00316 }
00317
for (Int_t crate = 0;crate < 30;crate++) {
00318
if (BEMCDecoderPresenter) {
00319
for (Int_t crateSeq = 0;crateSeq < 160;crateSeq++) {
00320 Int_t softId;
00321
if (BEMCDecoderPresenter->
GetTowerIdFromCrate(crate + 1, crateSeq, softId)) {
00322
if (softId < crateMinSoftId[crate]) crateMinSoftId[crate] = softId;
00323
if (softId > crateMaxSoftId[crate]) crateMaxSoftId[crate] = softId;
00324 }
00325 }
00326 }
00327 }
00328
00329
00330 }
00331
00332 Int_t *boxMinSoftId = psd ? pmtbxMinSoftId : crateMinSoftId;
00333 Int_t *boxMaxSoftId = psd ? pmtbxMaxSoftId : crateMaxSoftId;
00334
const Char_t *boxLabelFormat = psd ?
"%i" :
"0x%.2X";
00335 Int_t numBoxes = psd ? (
sizeof(pmtbxMinSoftId)/
sizeof(pmtbxMinSoftId[0])) : (
sizeof(crateMinSoftId)/
sizeof(crateMinSoftId[0]));
00336
00337 c->cd(1);
00338
if (HistRawAdc1) {
00339 HistRawAdc1->SetStats(0);
00340 HistRawAdc1->Draw(
"COLZ");
00341
if (twMaskFound) {
00342 TGraph *g1=twMask->crG;
00343 g1->Draw(
"L");
00344 g1->SetLineWidth(1);
00345 g1->SetLineColor(2);
00346 TLine *testline1=
new TLine(0,0,0,10000);
00347 testline1->SetLineColor(1);
00348 testline1->SetLineWidth(2);
00349 testline1->Draw();
00350 }
00351
for (Int_t crate = 0;crate < numBoxes;crate++) {
00352
if (!((boxMaxSoftId[crate] < HistRawAdc1->GetXaxis()->GetBinLowEdge(1))
00353 || (boxMinSoftId[crate] > HistRawAdc1->GetXaxis()->GetBinUpEdge(HistRawAdc1->GetXaxis()->GetNbins())))
00354 ) {
00355 Float_t left = max(boxMinSoftId[crate], HistRawAdc1->GetXaxis()->GetBinCenter(1)) - 0.5;
00356 Float_t right = 0.5 + min(boxMaxSoftId[crate], HistRawAdc1->GetXaxis()->GetBinCenter(HistRawAdc1->GetXaxis()->GetNbins()));
00357 TLine *lCrates =
new TLine(left, HistRawAdc1->GetYaxis()->GetBinLowEdge(1), left, HistRawAdc1->GetYaxis()->GetBinUpEdge(HistRawAdc1->GetYaxis()->GetNbins()));
00358
if (lCrates) {
00359 lCrates->SetLineColor(linesColor);
00360 lCrates->SetLineWidth(1);
00361 lCrates->Draw();
00362 }
00363 TLine *rCrates =
new TLine(right, HistRawAdc1->GetYaxis()->GetBinLowEdge(1), right, HistRawAdc1->GetYaxis()->GetBinUpEdge(HistRawAdc1->GetYaxis()->GetNbins()));
00364
if (rCrates) {
00365 rCrates->SetLineColor(linesColor);
00366 rCrates->SetLineWidth(1);
00367 rCrates->Draw();
00368 }
00369 TString crateLabel;
00370 crateLabel = Form(boxLabelFormat, crate + 1);
00371 TLatex *textCrate =
new TLatex(left + 10, HistRawAdc1->GetYaxis()->GetBinUpEdge(HistRawAdc1->GetYaxis()->GetNbins()) * 0.8, crateLabel.Data());
00372
if (textCrate) {
00373 textCrate->SetTextColor(linesColor);
00374 textCrate->SetTextSize(0.14);
00375 textCrate->Draw();
00376 }
00377 }
00378 }
00379 }
00380 c->cd(2);
00381
if (HistRawAdc2) {
00382 HistRawAdc2->SetStats(0);
00383 HistRawAdc2->Draw(
"COLZ");
00384
if (twMaskFound) {
00385 TGraph *g2=twMask->crG+1;
00386 g2->Draw(
"L");
00387 g2->SetLineColor(2);
00388 }
00389
for (Int_t crate = 0;crate < numBoxes;crate++) {
00390
if (!((boxMaxSoftId[crate] < HistRawAdc2->GetXaxis()->GetBinLowEdge(1))
00391 || (boxMinSoftId[crate] > HistRawAdc2->GetXaxis()->GetBinUpEdge(HistRawAdc2->GetXaxis()->GetNbins())))
00392 ) {
00393 Float_t left = max(boxMinSoftId[crate], HistRawAdc2->GetXaxis()->GetBinCenter(1)) - 0.5;
00394 Float_t right = 0.5 + min(boxMaxSoftId[crate], HistRawAdc2->GetXaxis()->GetBinCenter(HistRawAdc2->GetXaxis()->GetNbins()));
00395 TLine *lCrates =
new TLine(left, HistRawAdc2->GetYaxis()->GetBinLowEdge(1), left, HistRawAdc2->GetYaxis()->GetBinUpEdge(HistRawAdc2->GetYaxis()->GetNbins()));
00396
if (lCrates) {
00397 lCrates->SetLineColor(linesColor);
00398 lCrates->SetLineWidth(1);
00399 lCrates->Draw();
00400 }
00401 TLine *rCrates =
new TLine(right, HistRawAdc2->GetYaxis()->GetBinLowEdge(1), right, HistRawAdc2->GetYaxis()->GetBinUpEdge(HistRawAdc2->GetYaxis()->GetNbins()));
00402
if (rCrates) {
00403 rCrates->SetLineColor(linesColor);
00404 rCrates->SetLineWidth(1);
00405 rCrates->Draw();
00406 }
00407 TString crateLabel;
00408 crateLabel = Form(boxLabelFormat, crate + 1);
00409 TLatex *textCrate =
new TLatex(left + 10, HistRawAdc2->GetYaxis()->GetBinUpEdge(HistRawAdc2->GetYaxis()->GetNbins()) * 0.8, crateLabel.Data());
00410
if (textCrate) {
00411 textCrate->SetTextColor(linesColor);
00412 textCrate->SetTextSize(0.14);
00413 textCrate->Draw();
00414 }
00415 }
00416 }
00417 }
00418
00419 c->cd(3);
00420
if (HistRawAdc3) {
00421 HistRawAdc3->SetStats(0);
00422 HistRawAdc3->Draw(
"COLZ");
00423
if (twMaskFound) {
00424 TGraph *g3=twMask->crG+2;
00425 g3->Draw(
"L");
00426 g3->SetLineColor(2);
00427 }
00428
for (Int_t crate = 0;crate < numBoxes;crate++) {
00429
if (!((boxMaxSoftId[crate] < HistRawAdc3->GetXaxis()->GetBinLowEdge(1))
00430 || (boxMinSoftId[crate] > HistRawAdc3->GetXaxis()->GetBinUpEdge(HistRawAdc3->GetXaxis()->GetNbins())))
00431 ) {
00432 Float_t left = max(boxMinSoftId[crate], HistRawAdc3->GetXaxis()->GetBinCenter(1)) - 0.5;
00433 Float_t right = 0.5 + min(boxMaxSoftId[crate], HistRawAdc3->GetXaxis()->GetBinCenter(HistRawAdc3->GetXaxis()->GetNbins()));
00434 TLine *lCrates =
new TLine(left, HistRawAdc3->GetYaxis()->GetBinLowEdge(1), left, HistRawAdc3->GetYaxis()->GetBinUpEdge(HistRawAdc3->GetYaxis()->GetNbins()));
00435
if (lCrates) {
00436 lCrates->SetLineColor(linesColor);
00437 lCrates->SetLineWidth(1);
00438 lCrates->Draw();
00439 }
00440 TLine *rCrates =
new TLine(right, HistRawAdc3->GetYaxis()->GetBinLowEdge(1), right, HistRawAdc3->GetYaxis()->GetBinUpEdge(HistRawAdc3->GetYaxis()->GetNbins()));
00441
if (rCrates) {
00442 rCrates->SetLineColor(linesColor);
00443 rCrates->SetLineWidth(1);
00444 rCrates->Draw();
00445 }
00446 TString crateLabel;
00447 crateLabel = Form(boxLabelFormat, crate + 1);
00448 TLatex *textCrate =
new TLatex(left + 10, HistRawAdc3->GetYaxis()->GetBinUpEdge(HistRawAdc3->GetYaxis()->GetNbins()) * 0.8, crateLabel.Data());
00449
if (textCrate) {
00450 textCrate->SetTextColor(linesColor);
00451 textCrate->SetTextSize(0.14);
00452 textCrate->Draw();
00453 }
00454 }
00455 }
00456 }
00457
00458 c->cd(4);
00459
if (HistRawAdc4) {
00460 HistRawAdc4->SetStats(0);
00461 HistRawAdc4->Draw(
"COLZ");
00462
if (twMaskFound) {
00463 TGraph *g4=twMask->crG+3;
00464 g4->Draw(
"L");
00465 g4->SetLineWidth(2);
00466 g4->SetLineColor(2);
00467 }
00468
00469
for (Int_t crate = 0;crate < numBoxes;crate++) {
00470
if (!((boxMaxSoftId[crate] < HistRawAdc4->GetXaxis()->GetBinLowEdge(1))
00471 || (boxMinSoftId[crate] > HistRawAdc4->GetXaxis()->GetBinUpEdge(HistRawAdc4->GetXaxis()->GetNbins())))
00472 ) {
00473 Float_t left = max(boxMinSoftId[crate], HistRawAdc4->GetXaxis()->GetBinCenter(1)) - 0.5;
00474 Float_t right = 0.5 + min(boxMaxSoftId[crate], HistRawAdc4->GetXaxis()->GetBinCenter(HistRawAdc4->GetXaxis()->GetNbins()));
00475 TLine *lCrates =
new TLine(left, HistRawAdc4->GetYaxis()->GetBinLowEdge(1), left, HistRawAdc4->GetYaxis()->GetBinUpEdge(HistRawAdc4->GetYaxis()->GetNbins()));
00476
if (lCrates) {
00477 lCrates->SetLineColor(linesColor);
00478 lCrates->SetLineWidth(1);
00479 lCrates->Draw();
00480 }
00481 TLine *rCrates =
new TLine(right, HistRawAdc4->GetYaxis()->GetBinLowEdge(1), right, HistRawAdc4->GetYaxis()->GetBinUpEdge(HistRawAdc4->GetYaxis()->GetNbins()));
00482
if (rCrates) {
00483 rCrates->SetLineColor(linesColor);
00484 rCrates->SetLineWidth(1);
00485 rCrates->Draw();
00486 }
00487 TString crateLabel;
00488 crateLabel = Form(boxLabelFormat, crate + 1);
00489 TLatex *textCrate =
new TLatex(left + 10, HistRawAdc4->GetYaxis()->GetBinUpEdge(HistRawAdc4->GetYaxis()->GetNbins()) * 0.8, crateLabel.Data());
00490
if (textCrate) {
00491 textCrate->SetTextColor(linesColor);
00492 textCrate->SetTextSize(0.14);
00493 textCrate->Draw();
00494 }
00495 }
00496 }
00497 }
00498 }
00499
00500
00501
void BEMCPlotsPresenter::displayRawAdcZoom(FileType file, TPad *pad,
bool psd, Int_t mDebug) {
00502
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00503
00504
00505
bool twMaskFound=
false;
00506 BemcTwMask *twMask =
new BemcTwMask();
00507
const Char_t *bemcTwMaskFilename=(gEnv->GetValue(
"Online.bemcStatus",
"bemcStatus.txt"));
00508
00509 twMaskFound=useBtowMask(bemcTwMaskFilename, twMask);
00510
00511 TH2F *HistRawAdc1Zoom = (TH2F*)GetHisto(file, psd ? HistRawAdcPsd1Name : HistRawAdc1NameZoom);
00512
if (!HistRawAdc1Zoom || (mDebug >= 2)) cout <<
"HistRawAdc1zoom = " << HistRawAdc1Zoom << endl;
00513 TH2F *HistRawAdc2Zoom = (TH2F*)GetHisto(file, psd ? HistRawAdcPsd2Name : HistRawAdc2NameZoom);
00514
if (!HistRawAdc2Zoom || (mDebug >= 2)) cout <<
"HistRawAdc2zoom = " << HistRawAdc2Zoom << endl;
00515 TH2F *HistRawAdc3Zoom = (TH2F*)GetHisto(file, psd ? HistRawAdcPsd3Name : HistRawAdc3NameZoom);
00516
if (!HistRawAdc3Zoom || (mDebug >= 2)) cout <<
"HistRawAdc3zoom = " << HistRawAdc3Zoom << endl;
00517 TH2F *HistRawAdc4Zoom = (TH2F*)GetHisto(file, psd ? HistRawAdcPsd4Name : HistRawAdc4NameZoom);
00518
if (!HistRawAdc4Zoom || (mDebug >= 2)) cout <<
"HistRawAdc4zoom = " << HistRawAdc4Zoom << endl;
00519
00520
if (!pad)
return;
00521 pad->Clear();
00522 pad->cd(0);
00523
00524 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00525 c->Draw();
00526 c->cd(0);
00527 c->Divide(1, 4, 0.001, 0.001);
00528
00529
00530 Int_t linesColor = 16;
00531 Int_t crateMinSoftId[] = {4661, 2421, 2581, 2741, 2901, 3061, 3221, 3381, 3541, 3701, 3861, 4021, 4181, 4341, 4501, 2181, 2021, 1861, 1701, 1541, 1381, 1221, 1061, 901, 741, 581, 421, 261, 101, 1};
00532 Int_t crateMaxSoftId[] = {4800, 2580, 2740, 2900, 3060, 3220, 3380, 3540, 3700, 3860, 4020, 4180, 4340, 4500, 4660, 2340, 2180, 2020, 1860, 1700, 1540, 1380, 1220, 1060, 900, 740, 580, 420, 260, 100};
00533 Int_t pmtbxMinSoftId[] = {2261, 2181, 2101, 2021, 1941, 1861, 1781, 1701, 1621, 1541, 1461, 1381, 1301, 1221, 1141, 1061, 981, 901, 821, 741, 661, 581, 501, 421, 341, 261, 181, 101, 21, 2341,
00534 4661, 4741, 2421, 2501, 2581, 2661, 2741, 2821, 2901, 2981, 3061, 3141, 3221, 3301, 3381, 3461, 3541, 3621, 3701, 3781, 3861, 3941, 4021, 4101, 4181, 4261, 4341, 4421, 4501, 4581
00535
00536 };
00537 Int_t pmtbxMaxSoftId[] = {2340, 2260, 2180, 2100, 2020, 1940, 1860, 1780, 1700, 1620, 1540, 1460, 1380, 1300, 1220, 1140, 1060, 980, 900, 820, 740, 660, 580, 500, 420, 340, 260, 180, 100, 2400,
00538 4740, 4800, 2500, 2580, 2660, 2740, 2820, 2900, 2980, 3060, 3140, 3220, 3300, 3380, 3460, 3540, 3620, 3700, 3780, 3860, 3940, 4020, 4100, 4180, 4260, 4340, 4420, 4500, 4580, 4660
00539
00540 };
00541
if (useDecoderForBoundaries && BEMCDecoderPresenter) {
00542
for (Int_t crate = 0;crate < 30;crate++) {
00543 crateMinSoftId[crate] = 4800;
00544 crateMaxSoftId[crate] = 1;
00545 }
00546
for (Int_t crate = 0;crate < 30;crate++) {
00547
if (BEMCDecoderPresenter) {
00548
for (Int_t crateSeq = 0;crateSeq < 160;crateSeq++) {
00549 Int_t softId;
00550
if (BEMCDecoderPresenter->
GetTowerIdFromCrate(crate + 1, crateSeq, softId)) {
00551
if (softId < crateMinSoftId[crate]) crateMinSoftId[crate] = softId;
00552
if (softId > crateMaxSoftId[crate]) crateMaxSoftId[crate] = softId;
00553 }
00554 }
00555 }
00556 }
00557
00558
00559 }
00560
00561 Int_t *boxMinSoftId = psd ? pmtbxMinSoftId : crateMinSoftId;
00562 Int_t *boxMaxSoftId = psd ? pmtbxMaxSoftId : crateMaxSoftId;
00563
const Char_t *boxLabelFormat = psd ?
"%i" :
"0x%.2X";
00564 Int_t numBoxes = psd ? (
sizeof(pmtbxMinSoftId)/
sizeof(pmtbxMinSoftId[0])) : (
sizeof(crateMinSoftId)/
sizeof(crateMinSoftId[0]));
00565
00566 c->cd(1);
00567
if (HistRawAdc1Zoom) {
00568 HistRawAdc1Zoom->SetStats(0);
00569 HistRawAdc1Zoom->Draw(
"COLZ");
00570
if (twMaskFound) {
00571 TGraph *g1=twMask->crG;
00572 g1->Draw(
"L");
00573 g1->SetLineWidth(1);
00574 g1->SetLineColor(2);
00575 TLine *testline1=
new TLine(0,0,0,10000);
00576 testline1->SetLineColor(1);
00577 testline1->SetLineWidth(2);
00578 testline1->Draw();
00579 }
00580
for (Int_t crate = 0;crate < numBoxes;crate++) {
00581
if (!((boxMaxSoftId[crate] < HistRawAdc1Zoom->GetXaxis()->GetBinLowEdge(1))
00582 || (boxMinSoftId[crate] > HistRawAdc1Zoom->GetXaxis()->GetBinUpEdge(HistRawAdc1Zoom->GetXaxis()->GetNbins())))
00583 ) {
00584 Float_t left = max(boxMinSoftId[crate], HistRawAdc1Zoom->GetXaxis()->GetBinCenter(1)) - 0.5;
00585 Float_t right = 0.5 + min(boxMaxSoftId[crate], HistRawAdc1Zoom->GetXaxis()->GetBinCenter(HistRawAdc1Zoom->GetXaxis()->GetNbins()));
00586 TLine *lCrates =
new TLine(left, HistRawAdc1Zoom->GetYaxis()->GetBinLowEdge(1), left, HistRawAdc1Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc1Zoom->GetYaxis()->GetNbins()));
00587
if (lCrates) {
00588 lCrates->SetLineColor(linesColor);
00589 lCrates->SetLineWidth(1);
00590 lCrates->Draw();
00591 }
00592 TLine *rCrates =
new TLine(right, HistRawAdc1Zoom->GetYaxis()->GetBinLowEdge(1), right, HistRawAdc1Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc1Zoom->GetYaxis()->GetNbins()));
00593
if (rCrates) {
00594 rCrates->SetLineColor(linesColor);
00595 rCrates->SetLineWidth(1);
00596 rCrates->Draw();
00597 }
00598 TString crateLabel;
00599 crateLabel = Form(boxLabelFormat, crate + 1);
00600 TLatex *textCrate =
new TLatex(left + 10, HistRawAdc1Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc1Zoom->GetYaxis()->GetNbins()) * 0.8, crateLabel.Data());
00601
if (textCrate) {
00602 textCrate->SetTextColor(linesColor);
00603 textCrate->SetTextSize(0.14);
00604 textCrate->Draw();
00605 }
00606 }
00607 }
00608 }
00609 c->cd(2);
00610
if (HistRawAdc2Zoom) {
00611 HistRawAdc2Zoom->SetStats(0);
00612 HistRawAdc2Zoom->Draw(
"COLZ");
00613
if (twMaskFound) {
00614 TGraph *g2=twMask->crG+1;
00615 g2->Draw(
"L");
00616 g2->SetLineColor(2);
00617 }
00618
for (Int_t crate = 0;crate < numBoxes;crate++) {
00619
if (!((boxMaxSoftId[crate] < HistRawAdc2Zoom->GetXaxis()->GetBinLowEdge(1))
00620 || (boxMinSoftId[crate] > HistRawAdc2Zoom->GetXaxis()->GetBinUpEdge(HistRawAdc2Zoom->GetXaxis()->GetNbins())))
00621 ) {
00622 Float_t left = max(boxMinSoftId[crate], HistRawAdc2Zoom->GetXaxis()->GetBinCenter(1)) - 0.5;
00623 Float_t right = 0.5 + min(boxMaxSoftId[crate], HistRawAdc2Zoom->GetXaxis()->GetBinCenter(HistRawAdc2Zoom->GetXaxis()->GetNbins()));
00624 TLine *lCrates =
new TLine(left, HistRawAdc2Zoom->GetYaxis()->GetBinLowEdge(1), left, HistRawAdc2Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc2Zoom->GetYaxis()->GetNbins()));
00625
if (lCrates) {
00626 lCrates->SetLineColor(linesColor);
00627 lCrates->SetLineWidth(1);
00628 lCrates->Draw();
00629 }
00630 TLine *rCrates =
new TLine(right, HistRawAdc2Zoom->GetYaxis()->GetBinLowEdge(1), right, HistRawAdc2Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc2Zoom->GetYaxis()->GetNbins()));
00631
if (rCrates) {
00632 rCrates->SetLineColor(linesColor);
00633 rCrates->SetLineWidth(1);
00634 rCrates->Draw();
00635 }
00636 TString crateLabel;
00637 crateLabel = Form(boxLabelFormat, crate + 1);
00638 TLatex *textCrate =
new TLatex(left + 10, HistRawAdc2Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc2Zoom->GetYaxis()->GetNbins()) * 0.8, crateLabel.Data());
00639
if (textCrate) {
00640 textCrate->SetTextColor(linesColor);
00641 textCrate->SetTextSize(0.14);
00642 textCrate->Draw();
00643 }
00644 }
00645 }
00646 }
00647
00648 c->cd(3);
00649
if (HistRawAdc3Zoom) {
00650 HistRawAdc3Zoom->SetStats(0);
00651 HistRawAdc3Zoom->Draw(
"COLZ");
00652
if (twMaskFound) {
00653 TGraph *g3=twMask->crG+2;
00654 g3->Draw(
"L");
00655 g3->SetLineColor(2);
00656 }
00657
for (Int_t crate = 0;crate < numBoxes;crate++) {
00658
if (!((boxMaxSoftId[crate] < HistRawAdc3Zoom->GetXaxis()->GetBinLowEdge(1))
00659 || (boxMinSoftId[crate] > HistRawAdc3Zoom->GetXaxis()->GetBinUpEdge(HistRawAdc3Zoom->GetXaxis()->GetNbins())))
00660 ) {
00661 Float_t left = max(boxMinSoftId[crate], HistRawAdc3Zoom->GetXaxis()->GetBinCenter(1)) - 0.5;
00662 Float_t right = 0.5 + min(boxMaxSoftId[crate], HistRawAdc3Zoom->GetXaxis()->GetBinCenter(HistRawAdc3Zoom->GetXaxis()->GetNbins()));
00663 TLine *lCrates =
new TLine(left, HistRawAdc3Zoom->GetYaxis()->GetBinLowEdge(1), left, HistRawAdc3Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc3Zoom->GetYaxis()->GetNbins()));
00664
if (lCrates) {
00665 lCrates->SetLineColor(linesColor);
00666 lCrates->SetLineWidth(1);
00667 lCrates->Draw();
00668 }
00669 TLine *rCrates =
new TLine(right, HistRawAdc3Zoom->GetYaxis()->GetBinLowEdge(1), right, HistRawAdc3Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc3Zoom->GetYaxis()->GetNbins()));
00670
if (rCrates) {
00671 rCrates->SetLineColor(linesColor);
00672 rCrates->SetLineWidth(1);
00673 rCrates->Draw();
00674 }
00675 TString crateLabel;
00676 crateLabel = Form(boxLabelFormat, crate + 1);
00677 TLatex *textCrate =
new TLatex(left + 10, HistRawAdc3Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc3Zoom->GetYaxis()->GetNbins()) * 0.8, crateLabel.Data());
00678
if (textCrate) {
00679 textCrate->SetTextColor(linesColor);
00680 textCrate->SetTextSize(0.14);
00681 textCrate->Draw();
00682 }
00683 }
00684 }
00685 }
00686
00687 c->cd(4);
00688
if (HistRawAdc4Zoom) {
00689 HistRawAdc4Zoom->SetStats(0);
00690 HistRawAdc4Zoom->Draw(
"COLZ");
00691
if (twMaskFound) {
00692 TGraph *g4=twMask->crG+3;
00693 g4->Draw(
"L");
00694 g4->SetLineWidth(2);
00695 g4->SetLineColor(2);
00696 }
00697
00698
for (Int_t crate = 0;crate < numBoxes;crate++) {
00699
if (!((boxMaxSoftId[crate] < HistRawAdc4Zoom->GetXaxis()->GetBinLowEdge(1))
00700 || (boxMinSoftId[crate] > HistRawAdc4Zoom->GetXaxis()->GetBinUpEdge(HistRawAdc4Zoom->GetXaxis()->GetNbins())))
00701 ) {
00702 Float_t left = max(boxMinSoftId[crate], HistRawAdc4Zoom->GetXaxis()->GetBinCenter(1)) - 0.5;
00703 Float_t right = 0.5 + min(boxMaxSoftId[crate], HistRawAdc4Zoom->GetXaxis()->GetBinCenter(HistRawAdc4Zoom->GetXaxis()->GetNbins()));
00704 TLine *lCrates =
new TLine(left, HistRawAdc4Zoom->GetYaxis()->GetBinLowEdge(1), left, HistRawAdc4Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc4Zoom->GetYaxis()->GetNbins()));
00705
if (lCrates) {
00706 lCrates->SetLineColor(linesColor);
00707 lCrates->SetLineWidth(1);
00708 lCrates->Draw();
00709 }
00710 TLine *rCrates =
new TLine(right, HistRawAdc4Zoom->GetYaxis()->GetBinLowEdge(1), right, HistRawAdc4Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc4Zoom->GetYaxis()->GetNbins()));
00711
if (rCrates) {
00712 rCrates->SetLineColor(linesColor);
00713 rCrates->SetLineWidth(1);
00714 rCrates->Draw();
00715 }
00716 TString crateLabel;
00717 crateLabel = Form(boxLabelFormat, crate + 1);
00718 TLatex *textCrate =
new TLatex(left + 10, HistRawAdc4Zoom->GetYaxis()->GetBinUpEdge(HistRawAdc4Zoom->GetYaxis()->GetNbins()) * 0.8, crateLabel.Data());
00719
if (textCrate) {
00720 textCrate->SetTextColor(linesColor);
00721 textCrate->SetTextSize(0.14);
00722 textCrate->Draw();
00723 }
00724 }
00725 }
00726 }
00727 }
00728
00729
void BEMCPlotsPresenter::displayJetPatchHT(FileType file, TPad *pad, Int_t mDebug) {
00730
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00731
00732 TH1F *HistHighTowerSpectrum[12];
00733
for (Int_t i = 0;i < 12;i++) {
00734 TString name;
00735 name = Form(HistHighTowerSpectrumName
"_%u", i);
00736 HistHighTowerSpectrum[i] = (TH1F*)GetHisto(file, (
const char *)name);
00737
if (!HistHighTowerSpectrum[i] || (mDebug >= 2)) cout <<
"HistHighTowerSpectrum[" << i <<
"] = " << HistHighTowerSpectrum[i] << endl;
00738 }
00739
if (!pad)
return;
00740 pad->Clear();
00741 pad->cd(0);
00742
00743 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00744 c->Draw();
00745 c->cd(0);
00746 c->Divide(3, 4, 0.001, 0.001);
00747
00748
for (Int_t jetPatch = 0;jetPatch < 12;jetPatch++) {
00749 c->cd(jetPatch+1);
00750
if (HistHighTowerSpectrum[jetPatch]) {
00751 HistHighTowerSpectrum[jetPatch]->SetStats(0);
00752 HistHighTowerSpectrum[jetPatch]->Draw();
00753
if (HistHighTowerSpectrum[jetPatch]->GetEntries()) gPad->SetLogy();
00754 }
00755 }
00756 }
00757
00758
void BEMCPlotsPresenter::displayJetPatchSum(FileType file, TPad *pad, Int_t mDebug) {
00759
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00760
00761 TH1F *HistPatchSumSpectrum[12];
00762
for (Int_t i = 0;i < 12;i++) {
00763 TString name;
00764 name = Form(HistPatchSumSpectrumName
"_%u", i);
00765 HistPatchSumSpectrum[i] = (TH1F*)GetHisto(file, (
const char*)name);
00766
if (!HistPatchSumSpectrum[i] || (mDebug >= 2)) cout <<
"HistPatchSumSpectrum[" << i <<
"] = " << HistPatchSumSpectrum[i] << endl;
00767 }
00768
if (!pad)
return;
00769 pad->Clear();
00770 pad->cd(0);
00771
00772 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00773 c->Draw();
00774 c->cd(0);
00775 c->Divide(3, 4, 0.001, 0.001);
00776
00777
for (Int_t jetPatch = 0;jetPatch < 12;jetPatch++) {
00778 c->cd(jetPatch+1);
00779
if (HistPatchSumSpectrum[jetPatch]) {
00780 HistPatchSumSpectrum[jetPatch]->SetStats(0);
00781 HistPatchSumSpectrum[jetPatch]->Draw();
00782
if (HistPatchSumSpectrum[jetPatch]->GetEntries()) gPad->SetLogy();
00783 }
00784 }
00785 }
00786
00787
void BEMCPlotsPresenter::displayL0Input(FileType file, TPad *pad, Int_t mDebug) {
00788
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00789
00790 TH2F *HistDsmL0InputHighTower = (TH2F*)GetHisto(file, HistDsmL0InputHighTowerName);
00791
if (!HistDsmL0InputHighTower || (mDebug >= 2)) cout <<
"HistDsmL0InputHighTower = " << HistDsmL0InputHighTower << endl;
00792 TH2F *HistDsmL0InputPatchSum = (TH2F*)GetHisto(file, HistDsmL0InputPatchSumName);
00793
if (!HistDsmL0InputPatchSum || (mDebug >= 2)) cout <<
"HistDsmL0InputPatchSum = " << HistDsmL0InputPatchSum << endl;
00794
00795
if (!pad)
return;
00796 pad->Clear();
00797 pad->cd(0);
00798
00799 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00800 c->Draw();
00801 c->cd(0);
00802 c->Divide(1, 2, 0.001, 0.001);
00803
00804
00805 Int_t linesColor = 16;
00806 c->cd(1);
00807
if (HistDsmL0InputHighTower && BEMCDecoderPresenter) {
00808 HistDsmL0InputHighTower->SetStats(0);
00809 HistDsmL0InputHighTower->Draw(
"COLZ");
00810 TLine *lCrates =
new TLine(0, 50, 300, 50);
00811
if (lCrates) {
00812 lCrates->SetLineColor(linesColor);
00813 lCrates->SetLineWidth(1);
00814 lCrates->Draw();
00815 }
00816 TLatex *textCrates =
new TLatex(1, 50,
"BTOW Crates:");
00817
if (textCrates) {
00818 textCrates->SetTextColor(linesColor);
00819 textCrates->SetTextSize(0.0333);
00820 textCrates->Draw();
00821 }
00822
for (Int_t icrate = 1;icrate <= 30;icrate++) {
00823 Int_t triggerPatchBegin, triggerPatchEnd;
00824
if (BEMCDecoderPresenter->
GetTriggerPatchFromCrate(icrate, 0, triggerPatchBegin) && BEMCDecoderPresenter->
GetTriggerPatchFromCrate(icrate, 159, triggerPatchEnd)) {
00825 TLine *lCrateBegin =
new TLine(triggerPatchBegin-0.5, 0, triggerPatchBegin-0.5, 50);
00826
if (lCrateBegin) {
00827 lCrateBegin->SetLineColor(linesColor);
00828 lCrateBegin->SetLineWidth(1);
00829 lCrateBegin->Draw();
00830 }
00831 TString crateLabel;
00832 crateLabel = Form(
"%.2X", icrate);
00833 TLatex *textCrate =
new TLatex(triggerPatchBegin + 1, 45, crateLabel.Data());
00834
if (textCrate) {
00835 textCrate->SetTextColor(linesColor);
00836 textCrate->SetTextSize(0.0333);
00837 textCrate->Draw();
00838 }
00839 }
00840 }
00841
for (Int_t ijp = 0;ijp < 12;ijp++) {
00842 Int_t maxTriggerPatch = 0;
00843 Int_t minTriggerPatch = 300;
00844
for (Int_t j = 0;j < 25;j++) {
00845 Int_t triggerPatch;
00846
if (BEMCDecoderPresenter->
GetTriggerPatchFromJetPatch(ijp, j, triggerPatch)) {
00847
if (maxTriggerPatch < triggerPatch) maxTriggerPatch = triggerPatch;
00848
if (minTriggerPatch > triggerPatch) minTriggerPatch = triggerPatch;
00849 }
00850 }
00851 maxTriggerPatch++;
00852 Int_t height = (ijp%2) ? 55 : 60;
00853 TArrow *arrow =
new TArrow(minTriggerPatch-0.5, height, maxTriggerPatch-0.5, height, 0.02,
"<>");
00854
if (arrow) {
00855 arrow->SetLineColor(linesColor);
00856 arrow->SetFillColor(linesColor);
00857 arrow->Draw();
00858 }
00859 TString jpLabel;
00860 jpLabel = Form(
"JetPatch %u", ijp);
00861 TLatex *text =
new TLatex(minTriggerPatch + 1, height + 1, jpLabel.Data());
00862
if (text) {
00863 text->SetTextColor(linesColor);
00864 text->SetTextSize(0.0333);
00865 text->Draw();
00866 }
00867 }
00868 }
00869 c->cd(2);
00870
if (HistDsmL0InputPatchSum) {
00871 HistDsmL0InputPatchSum->SetStats(0);
00872 HistDsmL0InputPatchSum->Draw(
"COLZ");
00873
for (Int_t icrate = 1;icrate <= 30;icrate++) {
00874 Int_t triggerPatchBegin, triggerPatchEnd;
00875
if (BEMCDecoderPresenter->
GetTriggerPatchFromCrate(icrate, 0, triggerPatchBegin) && BEMCDecoderPresenter->
GetTriggerPatchFromCrate(icrate, 159, triggerPatchEnd)) {
00876 TLine *lCrateBegin =
new TLine(triggerPatchBegin-0.5, 0, triggerPatchBegin-0.5, 64);
00877
if (lCrateBegin) {
00878 lCrateBegin->SetLineColor(linesColor);
00879 lCrateBegin->SetLineWidth(1);
00880 lCrateBegin->Draw();
00881 }
00882 TString crateLabel;
00883 crateLabel = Form(
"%.2X", icrate);
00884 TLatex *textCrate =
new TLatex(triggerPatchBegin + 1, 60, crateLabel.Data());
00885
if (textCrate) {
00886 textCrate->SetTextColor(linesColor);
00887 textCrate->SetTextSize(0.0333);
00888 textCrate->Draw();
00889 }
00890 }
00891 }
00892 }
00893
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00894 }
00895
00896
void BEMCPlotsPresenter::displayL1Input(FileType file, TPad *pad, Int_t mDebug) {
00897
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
00898
00899 TH2F *HistDsmL1InputHighTowerBits = (TH2F*)GetHisto(file, HistDsmL1InputHighTowerBitsName);
00900
if (!HistDsmL1InputHighTowerBits || (mDebug >= 2)) cout <<
"HistDsmL1InputHighTowerBits = " << HistDsmL1InputHighTowerBits << endl;
00901 TH2F *HistDsmL1InputPatchSum = (TH2F*)GetHisto(file, HistDsmL1InputPatchSumName);
00902
if (!HistDsmL1InputPatchSum || (mDebug >= 2)) cout <<
"HistDsmL1InputPatchSum = " << HistDsmL1InputPatchSum << endl;
00903
00904
if (!pad)
return;
00905 pad->Clear();
00906 pad->cd(0);
00907
00908 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
00909 c->Draw();
00910 c->cd(0);
00911 c->Divide(1, 2, 0.001, 0.001);
00912
00913
00914 Int_t linesColor = 16;
00915 c->cd(1);
00916
if (HistDsmL1InputHighTowerBits) {
00917 HistDsmL1InputHighTowerBits->SetStats(0);
00918 HistDsmL1InputHighTowerBits->Draw(
"COLZ");
00919 HistDsmL1InputHighTowerBits->GetXaxis()->SetNdivisions(0,
false);
00920 HistDsmL1InputHighTowerBits->GetYaxis()->SetNdivisions(0,
false);
00921 TLatex *textHT0 =
new TLatex(-3.5, 0.5,
"HT < th0");
00922
if (textHT0) {
00923 textHT0->SetTextColor(linesColor);
00924 textHT0->SetTextSize(0.0333);
00925 textHT0->Draw();
00926 }
00927 TLatex *textHT1 =
new TLatex(-3.5, 1.5,
"th0 < HT < th1");
00928
if (textHT1) {
00929 textHT1->SetTextColor(linesColor);
00930 textHT1->SetTextSize(0.0333);
00931 textHT1->Draw();
00932 }
00933 TLatex *textHT2 =
new TLatex(-3.5, 2.5,
"th1 < HT < th2");
00934
if (textHT2) {
00935 textHT2->SetTextColor(linesColor);
00936 textHT2->SetTextSize(0.0333);
00937 textHT2->Draw();
00938 }
00939 TLatex *textHT3 =
new TLatex(-3.5, 3.5,
"th2 < HT");
00940
if (textHT3) {
00941 textHT3->SetTextColor(linesColor);
00942 textHT3->SetTextSize(0.0333);
00943 textHT3->Draw();
00944 }
00945 TLatex *textDsmsL0 =
new TLatex(-3.5, 4.0,
"#splitline{#splitline{DSM Level-0}{Boards}}{BTOW Crates}");
00946
if (textDsmsL0) {
00947 textDsmsL0->SetTextColor(linesColor);
00948 textDsmsL0->SetTextSize(0.0333);
00949 textDsmsL0->Draw();
00950 }
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963 Int_t dsmL0 = 0;
00964 Int_t ch = 0;
00965
for (Int_t idsmL1 = 0;idsmL1 < 6;idsmL1++) {
00966
for (Int_t idsmL1ch = 0;idsmL1ch < 6;idsmL1ch++) {
00967 TLine *lDsmL0Begin =
new TLine(ch-0.5, 0, ch-0.5, 4.4);
00968
if (lDsmL0Begin) {
00969 lDsmL0Begin->SetLineColor(linesColor);
00970 lDsmL0Begin->SetLineWidth(1);
00971 lDsmL0Begin->Draw();
00972 }
00973 TString label;
00974 Int_t crate = 0, crateSeq = 0;
00975
if (BEMCDecoderPresenter) {
00976 Int_t triggerPatch = dsmL0 * 10;
00977 BEMCDecoderPresenter->
GetCrateAndSequenceFromTriggerPatch(triggerPatch, crate, crateSeq);
00978 }
00979
if (idsmL1 < 3) {
00980 label = Form(
"#splitline{#splitline{BW}{0%.2u}}{%.2X}", (dsmL0 % 15) + 1, crate);
00981 }
else {
00982 label = Form(
"#splitline{#splitline{BE}{0%.2u}}{%.2X}", (dsmL0 % 15) + 1, crate);
00983 }
00984 TLatex *text =
new TLatex(ch + 0.1-0.5, 4.0, label.Data());
00985
if (text) {
00986 text->SetTextColor(linesColor);
00987 text->SetTextSize(0.0333);
00988 text->Draw();
00989 }
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004 ch++;
01005
if (idsmL1ch != 2) dsmL0++;
01006 }
01007 }
01008
for (Int_t ijp = 0;ijp < 12;ijp++) {
01009 Int_t maxCh = (ijp * 3) + 3;
01010 Int_t minCh = (ijp * 3) + 0;
01011 Float_t height = (ijp%2) ? 4.7 : 4.7;
01012 TArrow *arrow =
new TArrow(minCh-0.5, height, maxCh-0.5, height, 0.02,
"<>");
01013
if (arrow) {
01014 arrow->SetLineColor(linesColor);
01015 arrow->SetFillColor(linesColor);
01016 arrow->Draw();
01017 }
01018 TString jpLabel;
01019 jpLabel = Form(
"JetPatch %u", ijp);
01020 TLatex *text =
new TLatex(minCh + 0.1-0.5, height + 0.1, jpLabel.Data());
01021
if (text) {
01022 text->SetTextColor(linesColor);
01023 text->SetTextSize(0.0333);
01024 text->Draw();
01025 }
01026 }
01027 TLatex *textDsmsL1 =
new TLatex(-3.5, -0.4,
"#splitline{DSM Level-1}{Boards}");
01028
if (textDsmsL1) {
01029 textDsmsL1->SetTextColor(linesColor);
01030 textDsmsL1->SetTextSize(0.0333);
01031 textDsmsL1->Draw();
01032 }
01033
for (Int_t idsmL1 = 0;idsmL1 < 6;idsmL1++) {
01034 TArrow *arrow =
new TArrow((idsmL1 * 6)-0.5, -0.4, (idsmL1 * 6) + 6-0.5, -0.4, 0.02,
"<>");
01035
if (arrow) {
01036 arrow->SetLineColor(linesColor);
01037 arrow->SetFillColor(linesColor);
01038 arrow->Draw();
01039 }
01040 TString label;
01041
if (idsmL1 < 3) {
01042 label = Form(
"BW1%.2u", (idsmL1 % 3) + 1);
01043 }
else {
01044 label = Form(
"BE1%.2u", (idsmL1 % 3) + 1);
01045 }
01046 TLatex *text =
new TLatex((idsmL1 * 6) + 1-0.5, -0.35, label.Data());
01047
if (text) {
01048 text->SetTextColor(linesColor);
01049 text->SetTextSize(0.0333);
01050 text->Draw();
01051 }
01052 }
01053 }
01054
01055 c->cd(2);
01056
if (HistDsmL1InputPatchSum) {
01057 HistDsmL1InputPatchSum->SetStats(0);
01058 HistDsmL1InputPatchSum->Draw(
"COLZ");
01059 Int_t dsmL0 = 0;
01060 Int_t ch = 0;
01061
for (Int_t idsmL1 = 0;idsmL1 < 6;idsmL1++) {
01062
for (Int_t idsmL1ch = 0;idsmL1ch < 6;idsmL1ch++) {
01063 TLine *lDsmL0Begin =
new TLine(ch-0.5, 0, ch-0.5, 1024);
01064
if (lDsmL0Begin) {
01065 lDsmL0Begin->SetLineColor(linesColor);
01066 lDsmL0Begin->SetLineWidth(1);
01067 lDsmL0Begin->Draw();
01068 }
01069 Int_t crate = 0, crateSeq = 0;
01070
if (BEMCDecoderPresenter) {
01071 Int_t triggerPatch = dsmL0 * 10;
01072 BEMCDecoderPresenter->
GetCrateAndSequenceFromTriggerPatch(triggerPatch, crate, crateSeq);
01073 }
01074 TString label;
01075 label = Form(
"%.2X", crate);
01076 TLatex *text =
new TLatex(ch + 0.1-0.5, 900, label.Data());
01077
if (text) {
01078 text->SetTextColor(linesColor);
01079 text->SetTextSize(0.0333);
01080 text->Draw();
01081 }
01082 ch++;
01083
if (idsmL1ch != 2) dsmL0++;
01084 }
01085 }
01086 }
01087
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01088 }
01089
01090
void BEMCPlotsPresenter::displayL2Input(FileType file, TPad *pad, Int_t mDebug) {
01091
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01092
01093 TH2F *HistDsmL2InputHighTowerBits = (TH2F*)GetHisto(file, HistDsmL2InputHighTowerBitsName);
01094
if (!HistDsmL2InputHighTowerBits || (mDebug >= 2)) cout <<
"HistDsmL2InputHighTowerBits = " << HistDsmL2InputHighTowerBits << endl;
01095 TH2F *HistDsmL2InputPatchSumBits = (TH2F*)GetHisto(file, HistDsmL2InputPatchSumBitsName);
01096
if (!HistDsmL2InputPatchSumBits || (mDebug >= 2)) cout <<
"HistDsmL2InputPatchSumBits = " << HistDsmL2InputPatchSumBits << endl;
01097 TH2F *HistDsmL2InputPatchSum = (TH2F*)GetHisto(file, HistDsmL2InputPatchSumName);
01098
if (!HistDsmL2InputPatchSum || (mDebug >= 2)) cout <<
"HistDsmL2InputPatchSum = " << HistDsmL2InputPatchSum << endl;
01099
01100
if (!pad)
return;
01101 pad->Clear();
01102 pad->cd(0);
01103
01104 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
01105 c->Draw();
01106 c->cd(0);
01107 c->Divide(1, 3, 0.001, 0.001);
01108
01109
01110 Int_t linesColor = 16;
01111 c->cd(1);
01112
01113
if (HistDsmL2InputHighTowerBits) {
01114 HistDsmL2InputHighTowerBits->SetStats(0);
01115 HistDsmL2InputHighTowerBits->Draw(
"COLZ");
01116 HistDsmL2InputHighTowerBits->GetXaxis()->SetNdivisions(12,
false);
01117 HistDsmL2InputHighTowerBits->GetYaxis()->SetNdivisions(0,
false);
01118 TLatex *textHT0 =
new TLatex(-1.4, 0.5,
"HT < th0");
01119
if (textHT0) {
01120 textHT0->SetTextColor(linesColor);
01121 textHT0->SetTextSize(0.05);
01122 textHT0->Draw();
01123 }
01124 TLatex *textHT1 =
new TLatex(-1.4, 1.5,
"th0 < HT < th1");
01125
if (textHT1) {
01126 textHT1->SetTextColor(linesColor);
01127 textHT1->SetTextSize(0.05);
01128 textHT1->Draw();
01129 }
01130 TLatex *textHT2 =
new TLatex(-1.4, 2.5,
"th1 < HT < th2");
01131
if (textHT2) {
01132 textHT2->SetTextColor(linesColor);
01133 textHT2->SetTextSize(0.05);
01134 textHT2->Draw();
01135 }
01136 TLatex *textHT3 =
new TLatex(-1.4, 3.5,
"th2 < HT");
01137
if (textHT3) {
01138 textHT3->SetTextColor(linesColor);
01139 textHT3->SetTextSize(0.05);
01140 textHT3->Draw();
01141 }
01142 TLatex *textDsmsL1 =
new TLatex(-1.4, 4.5,
"#splitline{DSM Level-1}{Boards}");
01143
if (textDsmsL1) {
01144 textDsmsL1->SetTextColor(linesColor);
01145 textDsmsL1->SetTextSize(0.05);
01146 textDsmsL1->Draw();
01147 }
01148
for (Int_t ch = 0;ch < 12;ch += 2) {
01149 TLine *lDsmL1Begin =
new TLine(ch-0.5, 0, ch-0.5, 5);
01150
if (lDsmL1Begin) {
01151 lDsmL1Begin->SetLineColor(linesColor);
01152 lDsmL1Begin->SetLineWidth(1);
01153 lDsmL1Begin->Draw();
01154 }
01155 TString label;
01156
if (ch < 6) {
01157 label = Form(
"BW1%.2u", ((ch / 2) % 3) + 1);
01158 }
else {
01159 label = Form(
"BE1%.2u", ((ch / 2) % 3) + 1);
01160 }
01161 TLatex *text =
new TLatex(ch + 0.1-0.5, 4.5, label.Data());
01162
if (text) {
01163 text->SetTextColor(linesColor);
01164 text->SetTextSize(0.05);
01165 text->Draw();
01166 }
01167 }
01168 }
01169
01170 c->cd(2);
01171
if (HistDsmL2InputPatchSumBits) {
01172 HistDsmL2InputPatchSumBits->SetStats(0);
01173 HistDsmL2InputPatchSumBits->Draw(
"COLZ");
01174 HistDsmL2InputPatchSumBits->GetXaxis()->SetNdivisions(12,
false);
01175 HistDsmL2InputPatchSumBits->GetYaxis()->SetNdivisions(0,
false);
01176 TLatex *textHT0 =
new TLatex(-1.4, 0.5,
"Sum < th0");
01177
if (textHT0) {
01178 textHT0->SetTextColor(linesColor);
01179 textHT0->SetTextSize(0.05);
01180 textHT0->Draw();
01181 }
01182 TLatex *textHT1 =
new TLatex(-1.4, 1.5,
"th0 < Sum < th1");
01183
if (textHT1) {
01184 textHT1->SetTextColor(linesColor);
01185 textHT1->SetTextSize(0.05);
01186 textHT1->Draw();
01187 }
01188 TLatex *textHT2 =
new TLatex(-1.4, 2.5,
"th1 < Sum < th2");
01189
if (textHT2) {
01190 textHT2->SetTextColor(linesColor);
01191 textHT2->SetTextSize(0.05);
01192 textHT2->Draw();
01193 }
01194 TLatex *textHT3 =
new TLatex(-1.4, 3.5,
"th2 < Sum");
01195
if (textHT3) {
01196 textHT3->SetTextColor(linesColor);
01197 textHT3->SetTextSize(0.05);
01198 textHT3->Draw();
01199 }
01200
for (Int_t ch = 0;ch < 12;ch += 2) {
01201 TLine *lDsmL1Begin =
new TLine(ch-0.5, 0, ch-0.5, 4);
01202
if (lDsmL1Begin) {
01203 lDsmL1Begin->SetLineColor(linesColor);
01204 lDsmL1Begin->SetLineWidth(1);
01205 lDsmL1Begin->Draw();
01206 }
01207 }
01208 }
01209
01210 c->cd(3);
01211
if (HistDsmL2InputPatchSum) {
01212 HistDsmL2InputPatchSum->SetStats(0);
01213
01214
01215 HistDsmL2InputPatchSum->Draw(
"COLZ");
01216
for (Int_t ch = 0;ch < 6;ch++) {
01217 TLine *lDsmL1Begin =
new TLine(ch-0.5, 0, ch-0.5, 256);
01218
if (lDsmL1Begin) {
01219 lDsmL1Begin->SetLineColor(linesColor);
01220 lDsmL1Begin->SetLineWidth(1);
01221 lDsmL1Begin->Draw();
01222 }
01223 }
01224 }
01225
01226
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01227 }
01228
01229
void BEMCPlotsPresenter::displayL3Input(FileType file, TPad *pad, Int_t mDebug) {
01230
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01231
01232 TH1F *HistDsmL3InputHighTowerBits = (TH1F*)GetHisto(file, HistDsmL3InputHighTowerBitsName);
01233
if (!HistDsmL3InputHighTowerBits || (mDebug >= 2)) cout <<
"HistDsmL3InputHighTowerBits = " << HistDsmL3InputHighTowerBits << endl;
01234 TH1F *HistDsmL3InputPatchSumBits = (TH1F*)GetHisto(file, HistDsmL3InputPatchSumBitsName);
01235
if (!HistDsmL3InputPatchSumBits || (mDebug >= 2)) cout <<
"HistDsmL3InputPatchSumBits = " << HistDsmL3InputPatchSumBits << endl;
01236 TH1F *HistDsmL3InputBackToBackBit = (TH1F*)GetHisto(file, HistDsmL3InputBackToBackBitName);
01237
if (!HistDsmL3InputBackToBackBit || (mDebug >= 2)) cout <<
"HistDsmL3InputBackToBackBit = " << HistDsmL3InputBackToBackBit << endl;
01238 TH1F *HistDsmL3InputJPsiTopoBit = (TH1F*)GetHisto(file, HistDsmL3InputJPsiTopoBitName);
01239
if (!HistDsmL3InputJPsiTopoBit || (mDebug >= 2)) cout <<
"HistDsmL3InputJPsiTopoBit = " << HistDsmL3InputJPsiTopoBit << endl;
01240 TH1F *HistDsmL3InputJetPatchTopoBit = (TH1F*)GetHisto(file, HistDsmL3InputJetPatchTopoBitName);
01241
if (!HistDsmL3InputJetPatchTopoBit || (mDebug >= 2)) cout <<
"HistDsmL3InputJetPatchTopoBit = " << HistDsmL3InputJetPatchTopoBit << endl;
01242
01243
if (!pad)
return;
01244 pad->Clear();
01245 pad->cd(0);
01246
01247 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
01248 c->Draw();
01249 c->cd(0);
01250 c->Divide(2, 1, 0.001, 0.001);
01251
01252 c->cd(1);
01253
01254
if (HistDsmL3InputHighTowerBits) {
01255
01256 HistDsmL3InputHighTowerBits->Draw();
01257 }
01258
01259 c->cd(2);
01260
01261
if (HistDsmL3InputPatchSumBits) {
01262
01263 HistDsmL3InputPatchSumBits->Draw();
01264 }
01265
01266 }
01267
01268
void BEMCPlotsPresenter::displaySmdFeeSum(FileType file, TPad *pad, Int_t mDebug) {
01269
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01270
01271 TH2F *HistSmdFeeSum = (TH2F*)GetHisto(file, HistSmdFeeSumName);
01272
if (!HistSmdFeeSum || (mDebug >= 2)) cout <<
"HistSmdFeeSum = " << HistSmdFeeSum << endl;
01273 TH2F *HistSmdFeeSumNonZS = (TH2F*)GetHisto(file, HistSmdFeeSumNonZSName);
01274
if (!HistSmdFeeSumNonZS || (mDebug >= 2)) cout <<
"HistSmdFeeSumNonZS = " << HistSmdFeeSumNonZS << endl;
01275
if (!pad)
return;
01276 pad->Clear();
01277 pad->cd(0);
01278
01279
01280 Int_t linesColor = 16;
01281 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
01282 c->Draw();
01283
01284 c->Divide(1, 2, 0.001, 0.001);
01285
01286 c->cd(1);
01287
if (HistSmdFeeSum) {
01288 HistSmdFeeSum->SetStats(0);
01289 HistSmdFeeSum->Draw(
"COLZ");
01290 Int_t moduleRdo[120];
01291
if(BEMCDecoderPresenter) {
01292 Int_t RDO, index;
01293
for (Int_t module = 1;module <= 120;module++) {
01294 moduleRdo[module - 1] = -1;
01295
if (BEMCDecoderPresenter->
GetSmdRDO(3, module, 1, 1, RDO, index)) {
01296 moduleRdo[module - 1] = RDO;
01297 }
01298
01299 }
01300 }
01301 Int_t curmod = 1;
01302 Int_t currdo = -1;
01303 Int_t beginrdo = -1;
01304 Int_t endrdo = -1;
01305
while (curmod <= 121) {
01306
01307
if (((curmod <= 120) && (moduleRdo[curmod - 1] != currdo)) || (curmod == 121)) {
01308
if ((currdo == -1) && (curmod <= 120)) {
01309 beginrdo = curmod;
01310 currdo = moduleRdo[curmod - 1];
01311 curmod++;
01312 }
else {
01313 endrdo = curmod - 1;
01314 TLine *lRdoBegin =
new TLine(beginrdo - 0.5, HistSmdFeeSum->GetYaxis()->GetBinLowEdge(1), beginrdo - 0.5, HistSmdFeeSum->GetYaxis()->GetBinUpEdge(HistSmdFeeSum->GetYaxis()->GetNbins()));
01315
if (lRdoBegin) {
01316 lRdoBegin->SetLineColor(linesColor);
01317 lRdoBegin->SetLineWidth(1);
01318 lRdoBegin->Draw();
01319 }
01320 TLine *lRdoEnd =
new TLine(endrdo + 0.5, HistSmdFeeSum->GetYaxis()->GetBinLowEdge(1), endrdo + 0.5, HistSmdFeeSum->GetYaxis()->GetBinUpEdge(HistSmdFeeSum->GetYaxis()->GetNbins()));
01321
if (lRdoEnd) {
01322 lRdoEnd->SetLineColor(linesColor);
01323 lRdoEnd->SetLineWidth(1);
01324 lRdoEnd->Draw();
01325 }
01326 TString label;
01327 label = Form(
"RDO %i", currdo);
01328 TLatex *text =
new TLatex(beginrdo + 1 -0.5, 0.8 * HistSmdFeeSum->GetYaxis()->GetBinUpEdge(HistSmdFeeSum->GetYaxis()->GetNbins()), label.Data());
01329
if (text) {
01330 text->SetTextColor(linesColor);
01331 text->SetTextSize(0.03);
01332 text->Draw();
01333 }
01334 currdo = -1;
01335
if (curmod > 120) curmod++;
01336 }
01337 }
else {
01338 curmod++;
01339 }
01340 }
01341 }
01342
01343 c->cd(2);
01344
if (HistSmdFeeSumNonZS) {
01345 HistSmdFeeSumNonZS->SetStats(0);
01346 HistSmdFeeSumNonZS->Draw(
"COLZ");
01347 Int_t moduleRdo[120];
01348
if(BEMCDecoderPresenter) {
01349 Int_t RDO, index;
01350
for (Int_t module = 1;module <= 120;module++) {
01351 moduleRdo[module - 1] = -1;
01352
if (BEMCDecoderPresenter->
GetSmdRDO(3, module, 1, 1, RDO, index)) {
01353 moduleRdo[module - 1] = RDO;
01354 }
01355 }
01356 }
01357 Int_t curmod = 1;
01358 Int_t currdo = -1;
01359 Int_t beginrdo = -1;
01360 Int_t endrdo = -1;
01361
while (curmod <= 121) {
01362
if (((curmod <= 120) && (moduleRdo[curmod - 1] != currdo)) || (curmod == 121)) {
01363
if ((currdo == -1) && (curmod <= 120)) {
01364 beginrdo = curmod;
01365 currdo = moduleRdo[curmod - 1];
01366 curmod++;
01367 }
else {
01368 endrdo = curmod - 1;
01369 TLine *lRdoBegin =
new TLine(beginrdo - 0.5, HistSmdFeeSumNonZS->GetYaxis()->GetBinLowEdge(1), beginrdo - 0.5, HistSmdFeeSumNonZS->GetYaxis()->GetBinUpEdge(HistSmdFeeSumNonZS->GetYaxis()->GetNbins()));
01370
if (lRdoBegin) {
01371 lRdoBegin->SetLineColor(linesColor);
01372 lRdoBegin->SetLineWidth(1);
01373 lRdoBegin->Draw();
01374 }
01375 TLine *lRdoEnd =
new TLine(endrdo + 0.5, HistSmdFeeSumNonZS->GetYaxis()->GetBinLowEdge(1), endrdo + 0.5, HistSmdFeeSumNonZS->GetYaxis()->GetBinUpEdge(HistSmdFeeSumNonZS->GetYaxis()->GetNbins()));
01376
if (lRdoEnd) {
01377 lRdoEnd->SetLineColor(linesColor);
01378 lRdoEnd->SetLineWidth(1);
01379 lRdoEnd->Draw();
01380 }
01381 TString label;
01382 label = Form(
"RDO %i", currdo);
01383 TLatex *text =
new TLatex(beginrdo + 1 -0.5, 0.8 * HistSmdFeeSumNonZS->GetYaxis()->GetBinUpEdge(HistSmdFeeSumNonZS->GetYaxis()->GetNbins()), label.Data());
01384
if (text) {
01385 text->SetTextColor(linesColor);
01386 text->SetTextSize(0.03);
01387 text->Draw();
01388 }
01389 currdo = -1;
01390
if (curmod > 120) curmod++;
01391 }
01392 }
else {
01393 curmod++;
01394 }
01395 }
01396 }
01397 }
01398
01399
void BEMCPlotsPresenter::displayPsdFeeSum(FileType file, TPad *pad, Int_t mDebug) {
01400
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01401
01402 TH2F *HistPsdFeeSum = (TH2F*)GetHisto(file, HistPsdFeeSumName);
01403
if (!HistPsdFeeSum || (mDebug >= 2)) cout <<
"HistPsdFeeSum = " << HistPsdFeeSum << endl;
01404 TH2F *HistPsdFeeSumNonZS = (TH2F*)GetHisto(file, HistPsdFeeSumNonZSName);
01405
if (!HistPsdFeeSumNonZS || (mDebug >= 2)) cout <<
"HistPsdFeeSumNonZS = " << HistPsdFeeSumNonZS << endl;
01406
if (!pad)
return;
01407 pad->Clear();
01408 pad->cd(0);
01409
01410
01411 Int_t linesColor = 16;
01412 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
01413 c->Draw();
01414
01415 c->Divide(1, 2, 0.001, 0.001);
01416
01417 c->cd(1);
01418
if (HistPsdFeeSum) {
01419 HistPsdFeeSum->SetStats(0);
01420 HistPsdFeeSum->Draw(
"COLZ");
01421 Int_t pmtRdo[60];
01422
for (Int_t box = 0;box < 60;box++) pmtRdo[box] = -1;
01423
if(BEMCDecoderPresenter) {
01424
for (Int_t rdo = 0;rdo < 4;rdo++) {
01425
for (Int_t index = 0;index < 4800;index++) {
01426 Int_t
id, box, wire, Avalue;
01427
if (BEMCDecoderPresenter->
GetPsdId(rdo, index,
id, box, wire, Avalue)) {
01428
if ((box >= 1) && (box <= 60)) {
01429 pmtRdo[box - 1] = rdo + 8;
01430 }
01431 }
01432 }
01433 }
01434 }
01435 Int_t curmod = 1;
01436 Int_t currdo = -1;
01437 Int_t beginrdo = -1;
01438 Int_t endrdo = -1;
01439
while (curmod <= 61) {
01440
01441
if (((curmod <= 60) && (pmtRdo[curmod - 1] != currdo)) || (curmod == 61)) {
01442
if ((currdo == -1) && (curmod <= 60)) {
01443 beginrdo = curmod;
01444 currdo = pmtRdo[curmod - 1];
01445 curmod++;
01446 }
else {
01447 endrdo = curmod - 1;
01448 TLine *lRdoBegin =
new TLine(beginrdo - 0.5, HistPsdFeeSum->GetYaxis()->GetBinLowEdge(1), beginrdo - 0.5, HistPsdFeeSum->GetYaxis()->GetBinUpEdge(HistPsdFeeSum->GetYaxis()->GetNbins()));
01449
if (lRdoBegin) {
01450 lRdoBegin->SetLineColor(linesColor);
01451 lRdoBegin->SetLineWidth(1);
01452 lRdoBegin->Draw();
01453 }
01454 TLine *lRdoEnd =
new TLine(endrdo + 0.5, HistPsdFeeSum->GetYaxis()->GetBinLowEdge(1), endrdo + 0.5, HistPsdFeeSum->GetYaxis()->GetBinUpEdge(HistPsdFeeSum->GetYaxis()->GetNbins()));
01455
if (lRdoEnd) {
01456 lRdoEnd->SetLineColor(linesColor);
01457 lRdoEnd->SetLineWidth(1);
01458 lRdoEnd->Draw();
01459 }
01460 TString label;
01461 label = Form(
"RDO %i", currdo);
01462 TLatex *text =
new TLatex(beginrdo + 0.5 -0.5, 0.8 * HistPsdFeeSum->GetYaxis()->GetBinUpEdge(HistPsdFeeSum->GetYaxis()->GetNbins()), label.Data());
01463
if (text) {
01464 text->SetTextColor(linesColor);
01465 text->SetTextSize(0.03);
01466 text->Draw();
01467 }
01468 currdo = -1;
01469
if (curmod > 60) curmod++;
01470 }
01471 }
else {
01472 curmod++;
01473 }
01474 }
01475 }
01476
01477 c->cd(2);
01478
if (HistPsdFeeSumNonZS) {
01479 HistPsdFeeSumNonZS->SetStats(0);
01480 HistPsdFeeSumNonZS->Draw(
"COLZ");
01481 Int_t pmtRdo[60];
01482
for (Int_t box = 0;box < 60;box++) pmtRdo[box] = -1;
01483
if(BEMCDecoderPresenter) {
01484
for (Int_t rdo = 0;rdo < 4;rdo++) {
01485
for (Int_t index = 0;index < 4800;index++) {
01486 Int_t
id, box, wire, Avalue;
01487
if (BEMCDecoderPresenter->
GetPsdId(rdo, index,
id, box, wire, Avalue)) {
01488
if ((box >= 1) && (box <= 60)) {
01489 pmtRdo[box - 1] = rdo + 8;
01490 }
01491 }
01492 }
01493 }
01494 }
01495 Int_t curmod = 1;
01496 Int_t currdo = -1;
01497 Int_t beginrdo = -1;
01498 Int_t endrdo = -1;
01499
while (curmod <= 61) {
01500
01501
if (((curmod <= 60) && (pmtRdo[curmod - 1] != currdo)) || (curmod == 61)) {
01502
if ((currdo == -1) && (curmod <= 60)) {
01503 beginrdo = curmod;
01504 currdo = pmtRdo[curmod - 1];
01505 curmod++;
01506 }
else {
01507 endrdo = curmod - 1;
01508 TLine *lRdoBegin =
new TLine(beginrdo - 0.5, HistPsdFeeSumNonZS->GetYaxis()->GetBinLowEdge(1), beginrdo - 0.5, HistPsdFeeSumNonZS->GetYaxis()->GetBinUpEdge(HistPsdFeeSumNonZS->GetYaxis()->GetNbins()));
01509
if (lRdoBegin) {
01510 lRdoBegin->SetLineColor(linesColor);
01511 lRdoBegin->SetLineWidth(1);
01512 lRdoBegin->Draw();
01513 }
01514 TLine *lRdoEnd =
new TLine(endrdo + 0.5, HistPsdFeeSumNonZS->GetYaxis()->GetBinLowEdge(1), endrdo + 0.5, HistPsdFeeSumNonZS->GetYaxis()->GetBinUpEdge(HistPsdFeeSumNonZS->GetYaxis()->GetNbins()));
01515
if (lRdoEnd) {
01516 lRdoEnd->SetLineColor(linesColor);
01517 lRdoEnd->SetLineWidth(1);
01518 lRdoEnd->Draw();
01519 }
01520 TString label;
01521 label = Form(
"RDO %i", currdo);
01522 TLatex *text =
new TLatex(beginrdo + 0.5 -0.5, 0.8 * HistPsdFeeSumNonZS->GetYaxis()->GetBinUpEdge(HistPsdFeeSumNonZS->GetYaxis()->GetNbins()), label.Data());
01523
if (text) {
01524 text->SetTextColor(linesColor);
01525 text->SetTextSize(0.03);
01526 text->Draw();
01527 }
01528 currdo = -1;
01529
if (curmod > 60) curmod++;
01530 }
01531 }
else {
01532 curmod++;
01533 }
01534 }
01535 }
01536 }
01537
01538
void BEMCPlotsPresenter::displayTriggerCorruption(FileType file, TPad *pad,
bool hold, Int_t mDebug) {
01539
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01540
01541 TH1F *HistTriggerCorruptionHighTower = (TH1F*)GetHisto(file, HistTriggerCorruptionHighTowerName);
01542
if (!HistTriggerCorruptionHighTower || (mDebug >= 2)) cout <<
"HistTriggerCorruptionHighTower = " << HistTriggerCorruptionHighTower << endl;
01543 TH1F *HistTriggerCorruptionPatchSum = (TH1F*)GetHisto(file, HistTriggerCorruptionPatchSumName);
01544
if (!HistTriggerCorruptionPatchSum || (mDebug >= 2)) cout <<
"HistTriggerCorruptionPatchSum = " << HistTriggerCorruptionPatchSum << endl;
01545 TH2F *HistDSM0HTCorr = (TH2F*)GetHisto(file, HistDSM0HTCorrName);
01546
if (!HistDSM0HTCorr || (mDebug >= 2)) cout <<
"HistDSM0HTCorr = " << HistDSM0HTCorrName << endl;
01547 TH2F *HistDSM0TPCorr = (TH2F*)GetHisto(file, HistDSM0TPCorrName);
01548
if (!HistDSM0TPCorr || (mDebug >= 2)) cout <<
"HistDSM0TPCorr = " << HistDSM0TPCorrName << endl;
01549
01550
if (!pad)
return;
01551 pad->Clear();
01552 pad->cd(0);
01553
01554
01555
01556 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
01557 c->Draw();
01558 c->cd(0);
01559
01560
01561 c->Divide(2, 1, 0.001, 0.001);
01562
01563
01564
01565
01566
01567
01568
01569
01570
01571
01572
01573
01574
01575 c->cd(1);
01576
if (HistDSM0HTCorr) {
01577 HistDSM0HTCorr->SetStats(0);
01578 HistDSM0HTCorr->Draw(
"COLZ");
01579 }
01580 c->cd(2);
01581
if (HistDSM0TPCorr) {
01582 HistDSM0TPCorr->SetStats(0);
01583 HistDSM0TPCorr->Draw(
"COLZ");
01584 }
01585 }
01586
01587
01588
01589
void BEMCPlotsPresenter::displayAdcEtaPhi( FileType file, TPad *pad, Int_t mDebug)
01590 {
01591
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01592
01593 TH2F *Hist_ADCEtaPhi_TowHits= (TH2F*)GetHisto(file, Hist_ADCEtaPhi_TowHitsName);
01594
if (!Hist_ADCEtaPhi_TowHits || (mDebug >= 2)) cout <<
"HistADCEtaPhi_TowHits = " << Hist_ADCEtaPhi_TowHits << endl;
01595 TH2F *Hist_ADCEtaPhi_Pre1Hits = (TH2F*)GetHisto(file, Hist_ADCEtaPhi_Pre1HitsName);
01596
if (!Hist_ADCEtaPhi_Pre1Hits || (mDebug >= 2)) cout <<
"Hist_ADCEtaPhi_Pre1Hits = " << Hist_ADCEtaPhi_Pre1Hits << endl;
01597
01598
if (!pad)
return;
01599 pad->Clear();
01600 pad->cd(0);
01601
01602 TPad* c =
new TPad(
"pad2",
"apd2",0.0,0.1,1.,1.);
01603 c->Draw();
01604 c->cd(0);
01605 c->Divide(1, 2);
01606
01607 c->cd(1);
01608
if (Hist_ADCEtaPhi_TowHits) {
01609 Hist_ADCEtaPhi_TowHits->SetStats(0);
01610 Hist_ADCEtaPhi_TowHits->Draw(
"H COLZ");
01611 }
01612 c->cd(2);
01613
if (Hist_ADCEtaPhi_Pre1Hits) {
01614 Hist_ADCEtaPhi_Pre1Hits->SetStats(0);
01615 Hist_ADCEtaPhi_Pre1Hits->Draw(
"H COLZ");
01616 }
01617
01618 }
01619
01620
01621
01622
void BEMCPlotsPresenter::displayTab(Int_t tab, Int_t panel, FileType file, TPad *pad, Int_t mDebug) {
01623
01624
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01625
01626
01627
01628
if (!BEMCDecoderPresenter) BEMCDecoderPresenter =
new StEmcDecoder();
01629
if (mDebug >= 2) cout <<
"tab = " << tab << endl;
01630
if (mDebug >= 2) cout <<
"panel = " << panel << endl;
01631
if (!file.file() || (mDebug >= 2)) cout <<
"file = " << file.file() << endl;
01632
if (!pad || (mDebug >= 2)) cout <<
"pad = " << pad << endl;
01633
if (!BEMCDecoderPresenter || (mDebug >= 2)) cout <<
"BEMCDecoderPresenter = " << BEMCDecoderPresenter << endl;
01634
01635
if (tab == 0) {
01636
if (panel == 0) {
01637 displayStatus(file, pad, mDebug);
01638 }
else if (panel == 1) {
01639 displayTowers(file, pad, mDebug);
01640 }
else if (panel == 2) {
01641 displaySMDPSD(file, pad, mDebug);
01642 }
else if (panel == 3) {
01643 displayTrigger(file, pad, mDebug);
01644 }
else if (panel == 4) {
01645 displayJet(file, pad, mDebug);
01646 }
else if (panel == 5) {
01647 displayRawAdc(file, pad,
false, mDebug);
01648 }
else if (panel == 6) {
01649 displayJetPatchHT(file, pad, mDebug);
01650 }
else if (panel == 7) {
01651 displayJetPatchSum(file, pad, mDebug);
01652 }
else if (panel == 8) {
01653 displayL0Input(file, pad, mDebug);
01654 }
else if (panel == 9) {
01655 displayL1Input(file, pad, mDebug);
01656 }
else if (panel == 10) {
01657 displayL2Input(file, pad, mDebug);
01658 }
else if (panel == 11) {
01659 displaySmdFeeSum(file, pad, mDebug);
01660 }
else if (panel == 12) {
01661 displayTriggerCorruption(file, pad,
true, mDebug);
01662 }
else if (panel == 13) {
01663 displayPsdFeeSum(file, pad, mDebug);
01664 }
else if (panel == 14) {
01665 displayRawAdc(file, pad,
true, mDebug);
01666 }
01667 }
01668
if (tab == 1) {
01669
if (panel == 0) {
01670 displayRawAdcZoom(file, pad,
false, mDebug);
01671 }
else if (panel == 1) {
01672 displayAdcEtaPhi(file, pad, mDebug);
01673 }
else if (panel == 2) {
01674 displaySmdFeeSum(file, pad, mDebug);
01675 }
else if (panel == 3) {
01676
01677 }
else if (panel == 4) {
01678
01679 }
else if (panel == 5) {
01680 displayPsdFeeSum(file, pad, mDebug);
01681 }
else if (panel == 6) {
01682 displayRawAdc(file, pad,
true, mDebug);
01683 }
else if (panel == 7) {
01684 displayL0Input(file, pad, mDebug);
01685 }
else if (panel == 8) {
01686 displayTriggerCorruption(file, pad,
true, mDebug);
01687 }
01688 }
01689
if (mDebug >= 10) cout << __FILE__ <<
":" << __LINE__ << endl;
01690 }
01691