00001
00002
00003
00004
00006
00007
00008
00009
00010
00011
00012
00013
00014
00016
00017 #include <TSystem.h>
00018 #include <TStyle.h>
00019
00020 #include "TFndLmdMonFrame.h"
00021 #include "TFndRun.h"
00022
00023 ClassImp(TFndLmdMonFrame)
00024
00025
00026 TFndLmdMonFrame::TFndLmdMonFrame(TString filename):TFndMonFrame(filename),fIO(),fdch(),fwir(),maps(),iadc(),itdc(),oadc(),otdc(),fInnPad(),fOutPad(),fMultPad(),fWirePad(),fAllPad(),fChSelBut(),fAllButton(),fWireBut(),zoombutton(),fhists(),h2(),sly(),fWhichGroup(-1),fAllId(-1)
00027 {
00028
00029
00030
00031 Init();
00032 }
00033
00034
00035 void TFndLmdMonFrame::Init() {
00036
00037
00038 SetStyle();
00039 fHighlightCol[0] = 5;
00040 fHighlightCol[1] = 5;
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 }
00054
00055
00056 void TFndLmdMonFrame::Open() {
00057
00058 if(!fClosed) return;
00059 if(!StartInterface()) return;
00060 fClosed = kFALSE;
00061 }
00062
00063
00064 Bool_t TFndLmdMonFrame::StartInterface() {
00065
00066
00067
00068
00069 Int_t BackgroundCol = 12;
00070 Int_t DisplayPadCol = 15;
00071
00072 Float_t sep = 0.001;
00073 Float_t smallsep = 0.0005;
00074
00075 Float_t Start_X_displaypad = 0.08;
00076 Float_t Stop_X_displaypad = 1.;
00077 Float_t Start_Y_displaypad = 0.05;
00078 Float_t Stop_Y_displaypad = 0.94;
00079
00080 Float_t MultInn_Y_Edge = 0.11;
00081 Float_t InnOutEdge = ((Stop_Y_displaypad-sep)+(MultInn_Y_Edge+smallsep))/2;
00082
00083
00084 if(!fCanStartGUI) return kFALSE;
00085
00086
00087 fdch=1;
00088 fwir=1;
00089
00090 ReloadMapFiles();
00091
00092
00093
00094 if (fRF) Printf("TFndLmdMonFrame::StartInterface ---> source file found...starting GUI");
00095
00096
00097
00098
00099
00100
00101
00102 fMainCanvas[0] = new TCanvas("Lmd_MainCanvas","LMD Detector Display",
00103 fMainCanvCoord[0],fMainCanvCoord[1],
00104 fMainCanvCoord[2],fMainCanvCoord[3]);
00105 SetMonitorTitle(0,"LMD");
00106 fMainCanvas[0]->SetEditable(kFALSE);
00107
00108 fMainCanvas[0]->SetFillColor(BackgroundCol);
00109 fMainCanvas[0]->Draw();
00110
00111
00112 fMainCanvas[0]->cd();
00113 fDisplayPad[0] = new TPad("LmdMonFrameDisplayPad","hist display",
00114 Start_X_displaypad+sep,Start_Y_displaypad+sep,Stop_X_displaypad,Stop_Y_displaypad);
00115 fDisplayPad[0]->Draw();
00116 fDisplayPad[0]->SetFillColor(DisplayPadCol);
00117 fDisplayPad[0]->SetBorderSize(2);
00118
00119
00120 fAllPad = new TPad("lmd_AllPadControl","lmd_AllPadControl",Start_X_displaypad+sep,0.,Stop_X_displaypad,Start_Y_displaypad-sep);
00121 fAllPad->Draw();
00122
00123
00124 fMultPad = new TPad("mulLmdSelPad","mulLmdSelPad",0.,0.,Start_X_displaypad-sep,MultInn_Y_Edge-smallsep);
00125 fMultPad->SetFillColor(13);
00126 fMultPad->Draw();
00127 fInnPad = new TPad("iLmdSelPad","iLmdSelPad",0.,MultInn_Y_Edge+smallsep,Start_X_displaypad-sep,InnOutEdge-smallsep);
00128 fInnPad->SetFillColor(13);
00129 fInnPad->Draw();
00130 fOutPad = new TPad("oLmdSelPad","oLmdSelPad",0.,InnOutEdge+smallsep,Start_X_displaypad-sep,0.94);
00131 fOutPad->SetFillColor(13);
00132 fOutPad->Draw();
00133
00134
00135 fMainCanvas[0]->cd();
00136 fWirePad = new TPad("selectwire","wr",0.,Stop_Y_displaypad+sep,1.,1.);
00137 fWirePad->SetFillColor(BackgroundCol);
00138 fWirePad->Draw();
00139
00140 DrawButtons();
00141 BuildConnections();
00142
00143 fAllPad->SetEditable(kFALSE);
00144 fMultPad->SetEditable(kFALSE);
00145 fInnPad->SetEditable(kFALSE);
00146 fOutPad->SetEditable(kFALSE);
00147
00148 return kTRUE;
00149
00150 }
00151
00152
00153 void TFndLmdMonFrame::DrawButtons() {
00154
00155
00156 Float_t MapWidth = 0.08;
00157
00158 Float_t step = (1-MapWidth)/8.;
00159 Float_t xi = 0.;
00160 Float_t xf = MapWidth;
00161
00162 fAllPad->cd();
00163 fAllButton[0] = new TButton("Maps","fndrun->LmdMonFrame()->DisplayMaps();",xi,0.,xf,1.);
00164 fAllButton[0]->SetTextSize(0.5);
00165 fAllButton[0]->Draw();
00166 xi = xf;
00167 xf += step;
00168 fAllButton[1] = new TButton("i_eff","fndrun->LmdMonFrame()->DisplayAllHist(0,0);",xi,0.,xf,1.);
00169 fAllButton[1]->SetTextSize(0.5);
00170 fAllButton[1]->Draw();
00171 xi = xf;
00172 xf += step;
00173 fAllButton[2] = new TButton("o_eff","fndrun->LmdMonFrame()->DisplayAllHist(1,0);",xi,0.,xf,1.);
00174 fAllButton[2]->SetTextSize(0.5);
00175 fAllButton[2]->Draw();
00176 xi = xf;
00177 xf += step;
00178 fAllButton[3] = new TButton("i_adcs","fndrun->LmdMonFrame()->DisplayAllHist(0,1);",xi,0.,xf,1.);
00179 fAllButton[3]->SetTextSize(0.5);
00180 fAllButton[3]->Draw();
00181 xi = xf;
00182 xf += step;
00183 fAllButton[4] = new TButton("o_adcs","fndrun->LmdMonFrame()->DisplayAllHist(1,1);",xi,0.,xf,1.);
00184 fAllButton[4]->SetTextSize(0.5);
00185 fAllButton[4]->Draw();
00186 xi = xf;
00187 xf += step;
00188 fAllButton[5] = new TButton("i_tdcs","fndrun->LmdMonFrame()->DisplayAllHist(0,2);",xi,0.,xf,1.);
00189 fAllButton[5]->SetTextSize(0.5);
00190 fAllButton[5]->Draw();
00191 xi = xf;
00192 xf += step;
00193 fAllButton[6] = new TButton("o_tdcs","fndrun->LmdMonFrame()->DisplayAllHist(1,2);",xi,0.,xf,1.);
00194 fAllButton[6]->SetTextSize(0.5);
00195 fAllButton[6]->Draw();
00196 xi = xf;
00197 xf += step;
00198 fAllButton[7] = new TButton("i_adc_tdc","fndrun->LmdMonFrame()->DisplayAllHist(0,3);",xi,0.,xf,1.);
00199 fAllButton[7]->SetTextSize(0.5);
00200 fAllButton[7]->Draw();
00201 xi = xf;
00202 xf += step;
00203 fAllButton[8] = new TButton("o_adc_tdc","fndrun->LmdMonFrame()->DisplayAllHist(1,3);",xi,0.,xf,1.);
00204 fAllButton[8]->SetTextSize(0.5);
00205 fAllButton[8]->Draw();
00206
00207
00208 fMultPad->cd();
00209 fAllButton[9] = new TButton("i_mul","fndrun->LmdMonFrame()->DisplayAllHist(0,4);",0.,0.,1.0,0.5);
00210 fAllButton[9]->Draw();
00211 fAllButton[10] = new TButton("o_mul","fndrun->LmdMonFrame()->DisplayAllHist(1,4);",0.,0.5,1.0,1.);
00212 fAllButton[10]->Draw();
00213
00214 fAllPad->Modified();
00215
00216
00217 fInnPad->cd();
00218 for(Int_t i=0;i<8;i++) {
00219 TString str1 = TString("fndrun->LmdMonFrame()->SelectChamber(0,");
00220 TString modlab = TString("i_");
00221 modlab+=i+1;
00222 str1+=i+1;
00223 str1+="); ";
00224 str1+="fndrun->LmdMonFrame()->DrawWirePad();";
00225
00226 fChSelBut[i] = new TButton(modlab.Data(),str1.Data(),0.00,0.125*i,1.0,0.125*(i+1));
00227 fChSelBut[i]->Draw();
00228 }
00229 fInnPad->Modified();
00230
00231
00232 fOutPad->cd();
00233 for(Int_t i=0;i<8;i++) {
00234 TString str1 = TString("fndrun->LmdMonFrame()->SelectChamber(1,");
00235 TString modlab = TString("o_");
00236 modlab+=i+1;
00237 str1+=i+1;
00238 str1+=");";
00239 str1+="fndrun->LmdMonFrame()->DrawWirePad();";
00240
00241 fChSelBut[i+8] = new TButton(modlab.Data(),str1.Data(),0.00,0.125*i,1.0,0.125*(i+1));
00242 fChSelBut[i+8]->Draw();
00243 }
00244 fOutPad->Modified();
00245
00246
00247 RebuildWirePad();
00248 ResetFrameColors();
00249 }
00250
00251
00252 TFndLmdMonFrame::~TFndLmdMonFrame() {
00253 if(!fClosed) Close();
00254 }
00255
00256
00257 void TFndLmdMonFrame::Close() {
00258
00259
00260 if(!fClosed){
00261 Printf("TFndLmdMonFrame::Close ---> closing and re-initializing to zero all mapfiles...");
00262 if(maps) { maps->Close(); maps = 0; }
00263 if(iadc) { iadc->Close(); iadc = 0; }
00264 if(itdc) { itdc->Close(); itdc = 0; }
00265 if(oadc) { oadc->Close(); oadc = 0; }
00266 if(otdc) { otdc->Close(); otdc = 0; }
00267 Printf("TFndLmdMonFrame::Close ---> Done.");
00268
00269 for(Int_t i=0;i<16;i++) { delete fChSelBut[i]; fChSelBut[i] = 0; }
00270 for(Int_t i=0;i<11;i++) { delete fAllButton[i]; fAllButton[i] = 0; }
00271
00272 fWirePad->Close(); delete fWirePad;
00273 fOutPad->Close(); delete fOutPad;
00274 fInnPad->Close(); delete fInnPad;
00275 fMultPad->Close(); delete fMultPad;
00276 fAllPad->Close(); delete fAllPad;
00277 fDisplayPad[0]->Close(); delete fDisplayPad[0]; fDisplayPad[0] = 0;
00278 fMainCanvas[0]->Close(); delete fMainCanvas[0]; fMainCanvas[0] = 0;
00279 }
00280 fClosed = kTRUE;
00281 }
00282
00283
00284 Bool_t TFndLmdMonFrame::ReloadMapFiles(){
00285
00286 Bool_t result = kTRUE;
00287 if(!fIsOnline) return result;
00288
00289 if( CheckProducerMessages() != 0 ) return kFALSE;
00290
00291 TString shr_file_map_name[5] = 0;
00292
00293 #if defined _FND_ONL_USE_MAP_FILES_
00294 if(fndrun->GetDebug()) Printf("TFndLmdMonFrame::ReloadMapFiles ---> closing and re-initializing to zero all mapfiles...");
00295 if(maps) { maps->Close(); maps = 0; }
00296 if(iadc) { iadc->Close(); iadc = 0; }
00297 if(itdc) { itdc->Close(); itdc = 0; }
00298 if(oadc) { oadc->Close(); oadc = 0; }
00299 if(otdc) { otdc->Close(); otdc = 0; }
00300 if(fndrun->GetDebug()) Printf("TFndLmdMonFrame::ReloadMapFiles ---> Done");
00301
00302 shr_file_map_name[0] = "$FND_SHR/lmd.map";
00303 shr_file_map_name[1] = "$FND_SHR/lmd_i_adc.map";
00304 shr_file_map_name[2] = "$FND_SHR/lmd_i_tdc.map";
00305 shr_file_map_name[3] = "$FND_SHR/lmd_o_adc.map";
00306 shr_file_map_name[4] = "$FND_SHR/lmd_o_tdc.map";
00307 #elif defined _FND_ONL_USE_SHARED_FILES_
00308 if(maps) { if(maps->IsOpen()) maps->Close(); delete maps; maps = 0; }
00309 if(iadc) { if(iadc->IsOpen()) iadc->Close(); delete iadc; iadc = 0; }
00310 if(itdc) { if(itdc->IsOpen()) itdc->Close(); delete itdc; itdc = 0; }
00311 if(oadc) { if(oadc->IsOpen()) oadc->Close(); delete oadc; oadc = 0; }
00312 if(otdc) { if(otdc->IsOpen()) otdc->Close(); delete otdc; otdc = 0; }
00313
00314 shr_file_map_name[0] = "$FND_SHR/lmd.file.map";
00315 shr_file_map_name[1] = "$FND_SHR/lmd_i_adc.file.map";
00316 shr_file_map_name[2] = "$FND_SHR/lmd_i_tdc.file.map";
00317 shr_file_map_name[3] = "$FND_SHR/lmd_o_adc.file.map";
00318 shr_file_map_name[4] = "$FND_SHR/lmd_o_tdc.file.map";
00319 #endif
00320
00321
00322 if(fndrun->GetDebug()) Printf("TFndLmdMonFrame::ReloadMapFiles ---> Reloading shared memories...");
00323 if(!gSystem->AccessPathName(FROOT::ExpandPathName(shr_file_map_name[0].Data()))){
00324 #if defined _FND_ONL_USE_MAP_FILES_
00325 maps = TMapFile::Create(FROOT::ExpandPathName(shr_file_map_name[0].Data()),"READ");
00326 if(fndrun->GetDebug()) maps->Print();
00327 #elif defined _FND_ONL_USE_SHARED_FILES_
00328 maps = new TFile(FROOT::ExpandPathName(shr_file_map_name[0].Data()),"READ");
00329 #endif
00330 }
00331 else result = kFALSE;
00332
00333 if(!gSystem->AccessPathName(FROOT::ExpandPathName(shr_file_map_name[1].Data()))){
00334 #if defined _FND_ONL_USE_MAP_FILES_
00335 iadc = TMapFile::Create(FROOT::ExpandPathName(shr_file_map_name[1].Data()),"READ");
00336 if(fndrun->GetDebug()) iadc->Print();
00337 #elif defined _FND_ONL_USE_SHARED_FILES_
00338 iadc = new TFile(FROOT::ExpandPathName(shr_file_map_name[1].Data()),"READ");
00339 #endif
00340 }
00341 else result = kFALSE;
00342
00343 if(!gSystem->AccessPathName(FROOT::ExpandPathName(shr_file_map_name[2].Data()))){
00344 #if defined _FND_ONL_USE_MAP_FILES_
00345 itdc = TMapFile::Create(FROOT::ExpandPathName(shr_file_map_name[2].Data()),"READ");
00346 if(fndrun->GetDebug()) itdc->Print();
00347 #elif defined _FND_ONL_USE_SHARED_FILES_
00348 itdc = new TFile(FROOT::ExpandPathName(shr_file_map_name[2].Data()),"READ");
00349 #endif
00350 }
00351 else result = kFALSE;
00352
00353 if(!gSystem->AccessPathName(FROOT::ExpandPathName(shr_file_map_name[3].Data()))){
00354 #if defined _FND_ONL_USE_MAP_FILES_
00355
00356 oadc = TMapFile::Create(FROOT::ExpandPathName(shr_file_map_name[3].Data()),"READ");
00357 if(fndrun->GetDebug()) oadc->Print();
00358 #elif defined _FND_ONL_USE_SHARED_FILES_
00359 oadc = new TFile(FROOT::ExpandPathName(shr_file_map_name[3].Data()),"READ");
00360 #endif
00361 }
00362 else result = kFALSE;
00363
00364 if(!gSystem->AccessPathName(FROOT::ExpandPathName(shr_file_map_name[4].Data()))){
00365 #if defined _FND_ONL_USE_MAP_FILES_
00366
00367 otdc = TMapFile::Create(FROOT::ExpandPathName(shr_file_map_name[4].Data()),"READ");
00368 if(fndrun->GetDebug()) otdc->Print();
00369 #elif defined _FND_ONL_USE_SHARED_FILES_
00370 otdc = new TFile(FROOT::ExpandPathName(shr_file_map_name[4].Data()),"READ");
00371 #endif
00372 }
00373 else result = kFALSE;
00374
00375 if(fndrun->GetDebug()){
00376 if(result) Printf("TFndLmdMonFrame::ReloadMapFiles ---> Done");
00377 else Printf("TFndLmdMonFrame::ReloadMapFiles ---> shared memories not found!");
00378 }
00379 return result;
00380 }
00381
00382
00383 void TFndLmdMonFrame::ResetFrameColors() {
00384
00385
00386
00387 Int_t MultCol = 30;
00388 Int_t ChMapCol = 41;
00389 Int_t ChNumICol = 42;
00390 Int_t ChNumOCol = 44;
00391 Int_t EffCol = 17;
00392 Int_t AdcCol = 38;
00393 Int_t TdcCol = 50;
00394 Int_t AdcTdcCol = 29;
00395
00396 Int_t WireButCol = 42;
00397
00398
00399 fAllButton[0]->SetFillColor(ChMapCol);
00400 fAllButton[1]->SetFillColor(EffCol);
00401 fAllButton[2]->SetFillColor(EffCol);
00402 fAllButton[3]->SetFillColor(AdcCol);
00403 fAllButton[4]->SetFillColor(AdcCol);
00404 fAllButton[5]->SetFillColor(TdcCol);
00405 fAllButton[6]->SetFillColor(TdcCol);
00406 fAllButton[7]->SetFillColor(AdcTdcCol);
00407 fAllButton[8]->SetFillColor(AdcTdcCol);
00408 fAllButton[9] ->SetFillColor(MultCol);
00409 fAllButton[10]->SetFillColor(MultCol);
00410 for(Int_t i=0;i<11;i++) fAllButton[i]->Modified();
00411
00412 for(Int_t i=0;i<8;i++){
00413 fChSelBut[i]->SetFillColor(ChNumICol); fChSelBut[i]->Modified();
00414 fChSelBut[i+8]->SetFillColor(ChNumOCol); fChSelBut[i+8]->Modified();
00415 }
00416 fWireBut[0]->SetFillColor(50); fWireBut[0]->Modified();
00417 for(Int_t i=1;i<=fNWires;i++) { fWireBut[i]->SetFillColor(WireButCol); fWireBut[i]->Modified(); }
00418
00419 }
00420
00421
00422 void TFndLmdMonFrame::SelectChamber(Int_t io, Int_t d){
00423
00424
00425
00426 fIO=io; fdch=d;
00427 fNWires = 22;
00428 if(fIO == 0) fNWires = 12;
00429 fwir = 0;
00430 RebuildWirePad();
00431
00432 SelectWire(0);
00433 DisplayHist();
00434
00435 fWhichGroup = 0;
00436 fAllId = 0;
00437 }
00438
00439
00440 void TFndLmdMonFrame::RebuildWirePad(){
00441
00442
00443
00444 Int_t WireButCol = 42;
00445 for(Int_t i=0;i<=23;i++) { delete fWireBut[i]; fWireBut[i] = 0;}
00446 fNWires = 22;
00447 if(fIO == 0) fNWires = 12;
00448
00449 Float_t xi = 0.;
00450 Float_t step = 1./(fNWires+1);
00451 Float_t xf = step;
00452
00453 fWirePad->cd();
00454 fWireBut[0] = new TButton("All","fndrun->LmdMonFrame()->SelectWire(0);fndrun->LmdMonFrame()->DisplayHist();",xi,0.,xf,1.);
00455 fWireBut[0]->SetFillColor(50);
00456 xi = xf;
00457 xf += step;
00458
00459 fWirePad->cd();
00460 for(Int_t i=1;i<=fNWires;i++) {
00461 TString str1 = TString("w");
00462 TString str3 = TString("fndrun->LmdMonFrame()->SelectWire(");
00463 str1+=i;
00464 str3+=i;
00465 str3+="); fndrun->LmdMonFrame()->DisplayHist();";
00466 fWireBut[i] = new TButton(str1.Data(),str3.Data(),xi,0.,xf,1.);
00467 fWireBut[i]->SetFillColor(WireButCol);
00468 fWireBut[i]->SetTextSize(0.4);
00469 xi = xf;
00470 xf += step;
00471 if(xf > 1.) xf = 1.;
00472 }
00473 fWirePad->Modified();
00474
00475 }
00476
00477
00478 void TFndLmdMonFrame::DrawWirePad(){
00479
00480
00481
00482
00483
00484
00485
00486
00487 fWirePad->cd();
00488 for(Int_t i=0;i<=fNWires;i++){
00489 fWireBut[i]->Draw();
00490 }
00491 gPad->Modified();
00492
00493 }
00494
00495
00496 TButton *TFndLmdMonFrame::HighlightButtons(Int_t which_group,Int_t All_id){
00497
00498
00499
00500
00501
00502 fWhichGroup = which_group;
00503 fAllId = All_id;
00504
00505 Int_t dch_id = fdch+fIO*8-1;
00506 switch(which_group){
00507 case 0:
00508 fChSelBut[dch_id]->SetFillColor(fHighlightCol[fIO]);
00509 fChSelBut[dch_id]->Modified();
00510
00511 fWireBut[fwir]->SetFillColor(fHighlightCol[fIO]);
00512 fWireBut[fwir]->Modified();
00513 return fWireBut[fwir];
00514
00515
00516 case 1:
00517 fAllButton[All_id]->SetFillColor(fHighlightCol[fIO]);
00518 fAllButton[All_id]->Modified();
00519 return fAllButton[All_id];
00520
00521 default: return 0;
00522 }
00523 }
00524
00525
00526 void TFndLmdMonFrame::RefreshSingleMonView(){
00527
00528 if(fWhichGroup == -1 || fAllId == -1) return;
00529 FlashDisplayPad();
00530 HighlightButtons(fWhichGroup,fAllId)->ExecuteEvent(11,0,0);
00531 }
00532
00533
00534
00535
00536
00537
00538 void TFndLmdMonFrame::DrawHist(Int_t opt, Int_t flg, Char_t *DrawOpt){
00539
00540
00541
00542
00543
00544
00545
00546
00547 h2 = NULL;
00548 fhists = 0;
00549 sly = NULL;
00550
00551 TString type = TString("");
00552 switch(opt){
00553 case 0: type = "adc"; break;
00554 case 1: type = "adce"; break;
00555 case 2: type = "adcp"; break;
00556 case 3: type = "crg"; break;
00557 case 4: type = "zet"; break;
00558
00559
00560
00561
00562
00563 case 5: type = "aepat"; break;
00564 case 6: type = "appat"; break;
00565 case 7: type = "tepat"; break;
00566 case 8: type = "tppat"; break;
00567 case 9: type = "mapadctdc"; break;
00568 case 10: type = "adc_tdc"; break;
00569
00570 case 11: type = "tdc"; break;
00571 case 12: type = "tdce"; break;
00572 case 13: type = "tdcp"; break;
00573 case 14: type = "tmean"; break;
00574 case 15: type = "tdf"; break;
00575
00576 case 16: type = "mul"; break;
00577 default: break;
00578 }
00579
00580 TString etichetta = TString("");
00581
00582
00583
00584
00585 if(fwir == 0) etichetta+="lmd_all_";
00586 else etichetta+="lmd";
00587 etichetta+=type.Data();
00588
00589
00590 etichetta+="_";
00591 etichetta+=fIO+1;
00592 etichetta+="_";
00593 etichetta+=fdch;
00594
00595
00596 if(fwir != 0) {
00597 etichetta+="_";
00598 etichetta+=fwir;
00599 }
00600
00601
00602
00603
00604 if(opt<9) {
00605 if(opt==0){
00606 if(!fRF){
00607 if(fIO==0) h2 =(TH2F*) iadc->Get(etichetta.Data());
00608 else h2 =(TH2F*) oadc->Get(etichetta.Data());
00609 }
00610 else h2 =(TH2F*) fRF->Get(etichetta.Data());
00611 }
00612 else if(opt==7 || opt ==8){
00613 if(!fRF){
00614 if(fIO==0) fhists =(TH1F*) itdc->Get(etichetta.Data());
00615 else fhists =(TH1F*) otdc->Get(etichetta.Data());
00616 }
00617 else fhists =(TH1F*) fRF->Get(etichetta.Data());
00618 }
00619 else {
00620 if(!fRF) {
00621 if(fIO==0) fhists =(TH1F*) iadc->Get(etichetta.Data());
00622 else fhists =(TH1F*) oadc->Get(etichetta.Data());
00623 }
00624 else fhists =(TH1F*) fRF->Get(etichetta.Data());
00625 }
00626 }
00627
00628 else if (opt==9 || opt ==10) {
00629 if(!fRF)
00630 h2 =(TH2F*) maps->Get(etichetta.Data());
00631 else
00632 h2 =(TH2F*) fRF->Get(etichetta.Data());
00633
00634 Int_t drch = fdch;
00635 if(fIO == 1) drch += 10;
00636 if(h2) sly = h2->ProjectionY("_py",drch,drch);
00637 if(sly) sly->SetLineColor(2*(2-opt%2));
00638
00639 }
00640
00641 else {
00642 if(opt==11) {
00643 if(!fRF) {
00644 if(fIO==0) h2 =(TH2F*) itdc->Get(etichetta.Data());
00645 else h2 =(TH2F*) otdc->Get(etichetta.Data());
00646 }
00647 else h2 =(TH2F*) fRF->Get(etichetta.Data());
00648 }
00649 else if(opt==16) {
00650 if(!fRF) {
00651 fhists =(TH1F*) maps->Get(etichetta.Data());
00652 }
00653 else fhists =(TH1F*) fRF->Get(etichetta.Data());
00654 }
00655 else {
00656 if(!fRF) {
00657 if(fIO==0) fhists =(TH1F*) itdc->Get(etichetta.Data());
00658 else fhists =(TH1F*) otdc->Get(etichetta.Data());
00659 }
00660 else fhists =(TH1F*) fRF->Get(etichetta.Data());
00661 }
00662 }
00663
00664
00665 if(flg) {
00666 if(fhists) fhists->Draw("SAME");
00667 if(sly) { sly->Draw("SAME"); }
00668 }
00669 else {
00670 if(fhists) fhists->Draw(DrawOpt);
00671 if(sly) sly->Draw(DrawOpt);
00672 }
00673
00674
00675 if(h2) h2->Draw(DrawOpt);
00676 }
00677
00678
00679 void TFndLmdMonFrame::DisplayMaps(){
00680
00681
00682 if(!ReloadMapFiles()){
00683 fDisplayPad[0]->Clear();
00684 fDisplayPad[0]->Modified();
00685 return;
00686 }
00687
00688 Char_t *Draw2D_opt = "box";
00689
00690 RebuildWirePad();
00691 fDisplayPad[0]->Clear();
00692 Int_t EachPadCol = 18;
00693 Float_t Margin = 0.002;
00694 Int_t npads = 8;
00695
00696 fDisplayPad[0]->Divide(4,2,Margin,Margin,EachPadCol);
00697
00698 fwir = 0;
00699 for(Int_t j=0;j<npads;j++) {
00700 TString hnamestr = TString("lmd");
00701 if(j==0) hnamestr+="_i_o_mult";
00702 if(j!=0) hnamestr+="map";
00703 if(j>0 && j<4) hnamestr+="adc";
00704 if(j>4) hnamestr+="tdc";
00705 if(j==2 || j==6) hnamestr+="e";
00706 if(j==3 || j==7) hnamestr+="p";
00707
00708 fDisplayPad[0]->cd(j+1);
00709
00710
00711 if(!fRF)
00712 h2 = (TH2F *) maps->Get(hnamestr.Data());
00713 else
00714 h2 = (TH2F *) fRF->Get(hnamestr.Data());
00715 if(h2){
00716 h2->Draw(Draw2D_opt);
00717
00718 }
00719 }
00720 fDisplayPad[0]->Modified();
00721 ResetFrameColors();
00722 HighlightButtons(1,0);
00723 }
00724
00725
00726 void TFndLmdMonFrame::DisplayHist(){
00727
00728
00729
00730
00731 if(!ReloadMapFiles()){
00732 fDisplayPad[0]->Clear();
00733 fDisplayPad[0]->Modified();
00734 return;
00735 }
00736
00737 Char_t *Draw2D_opt = "colz";
00738 Int_t EachPadCol = 18;
00739 Float_t Margin = 0.002;
00740
00741 fDisplayPad[0]->Clear();
00742 Int_t npads = 0;
00743 if(fwir == 0){
00744
00745 fDisplayPad[0]->Divide(4,3,Margin,Margin,EachPadCol);
00746 npads = 12;
00747 }
00748 else{
00749
00750 fDisplayPad[0]->Divide(4,2,Margin,Margin,EachPadCol);
00751 npads = 8;
00752 }
00753
00754 Int_t opt = 0;
00755 if(fwir == 0){
00756 for(Int_t i=0;i<npads;i++){
00757
00758 fDisplayPad[0]->cd(i+1);
00759 if(i==0 || i==3) Draw2D_opt = "box";
00760
00761
00762 else Draw2D_opt = "";
00763
00764
00765 DrawHist(opt,0,Draw2D_opt);
00766 if(i==1 || i==9) DrawHist(++opt,1,Draw2D_opt);
00767
00768 opt++;
00769 }
00770 }
00771 else{
00772 opt = 1;
00773 for(Int_t i=0;i<npads;i++){
00774 if(i==4) opt = 12;
00775 fDisplayPad[0]->cd(i+1);
00776 DrawHist(opt,0);
00777 opt++;
00778 }
00779 }
00780 fDisplayPad[0]->Modified();
00781 ResetFrameColors();
00782 HighlightButtons(0,0);
00783 }
00784
00785
00786 void TFndLmdMonFrame::DisplayAllHist(Int_t io, Int_t option){
00787
00788
00789 if(!ReloadMapFiles()){
00790 fDisplayPad[0]->Clear();
00791 fDisplayPad[0]->Modified();
00792 return;
00793 }
00794
00795 RebuildWirePad();
00796 fDisplayPad[0]->Clear();
00797 Int_t EachPadCol = 18;
00798 Float_t Margin = 0.002;
00799 Int_t npads = 8;
00800 fIO = io;
00801
00802 fDisplayPad[0]->Divide(4,2,Margin,Margin,EachPadCol);
00803
00804 fwir = 0;
00805 for(Int_t i=0;i<npads;i++){
00806 fDisplayPad[0]->cd(i+1);
00807 fdch = i+1;
00808
00809 switch(option){
00810 case 0: DrawHist(9,0,"colz"); break;
00811 case 1: DrawHist(3,0); break;
00812 case 2: DrawHist(14,0); break;
00813 case 3: DrawHist(10,0); break;
00814 case 4: DrawHist(16,0); break;
00815
00816 default: break;
00817 }
00818 }
00819 fDisplayPad[0]->Modified();
00820 ResetFrameColors();
00821
00822 Int_t all_id = 1+fIO+2*option;
00823 HighlightButtons(1,all_id);
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
01197
01198
01199
01200
01201
01202
01203
01204
01205
01206
01207
01208
01209
01210
01211
01212
01213
01214
01215
01216
01217
01218
01219
01220
01221
01222
01223
01224
01225
01226
01227
01228
01229
01230
01231
01232
01233
01234
01235
01236
01237
01238
01239
01240
01241
01242
01243
01244
01245
01246
01247
01248
01249
01250
01251
01252
01253
01254
01255
01256
01257
01258
01259
01260
01261
01262
01263
01264
01265
01266
01267
01268
01269
01270
01271
01272
01273
01274
01275
01276
01277
01278
01279
01280
01281
01282
01283
01284
01285
01286
01287
01288
01289
01290
01291
01292
01293
01294
01295
01296
01297
01298
01299
01300
01301
01302
01303
01304
01305
01306
01307
01308
01309
01310
01311
01312
01313
01314
01315
01316
01317
01318
01319
01320
01321
01322
01323
01324
01325
01326
01327
01328
01329
01330
01331
01332
01333
01334
01335
01336
01337
01338
01339
01340
01341
01342
01343
01344
01345
01346
01347
01348
01349
01350
01351
01352
01353
01354
01355
01356
01357
01358
01359
01360
01361
01362
01363
01364
01365
01366
01367
01368
01369
01370
01371
01372
01373
01374
01375
01376
01377
01378
01379
01380
01381
01382
01383
01384
01385
01386
01387
01388
01389
01390
01391
01392
01393
01394
01395
01396
01397
01398
01399
01400
01401
01402
01403
01404
01405
01406
01407
01408
01409
01410
01411
01412
01413
01414
01415
01416
01417
01418
01419
01420