1 #include "KVIDGridManagerGUI.h"
3 #include "KVIDGridManager.h"
13 #include <KVTestIDGridDialog.h>
15 #include <KVIDGUITelescopeChooserDialog.h>
16 #include <KVDropDownDialog.h>
17 #include <KVIdentificationResult.h>
18 #include <KVReconstructedNucleus.h>
20 #include "KVInputDialog.h"
21 #include "KVIDCutLine.h"
22 #include "KVIDCutContour.h"
23 #include "KVVirtualIDFitter.h"
38 fLastSelectedGrid = 0;
47 gIDGridManager->Connect(
"Modified()",
"KVIDGridManagerGUI",
this,
48 "UpdateListOfGrids()");
56 sgm->
AddEntry(
"Selected", M_GRIDS_SAVE_SEL);
57 sgm->
AddEntry(
"Tab", M_GRIDS_SAVE_TAB);
58 sgm->
AddEntry(
"All", M_GRIDS_SAVE_ALL);
59 fMenuFile->AddPopup(
"Save...", sgm);
61 fMenuFile->AddSeparator();
64 sgm->
AddEntry(
"Selected", M_GRIDS_DEL_SEL);
65 sgm->
AddEntry(
"Tab", M_GRIDS_DEL_TAB);
66 sgm->
AddEntry(
"All", M_GRIDS_DEL_ALL);
67 fMenuFile->AddPopup(
"Delete...", sgm);
68 fMenuFile->AddSeparator();
69 fMenuFile->AddEntry(
"&Quit", M_QUIT);
71 fMenuFile->Connect(
"Activated(Int_t)",
"KVIDGridManagerGUI",
this,
72 "HandleGridsMenu(Int_t)");
80 sgm->
AddEntry(
"Runlist", M_GRIDS_SET_RUNLIST);
81 sgm->
AddEntry(
"X Variable", M_GRIDS_SET_VARX);
82 sgm->
AddEntry(
"Y Variable", M_GRIDS_SET_VARY);
84 sgm->
AddEntry(
"Z ID Only", M_GRIDS_SET_ZID);
85 fMenuEdit->AddPopup(
"Set...", sgm);
86 fMenuEdit->AddEntry(
"Clear", M_GRIDS_CLEAR);
87 fMenuEdit->Connect(
"Activated(Int_t)",
"KVIDGridManagerGUI",
this,
88 "HandleGridsMenu(Int_t)");
94 fMenuBar->AddPopup(
"&File", fMenuFile, fMenuBarItemLayout);
95 fMenuBar->AddPopup(
"&Edit", fMenuEdit, fMenuBarItemLayout);
108 const char* xpms[] = {
121 const char* tips[] = {
122 "Open file containing grids",
123 "Save all grids in current file",
126 "Delete selected grid(s)",
127 "Set ID telescopes for grid",
157 const char* method[] = {
162 "DeleteSelectedGrids()",
166 "UpdateListOfGrids()",
181 *buttons[i] = fToolBar->AddButton(
this, &t[i], spacing[i]);
182 (*buttons[i])->Connect(
"Clicked()",
"KVIDGridManagerGUI",
this, method[i]);
183 fTBbuttons[i] = *buttons[i];
208 fGridListTabs =
new TGTab(fHframe, 550, 400);
209 fGridListTabs->Connect(
"Selected(Int_t)",
"KVIDGridManagerGUI",
this,
"TabSelect(Int_t)");
214 fHframe->AddFrame(fGridListTabs,
219 TGLabel* lab1 =
new TGLabel(line_frame,
"CURRENT GRID IDENTIFIERS");
224 fIDLineList->SetDataColumns(5);
225 fIDLineList->SetDataColumn(0,
"Name",
"",
kTextLeft);
228 fIDLineList->SetDataColumn(3,
"OnlyZId",
"OnlyZId",
kTextCenterX);
229 fIDLineList->SetDataColumn(4,
"MassFormula",
"",
kTextCenterX);
230 fIDLineList->GetDataColumn(3)->SetIsBoolean();
231 fIDLineList->ActivateSortButtons();
232 fIDLineList->AllowBrowse(
kFALSE);
237 lab1 =
new TGLabel(line_frame,
"Cuts");
241 fCUTList->SetDataColumns(3);
242 fCUTList->SetDataColumn(0,
"Name",
"",
kTextLeft);
243 fCUTList->SetDataColumn(1,
"# Points",
"GetN",
kTextCenterX);
244 fCUTList->SetDataColumn(2,
"Class",
"ClassName",
kTextCenterX);
246 fCUTList->ActivateSortButtons();
247 fCUTList->AllowBrowse(
kFALSE);
252 lab1 =
new TGLabel(line_frame,
"Infos");
256 fCUTInfoList->SetDataColumns(3);
257 fCUTInfoList->SetDataColumn(0,
"Name",
"",
kTextLeft);
258 fCUTInfoList->SetDataColumn(1,
"# Points",
"GetN",
kTextCenterX);
259 fCUTInfoList->SetDataColumn(2,
"Class",
"ClassName",
kTextCenterX);
262 fCUTInfoList->ActivateSortButtons();
263 fCUTInfoList->AllowBrowse(
kFALSE);
274 SetWindowName(
"ID Grid Manager");
278 Resize(GetDefaultSize());
280 SetWMSize(1200, 600);
292 KVIDGridManagerGUI::~KVIDGridManagerGUI()
296 gIDGridManager->Disconnect(
"Modified()",
this,
"UpdateListOfGrids()");
317 if (fIDGridEditor->IsClosed()) fIDGridEditor->
StartViewer();
321 fSelectedGrid->UpdateLastSavedVersion();
322 fIDGridEditor->SetGrid(fSelectedGrid);
343 static TString dir(
"$HISTOROOT");
348 const char* filetypes[] = {
"Root files",
"*.root",
"All files",
"*", 0, 0};
379 cout <<
"Add new grid" << endl;
386 case M_GRIDS_SAVE_SEL:
388 SaveGridsAs(fSelectedEntries.get());
391 case M_GRIDS_SAVE_TAB:
393 SaveGridsAs(GetAllGridsInTab());
396 case M_GRIDS_SAVE_ALL:
402 case M_GRIDS_DEL_SEL:
403 DeleteSelectedGrids();
406 case M_GRIDS_DEL_TAB:
410 new TGMsgBox(fClient->GetDefaultRoot(),
this,
"ID Grid Manager",
411 "This will delete all grids in the current tab. Are you sure ?",
413 if (ret_val &
kMBOk) {
414 DeleteAllGridsInTab();
418 case M_GRIDS_DEL_ALL:
423 new TGMsgBox(fClient->GetDefaultRoot(),
this,
"ID Grid Manager",
424 "This will delete all grids. Are you sure ?",
426 if (ret_val &
kMBOk) {
427 gIDGridManager->
Clear();
436 case M_GRIDS_SET_RUNLIST:
439 if (!fSelectedGrid)
break;
440 TString runs = fSelectedGrid->GetRunList();
442 new KVInputDialog(
this,
"Enter list of runs for grid(s):", &runs, &ok_pressed,
443 "Example: 1-10, 13, 22-657");
444 if (!ok_pressed)
break;
445 TIter next(fSelectedEntries.get());
452 case M_GRIDS_SET_VARX:
455 if (!fSelectedGrid)
break;
456 TString runs = fSelectedGrid->GetVarX();
458 new KVInputDialog(
this,
"Enter X variable for grid(s):", &runs, &ok_pressed,
460 if (!ok_pressed)
break;
461 TIter next(fSelectedEntries.get());
468 case M_GRIDS_SET_VARY:
471 if (!fSelectedGrid)
break;
472 TString runs = fSelectedGrid->GetVarY();
474 new KVInputDialog(
this,
"Enter Y variable for grid(s):", &runs, &ok_pressed,
476 if (!ok_pressed)
break;
477 TIter next(fSelectedEntries.get());
484 case M_GRIDS_SET_ZID:
487 if (!fSelectedGrid)
break;
488 Bool_t runs = !fSelectedGrid->HasMassIDCapability();
489 TIter next(fSelectedEntries.get());
499 if (!fSelectedGrid)
break;
500 TIter next(fSelectedEntries.get());
523 new TGMsgBox(fClient->GetDefaultRoot(),
this,
"ID Grid Manager",
524 "This will delete the selected grids. Are you sure ?",
526 if (ret_val &
kMBOk) {
538 const char* filetypes[] = {
539 "ID Grid files",
"*.dat",
556 SetStatus(
Form(
"Read %d grids from file %s", ngriread, fi.
fFilename));
561 new TGMsgBox(fClient->GetDefaultRoot(),
this,
"ID Grid Manager",
613 fSelectedEntries.reset(fIDGridList->GetSelectedObjects());
614 fSelectedGrid = (
KVIDGraph*)fIDGridList->GetLastSelectedObject();
615 if (!GetNSelected())fSelectedGrid = 0x0;
618 ActivateToolbarButtons();
619 if (!GetNSelected()) SetStatus();
620 else if (GetNSelected() == 1) SetStatus(
Form(
"Selected grid %s (%s)", fSelectedGrid->GetName(), fSelectedGrid->ClassName()));
621 else SetStatus(
Form(
"Selected %d grids, last selected grid %s (%s)", GetNSelected(), fSelectedGrid->GetName(), fSelectedGrid->ClassName()));
632 return (fSelectedEntries ? fSelectedEntries->GetSize() : 0);
644 if (!GetNSelected())
return;
650 if (fLastSelectedGrid == entry) fLastSelectedGrid = 0;
656 fSelectedEntries.reset(
nullptr);
676 fSelectedEntries.reset(
nullptr);
691 telescopes.
AddAll(fSelectedGrid->GetIDTelescopes());
693 fClient->GetDefaultRoot(),
this,
kTRUE);
694 if (cancel || !telescopes.
GetEntries())
return;
695 fSelectedGrid->ClearListOfTelescopes();
696 fSelectedGrid->AddIDTelescopes(&telescopes);
708 if (GetNSelected() == 1)
709 fSelectedGrid->Clear();
710 else if (GetNSelected() > 1) {
712 TIter next(fSelectedEntries.get());
721 Clist->R__FOR_EACH(
TCanvas, Modified)();
722 Clist->R__FOR_EACH(
TCanvas, Update)();
732 if (!fSelectedGrid)
return;
733 gIDGridManager->Disconnect(
"Modified()",
this,
"UpdateListOfGrids()");
735 fSelectedGrid->Copy(*new_gr);
740 gIDGridManager->Connect(
"Modified()",
"KVIDGridManagerGUI",
this,
"UpdateListOfGrids()");
741 fIDGridList->Sort(0);
742 fIDGridList->Sort(0);
763 Info(
"NewGrid",
"There are %d grids in the manager", gIDGridManager->
GetGrids()->
GetSize());
764 TString default_class =
"KVIDZAGrid";
766 if (gMultiDetArray) {
769 fClient->GetDefaultRoot(),
this);
770 if (cancel || !telescopes->
At(0)) {
771 Info(
"NewGrid",
"No ID telescopes chosen. Grid creation cancelled.");
775 default_class = ((
KVIDTelescope*)telescopes->
At(0))->GetDefaultIDGridClass();
784 choice.
Data(), default_class.
Data(), &id_grid_class, &ok_pressed);
786 Info(
"NewGrid",
"No ID grid class chosen. Grid creation cancelled.");
789 gIDGridManager->Disconnect(
"Modified()",
this,
"UpdateListOfGrids()");
793 gIDGridManager->Connect(
"Modified()",
"KVIDGridManagerGUI",
this,
"UpdateListOfGrids()");
827 const char* filetypes[] = {
828 "ID Grid files",
"*.dat",
845 SetStatus(
Form(
"Saved %d grids in file %s", n_saved, filenam.
Data()));
850 new TGMsgBox(fClient->GetDefaultRoot(),
this,
"ID Grid Manager",
851 Form(
"Could not write file %s", filenam.
Data()), 0,
878 fIDGridList->SetDataColumns(11);
879 fIDGridList->SetDataColumn(0,
"Name",
"",
kTextLeft);
880 fIDGridList->SetDataColumn(2,
"VarX",
"",
kTextLeft);
881 fIDGridList->SetDataColumn(1,
"VarY",
"",
kTextLeft);
882 fIDGridList->SetDataColumn(3,
"ID Telescopes",
"GetNamesOfIDTelescopes",
kTextLeft);
883 fIDGridList->SetDataColumn(4,
"RunList",
"",
kTextLeft);
884 fIDGridList->SetDataColumn(5,
"Identify Z and A?",
"HasMassIDCapability",
kTextCenterX);
885 fIDGridList->GetDataColumn(5)->SetIsBoolean();
886 fIDGridList->SetDataColumn(6,
"# Ident.",
"GetNumberOfIdentifiers",
kTextRight);
887 fIDGridList->SetDataColumn(7,
"# Cuts",
"GetNumberOfCuts",
kTextRight);
888 fIDGridList->SetDataColumn(8,
"# Infos",
"GetNumberOfInfos",
kTextRight);
889 fIDGridList->SetDataColumn(9,
"X scaling",
"GetXScaleFactor",
kTextRight);
890 fIDGridList->SetDataColumn(10,
"Y scaling",
"GetYScaleFactor",
kTextRight);
891 fIDGridList->ActivateSortButtons();
892 fIDGridList->Connect(
"SelectionChanged()",
"KVIDGridManagerGUI",
this,
893 "SelectionChanged()");
894 fIDGridList->SetDoubleClickAction(
"KVIDGridManagerGUI",
this,
"StartEditor(TObject*)");
899 fIDGridList->Display(grids);
904 while (! labels.
End()) {
909 fIDGridList->SetDataColumns(10);
910 fIDGridList->SetDataColumn(0,
"Name",
"",
kTextLeft);
911 fIDGridList->SetDataColumn(2,
"VarX",
"",
kTextLeft);
912 fIDGridList->SetDataColumn(1,
"VarY",
"",
kTextLeft);
913 fIDGridList->SetDataColumn(3,
"ID Telescopes",
"GetNamesOfIDTelescopes",
kTextLeft);
914 fIDGridList->SetDataColumn(4,
"RunList",
"",
kTextLeft);
915 fIDGridList->SetDataColumn(5,
"Identify Z and A?",
"HasMassIDCapability",
kTextCenterX);
916 fIDGridList->GetDataColumn(5)->SetIsBoolean();
917 fIDGridList->SetDataColumn(6,
"# Ident.",
"GetNumberOfIdentifiers",
kTextRight);
918 fIDGridList->SetDataColumn(7,
"# Cuts",
"GetNumberOfCuts",
kTextRight);
919 fIDGridList->SetDataColumn(8,
"X scaling",
"GetXScaleFactor",
kTextRight);
920 fIDGridList->SetDataColumn(9,
"Y scaling",
"GetYScaleFactor",
kTextRight);
921 fIDGridList->ActivateSortButtons();
922 fIDGridList->Connect(
"SelectionChanged()",
"KVIDGridManagerGUI",
this,
923 "SelectionChanged()");
924 fIDGridList->SetDoubleClickAction(
"KVIDGridManagerGUI",
this,
"StartEditor(TObject*)");
929 fIDGridList->Display(grids);
948 fIDGridList->SelectionChanged();
973 fIDGridList->SetDataColumns(10);
974 fIDGridList->SetDataColumn(0,
"Name",
"",
kTextLeft);
975 fIDGridList->SetDataColumn(2,
"VarX",
"",
kTextLeft);
976 fIDGridList->SetDataColumn(1,
"VarY",
"",
kTextLeft);
977 fIDGridList->SetDataColumn(3,
"ID Telescopes",
"GetNamesOfIDTelescopes",
kTextLeft);
978 fIDGridList->SetDataColumn(4,
"RunList",
"",
kTextLeft);
979 fIDGridList->SetDataColumn(5,
"Identify Z and A?",
"HasMassIDCapability",
kTextCenterX);
980 fIDGridList->GetDataColumn(5)->SetIsBoolean();
981 fIDGridList->SetDataColumn(6,
"# Ident.",
"GetNumberOfIdentifiers",
kTextRight);
982 fIDGridList->SetDataColumn(7,
"# Cuts",
"GetNumberOfCuts",
kTextRight);
983 fIDGridList->SetDataColumn(8,
"X scaling",
"GetXScaleFactor",
kTextRight);
984 fIDGridList->SetDataColumn(9,
"Y scaling",
"GetYScaleFactor",
kTextRight);
985 fIDGridList->ActivateSortButtons();
986 fIDGridList->Connect(
"SelectionChanged()",
"KVIDGridManagerGUI",
this,
987 "SelectionChanged()");
991 fGridListTabs->MapSubwindows();
992 fGridListTabs->Layout();
993 Int_t ntabs = fGridListTabs->GetCurrent();
1002 cout <<
"cf = 0x0 : label=Grids tab name=" <<
1003 fGridListTabs->GetTabTab(
"Grids")->GetText()->GetString() << endl;
1009 fIDGridList->Display(grids);
1012 Int_t ntabs = fGridListTabs->GetCurrent();
1018 while (! labels.
End()) {
1021 if (!fGridListTabs->GetTabContainer(lab.
Data())) {
1026 fIDGridList->SetDataColumns(11);
1027 fIDGridList->SetDataColumn(0,
"Name",
"",
kTextLeft);
1028 fIDGridList->SetDataColumn(2,
"VarX",
"",
kTextLeft);
1029 fIDGridList->SetDataColumn(1,
"VarY",
"",
kTextLeft);
1030 fIDGridList->SetDataColumn(3,
"ID Telescopes",
"GetNamesOfIDTelescopes",
kTextLeft);
1031 fIDGridList->SetDataColumn(4,
"RunList",
"",
kTextLeft);
1032 fIDGridList->SetDataColumn(5,
"Identify Z and A?",
"HasMassIDCapability",
kTextCenterX);
1033 fIDGridList->GetDataColumn(5)->SetIsBoolean();
1034 fIDGridList->SetDataColumn(6,
"# Ident.",
"GetNumberOfIdentifiers",
kTextRight);
1035 fIDGridList->SetDataColumn(7,
"# Cuts",
"GetNumberOfCuts",
kTextRight);
1036 fIDGridList->SetDataColumn(8,
"# Infos",
"GetNumberOfInfos",
kTextRight);
1037 fIDGridList->SetDataColumn(9,
"X scaling",
"GetXScaleFactor",
kTextRight);
1038 fIDGridList->SetDataColumn(10,
"Y scaling",
"GetYScaleFactor",
kTextRight);
1039 fIDGridList->ActivateSortButtons();
1040 fIDGridList->Connect(
"SelectionChanged()",
"KVIDGridManagerGUI",
this,
1041 "SelectionChanged()");
1046 fIDGridList->Display(grids);
1048 fGridListTabs->MapSubwindows();
1049 fGridListTabs->Layout();
1050 fGridListTabs->SetTab(fGridListTabs->GetNumberOfTabs() - 1,
kTRUE);
1056 cout <<
"cf = 0x0 : label=" << lab.
Data() <<
" tab name=" <<
1057 fGridListTabs->GetTabTab(lab.
Data())->GetText()->GetString() << endl;
1068 fIDGridList->Display(grids);
1071 if (grids)
delete grids;
1080 Int_t ntabs = fGridListTabs->GetCurrent();
1094 Int_t ntabs = fGridListTabs->GetNumberOfTabs();
1096 for (
Int_t itab = 0; itab < ntabs; itab++) {
1099 KVString lab = fGridListTabs->GetTabTab(itab)->GetString();
1112 fGridListTabs->RemoveTab(itab,
kFALSE);
1117 if (recursive) RemoveEmptyTabs();
1118 fGridListTabs->MapSubwindows();
1119 fGridListTabs->Layout();
1133 if (!fLastSelectedGrid)
return;
1135 KVList* ids = fLastSelectedGrid->GetIdentifiers();
1138 fIDLineList->Display(ids);
1140 fCUTList->Display(fSelectedGrid->GetCuts());
1144 fCUTInfoList->Display(fSelectedGrid->GetInfos());
1164 if (GetNSelected() == 1 && fSelectedGrid) {
1165 KVList* ids = fSelectedGrid->GetIdentifiers();
1168 fIDLineList->Display(ids);
1170 fCUTList->Display(fSelectedGrid->GetCuts());
1173 fCUTInfoList->Display(fSelectedGrid->GetInfos());
1175 if (fLastSelectedGrid) {
1176 fLastSelectedGrid->Disconnect(
"Modified()",
this,
"UpdateListOfLines()");
1178 fSelectedGrid->Connect(
"Modified()",
"KVIDGridManagerGUI",
this,
"UpdateListOfLines()");
1179 fLastSelectedGrid = fSelectedGrid;
1182 fIDLineList->RemoveAll();
1183 fCUTList->RemoveAll();
1184 fCUTInfoList->RemoveAll();
1185 if (fLastSelectedGrid) {
1186 fLastSelectedGrid->Disconnect(
"Modified()",
this,
"UpdateListOfLines()");
1187 fLastSelectedGrid = 0;
1200 for (
int i = 0; i < fNbButtons; i++) fTBbuttons[i]->SetEnabled(
kFALSE);
1202 fTBOpen->SetEnabled();
1203 fTBRefresh->SetEnabled();
1205 fTBNewG->SetEnabled();
1206 fTBOpenRoot->SetEnabled();
1210 if (!GetNSelected())
return;
1213 fTBDelG->SetEnabled();
1215 if (GetNSelected() == 1) {
1217 fTBStartEditor->SetEnabled();
1218 fTBCopyG->SetEnabled();
1219 if (gMultiDetArray) fTBSetIDG->SetEnabled();
1250 if (!fSelectedGrid || GetNSelected() != 1)
return;
1252 resname.
Form(
"%s.IDClass", fSelectedGrid->ClassName());
1254 resname.
Form(
"%s.DefaultIDClass", fSelectedGrid->ClassName());
1260 "Choose class of new identifier :",
1265 if (!okpressed)
return;
1268 cut_class = cut_choices;
1269 SetStatus(
Form(
"Draw ID line (%s) in current pad", cut_class.
Data()));
1270 fSelectedGrid->DrawAndAdd(
"ID", cut_class.
Data());
1302 if (!fSelectedGrid || GetNSelected() != 1)
return;
1304 resname.
Form(
"%s.CutClass", fSelectedGrid->ClassName());
1306 resname.
Form(
"%s.DefaultCutClass", fSelectedGrid->ClassName());
1309 TString cut_types = cut_choices;
1314 "Choose class of new cut :",
1319 if (!okpressed)
return;
1322 cut_class = cut_types;
1323 SetStatus(
Form(
"Draw cut %s in current pad", cut_class.
Data()));
1325 fSelectedGrid->DrawAndAdd(
"CUT", cut_class.
Data());
1343 if (GetNSelected() != 1)
return;
1344 if (!fSelectedGrid)
return;
1348 TIter next(
gPad->GetListOfPrimitives());
1350 while ((o = next())) {
1358 SetStatus(
"No TH2 found in current pad. Select pad containing 2D histo with data to identify.");
1362 SetStatus(
Form(
"Test identification of data in current pad %s.", histo->
GetName()));
1364 new KVTestIDGridDialog(fClient->GetDefaultRoot(),
this, 10, 10, fSelectedGrid, histo);
1379 if (GetNSelected() != 1)
return;
1380 if (!fSelectedGrid)
return;
1384 TIter next(
gPad->GetListOfPrimitives());
1386 while ((o = next())) {
1394 SetStatus(
"No TH2 found in current pad. Select pad containing 2D histo with data to identify.");
1398 SetStatus(
Form(
"Test identification of data in current pad %s.", histo->
GetName()));
1400 TFile* tmpfiles = TestIdentificationWithTree(fSelectedGrid, histo->
GetName());
1402 SetStatus(
"There was a problem with the test ???");
1406 TH2*
id = (
TH2*)tmpfiles->
Get(
"idcode_map");
1430 TFile* KVIDGridManagerGUI::TestIdentificationWithTree(
KVIDGraph* gr,
const Char_t* name_of_data_histo)
1448 printf(
" KVIDGraph::TestIdentificationWithTree l histo %s n existe pas\n", name_of_data_histo);
1460 if ((tid = (
TTree*)
gROOT->FindObject(
"tree_idresults"))) {
1461 printf(
" KVIDGraph::TestIdentificationWithTree effacemenent de l arbre existant\n");
1465 TString fn(
"IDtestTree.root");
1467 TFile* tmpfile =
new TFile(fn.Data(),
"recreate");
1470 tid =
new TTree(
"tree_idresults",
"pid");
1471 Float_t br_xxx, br_yyy, br_stat, br_pid;
1472 Int_t br_idcode, br_isid;
1474 tid->
Branch(
"X", &br_xxx,
"br_xxx/F");
1475 tid->
Branch(
"Y", &br_yyy,
"br_yyy/F");
1476 tid->
Branch(
"Stat", &br_stat,
"br_stat/F");
1478 tid->
Branch(
"PID", &br_pid,
"br_pid/F");
1479 tid->
Branch(
"IDcode", &br_idcode,
"br_idcode/I");
1480 tid->
Branch(
"IsIdentified", &br_isid,
"br_isid/I");
1483 Int_t events_read = 0;
1487 for (
int i = 1; i <=
data->GetNbinsX(); i++) {
1488 for (
int j = 1; j <=
data->GetNbinsY(); j++) {
1495 Axis_t x0 =
data->GetXaxis()->GetBinCenter(i);
1496 Axis_t y0 =
data->GetYaxis()->GetBinCenter(j);
1497 Axis_t wx =
data->GetXaxis()->GetBinWidth(i);
1498 Axis_t wy =
data->GetYaxis()->GetBinWidth(j);
1510 for (
int k = 0; k < kmax; k++) {
1514 if (
gr->IsIdentifiable(x, y)) {
1516 gr->Identify(x, y, idr);
1519 br_idcode =
gr->GetQualityCode();
1530 events_read += (
Int_t) poids;
1531 percent = (1. * events_read / tot_events) * 100.;
1533 if (percent >= cumul) {
1534 cout << (
Int_t) percent <<
"\% processed" << endl;
1553 if (GetNSelected() != 1)
return;
1554 if (!fSelectedGrid)
return;
1555 SetStatus(
Form(
"Fitting grid %s", fSelectedGrid->GetName()));
1557 fitter->
SetGrid(fSelectedGrid);
1558 fitter->
SetPad(fSelectedGrid->GetPad());
1561 cm->Action(fitter,
m);
const Bool_t kIterBackward
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize UnmapWindow
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize MapSubwindows
Option_t Option_t TPoint TPoint percent
R__EXTERN TRandom * gRandom
char * Form(const char *fmt,...)
char * StrDup(const char *str)
R__EXTERN TSystem * gSystem
static const Char_t * GetListOfPlugins(const Char_t *base)
static void GetTempFileName(TString &base)
static const Char_t * GetKVVersion()
Returns KaliVeda version string.
Ask user to choose between several options in a drop-down list.
ID Grid Manager dialog for choice of ID telescope(s)
Base class for particle identification in a 2D map.
void SetRunList(const char *runlist)
virtual void SetVarX(const char *v)
virtual void SetVarY(const char *v)
void AddIDTelescopes(const TList *)
Associate this graph with all ID telescopes in list.
static KVIDGraph * MakeIDGraph(const Char_t *)
virtual void Clear(Option_t *opt="")
virtual void SetOnlyZId(Bool_t yes=kTRUE)
Identification grid editor GUI ,.
void StartViewer()
Close();.
Graphical interface tool for managing, creating, testing and fitting identification grids.
void TabSelect(Int_t)
called when a new tab is selected
Int_t GetNSelected()
returns current number of selected items in grid list
void SaveGridsAs(const TCollection *=0)
void DeleteSelectedGrids()
warning message and confirmation
void HandleGridsMenu(Int_t id)
Receive signals emitted by items selected in Grids menu.
void DeleteAllGridsInTab()
delete the all grids in currently selected tab
void SetIDTelescopes()
Set ID telescopes for selected grid.
void ActivateToolbarButtons()
disable all buttons
void DeleteGrids()
delete the current selected grid, or all currently selected grids if there are more than one
void CloseWindow()
close viewer
void ClearGrid()
deletes all lines in currently selected grid(s)
void RemoveEmptyTabs()
Recursively remove any empty tabs.
void GetListOfIDTelescopeLabels(KVString &)
void DeleteGrid(KVIDGraph *, Bool_t update=kTRUE)
void Clear(Option_t *opt="")
Delete all grids and empty list, ready to start anew.
Int_t WriteAsciiFile(const Char_t *filename, const TCollection *selection=0)
KVList * GetGridsForIDTelescope(const Char_t *label)
Bool_t ReadAsciiFile(const Char_t *filename)
Base class for all detectors or associations of detectors in array which can identify charged particl...
Full result of one attempted particle identification.
Enhanced version of ROOT TGListView widget.
Extended TList class which owns its objects by default.
void Sort(Bool_t order=kSortAscending)
Bool_t ReadGridsFromAsciiFile(const Char_t *) const
Nuclei reconstructed from data measured by a detector array .
void SetIdentification(KVIdentificationResult *, KVIDTelescope *)
virtual Float_t GetPID() const
virtual Int_t GetSize() const
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
void Begin(TString delim) const
KVString Next(Bool_t strip_whitespace=kFALSE) const
GUI for testing identification grids.
ABC for fitting ID grids with functionals.
static KVVirtualIDFitter * GetDefaultFitter()
void SetPad(TVirtualPad *p)
void SetGrid(KVIDGraph *g)
TMethod * GetMethodAny(const char *method)
virtual void AddAll(const TCollection *col)
virtual Int_t GetEntries() const
virtual Int_t GetSize() const
T * Get(const char *namecycle)
virtual const char * GetValue(const char *name, const char *dflt) const
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
static TFile * Open(const char *name, Option_t *option="", const char *ftitle="", Int_t compress=ROOT::RCompressionSetting::EDefaults::kUseCompiledDefault, Int_t netopt=0)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=nullptr)
virtual TList * GetList() const
void ChangeOptions(UInt_t options) override
void Reset(Option_t *option="") override
void SetBinContent(Int_t bin, Double_t content) override
TObject * At(Int_t idx) const override
const char * GetName() const override
TClass * IsA() const override
virtual Bool_t InheritsFrom(const char *classname) const
virtual Double_t Uniform(Double_t x1, Double_t x2)
const char * Data() const
TString & Prepend(char c, Ssiz_t rep=1)
void Form(const char *fmt,...)
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TString & ReplaceAll(const char *s1, const char *s2)
Bool_t cd(const char *path)
virtual const char * BaseName(const char *pathname)
virtual char * ExpandPathName(const char *path)
virtual Int_t Branch(const char *folder, Int_t bufsize=32000, Int_t splitlevel=99)
virtual void StartViewer()
TFile * OpenFile(const TString &fin)
Double_t Min(Double_t a, Double_t b)