23 #include <TDirectory.h> 27 #include <TVirtualPad.h> 29 #include <TObjArray.h> 30 #include <TObjString.h> 39 #include <TIterator.h> 42 #include <TTimeStamp.h> 46 #include <TGFileDialog.h> 47 #include <TGInputDialog.h> 50 #include <TGListBox.h> 51 #include <TGComboBox.h> 52 #include <TGNumberEntry.h> 54 #include <TRootEmbeddedCanvas.h> 55 #include <TGSplitter.h> 56 #include <TGButtonGroup.h> 74 TGCompositeFrame(p,w,h),
78 fCalibViewerGUItab(0x0),
81 fCurrentRunDetails(-1),
82 fOutputCacheDir("/tmp"),
86 fIsCustomDraw(kFALSE),
92 fGraphLimitEntries(10000),
93 fMapRefTrees(new TMap),
102 fChkDrawOptSame(0x0),
103 fChkDrawOptSparse(0x0),
104 fComboAddDrawOpt(0x0),
106 fContDrawSelSubRunTime(0x0),
127 fLblRunNumberVal(0x0),
136 fContCustomCuts(0x0),
139 fComboCustomDraw(0x0),
140 fComboCustomCuts(0x0),
146 fMapRefTrees->SetOwnerKeyValue();
147 fTrashBox->SetOwner();
149 gStyle->SetMarkerStyle(20);
150 gStyle->SetMarkerSize(0.5);
167 SetCleanup(kDeepCleanup);
173 fContTopBottom =
new TGCompositeFrame(
this, w, h, kVerticalFrame | kFixedWidth | kFixedHeight);
174 AddFrame(
fContTopBottom,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
183 fContLeft =
new TGCompositeFrame(
fContLCR, 200, 200, kVerticalFrame | kFixedWidth | kFitHeight);
184 fContLCR->AddFrame(
fContLeft,
new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandY, 5, 3, 3, 3));
187 TGVSplitter *splitLeft =
new TGVSplitter(
fContLCR);
189 fContLCR->AddFrame(splitLeft,
new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 0, 0, 0, 0));
192 fContRight =
new TGCompositeFrame(
fContLCR, 150, 200, kVerticalFrame | kFixedWidth | kFitHeight);
193 fContLCR->AddFrame(
fContRight,
new TGLayoutHints(kLHintsTop | kLHintsRight | kLHintsExpandY, 3, 5, 3, 3));
196 fContCenter =
new TGCompositeFrame(
fContLCR, 200, 200, kVerticalFrame | kFixedWidth | kFitHeight);
197 fContLCR->AddFrame(
fContCenter,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
200 TGVSplitter *splitRight =
new TGVSplitter(
fContLCR);
202 fContLCR->AddFrame(splitRight,
new TGLayoutHints(kLHintsLeft | kLHintsExpandY, 0, 0, 0, 0));
213 TGCompositeFrame *cfr =
new TGCompositeFrame(
fContDrawOpt, 200, 23, kHorizontalFrame | kFitWidth | kFixedHeight);
214 fContDrawOpt->AddFrame(cfr,
new TGLayoutHints(kLHintsCenterX | kLHintsExpandX , 0, 0, 0, 0));
217 cfr->AddFrame(
fChkDrawOptSame,
new TGLayoutHints(kLHintsNormal, 0, 2, 0, 0));
222 fChkDrawOptSparse->Connect(
"Clicked()",
"AliTPCCalibViewerGUItime",
this,
"DoNewSelection()");
223 fChkDrawOptSparse->SetToolTipText(
"In case of run trending only plot runs with information");
235 fContDrawSel =
new TGGroupFrame(
fContLeft,
"Draw selection", kVerticalFrame | kFitWidth | kFitHeight);
247 fRadioXhist->Connect(
"Clicked()",
"AliTPCCalibViewerGUItime",
this,
"HandleButtonsDrawSel()");
248 fRadioXhist->SetToolTipText(
"Draw the distribution of the variable");
252 fRadioXrun->Connect(
"Clicked()",
"AliTPCCalibViewerGUItime",
this,
"HandleButtonsDrawSel()");
253 fRadioXrun->SetToolTipText(
"Use run number as x-value");
258 fRadioXtime->Connect(
"Clicked()",
"AliTPCCalibViewerGUItime",
this,
"HandleButtonsDrawSel()");
259 fRadioXtime->SetToolTipText(
"Use time stamp number as x-value");
265 fListVariables->Connect(
"Selected(Int_t)",
"AliTPCCalibViewerGUItime",
this,
"DoNewSelection()");
277 fComboRunType->Connect(
"Selected(Int_t)",
"AliTPCCalibViewerGUItime",
this,
"DoDraw()");
284 fLblPar->SetTextJustify(kTextLeft);
285 fContDrawSel->AddFrame(
fLblPar,
new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
287 fNmbPar =
new TGNumberEntry(
fContDrawSel, 0, 1, -1, TGNumberFormat::kNESInteger, TGNumberFormat::kNEANonNegative, TGNumberFormat::kNELLimitMinMax, 0, 71);
288 fContDrawSel->AddFrame(
fNmbPar,
new TGLayoutHints(kLHintsNormal | kLHintsExpandX, 0, 0, 0, 0));
289 fNmbPar->Connect(
"ValueSet(Long_t)",
"AliTPCCalibViewerGUItime",
this,
"DoParLimitChange()");
301 fListCalibType->Connect(
"Selected(Int_t)",
"AliTPCCalibViewerGUItime",
this,
"DoChangeSelectionList()");
310 fCanvMain =
new TRootEmbeddedCanvas(
"GUItime_Canvas",
fContCenter, 200, 200, kFitWidth | kFitHeight);
311 fContCenter->AddFrame(
fCanvMain,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
312 fCanvMain->GetCanvas()->Connect(
"ProcessedEvent(Int_t, Int_t, Int_t, TObject*)",
"AliTPCCalibViewerGUItime",
this,
"MouseMove(Int_t, Int_t, Int_t, TObject*)");
314 fCanvMain->GetCanvas()->SetToolTipText(
"The Main_Canvas, here your plots are displayed.");
315 fCanvMain->GetCanvas()->SetRightMargin(0.062);
316 fCanvMain->GetCanvas()->SetLeftMargin(0.15);
322 fContValues =
new TGGroupFrame(
fContRight,
"Data point info", kVerticalFrame | kFitWidth | kFitHeight);
363 fBtnDumpRuns->Connect(
"Clicked()",
"AliTPCCalibViewerGUItime",
this,
"DoDumpRuns()");
364 fBtnDumpRuns->SetToolTipText(
"Press to dump the run numbers of the current selection.");
370 fContAliases->AddFrame(
fListAliases,
new TGLayoutHints(kLHintsNormal | kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
371 fListAliases->Connect(
"Selected(Int_t)",
"AliTPCCalibViewerGUItime",
this,
"DoNewSelectionAliases()");
374 TGCompositeFrame *frame1 =
new TGCompositeFrame(
fContAliases, 200, 23, kHorizontalFrame | kFitWidth | kFitHeight);
375 fContAliases->AddFrame(frame1,
new TGLayoutHints(kLHintsCenterX | kLHintsExpandX , 0, 0, 0, 0));
377 TGTextButton *btnAdd =
new TGTextButton(frame1,
"&Add");
378 frame1->AddFrame(btnAdd,
new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0));
379 btnAdd->Connect(
"Clicked()",
"AliTPCCalibViewerGUItime",
this,
"DoAddAlias()");
380 btnAdd->SetToolTipText(
"Press to add an alias.");
381 btnAdd->Resize(0,22);
383 TGTextButton *btnDel =
new TGTextButton(frame1,
"&Del");
384 frame1->AddFrame(btnDel,
new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0));
385 btnDel->Connect(
"Clicked()",
"AliTPCCalibViewerGUItime",
this,
"DoDelAlias()");
386 btnDel->SetToolTipText(
"Press to delete the selected alias.");
387 btnDel->Resize(0,22);
389 TGTextButton *btnUp =
new TGTextButton(frame1,
"&Upd");
390 frame1->AddFrame(btnUp,
new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0));
391 btnUp->Connect(
"Clicked()",
"AliTPCCalibViewerGUItime",
this,
"UpdateAliasList()");
392 btnUp->SetToolTipText(
"Press to update the alias list.");
416 fComboCustomDraw->Connect(
"ReturnPressed()",
"AliTPCCalibViewerGUItime",
this,
"DoCustomDraw()");
417 fComboCustomDraw->Connect(
"Selected(Int_t)",
"AliTPCCalibViewerGUItime",
this,
"DoCustomDraw()");
434 fComboCustomCuts->Connect(
"ReturnPressed()",
"AliTPCCalibViewerGUItime",
this,
"DoCustomCutsDraw()");
435 fComboCustomCuts->Connect(
"Selected(Int_t)",
"AliTPCCalibViewerGUItime",
this,
"DoCustomCutsDraw()");
438 SetWindowName(
"AliTPCCalibViewer GUI - Time");
440 Resize(GetDefaultSize());
456 TString file(fileName);
457 if (file.Contains(
"://")) {
458 if (file.Contains(
";")) {
459 arr=file.Tokenize(
";");
462 arr->Add(
new TObjString(fileName));
465 TString s=gSystem->GetFromPipe(Form(
"ls %s",fileName));
466 arr=s.Tokenize(
"\n");
473 fTree=
new TChain(treeName);
474 while ( (o=next()) ){
475 fTree->AddFile(o->GetName());
501 if (!
fTree)
return kFALSE;
503 Long64_t entries=
fTree->GetEntries();
505 AliError(
"No entries found in chain");
531 if (!
fTree->GetBranch(
"runType."))
return;
532 TObjString *runType=0x0;
533 Int_t nevets=
fTree->GetEntries();
534 fTree->SetBranchStatus(
"*",0);
535 fTree->SetBranchStatus(
"runType.*",1);
536 fTree->SetBranchAddress(
"runType.",&runType);
537 for (Int_t iev=0;iev<nevets;++iev){
538 fTree->GetEntry(iev);
539 TString type=runType->String();
542 fTree->ResetBranchAddresses();
543 fTree->SetBranchStatus(
"*",1);
558 type.Remove(TString::kBoth,
' ');
559 type.Remove(TString::kBoth,
'\t');
560 if (type.IsNull()) type=
"UNSPECIFIED";
589 if ( !
fTree )
return;
596 fTree->SetBranchStatus(
"*",1);
604 if ( !branchList )
return;
605 TIter nextBranch(branchList);
606 Int_t idCount=0,
id=0;
607 TObject *objBranch=0;
608 while ( (objBranch=nextBranch()) ){
609 TString branchName(objBranch->GetName());
610 TString branchTitle(objBranch->GetName());
611 if (branchName ==
"run" || branchName ==
"time" || branchName ==
"runType.")
continue;
613 TString calibType=
"UNSPECIFIED";
615 const TObject *key=(*fConfigParser)(branchName.Data());
619 id=(*fConfigParser)()->IndexOf(key);
629 if (calibType.IsNull()) calibType=
"UNSPECIFIED";
632 Bool_t calibActive=kFALSE;
633 TIter nextCalib(&calibTypes);
635 while ( (objCalib=nextCalib()) )
636 if (calibType==objCalib->GetTitle()) calibActive=kTRUE;
639 TString s=branchName;
640 if (branchName.EndsWith(
".")) s+=
"*";
657 fMapRefTrees->Add(
new TObjString(refName),
new TObjString(treeFileName));
664 TString selectedVariable=
"";
667 selectedVariable =
fListVariables->GetSelectedEntry()->GetTitle();
670 TString branchName=selectedVariable;
672 const TObject *key=(*fConfigParser)(id);
673 if (key) branchName=(*fConfigParser)(id)->GetName();
676 if (branchName.EndsWith(
".")){
677 Int_t par = (Int_t)(
fNmbPar->GetNumber());
678 branchName.Append(Form(
"fElements[%d]",par));
693 if (
fChkDrawOptSame->GetState()==kButtonDown && !drawOpt.Contains(
"same",TString::kIgnoreCase))
704 if (runType!=
"ALL"&&!runType.IsNull()) cuts+=Form(
"runType.String().Data()==\"%s\"",runType.Data());
705 cutStr=cuts.GetTitle();
718 const Long64_t nrows=
fTree->GetSelectedRows();
723 long long *index=
new long long[nrows];
727 for (Int_t i=0;i<
fTree->GetSelectedRows();++i){
728 if (
fTree->GetV2()[i]<1) ++nTime0;
731 if (nTime0==
fTree->GetSelectedRows()){
732 TMath::Sort(nrows,
fTree->GetV1(),index,kFALSE);
734 TMath::Sort(nrows,
fTree->GetV2(),index,kFALSE);
737 Double_t lastRun=-1.;
740 for (Long64_t i=0; i<nrows; ++i){
742 Double_t run =
fTree->GetV1()[index[i]];
743 Double_t xval = xArr[index[i]];
746 if (TMath::Abs(lastRun-run)<.1) {
752 fValuesX.GetMatrixArray()[entries]=xval;
777 Int_t pos=title.First(
">>");
778 if (pos>0) title=title(0,pos);
793 TIter next(arr,kIterBackward);
794 while ( (o=next()) ){
795 TString varName=o->GetName();
799 TString branchName=varName;
801 if (branchName.Contains(
'.')) branchName=branchName(0,branchName.First(
'.')+1);
803 const TObject *oBranch=(*fConfigParser)(branchName.Data());
806 if (!branchTitle.IsNull()){
809 if (varName.Contains(
"fElements")){
810 TString parStr=varName(varName.First(
'[')+1,varName.Length()-varName.First(
'[')-2);
814 if (!yparname.IsNull()){
815 branchTitle+=yparname;
839 while ( (o=nextGraphicObject()) ){
840 if (o->IsA()==TGraph::Class()){
841 TGraph *
gr=(TGraph*)o;
843 min=TMath::MinElement(gr->GetN(),gr->GetY());
844 max=TMath::MaxElement(gr->GetN(),gr->GetY());
846 Float_t currmin=TMath::MinElement(gr->GetN(),gr->GetY());
847 Float_t currmax=TMath::MaxElement(gr->GetN(),gr->GetY());
848 if (currmax>max) max=currmax;
849 if (currmin<min) min=currmin;
854 if (min!=0) min=min-(max-min)/10;
855 if (max!=0) max=max+(max-min)/10;
869 graphOutput&=(drawString.First(
">>")<0);
875 Bool_t drawSame=optString.Contains(
"same",TString::kIgnoreCase);
878 drawString.Prepend(
"run:time:");
889 TVirtualPad *padsave=gPad;
899 fTree->Draw(drawString.Data(),cutString.Data(),optString.Data());
900 if (
fTree->GetSelectedRows()==-1)
return;
904 Bool_t drawGraph=kFALSE;
948 if (!drawSame) grDraw+=
"a";
953 Double_t *newBins =
new Double_t[nrows+1];
954 for (Int_t ibin=0; ibin<nrows+1; ++ibin) newBins[ibin]=ibin;
955 graph->GetXaxis()->Set(nrows,newBins);
956 graph->GetXaxis()->LabelsOption(
"v");
957 for (Int_t i=0; i<nrows;++i)
958 graph->GetXaxis()->SetBinLabel(i+1,Form(
"%.0f",
fRunNumbers.GetMatrixArray()[i]));
961 graph->Draw(grDraw.Data());
962 graph->SetEditable(kFALSE);
963 TH1 *hist=graph->GetHistogram();
964 hist->SetTitle(title.Data());
966 graph->SetLineColor(
fTrashBox->GetEntries());
967 graph->SetMarkerColor(
fTrashBox->GetEntries());
973 TH1 *hist=
fTree->GetHistogram();
974 hist->SetTitle(title.Data());
977 hist->SetLineColor(
fTrashBox->GetEntries());
978 hist->SetMarkerColor(
fTrashBox->GetEntries());
984 if (
fRadioXtime->GetState()==kButtonDown&&!drawSame){
986 xaxis->SetTimeFormat(
"#splitline{%d.%m}{%H:%M}");
987 xaxis->SetTimeDisplay(1);
988 xaxis->SetLabelOffset(xaxis->GetLabelOffset()*3);
989 xaxis->SetLabelSize(xaxis->GetLabelSize()/1.3);
1009 Int_t *sortIndex =
new Int_t[
npoints];
1010 TMath::Sort(npoints,
fRunNumbers.GetMatrixArray(),sortIndex,kFALSE);
1011 Int_t run=0, prevRun=-1;
1013 for (Int_t irun=0;irun<
npoints;++irun){
1014 run=(Int_t)
fRunNumbers.GetMatrixArray()[sortIndex[irun]];
1015 if (run!=prevRun) std::cout << Form(
"%d",run) << std::endl;
1018 delete [] sortIndex;
1069 TGButton *btn = (TGButton *) gTQSender;
1070 id = btn->WidgetId();
1073 Bool_t doDraw=kFALSE;
1074 Bool_t noDraw=kFALSE;
1112 Int_t par = (Int_t)(
fNmbPar->GetNumber());
1116 if (parName==
"") parName.Form(
"%d",par);
1117 fLblPar->SetText(Form(
"Parameter: %s",parName.Data()));
1128 TString selectedVariableTitle=
"";
1131 selectedVariableTitle =
fListVariables->GetSelectedEntry()->GetTitle();
1134 TString selectedVariable=selectedVariableTitle;
1135 const TObject *key=(*fConfigParser)(id);
1136 if (key) selectedVariable=(*fConfigParser)(id)->GetName();
1138 if (selectedVariable.IsNull()||!selectedVariable.EndsWith(
".")) {
1140 fLblPar->SetText(
"Parameter: none");
1147 TBranch *branch=
fTree->GetTree()->GetBranch(selectedVariable.Data());
1148 TString branchClass=branch->GetClassName();
1150 if (branchClass==
"TVectorT<double>"){
1152 fTree->SetBranchAddress(selectedVariable.Data(),&vD);
1153 while (maxPar<2&&event<fTree->GetEntries()){
1154 fTree->GetEntry(event++);
1155 maxPar=vD->GetNrows();
1157 }
else if (branchClass==
"TVectorT<float>"){
1159 fTree->SetBranchAddress(selectedVariable.Data(),&vF);
1160 while (maxPar<2&&event<fTree->GetEntries()){
1161 fTree->GetEntry(event++);
1162 maxPar=vF->GetNrows();
1170 fTree->SetBranchAddress(selectedVariable.Data(),0x0);
1172 fNmbPar->SetLimitValues(0,maxPar-1);
1181 UInt_t dd=0,mm=0,yy=0,HH=0,MM=0,SS=0,run=0;
1182 Double_t valx=0.,valy=0.;
1185 fLblRunTimeVal->SetText(Form(
"%02u.%02u.%04u\n%02u:%02u:%02u",dd,mm,yy,HH,MM,SS));
1190 TVirtualPad *padsave=gPad;
1196 Int_t minDist=1000000;
1198 for (Int_t i=0;i<n;++i){
1199 Int_t pxp = gPad->XtoAbsPixel(gPad->XtoPad(arr[i]));
1200 Int_t pyp = gPad->YtoAbsPixel(gPad->YtoPad(
fValuesY[i]));
1201 Int_t d = TMath::Nint(TMath::Sqrt(TMath::Abs(pxp-x) + TMath::Abs(pyp-y)));
1209 t.GetDate(kTRUE,0,&yy,&mm,&dd);
1210 t.GetTime(kTRUE,0,&HH,&MM,&SS);
1215 dd=0;mm=0;yy=0;HH=0;MM=0;SS=0;run=0;
1220 fLblRunTimeVal->SetText(Form(
"%02u.%02u.%04u\n%02u.%02u.%02u",dd,mm,yy,HH,MM,SS));
1233 if (event == kButton1Double ){
1250 if (!fileName.EndsWith(
"/")) fileName+=
"/";
1251 fileName+=Form(
"guiTreeRun_%d.root",run);
1253 if (gSystem->AccessPathName(fileName.Data())){
1270 if (!fileName.EndsWith(
"/")) fileName+=
"/";
1273 if (gSystem->AccessPathName(fileName.Data())){
1286 while ( (o=nextRefTree()) ){
1296 s.ReplaceAll(
"_{",
"|{");
1297 s.ReplaceAll(
"_",
" ");
1298 s.ReplaceAll(
"|{",
"_{");
1307 TList *l=
fTree->GetListOfAliases();
1309 TString selectedVariable=
"";
1311 selectedVariable =
fListAliases->GetSelectedEntry()->GetTitle();
1329 TList *l=
fTree->GetListOfAliases();
1331 TString selectedVariable=
"";
1333 selectedVariable =
fListAliases->GetSelectedEntry()->GetTitle();
1334 l->Remove(l->FindObject(selectedVariable.Data()));
1343 printf(
"UpdateAliasList\n");
1345 TList *l=
fTree->GetListOfAliases();
1351 while( (o=nextAlias()) ){
1362 TGMainFrame* frmMain =
new TGMainFrame(gClient->GetRoot(), 1000, 600);
1363 frmMain->SetWindowName(
"AliTPCCalibViewer GUItime");
1364 frmMain->SetCleanup(kDeepCleanup);
1366 TGTab* tabMain =
new TGTab(frmMain, 1000, 600);
1367 frmMain->AddFrame(tabMain,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
1369 TGCompositeFrame* tabCont1 = tabMain->AddTab(
"Time");
1370 TGCompositeFrame* tabCont2 = tabMain->AddTab(
"Detail - XXXXX");
1373 tabCont1->AddFrame(calibViewerTime,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
1374 calibViewerTime->
SetConfigFileName(
"$ALICE_ROOT/TPC/CalibMacros/calibVarDescription.txt");
1375 calibViewerTime->
UseFile(fileName, treeName);
1378 tabCont2->AddFrame(calibViewer,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
1384 guiArray->Add(calibViewerTime);
1385 guiArray->Add(calibViewer);
1387 frmMain->MapSubwindows();
1389 frmMain->MapWindow();
1399 TGMainFrame* frmMain =
new TGMainFrame(gClient->GetRoot(), 1000, 600);
1400 frmMain->SetWindowName(
"AliTPCCalibViewer GUItime");
1401 frmMain->SetCleanup(kDeepCleanup);
1403 TGTab* tabMain =
new TGTab(frmMain, 1000, 600);
1404 frmMain->AddFrame(tabMain,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
1406 TGCompositeFrame* tabCont1 = tabMain->AddTab(
"Time");
1409 tabCont1->AddFrame(calibViewerTime,
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0));
1413 guiArray->Add(calibViewerTime);
1415 frmMain->MapSubwindows();
1417 frmMain->MapWindow();
1435 UInt_t w, UInt_t h, UInt_t options,
1442 fMain =
new TGTransientFrame(
p,
main, w, h, options);
1443 fMain->Connect(
"CloseWindow()",
"AliTPCCalibViewerGUItimeAddAliasFrame",
this,
"DoCancel()");
1444 fMain->DontCallClose();
1447 fMain->SetCleanup(kDeepCleanup);
1450 TGLayoutHints *l1 =
new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2);
1451 TGLayoutHints *l2 =
new TGLayoutHints(kLHintsTop | kLHintsRight | kLHintsExpandX, 2, 2, 0, 5);
1455 TGCompositeFrame *f1 =
new TGCompositeFrame(fMain, 60, 20, kVerticalFrame);
1456 fMain->AddFrame(f1, l1);
1457 TGCompositeFrame *frameName =
new TGCompositeFrame(f1);
1458 TGCompositeFrame *frameFormula =
new TGCompositeFrame(f1);
1459 f1->AddFrame(frameName,l2);
1460 f1->AddFrame(frameFormula,l2);
1461 TGLabel *lblTxt1 =
new TGLabel(frameName,
"Name:");
1462 TGLabel *lblTxt2 =
new TGLabel(frameFormula,
"Formula:");
1463 fTxt1 =
new TGTextEntry(frameName,
new TGTextBuffer(1000));
1464 fTxt2 =
new TGTextEntry(frameFormula,
new TGTextBuffer(1000));
1466 frameName->AddFrame(lblTxt1, l2);
1467 frameName->AddFrame(fTxt1, l2);
1468 frameFormula->AddFrame(lblTxt2, l2);
1469 frameFormula->AddFrame(fTxt2, l2);
1471 fTxt1->Resize(350, fTxt1->GetDefaultHeight());
1472 fTxt2->Resize(350, fTxt2->GetDefaultHeight());
1475 TGHorizontalFrame *frame =
new TGHorizontalFrame(fMain, 60, 20, kFixedWidth);
1477 TGTextButton *okButton =
new TGTextButton(frame,
"&Ok", 1);
1478 okButton->Connect(
"Clicked()",
"AliTPCCalibViewerGUItimeAddAliasFrame",
this,
"DoOK()");
1479 TGTextButton *cancelButton =
new TGTextButton(frame,
"&Cancel", 2);
1480 cancelButton->Connect(
"Clicked()",
"AliTPCCalibViewerGUItimeAddAliasFrame",
this,
"DoCancel()");
1483 frame->AddFrame(okButton, l1);
1484 frame->AddFrame(cancelButton, l1);
1486 frame->Resize(150, okButton->GetDefaultHeight());
1488 fMain->AddFrame(frame,
new TGLayoutHints(kLHintsBottom | kLHintsRight, 2, 2, 5, 1));
1491 TString aliasName, alias;
1492 if (!strAlias.IsNull()){
1493 TChain *c=fGUI->GetChain();
1495 TList *l=c->GetListOfAliases();
1497 TNamed *d=(TNamed*)l->FindObject(strAlias);
1499 aliasName=d->GetName();
1500 alias=d->GetTitle();
1505 alias=fGUI->GetCustomDrawString();
1507 fTxt1->SetText(aliasName.Data(),kFALSE);
1508 fTxt2->SetText(alias.Data(),kFALSE);
1510 fMain->MapSubwindows();
1514 fMain->CenterOnParent();
1516 fMain->SetWindowName(
"Alias Editor");
1526 fMain->DeleteWindow();
1533 TString aliasName=fTxt1->GetText();
1534 TString alias=fTxt2->GetText();
1535 if (!aliasName.IsNull()&&!alias.IsNull()){
1536 TChain *c=fGUI->GetChain();
1538 c->SetAlias(aliasName.Data(),alias.Data());
1541 fGUI->UpdateAliasList();
TGGroupFrame * fContDrawSel
Subgroup for draw selection.
AliTPCCalibViewerGUItime(const TGWindow *p, UInt_t w, UInt_t h)
TGCompositeFrame * fContCenter
container for GUI elements at the center
Bool_t fIsCustomDraw
if custom draw string is selected
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Class for Parsing simple text configuration files.
TGCheckButton * fChkDrawOptSame
draw option 'same'
TGGroupFrame * fContValues
container to keep data point information
TGRadioButton * fRadioXtime
Radio button x-variable: time.
TGLabel * fLblPar
parameter name
TString fDrawString
current draw string
const TString GetDrawOptionString()
TGLabel * fLblValueY
value label
TGCompositeFrame * fContTopBottom
container for all GUI elements, vertical divided
TGTextButton * fBtnDumpRuns
draw button
void UpdateValueArrays(Bool_t withGraph, const Double_t *xArr)
GUI for the AliTPCCalibViewer used for the calibration monitor All functionalities of the AliTPCCalib...
Bool_t CreateGUIRefTree(const char *filename="")
TGLabel * fLblCustomCuts
label for custom cuts string
TGRadioButton * fRadioXrun
Radio button x-variable: run.
const TString GetDrawString()
const char * GetData(const char *key, UInt_t position=0)
TGLabel * fLblCustomDraw
label for custom draw string
TGCompositeFrame * fContCustom
container for custom draw command GUI elements
AliTPCCalibViewerGUI * fCalibViewerGUI
calib viewer gui used to display verbose information for one run
void Initialize(const char *fileName, const char *treeName="calPads")
void SetCalibViewerGUItab(TGTabElement *const tab)
void UpdateRefDataFromOCDB()
TVectorD fValuesX
values of current selection
virtual ~AliTPCCalibViewerGUItimeAddAliasFrame()
AliTPCCalibViewer * GetViewer()
void Reload(Int_t first=1)
TGraph * fCurrentGraph
current graph
TVectorD fTimeStamps
timr stamps of current selection
TString fileName(const char *dir, int runNumber, const char *da, int i, const char *type)
void DoNewSelectionAliases()
Class providing the calculation of derived quantities (mean,rms,fits,...) of calibration entries...
void UseConfigFile(const char *file="")
TGGroupFrame * fContAliases
container to keep data point information
TGCompositeFrame * fContDrawSelSubRunTime
Radio button subframe.
TH1 * fCurrentHist
histogram currently drawn in main canvas
TGLabel * fLblValueXVal
value of the data point hoovered
TGLabel * fLblRunNumber
run number label
AliTPCConfigParser * fConfigParser
configuration parser
Bool_t CreateGUITree(const char *filename="")
void SetGuiTree(Int_t run)
TMap * fMapRefTrees
map of reference trees for the CalibViewer
TString fConfigFile
configuration file keeping active branches and branch descriptions
TVectorD fRunNumbers
run numbers of current selection
TGGroupFrame * fContDrawOpt
Subgroup for draw selection.
TGLabel * fLblRunType
run type label
TGCompositeFrame * fContLCR
container for all GUI elements, horizontal divided
void HandleButtonsDrawSel(Int_t id=-1)
void AddReferenceTree(const char *treeFileName, const char *refName="R")
TGCheckButton * fChkDrawOptSparse
draw option 'sparse'
void SetCalibViewerGUI(AliTPCCalibViewerGUI *const gui)
void GetCutString(TString &cutStr)
TFriendElement * AddReferenceTree(const char *filename, const char *treename="calPads", const char *refname="R")
TGLabel * fLblRunTime
time stamp label
TGLabel * fLblRunNumberVal
run number of the data point hoovered
TVectorD fValuesY
values of current selection
void MouseMove(Int_t event, Int_t x, Int_t y, TObject *)
TGNumberEntry * fNmbPar
parameter number
void DrawGUI(const TGWindow *, UInt_t w, UInt_t h)
TObjArray * fTrashBox
graphics objects to be deleted (histograms, graphs,...)
virtual ~AliTPCCalibViewerGUItime()
TRootEmbeddedCanvas * fCanvMain
main drawing canvas
TGComboBox * fComboAddDrawOpt
additional draw options combo box
AliTPCCalibViewerGUI * gui
const char * GetGUIRefTreeDefaultName()
Bool_t fNoGraph
Whether to create a graph.
TGComboBox * fComboCustomCuts
combo box custom cuts string
static TObjArray * ShowGUI(const char *fileName=0, const char *treeName="dcs")
TGListBox * fListVariables
listbox with possible variables
TGLabel * fLblValueX
value label
TGCompositeFrame * fContCustomCuts
container for custom cut options GUI elements
void SubstituteUnderscores(TString &s)
void UseChain(TChain *const chain)
void SetReferenceRun(Int_t run=-1)
TGListBox * fListCalibType
calibration type selection box
Int_t ParseConfigFileTxt(const char *cfgfile)
Float_t GetValue(const char *key, UInt_t position=0)
TGComboBox * fComboCustomDraw
combo box custom draw string
TGLabel * fLblValueYVal
value of the data point hoovered
void UseFile(const char *fileName, const char *treeName)
TGTabElement * fCalibViewerGUItab
tab the calib view gui redies in
#define AliError(message)
void SetConfigFileName(const char *file)
TGRadioButton * fRadioXhist
Radio button x-variable: show only 1D distribution.
TGCompositeFrame * fContRight
container for GUI elements on right side
TGLabel * fLblRunTimeVal
time stamp of the data point hoovered
GUI for displaying calibration entires over time Calibration Trees are created using the macro TPC/Ca...
TGComboBox * fComboRunType
run type selection box
TGListBox * fListAliases
list of aliases
int main(int argc, char **argv)
TChain * fTree
internal tree
TGCompositeFrame * fContLeft
container for GUI elements on left side
void GetHistogramTitle(TString &title)
TString fOutputCacheDir
output cache diretory for AliTPCCalibViewerGUI trees, created on the fly
TGGroupFrame * fContCalibType
calibration type label