00001
00002
00003
00004
00006
00007
00008
00009
00010
00011
00013
00014 #include <TSystem.h>
00015 #include <TStyle.h>
00016
00017 #include "FROOT.h"
00018 #include "TFndTofMonFrame.h"
00019 #include "TFndRun.h"
00020 #include "TFndHdt.h"
00021
00022 ClassImp(TFndTofMonFrame)
00023
00024
00025 TFndTofMonFrame::TFndTofMonFrame(TString filename):
00026 TFndMonFrame(filename),fIO(),fCurSlab(),fNSlabs(),
00027 fGenMapFile(),fAdcMapFile(),fTdcMapFile(),
00028 fSlabPad(),fAllPad(),
00029 fSlabButton(),fAllButton(),
00030 hists(),h2(),
00031 fWhichGroup(-1),fAllId(-1)
00032 {
00033
00034 Init();
00035 }
00036
00037
00038 TFndTofMonFrame::~TFndTofMonFrame() {
00039
00040 if(!fClosed) Close();
00041 }
00042
00043
00044 void TFndTofMonFrame::Init() {
00045
00046
00047 SetStyle();
00048
00049 fNSlabs[0] = 12;
00050 fNSlabs[1] = 72;
00051
00052 fHighlightCol[0] = 5;
00053 fHighlightCol[1] = 5;
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065 }
00066
00067
00068 void TFndTofMonFrame::Open() {
00069
00070 if(!fClosed) return;
00071 if(! StartInterface(1)) return;
00072 if(! StartInterface(0)) return;
00073 fClosed = kFALSE;
00074 }
00075
00076
00077 void TFndTofMonFrame::Close() {
00078
00079
00080 if(!fClosed){
00081 Printf("TFndTofMonFrame::Close() ---> closing and re-initializing to zero all mapfiles");
00082 if(fGenMapFile) { fGenMapFile->Close(); fGenMapFile = 0; }
00083 if(fAdcMapFile) { fAdcMapFile->Close(); fAdcMapFile = 0; }
00084 if(fTdcMapFile) { fTdcMapFile->Close(); fTdcMapFile = 0; }
00085 Printf("TFndTofMonFrame::Close() ---> Done");
00086 }
00087 fClosed = kTRUE;
00088
00089 }
00090
00091
00092 Bool_t TFndTofMonFrame::ReloadMapFiles(){
00093
00094 Bool_t result = kTRUE;
00095 if(!fIsOnline) return result;
00096
00097 if( CheckProducerMessages() != 0 ) return kFALSE;
00098 TString shr_file_map_name[3] = 0;
00099
00100 #if defined _FND_ONL_USE_MAP_FILES_
00101 if(fndrun->GetDebug()) Printf("TFndTofMonFrame::ReloadMapFiles() ---> closing and re-initializing to zero all mapfiles");
00102 if(fGenMapFile) { fGenMapFile->Close(); fGenMapFile = 0; }
00103 if(fAdcMapFile) { fAdcMapFile->Close(); fAdcMapFile = 0; }
00104 if(fTdcMapFile) { fTdcMapFile->Close(); fTdcMapFile = 0; }
00105 if(fndrun->GetDebug()) Printf("TFndTofMonFrame::ReloadMapFiles() ---> Done");
00106
00107 shr_file_map_name[0] = "$FND_SHR/tof_map.map";
00108 shr_file_map_name[1] = "$FND_SHR/tof_adc.map";
00109 shr_file_map_name[2] = "$FND_SHR/tof_tdc.map";
00110 #elif defined _FND_ONL_USE_SHARED_FILES_
00111 if(fGenMapFile) { if(fGenMapFile->IsOpen()) fGenMapFile->Close(); delete fGenMapFile; fGenMapFile = 0; }
00112 if(fAdcMapFile) { if(fAdcMapFile->IsOpen()) fAdcMapFile->Close(); delete fAdcMapFile; fAdcMapFile = 0; }
00113 if(fTdcMapFile) { if(fTdcMapFile->IsOpen()) fTdcMapFile->Close(); delete fTdcMapFile; fTdcMapFile = 0; }
00114 if(fndrun->GetDebug()) Printf("TFndTofMonFrame::ReloadMapFiles() ---> Done");
00115
00116 shr_file_map_name[0] = "$FND_SHR/tof_map.file.map";
00117 shr_file_map_name[1] = "$FND_SHR/tof_adc.file.map";
00118 shr_file_map_name[2] = "$FND_SHR/tof_tdc.file.map";
00119 #endif
00120
00121 if(fndrun->GetDebug()) Printf("Reloading shared memories...");
00122
00123 if(!gSystem->AccessPathName(FROOT::ExpandPathName(shr_file_map_name[0].Data()))){
00124 #if defined _FND_ONL_USE_MAP_FILES_
00125 if(fndrun->GetDebug()) Printf(" fGenMapFile ");
00126
00127 fGenMapFile = TMapFile::Create(FROOT::ExpandPathName(shr_file_map_name[0].Data()),"READ");
00128 if(fndrun->GetDebug())fGenMapFile->Print();
00129
00130 #elif defined _FND_ONL_USE_SHARED_FILES_
00131 fGenMapFile = new TFile(FROOT::ExpandPathName(shr_file_map_name[0].Data()),"READ");
00132 Info("TFndTofMonFrame::ReloadMapFiles","Reloading shared file \"%s\"",shr_file_map_name[0].Data());
00133
00134 #endif
00135 }
00136 else result = kFALSE;
00137
00138 if(!gSystem->AccessPathName(FROOT::ExpandPathName(shr_file_map_name[1].Data()))){
00139 #if defined _FND_ONL_USE_MAP_FILES_
00140 if(fndrun->GetDebug()) Printf(" fAdcMapFile ");
00141
00142 fAdcMapFile = TMapFile::Create(FROOT::ExpandPathName(shr_file_map_name[1].Data()),"READ");
00143 if(fndrun->GetDebug())fAdcMapFile->Print();
00144
00145 #elif defined _FND_ONL_USE_SHARED_FILES_
00146 fAdcMapFile = new TFile(FROOT::ExpandPathName(shr_file_map_name[1].Data()),"READ");
00147 Info("TFndTofMonFrame::ReloadMapFiles","Reloading shared file \"%s\"",shr_file_map_name[1].Data());
00148
00149 #endif
00150 }
00151 else result = kFALSE;
00152
00153 if(!gSystem->AccessPathName(FROOT::ExpandPathName(shr_file_map_name[2].Data()))){
00154 #if defined _FND_ONL_USE_MAP_FILES_
00155 if(fndrun->GetDebug()) Printf(" fTdcMapFile ");
00156
00157 fTdcMapFile = TMapFile::Create(FROOT::ExpandPathName(shr_file_map_name[2].Data()),"READ");
00158 if(fndrun->GetDebug())fTdcMapFile->Print();
00159
00160 #elif defined _FND_ONL_USE_SHARED_FILES_
00161 fTdcMapFile = new TFile(FROOT::ExpandPathName(shr_file_map_name[2].Data()),"READ");
00162 Info("TFndTofMonFrame::ReloadMapFiles","Reloading shared file \"%s\"",shr_file_map_name[2].Data());
00163
00164 #endif
00165 }
00166 else result = kFALSE;
00167
00168 if(fndrun->GetDebug()){
00169 if(result) Printf("TFndTofMonFrame::ReloadMapFiles() ---> exiting method");
00170 else Printf("TFndTofMonFrame::ReloadMapFiles() ---> exiting method (shared memories not found)");
00171 }
00172 return result;
00173 }
00174
00175
00176 Bool_t TFndTofMonFrame::StartInterface(Int_t ring) {
00177
00178 Int_t BackgroundCol = 12;
00179 Int_t DisplayPadCol = 15;
00180
00181 Int_t x0 = 150;
00182 Int_t y0 = 100;
00183
00184
00185
00186 Float_t sep = 0.001;
00187 Float_t smallsep = 0.0005;
00188
00189 Float_t Start_X_displaypad[2];
00190 Float_t Stop_X_displaypad[2];
00191 Float_t Start_Y_displaypad[2];
00192 Float_t Stop_Y_displaypad[2];
00193 Start_X_displaypad[0] = 0.085;
00194 Stop_X_displaypad[0] = 1.;
00195 Start_Y_displaypad[0] = 0.05;
00196 Stop_Y_displaypad[0] = 1.;
00197
00198 Start_X_displaypad[1] = 0.055;
00199 Stop_X_displaypad[1] = 0.945;
00200 Start_Y_displaypad[1] = 0.05;
00201 Stop_Y_displaypad[1] = 0.95;
00202
00203
00204 if(!fCanStartGUI) return kFALSE;
00205
00206
00207 fIO=ring;
00208 fCurSlab=0;
00209
00210
00211 ReloadMapFiles();
00212
00213
00214
00215
00216 if (fRF) Printf("TFndTofMonFrame::StartInterface ---> source file found...starting GUI");
00217
00218 TString str1 = TString();
00219 TString name1 = TString();
00220
00221
00222
00223 Char_t *mod[2];
00224 mod[0] = "tof";
00225 mod[1] = "TOF";
00226 str1+=mod[fIO];
00227 str1+=" Detector Display";
00228 name1+=mod[fIO];
00229 name1+="_MainCanvas";
00230 if(fIO==1) {
00231 x0 +=100;
00232 y0 -=100;
00233 }
00234 fMainCanvas[fIO] = new TCanvas(name1.Data(),str1.Data(),
00235 fMainCanvCoord[0],fMainCanvCoord[1],
00236 fMainCanvCoord[2],fMainCanvCoord[3]);
00237 if(fIO==0) SetMonitorTitle(0,"tofino");
00238 else SetMonitorTitle(1,"TOFONE");
00239 fMainCanvas[fIO]->SetEditable(kFALSE);
00240 fMainCanvas[fIO]->SetFillColor(BackgroundCol);
00241 fMainCanvas[fIO]->Draw();
00242
00243
00244 str1+=mod[fIO];
00245 str1+=" control pad";
00246
00247
00248 str1 = mod[fIO];
00249 str1+=" hist display";
00250 name1 = mod[fIO];
00251 name1+=" viewpad";
00252 fDisplayPad[fIO] = new TPad(name1.Data(),str1.Data(),
00253 Start_X_displaypad[fIO],Start_Y_displaypad[fIO],
00254 Stop_X_displaypad[fIO],Stop_Y_displaypad[fIO]);
00255 fDisplayPad[fIO]->Draw();
00256 fDisplayPad[fIO]->SetFillColor(DisplayPadCol);
00257 fDisplayPad[fIO]->SetBorderSize(2);
00258
00259 str1 = mod[fIO];
00260 str1+=" tof_AllPadControl";
00261
00262
00263 fAllPad[0] = new TPad(str1.Data(),str1.Data(),
00264 Start_X_displaypad[fIO], 0.,
00265 Stop_X_displaypad[fIO], Start_Y_displaypad[fIO]-sep);
00266
00267 switch(fIO){
00268 case 0:
00269 fSlabPad[0] = new TPad("SlabTofSelPad","SlabTofSelPad",0.,Start_Y_displaypad[fIO],Start_X_displaypad[fIO]-sep,Stop_Y_displaypad[fIO]);
00270 fSlabPad[0]->SetFillColor(13);
00271 fSlabPad[0]->Draw();
00272
00273 fAllPad[fIO]->Draw();
00274 break;
00275 case 1:
00276 fSlabPad[1] = new TPad("SlabTofSelPad1","SlabTofSelPad1",
00277 0., Start_Y_displaypad[fIO]+smallsep,
00278 Start_X_displaypad[fIO]-sep, Stop_Y_displaypad[fIO]-smallsep);
00279 fSlabPad[1]->SetFillColor(3);
00280 fSlabPad[1]->Draw();
00281
00282 fSlabPad[2] = new TPad("SlabTofSelPad2","SlabTofSelPad2",
00283 0., Stop_Y_displaypad[fIO]+smallsep,
00284 1., 1.);
00285 fSlabPad[2]->SetFillColor(3);
00286 fSlabPad[2]->Draw();
00287
00288 fSlabPad[3] = new TPad("SlabTofSelPad3","SlabTofSelPad3",
00289 Stop_X_displaypad[fIO]+sep, Start_Y_displaypad[fIO]+smallsep,
00290 1., Stop_Y_displaypad[fIO]-smallsep);
00291 fSlabPad[3]->SetFillColor(3);
00292 fSlabPad[3]->Draw();
00293
00294 fSlabPad[4] = new TPad("SlabTofSelPad4","SlabTofSelPad4",
00295 0., 0.,
00296 1., Start_Y_displaypad[fIO]-smallsep);
00297 fSlabPad[4]->SetFillColor(3);
00298 fSlabPad[4]->Draw();
00299 break;
00300 default: break;
00301 }
00302
00303 DrawButtons();
00304 BuildConnections();
00305 return kTRUE;
00306 }
00307
00308
00309 void TFndTofMonFrame::DrawButtons() {
00310
00311 Int_t ButtonsPerPad = 18;
00312 Float_t butstep = 0.0001;
00313
00314 Float_t step = 1./9.;
00315 Float_t xi = 0.;
00316 Float_t yi = 0.;
00317 Float_t xo = 0.;
00318 Float_t yo = 0.;
00319 Float_t xf = 0;
00320
00321 TString command = TString();
00322 TString modlab = TString();
00323
00324 switch(fIO){
00325 case 0:
00326
00327
00328 fAllPad[fIO]->cd();
00329 xf = 0;
00330 xf = step;
00331 fAllButton[0] = new TButton("Maps","fndrun->TofMonFrame()->DisplayMaps();",xi,0.,xf,1.);
00332 fAllButton[0]->Draw();
00333 xi = xf;
00334 xf += step;
00335 fAllButton[1] = new TButton("eff","fndrun->TofMonFrame()->DisplayAllHist(0,10);",xi,0.,xf,1.);
00336 fAllButton[1]->Draw();
00337 xi = xf;
00338 xf += step;
00339 fAllButton[2] = new TButton("adc_tdc","fndrun->TofMonFrame()->DisplayAllHist(0,11);",xi,0.,xf,1.);
00340 fAllButton[2]->Draw();
00341 xi = xf;
00342 xf += step;
00343 fAllButton[3] = new TButton("adcs","fndrun->TofMonFrame()->DisplayAllHist(0,0);",xi,0.,xf,1.);
00344 fAllButton[3]->Draw();
00345 xi = xf;
00346 xf += step;
00347 fAllButton[4] = new TButton("light","fndrun->TofMonFrame()->DisplayAllHist(0,3);",xi,0.,xf,1.);
00348 fAllButton[4]->Draw();
00349 xi = xf;
00350 xf += step;
00351 fAllButton[5] = new TButton("zet","fndrun->TofMonFrame()->DisplayAllHist(0,4);",xi,0.,xf,1.);
00352 fAllButton[5]->Draw();
00353 xi = xf;
00354 xf += step;
00355 fAllButton[6] = new TButton("tdcs","fndrun->TofMonFrame()->DisplayAllHist(0,5);",xi,0.,xf,1.);
00356 fAllButton[6]->Draw();
00357 xi = xf;
00358 xf += step;
00359 fAllButton[7] = new TButton("tmn","fndrun->TofMonFrame()->DisplayAllHist(0,8);",xi,0.,xf,1.);
00360 fAllButton[7]->Draw();
00361 xi = xf;
00362 xf += step;
00363 fAllButton[8] = new TButton("tdf","fndrun->TofMonFrame()->DisplayAllHist(0,9);",xi,0.,xf,1.);
00364 fAllButton[8]->Draw();
00365 fAllPad[fIO]->Modified();
00366
00367
00368 fSlabPad[0]->cd();
00369 for(Int_t i=0;i<fNSlabs[fIO];i++) {
00370
00371 modlab = "sl_";
00372 modlab+=i+1;
00373 command = "fndrun->TofMonFrame()->SelectSlab(";
00374 command+=i+1;
00375 command+="); ";
00376 command+="fndrun->TofMonFrame()->DisplayHist();";
00377
00378 xi = 0.;
00379 yi = ((Float_t) i)/fNSlabs[fIO];
00380 xo = 1.;
00381 yo = (i+1.)/fNSlabs[fIO];
00382 fSlabButton[i] = new TButton(modlab.Data(),command.Data(),xi,yi,xo,yo);
00383 fSlabButton[i]->SetTextSize(0.5);
00384 fSlabButton[i]->Draw();
00385
00386 }
00387 fSlabPad[0]->Modified();
00388 break;
00389
00390 case 1:
00391
00392
00393 step = 1./(Float_t)ButtonsPerPad;
00394 for(Int_t p=1;p<=4;p++) {
00395 fSlabPad[p]->cd();
00396
00397 switch(p){
00398 case 1:
00399 xi = 0; yi = 0;
00400 xo = 1.; yo = step - butstep;
00401 break;
00402 case 2:
00403 xi = 0; yi = 0;
00404 xo = step; yo = 1.;
00405 break;
00406 case 3:
00407 xi = 0; yi = 1. - step;
00408 xo = 1.; yo = 1.;
00409 break;
00410 case 4:
00411 xi = 1. -step; yi = 0;
00412 xo = 1.; yo = 1.;
00413 break;
00414 default: break;
00415 }
00416
00417
00418
00419 for(Int_t i=0;i<ButtonsPerPad;i++) {
00420
00421 Int_t nsl = i + fNSlabs[0] + (ButtonsPerPad * (p-1)) +1;
00422 Int_t but_id = nsl - 1;
00423 if(nsl>(fNSlabs[0]+fNSlabs[1])) Error("DrawButtons","\"nsl\" too big!!!");
00424 modlab = "sl_";
00425 modlab+= nsl-fNSlabs[0];
00426 command = "fndrun->TofMonFrame()->SelectSlab(";
00427 command+=nsl;
00428 command+="); ";
00429 command+="fndrun->TofMonFrame()->DisplayHist();";
00430
00431 fSlabButton[but_id] = new TButton(modlab.Data(),command.Data(),xi,yi,xo,yo);
00432 fSlabButton[but_id]->SetTextSize(0.5);
00433 fSlabButton[but_id]->Draw();
00434
00435 switch(p){
00436 case 1:
00437 xi = 0; yi = yo + butstep;
00438 xo = 1.; yo += step - butstep;
00439 break;
00440 case 2:
00441 xi = xo + butstep; yi = 0;
00442 xo += step - butstep; yo = 1.;
00443 break;
00444 case 3:
00445 xi = 0; yo = yi - butstep;
00446 xo = 1.; yi -= step - butstep;
00447 break;
00448 case 4:
00449 xo = xi -butstep; yi = 0;
00450 xi -= step - butstep; yo = 1.;
00451 break;
00452 default: break;
00453 }
00454
00455 }
00456 fSlabPad[p]->Modified();
00457 }
00458 break;
00459
00460 default: break;
00461 }
00462
00463 ResetFrameColors();
00464 }
00465
00466
00467 void TFndTofMonFrame::ResetFrameColors(){
00468
00469 Int_t SlabButCol[2];
00470 SlabButCol[0] = 33;
00471 SlabButCol[1] = 38;
00472 Int_t AllButCols[9] = {25,25,22,22,28,28,22,22,28};
00473
00474 switch(fIO){
00475 case 0:
00476 for(Int_t i=0;i<9;i++){
00477 fAllButton[i]->SetFillColor(AllButCols[i]);
00478 fAllButton[i]->Modified();
00479 }
00480 for(Int_t i=0;i<fNSlabs[fIO];i++){
00481 fSlabButton[i]->SetFillColor(SlabButCol[fIO]);
00482 fSlabButton[i]->Modified();
00483 }
00484 break;
00485 case 1:
00486 for(Int_t i=0;i<fNSlabs[1];i++){
00487 fSlabButton[fNSlabs[0]+i]->SetFillColor(SlabButCol[fIO]);
00488 fSlabButton[fNSlabs[0]+i]->Modified();
00489 }
00490 break;
00491 default: break;
00492 }
00493 }
00494
00495
00496 void TFndTofMonFrame::SelectSlab(Int_t s){
00497 if(s<0 || s>(fNSlabs[0]+fNSlabs[1])) { Warning("SelectSlab","Wrong Slab Number: %d",s); return; }
00498 fIO = 0;
00499 fCurSlab = s;
00500 if(s>fNSlabs[0]) { fIO = 1; fCurSlab = s+88; }
00501 }
00502
00503
00504 void TFndTofMonFrame::DrawHist(Int_t opt, Int_t flg, Char_t *DrawOpt){
00505
00506
00507 TString type = 0;
00508
00509 switch(opt){
00510 case 0: type = "adc"; break;
00511 case 1: type = "adcp"; break;
00512 case 2: type = "adce"; break;
00513 case 3: type = "crg"; break;
00514 case 4: type = "zet"; break;
00515 case 5: type = "tdc"; break;
00516 case 6: type = "tdcp"; break;
00517 case 7: type = "tdce"; break;
00518 case 8: type = "tmn"; break;
00519 case 9: type = "tdf"; break;
00520 case 10: type = "mapadctdc"; break;
00521 case 11: type = "adc_tdc"; break;
00522 case 12: type = "tmn_hw"; break;
00523 default: if(fndrun->GetDebug()) Warning("DrawHist","wrong option"); return;
00524 }
00525
00526 h2 = NULL;
00527 hists = NULL;
00528
00529 TString label = TString("tof_"); label+=type.Data(); label+="_"; label+=fCurSlab;
00530 switch(opt){
00531 case 0:
00532 if(fIsOnline) h2 =(TH2F*) fAdcMapFile->Get(label.Data());
00533 else h2 =(TH2F*) fRF->Get(label.Data());
00534 break;
00535 case 1:
00536 if(fIsOnline) hists =(TH1F*) fAdcMapFile->Get(label.Data());
00537 else hists =(TH1F*) fRF->Get(label.Data());
00538 break;
00539 case 2:
00540 if(fIsOnline) hists =(TH1F*) fAdcMapFile->Get(label.Data());
00541 else hists =(TH1F*) fRF->Get(label.Data());
00542 break;
00543 case 3:
00544 if(fIsOnline) hists =(TH1F*) fAdcMapFile->Get(label.Data());
00545 else hists =(TH1F*) fRF->Get(label.Data());
00546 break;
00547 case 4:
00548 if(fIsOnline) hists =(TH1F*) fAdcMapFile->Get(label.Data());
00549 else hists =(TH1F*) fRF->Get(label.Data());
00550 break;
00551 case 5:
00552 if(fIsOnline) h2 =(TH2F*) fTdcMapFile->Get(label.Data());
00553 else h2 =(TH2F*) fRF->Get(label.Data());
00554 break;
00555 case 6:
00556 if(fIsOnline) hists =(TH1F*) fTdcMapFile->Get(label.Data());
00557 else hists =(TH1F*) fRF->Get(label.Data());
00558 break;
00559 case 7:
00560 if(fIsOnline) hists =(TH1F*) fTdcMapFile->Get(label.Data());
00561 else hists =(TH1F*) fRF->Get(label.Data());
00562 break;
00563 case 8:
00564 if(fIsOnline) hists =(TH1F*) fTdcMapFile->Get(label.Data());
00565 else hists =(TH1F*) fRF->Get(label.Data());
00566 break;
00567 case 9:
00568 if(fIsOnline) hists =(TH1F*) fTdcMapFile->Get(label.Data());
00569 else hists =(TH1F*) fRF->Get(label.Data());
00570 break;
00571 case 10:
00572 if(fIsOnline) h2 =(TH2F*) fGenMapFile->Get(label.Data());
00573 else h2 =(TH2F*) fRF->Get(label.Data());
00574 break;
00575 case 11:
00576 if(fIsOnline) h2 =(TH2F*) fGenMapFile->Get(label.Data());
00577 else h2 =(TH2F*) fRF->Get(label.Data());
00578 break;
00579 case 12:
00580 if(fIsOnline) hists =(TH1F*) fTdcMapFile ->Get(label.Data());
00581 else hists =(TH1F*) fRF->Get(label.Data());
00582 break;
00583 default: if(fndrun->GetDebug()) Warning("DrawHist","wrong option"); return;
00584 }
00585
00586 if(h2) h2->Draw(DrawOpt);
00587 if(hists) {
00588 if(flg)
00589 hists->Draw("SAME");
00590 else
00591 hists->Draw(DrawOpt);
00592 }
00593
00594 }
00595
00596
00597 void TFndTofMonFrame::DisplayMaps(){
00598
00599 if(!ReloadMapFiles()){
00600 for(Int_t i=0;i<2;i++){
00601 fDisplayPad[i]->Clear();
00602 fDisplayPad[i]->Modified();
00603 }
00604 Warning("TFndTofMonFrame::DisplayMaps","Problems while reloading shared memories");
00605 return;
00606 }
00607
00608 Char_t *Draw2D_opt = "colz";
00609 Int_t EachPadCol = 18;
00610 Float_t Margin = 0.002;
00611
00612
00613
00614 fDisplayPad[0]->Clear();
00615 fDisplayPad[0]->Divide(4,2,Margin,Margin,EachPadCol);
00616
00617 for(Int_t j=0;j<8;j++) {
00618 TString str = TString("tof_");
00619 if(j==0) str+="i_o_mult";
00620 if(j!=0) str+="map";
00621 if(j>=1 && j<4) str+="adc";
00622 if(j==4) str+="mt";
00623 if(j>4) str+="tdc";
00624 if(j==2 || j==6) str+="p";
00625 if(j==3 || j==7) str+="e";
00626 fDisplayPad[0]->cd(j+1);
00627 h2 = 0;
00628 hists = 0;
00629 if(j==0) {
00630 Draw2D_opt = "box";
00631 if(fRF)
00632 h2 = (TH2F *) fRF->Get(str.Data());
00633 else
00634 h2 = (TH2F *) fGenMapFile->Get(str.Data());
00635 }
00636 else {
00637 Draw2D_opt = "";
00638 if(fRF)
00639 hists = (TH1F *) fRF->Get(str.Data());
00640 else
00641 hists = (TH1F *) fGenMapFile->Get(str.Data());
00642 }
00643 if(h2) h2->Draw(Draw2D_opt);
00644 if(hists) hists->Draw(Draw2D_opt);
00645 }
00646 fDisplayPad[0]->Modified();
00647
00648 ResetFrameColors();
00649 HighlightButtons(1,0);
00650 }
00651
00652
00653 void TFndTofMonFrame::DisplayHist(){
00654
00655 if(!ReloadMapFiles()){
00656 for(Int_t i=0;i<2;i++){
00657 fDisplayPad[i]->Clear();
00658 fDisplayPad[i]->Modified();
00659 }
00660 Warning("TFndTofMonFrame::DisplayHist","Problems while reloading shared memories");
00661 return;
00662 }
00663 Char_t *Draw2D_opt = "";
00664 Int_t EachPadCol = 17;
00665 Float_t Margin = 0.002;
00666
00667
00668 fDisplayPad[fIO]->Clear();
00669 fDisplayPad[fIO]->Divide(4,3,Margin,Margin,EachPadCol);
00670
00671
00672 Int_t opt = -1;
00673 for(Int_t j=0;j<12;j++){
00674 fDisplayPad[fIO]->cd(j+1);
00675 opt++;
00676 if(j==8) Draw2D_opt = "colz";
00677 else Draw2D_opt = "";
00678 DrawHist(opt,0,Draw2D_opt);
00679 if(j==1 || j==5) DrawHist(++opt,1);
00680 }
00681 fDisplayPad[fIO]->Modified();
00682
00683 ResetFrameColors();
00684 HighlightButtons(0);
00685 }
00686
00687
00688 void TFndTofMonFrame::DisplayAllHist(Int_t io, Int_t option){
00689
00690 if(!ReloadMapFiles()){
00691 for(Int_t i=0;i<2;i++){
00692 fDisplayPad[i]->Clear();
00693 fDisplayPad[i]->Modified();
00694 }
00695 Warning("TFndTofMonFrame::DisplayAllHist","Problems while reloading shared memories");
00696 return;
00697 }
00698 Char_t *Draw2D_opt = 0;
00699 if(option==10) Draw2D_opt = "colz";
00700 else Draw2D_opt = "";
00701
00702 Int_t EachPadCol = 19;
00703 Float_t Margin = 0.002;
00704
00705 fDisplayPad[0]->Clear();
00706 fDisplayPad[0]->Divide(4,3,Margin,Margin,EachPadCol);
00707
00708
00709 fIO = io;
00710
00711 for(Int_t k=0;k<12;k++){
00712 fDisplayPad[0]->cd(k+1);
00713 fCurSlab = k+1;
00714 DrawHist(option,0,Draw2D_opt);
00715 }
00716 fDisplayPad[0]->Modified();
00717
00718 ResetFrameColors();
00719 Int_t all_id = 0;
00720 switch(option){
00721 case 10: all_id = 1; break;
00722 case 11: all_id = 2; break;
00723 case 0: all_id = 3; break;
00724 case 3: all_id = 4; break;
00725 case 4: all_id = 5; break;
00726 case 5: all_id = 6; break;
00727 case 8: all_id = 7; break;
00728 case 9: all_id = 8; break;
00729 default: break;
00730 }
00731 HighlightButtons(1,all_id);
00732 }
00733
00734
00735 TButton *TFndTofMonFrame::HighlightButtons(Int_t which_group,Int_t All_id){
00736
00737
00738
00739
00740
00741
00742 fWhichGroup = which_group;
00743 fAllId = All_id;
00744
00745 Int_t sl = fCurSlab;
00746 if(sl > fNSlabs[0]) sl -= 88;
00747
00748
00749 switch(which_group){
00750 case 0:
00751 fSlabButton[sl-1]->SetFillColor(fHighlightCol[fIO]);
00752 fSlabButton[sl-1]->Modified();
00753 return fSlabButton[sl-1];
00754
00755 case 1:
00756 fAllButton[All_id]->SetFillColor(fHighlightCol[fIO]);
00757 fAllButton[All_id]->Modified();
00758 return fAllButton[All_id];
00759
00760 default: return 0;
00761 }
00762 }
00763
00764
00765 void TFndTofMonFrame::RefreshSingleMonView(){
00766
00767 if(fndrun->GetDebug()){
00768 Printf("");
00769 Printf("fWhichGroup: %d",fWhichGroup);
00770 Printf("fCurSlab: %d",fCurSlab);
00771 Printf("fAllId: %d",fAllId);
00772 Printf("fIO: %d",fIO);
00773 }
00774
00775 if(fWhichGroup ==- 1 || fAllId == - 1) return;
00776
00777 if(fCurSlab > fNSlabs[0]) FlashDisplayPad(1);
00778 else FlashDisplayPad(0);
00779
00780 HighlightButtons(fWhichGroup,fAllId)->ExecuteEvent(11,0,0);
00781 }
00782
00783
00784
00785
00786
00787
00788
00789
00790
00791
00792
00793
00794
00795
00796
00797
00798
00799
00800
00801
00802
00803
00804
00805
00806
00807
00808
00809
00810
00811
00812
00813
00814
00815
00816
00817
00818
00819
00820
00821
00822
00823
00824
00825
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835
00836
00837
00838
00839
00840
00841
00842
00843
00844
00845
00846
00847
00848
00849
00850
00851
00852
00853
00854
00855
00856
00857
00858
00859
00860
00861
00862
00863
00864
00865
00866
00867
00868
00869
00870
00871
00872
00873
00874
00875
00876
00877
00878
00879
00880
00881
00882
00883
00884
00885
00886
00887
00888
00889
00890
00891
00892
00893
00894
00895
00896
00897
00898
00899
00900
00901
00902
00903
00904
00905
00906
00907
00908
00909
00910
00911
00912
00913
00914
00915
00916
00917
00918
00919
00920
00921
00922
00923
00924
00925
00926
00927
00928
00929
00930
00931
00932
00933
00934
00935
00936
00937
00938
00939
00940
00941
00942
00943
00944
00945
00946
00947
00948
00949
00950
00951
00952
00953
00954
00955
00956
00957
00958
00959
00960
00961
00962
00963
00964
00965
00966
00967
00968
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986
00987
00988
00989
00990
00991
00992
00993
00994
00995
00996
00997
00998
00999
01000
01001
01002
01003
01004
01005
01006
01007
01008
01009
01010
01011
01012
01013
01014
01015
01016
01017
01018
01019
01020
01021
01022
01023
01024
01025
01026
01027
01028
01029
01030
01031
01032
01033
01034
01035
01036
01037
01038
01039
01040
01041
01042
01043
01044
01045
01046
01047
01048
01049
01050
01051
01052
01053
01054
01055
01056
01057
01058
01059
01060
01061
01062
01063
01064
01065
01066
01067
01068
01069
01070
01071
01072
01073
01074
01075
01076
01077
01078
01079
01080
01081
01082
01083
01084
01085
01086
01087
01088
01089
01090
01091
01092
01093
01094
01095
01096
01097
01098
01099
01100
01101
01102
01103
01104
01105
01106
01107
01108
01109
01110
01111
01112
01113
01114
01115
01116
01117
01118
01119
01120
01121
01122
01123
01124
01125
01126
01127
01128
01129
01130
01131
01132
01133
01134
01135
01136
01137
01138
01139
01140
01141
01142
01143
01144
01145
01146
01147
01148
01149
01150
01151
01152
01153
01154
01155
01156
01157
01158
01159
01160
01161
01162
01163
01164
01165
01166
01167
01168
01169
01170
01171
01172
01173
01174
01175
01176
01177
01178
01179
01180
01181
01182
01183
01184
01185
01186
01187
01188
01189
01190
01191
01192
01193
01194
01195
01196