KaliVeda  1.12/06
Heavy-Ion Analysis Toolkit
KVTestIDGridDialog.cpp
Go to the documentation of this file.
1 #include "KVTestIDGridDialog.h"
2 #include "Riostream.h"
3 #include "KVIDGridManager.h"
4 #include "TGFileDialog.h"
5 #include "TPad.h"
6 #include <TGMsgBox.h>
7 #include <TTimer.h>
8 #include <TClass.h>
9 #include <TROOT.h>
10 #include <TGLayout.h>
11 #include <TCanvas.h>
12 #include "KVConfig.h"
13 #include "KVNucleus.h"
14 #include "TStyle.h"
15 #include "TBox.h"
16 #include "TLine.h"
17 #include "KVNuclearChart.h"
18 #include "KVIdentificationResult.h"
19 #include "KVIDZAFromZGrid.h"
20 
33 
35 
37  const TGWindow* main, UInt_t w,
38  UInt_t h, KVIDGraph* g, TH2* data_histo)
39 {
40  if (data_histo) {
41  fNameData.Form("%s", data_histo->GetName());
42  fNameZreal.Form("PID:H=%s_G=%s", data_histo->GetName(), g->GetName());
43  fNameZvsE.Form("PIDvsEres:H=%s_G=%s", data_histo->GetName(), g->GetName());
44  hzvsexmax = data_histo->GetXaxis()->GetXmax();
45  }
46  // set PID limits from grid
47  g->GetIdentifiers()->Sort(); // make sure lines are in order of increasing PID
48  hzrealxmin = ((KVIDentifier*)g->GetIdentifiers()->First())->GetPID() - 1.0;
49  hzrealxmax = ((KVIDentifier*)g->GetIdentifiers()->Last())->GetPID() + 1.0;
50  hzvseymin = hzrealxmin;
51  hzvseymax = hzrealxmax;
52 
53  if (g->HasMassIDCapability() && !g->InheritsFrom("KVIDZAFromZGrid")) {// KLUDGE! replaces if(!g->IsOnlyZId()) {
54  hzrealbins = 150 * (hzrealxmax - hzrealxmin);
55  hzvseybins = hzrealbins;
56  }
57 
58  //Dialog box for testing identification grid
59  fMain = new TGTransientFrame(p, main, w, h);
60  fMain->Connect("CloseWindow()", "KVTestIDGridDialog", this,
61  "DoClose()");
62  fMain->DontCallClose(); // to avoid double deletions.
63 
64  fSelectedGrid = g;
65  // use hierarchical cleaning
66  fMain->SetCleanup(kDeepCleanup);
67 
68  /******* frame for name of data histo ********/
69  fHdataFrame = new TGHorizontalFrame(fMain);
70  fHdataNameLabel = new TGLabel(fHdataFrame, "Name of data histo (TH2F)");
71  fHdataNameEntry = new TGTextEntry(fNameData, fHdataFrame);
72  fHdataNameEntry->SetWidth(150);
73  fHdataFrame->AddFrame(fHdataNameEntry,
74  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
75  fHdataFrame->AddFrame(fHdataNameLabel,
76  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
77 
78  /******* frame for Zreal histo **************/
79  fHzrealFrame = new TGGroupFrame(fMain, "ID test histo");
80  fHzrealNameFrame = new TGHorizontalFrame(fHzrealFrame);
81  fHzrealNameLabel =
82  new TGLabel(fHzrealNameFrame, "Name of PID histo (TH1F)");
83  fHzrealNameEntry = new TGTextEntry(fNameZreal, fHzrealNameFrame);
84  fHzrealNameEntry->SetWidth(150);
85  fHzrealNameFrame->AddFrame(fHzrealNameEntry,
86  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
87  fHzrealNameFrame->AddFrame(fHzrealNameLabel,
88  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
89  fHzrealBinsFrame = new TGHorizontalFrame(fHzrealFrame);
90  fHzrealBinsLabel = new TGLabel(fHzrealBinsFrame, "nbins");
91  fHzrealBinsEntry =
92  new TGNumberEntry(fHzrealBinsFrame, hzrealbins, 4, 0,
95  fHzrealXminLabel = new TGLabel(fHzrealBinsFrame, "xmin");
96  fHzrealXminEntry =
97  new TGNumberEntry(fHzrealBinsFrame, hzrealxmin, 4, 0,
100  fHzrealXmaxLabel = new TGLabel(fHzrealBinsFrame, "xmax");
101  fHzrealXmaxEntry =
102  new TGNumberEntry(fHzrealBinsFrame, hzrealxmax, 4, 0,
105  fHzrealBinsFrame->AddFrame(fHzrealXmaxEntry,
106  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
107  fHzrealBinsFrame->AddFrame(fHzrealXmaxLabel,
108  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
109  fHzrealBinsFrame->AddFrame(fHzrealXminEntry,
110  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
111  fHzrealBinsFrame->AddFrame(fHzrealXminLabel,
112  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
113  fHzrealBinsFrame->AddFrame(fHzrealBinsEntry,
114  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
115  fHzrealBinsFrame->AddFrame(fHzrealBinsLabel,
116  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
117  fHzrealFrame->AddFrame(fHzrealNameFrame,
118  new TGLayoutHints(kLHintsNormal, 5, 5, 2, 2));
119  fHzrealFrame->AddFrame(fHzrealBinsFrame,
120  new TGLayoutHints(kLHintsNormal, 5, 5, 2, 2));
121 
122  /******* frame for ZvsE histo **************/
123  fHzvseFrame = new TGGroupFrame(fMain, "PID vs. E histo");
124  fHzvseNameFrame = new TGHorizontalFrame(fHzvseFrame);
125  fHzvseNameLabel = new TGLabel(fHzvseNameFrame, "Name of histo (TH2F)");
126  fHzvseNameEntry = new TGTextEntry(fNameZvsE, fHzvseNameFrame);
127  fHzvseNameEntry->SetWidth(150);
128  fHzvseNameFrame->AddFrame(fHzvseNameEntry,
129  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
130  fHzvseNameFrame->AddFrame(fHzvseNameLabel,
131  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
132  fHzvseXBinsFrame = new TGHorizontalFrame(fHzvseFrame);
133  fHzvseXBinsLabel = new TGLabel(fHzvseXBinsFrame, "nbins");
134  fHzvseXBinsEntry =
135  new TGNumberEntry(fHzvseXBinsFrame, hzvsexbins, 4, 0,
138  fHzvseXminLabel = new TGLabel(fHzvseXBinsFrame, "E : min");
139  fHzvseXminEntry =
140  new TGNumberEntry(fHzvseXBinsFrame, hzvsexmin, 4, 0,
142  fHzvseXmaxLabel = new TGLabel(fHzvseXBinsFrame, "max");
143  fHzvseXmaxEntry =
144  new TGNumberEntry(fHzvseXBinsFrame, hzvsexmax, 4, 0,
146  fHzvseXBinsFrame->AddFrame(fHzvseXmaxEntry,
147  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
148  fHzvseXBinsFrame->AddFrame(fHzvseXmaxLabel,
149  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
150  fHzvseXBinsFrame->AddFrame(fHzvseXminEntry,
151  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
152  fHzvseXBinsFrame->AddFrame(fHzvseXminLabel,
153  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
154  fHzvseXBinsFrame->AddFrame(fHzvseXBinsEntry,
155  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
156  fHzvseXBinsFrame->AddFrame(fHzvseXBinsLabel,
157  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
158  fHzvseYBinsFrame = new TGHorizontalFrame(fHzvseFrame);
159  fHzvseYBinsLabel = new TGLabel(fHzvseYBinsFrame, "nbins");
160  fHzvseYBinsEntry =
161  new TGNumberEntry(fHzvseYBinsFrame, hzvseybins, 4, 0,
164  fHzvseYminLabel = new TGLabel(fHzvseYBinsFrame, "PID : min");
165  fHzvseYminEntry =
166  new TGNumberEntry(fHzvseYBinsFrame, hzvseymin, 4, 0,
169  fHzvseYmaxLabel = new TGLabel(fHzvseYBinsFrame, "max");
170  fHzvseYmaxEntry =
171  new TGNumberEntry(fHzvseYBinsFrame, hzvseymax, 4, 0,
174  fHzvseYBinsFrame->AddFrame(fHzvseYmaxEntry,
175  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
176  fHzvseYBinsFrame->AddFrame(fHzvseYmaxLabel,
177  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
178  fHzvseYBinsFrame->AddFrame(fHzvseYminEntry,
179  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
180  fHzvseYBinsFrame->AddFrame(fHzvseYminLabel,
181  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
182  fHzvseYBinsFrame->AddFrame(fHzvseYBinsEntry,
183  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
184  fHzvseYBinsFrame->AddFrame(fHzvseYBinsLabel,
185  new TGLayoutHints(kLHintsRight, 5, 5, 2, 2));
186  fHzvseFrame->AddFrame(fHzvseNameFrame,
187  new TGLayoutHints(kLHintsNormal, 5, 5, 2, 2));
188  fHzvseFrame->AddFrame(fHzvseXBinsFrame,
189  new TGLayoutHints(kLHintsNormal, 5, 5, 2, 2));
190  fHzvseFrame->AddFrame(fHzvseYBinsFrame,
191  new TGLayoutHints(kLHintsNormal, 5, 5, 2, 2));
192 
193  /********** progress bar **********/
194  fProgressBar = new TGHProgressBar(fMain, TGProgressBar::kFancy, 300);
195  fProgressBar->SetFillType(TGProgressBar::kBlockFill);
196  fProgressBar->ShowPosition();
197  fProgressBar->SetBarColor("red");
198 
199  /************buttons***************/
200  fButtonsFrame = new TGHorizontalFrame(fMain, 100, 50);
201  fTestButton = new TGTextButton(fButtonsFrame, "&Test");
202  fTestButton->Connect("Clicked()", "KVTestIDGridDialog", this,
203  "TestGrid()");
204  fCloseButton = new TGTextButton(fButtonsFrame, "&Close");
205  fCloseButton->Connect("Clicked()", "KVTestIDGridDialog", this,
206  "DoClose()");
207 
208  fButtonsFrame->AddFrame(fTestButton,
211  kLHintsCenterY, 2, 2, 5, 5));
212  fButtonsFrame->AddFrame(fCloseButton,
215  kLHintsCenterY, 2, 2, 5, 5));
216 
217  fMain->AddFrame(fHdataFrame,
218  new TGLayoutHints(kLHintsLeft | kLHintsTop, 2, 2, 15,
219  5));
220  fMain->AddFrame(fHzrealFrame,
221  new TGLayoutHints(kLHintsLeft | kLHintsTop, 2, 2, 5,
222  5));
223  fMain->AddFrame(fHzvseFrame,
224  new TGLayoutHints(kLHintsLeft | kLHintsTop, 2, 2, 5,
225  10));
226  fMain->AddFrame(fProgressBar,
227  new TGLayoutHints(kLHintsCenterX | kLHintsTop, 2, 2, 5,
228  5));
229  fMain->AddFrame(fButtonsFrame,
230  new TGLayoutHints(kLHintsCenterX | kLHintsTop, 2, 2, 5,
231  5));
232 
233  //layout and display window
234  fMain->MapSubwindows();
235  fMain->Resize(fMain->GetDefaultSize());
236 
237  // position relative to the parent's window
238  fMain->CenterOnParent();
239 
240  fMain->SetWindowName("Test ID grid");
241  fMain->MapWindow();
242 
243 }
244 
246 {
247  TTimer::SingleShot(150, "KVTestIDGridDialog", this, "CloseWindow()");
248 }
249 
251 {
252  delete this;
253 }
254 
255 KVTestIDGridDialog::~KVTestIDGridDialog()
256 {
257  //Delete all widgets
258 
259  delete fMain;
260 }
261 
263 {
264  //read current values of all fields, find/create the histograms,
265  //and test the identification
266 
270 
272  || !CheckNameOK(fNameZvsE)) {
273 
274  new TGMsgBox(gClient->GetRoot(), fMain, "Test ID Grid",
275  "Give a valid name for each histo", kMBIconExclamation);
276  return;
277  }
278 
282 
286 
290 
291  Int_t hnmin = ((KVIDentifier*)fSelectedGrid->GetIdentifiers()->First())->GetA() - ((KVIDentifier*)fSelectedGrid->GetIdentifiers()->First())->GetZ() - 1.0;
292  Int_t hnmax = ((KVIDentifier*)fSelectedGrid->GetIdentifiers()->Last())->GetA() - ((KVIDentifier*)fSelectedGrid->GetIdentifiers()->Last())->GetZ() + 1.0;
293  Int_t hamin = ((KVIDentifier*)fSelectedGrid->GetIdentifiers()->First())->GetA();
294  Int_t hamax = ((KVIDentifier*)fSelectedGrid->GetIdentifiers()->Last())->GetA();
295  Int_t hzmin = ((KVIDentifier*)fSelectedGrid->GetIdentifiers()->First())->GetZ();
296  Int_t hzmax = ((KVIDentifier*)fSelectedGrid->GetIdentifiers()->Last())->GetZ();
297  if (fSelectedGrid->InheritsFrom("KVIDZAFromZGrid")) {
298  KVList* is_list = ((KVIDZAFromZGrid*)fSelectedGrid)->GetIntervalSets();
299  if (is_list && is_list->GetEntries()) {
300  KVList* iv_list = ((interval_set*)is_list->Last())->GetIntervals();
301  if (iv_list && iv_list->GetEntries()) {
302  interval* itv = (interval*)iv_list->Last();
303  hnmax = itv->GetA() - itv->GetZ();
304  hamax = itv->GetA();
305  hzmax = itv->GetZ();
306  itv = (interval*)((interval_set*)is_list->First())->GetIntervals()->First();
307  if (itv) {
308  hamin = itv->GetA();
309  hzmin = itv->GetZ();
310  }
311  }
312  }
313  }
314 
315  TH2F* hdata = (TH2F*) gROOT->FindObject(fNameData.Data());
316  if (!hdata) {
317 
318  new TGMsgBox(gClient->GetRoot(), fMain, "Test ID Grid",
319  "Check name of data histogram", kMBIconExclamation);
320  return;
321  }
322  //in case user changes definitions of histo (without changing name),
323  //we delete the histogram if it already exists
324  TH1F* hzreal = (TH1F*) gROOT->FindObject(fNameZreal.Data());
325  if (hzreal) {
326  delete hzreal;
327  hzreal = 0;
328  }
329  hzreal =
330  new TH1F(fNameZreal.Data(), "PID distribution", hzrealbins,
332 
333  KVNameValueList histo_names;
334  KVHashList histos;
335 
336  histo_names.SetValue("ID_REAL", fNameZreal.Data());
337  histos.Add(hzreal);
338 
339  TH2F* hzvse = (TH2F*) gROOT->FindObject(fNameZvsE.Data());
340  if (hzvse) {
341  delete hzvse;
342  hzvse = 0;
343  }
344  hzvse =
345  new TH2F(fNameZvsE.Data(), "PID vs. E_{res}", hzvsexbins, hzvsexmin,
347 
348  histo_names.SetValue("ID_REAL_VS_ERES", fNameZvsE.Data());
349  histos.Add(hzvse);
350 
351  // maps to show where different quality codes are assigned
352  TH1* icodemap = (TH1*)hdata->Clone("ZIDENT_ICODE0");
353  icodemap->SetMarkerColor(kBlack);
354  icodemap->SetFillColor(kBlack);
355  icodemap->SetStats(kFALSE);
356  icodemap->SetTitle("ICODE=0");
357  histos.Add(icodemap);
358  histo_names.SetValue("ZIDENT_ICODE0", "ZIDENT_ICODE0");
359  icodemap = (TH1*)hdata->Clone("ZIDENT_ICODE123");
360  icodemap->SetMarkerColor(kBlue);
361  icodemap->SetFillColor(kBlue);
362  icodemap->SetStats(kFALSE);
363  icodemap->SetTitle("ICODE=1,2,3");
364  histos.Add(icodemap);
365  histo_names.SetValue("ZIDENT_ICODE123", "ZIDENT_ICODE123");
366  icodemap = (TH1*)hdata->Clone("ZIDENT_ICODE4");
367  icodemap->SetMarkerColor(kRed);
368  icodemap->SetFillColor(kRed);
369  icodemap->SetStats(kFALSE);
370  icodemap->SetTitle("ICODE=4");
371  histos.Add(icodemap);
372  histo_names.SetValue("ZIDENT_ICODE4", "ZIDENT_ICODE4");
373  icodemap = (TH1*)hdata->Clone("ZIDENT_ICODE5");
374  icodemap->SetMarkerColor(kGreen);
375  icodemap->SetFillColor(kGreen);
376  icodemap->SetStats(kFALSE);
377  icodemap->SetTitle("ICODE=5");
378  histos.Add(icodemap);
379  histo_names.SetValue("ZIDENT_ICODE5", "ZIDENT_ICODE5");
380  icodemap = (TH1*)hdata->Clone("ZIDENT_ICODE6");
381  icodemap->SetMarkerColor(kCyan);
382  icodemap->SetFillColor(kCyan);
383  icodemap->SetStats(kFALSE);
384  icodemap->SetTitle("ICODE=6");
385  histos.Add(icodemap);
386  histo_names.SetValue("ZIDENT_ICODE6", "ZIDENT_ICODE6");
387  icodemap = (TH1*)hdata->Clone("ZIDENT_ICODE7");
388  icodemap->SetMarkerColor(kMagenta);
389  icodemap->SetFillColor(kMagenta);
390  icodemap->SetStats(kFALSE);
391  icodemap->SetTitle("ICODE=7");
392  histos.Add(icodemap);
393  histo_names.SetValue("ZIDENT_ICODE7", "ZIDENT_ICODE7");
394 
395  // A vs Z map in case of mass identification
396  // A dist for isotopically identified particles
397  TH2F* hazreal = 0;
398  TH2F* adist_aident = 0;
400  hazreal = new TH2F("AZMap", "Z vs. A", 30 * (hnmax - hnmin + 0.5), hnmin - 0.5, hnmax + 1, 30 * (hzrealxmax - hzrealxmin + 1), hzrealxmin - 1, hzrealxmax + 1);
401 
402  histo_names.SetValue("Z_A_REAL", "AZMap");
403  histos.Add(hazreal);
404 
405  adist_aident = new TH2F("ZADIST_AIDENT", "Z-A distribution [isotopic ID OK]", hzmax - hzmin + 1, hzmin - .5, hzmax + .5, hamax - hamin + 1, hamin - .5, hamax + .5);
406  histo_names.SetValue("ZADIST_AIDENT", "ZADIST_AIDENT");
407  histos.Add(adist_aident);
408 
409  icodemap = (TH1*)hdata->Clone("AIDENT_ICODE0");
410  icodemap->SetMarkerColor(kBlack);
411  icodemap->SetFillColor(kBlack);
412  icodemap->SetStats(kFALSE);
413  icodemap->SetTitle("ICODE=0");
414  histos.Add(icodemap);
415  histo_names.SetValue("AIDENT_ICODE0", "AIDENT_ICODE0");
416  icodemap = (TH1*)hdata->Clone("AIDENT_ICODE123");
417  icodemap->SetMarkerColor(kBlue);
418  icodemap->SetFillColor(kBlue);
419  icodemap->SetStats(kFALSE);
420  icodemap->SetTitle("ICODE=1,2,3");
421  histos.Add(icodemap);
422  histo_names.SetValue("AIDENT_ICODE123", "AIDENT_ICODE123");
423  icodemap = (TH1*)hdata->Clone("AIDENT_ICODE4");
424  icodemap->SetMarkerColor(kRed);
425  icodemap->SetFillColor(kRed);
426  icodemap->SetStats(kFALSE);
427  icodemap->SetTitle("ICODE=4");
428  histos.Add(icodemap);
429  histo_names.SetValue("AIDENT_ICODE4", "AIDENT_ICODE4");
430  icodemap = (TH1*)hdata->Clone("AIDENT_ICODE5");
431  icodemap->SetMarkerColor(kGreen);
432  icodemap->SetFillColor(kGreen);
433  icodemap->SetStats(kFALSE);
434  icodemap->SetTitle("ICODE=5");
435  histos.Add(icodemap);
436  histo_names.SetValue("AIDENT_ICODE5", "AIDENT_ICODE5");
437  icodemap = (TH1*)hdata->Clone("AIDENT_ICODE6");
438  icodemap->SetMarkerColor(kCyan);
439  icodemap->SetFillColor(kCyan);
440  icodemap->SetStats(kFALSE);
441  icodemap->SetTitle("ICODE=6");
442  histos.Add(icodemap);
443  histo_names.SetValue("AIDENT_ICODE6", "AIDENT_ICODE6");
444  icodemap = (TH1*)hdata->Clone("AIDENT_ICODE7");
445  icodemap->SetMarkerColor(kMagenta);
446  icodemap->SetFillColor(kMagenta);
447  icodemap->SetStats(kFALSE);
448  icodemap->SetTitle("ICODE=7");
449  histos.Add(icodemap);
450  histo_names.SetValue("AIDENT_ICODE7", "AIDENT_ICODE7");
451  }
452 
453  //progress bar set up
454  fProgressBar->SetRange(0, hdata->GetSum());
455  fProgressBar->Reset();
456  fSelectedGrid->Connect("Increment(Float_t)", "TGHProgressBar",
457  fProgressBar, "SetPosition(Float_t)");
458 #ifdef __WITHOUT_TGBUTTON_SETENABLED
459 #define SetEnabled(flag) \
460  SetState( flag ? kButtonUp : kButtonDisabled )
461 #endif
464  fSelectedGrid->TestIdentification(hdata, histos, histo_names);
467 #ifdef __WITHOUT_TGBUTTON_SETENABLED
468 #undef SetEnabled
469 #endif
470  fSelectedGrid->Disconnect("Increment(Float_t)", fProgressBar,
471  "SetPosition(Float_t)");
472  fProgressBar->Reset();
473 
474  if (hazreal) {
475  KVCanvas* cc = new KVCanvas;
476  cc->SetTitle(Form("Z vs N map for %s", fSelectedGrid->GetName()));
477  cc->cd();
478  cc->SetLogz();
479  hazreal->Draw("col");
480 
481  if (!strcmp(hazreal->GetTitle(), "Z vs. A")) {
482  TAxis* ax = 0;
483  ax = hazreal->GetXaxis();
484  ax->SetNdivisions(000);
485  ax->SetLabelOffset(-0.04);
486  ax->SetTickLength(0);
487 
488  ax = hazreal->GetYaxis();
489  ax->SetNdivisions(000);
490  ax->SetLabelOffset(-0.03);
491  ax->SetTickLength(0);
492  hazreal->SetMinimum(1);
493  DrawChart(cc, (Int_t)hzrealxmin, (Int_t)hzrealxmax, (Int_t)hnmin, (Int_t)hnmax);
494  }
495 
496  cc = new KVCanvas;
497  cc->SetTitle(Form("ZA identification for %s", fSelectedGrid->GetName()));
498  cc->cd();
499  cc->SetLogz();
500  adist_aident->Draw("col");
501 
502  // show results in canvas
503  cc = new KVCanvas;
504  cc->SetTitle("AIDENT Quality Code Maps");
505  //cc->Divide(2,3);
506  //cc->cd(1);
507  histos.FindObject("AIDENT_ICODE0")->Draw();
508  //cc->cd(2);
509  histos.FindObject("AIDENT_ICODE123")->Draw("same");
510  //cc->cd(3);
511  histos.FindObject("AIDENT_ICODE4")->Draw("same");
512  //cc->cd(4);
513  histos.FindObject("AIDENT_ICODE5")->Draw("same");
514  //cc->cd(5);
515  histos.FindObject("AIDENT_ICODE6")->Draw("same");
516  //cc->cd(6);
517  histos.FindObject("AIDENT_ICODE7")->Draw("same");
518  cc->BuildLegend();
519  }
520 
521 
522  // show results in canvas
523  KVCanvas* C = new KVCanvas;
524  C->SetTitle(Form("ID test : grid %s : histo %s (pid)", fSelectedGrid->GetName(), hdata->GetName()));
525 // C->Divide(1,2);
526 // C->cd(1);
527  gPad->SetGridx();
528  gPad->SetGridy();
529  hzreal->SetStats(kFALSE);
530  hzreal->Draw("hist");
531 
532  C = new KVCanvas;
533  C->SetLogz(kTRUE);
534  C->SetGridx();
535  C->SetGridy();
536  gStyle->SetPalette(1);
537  hzvse->SetStats(kFALSE);
538  hzvse->Draw("zcol");
539 
540  // show results in canvas
541  TCanvas* cc = new TCanvas;
542  cc->SetTitle("ZIDENT Quality Code Maps");
543  //cc->Divide(2,1);
544  //cc->cd(1);
545  histos.FindObject("ZIDENT_ICODE0")->Draw();
546  //cc->cd(2);
547  histos.FindObject("ZIDENT_ICODE123")->Draw("same");
548  //cc->cd(3);
549  histos.FindObject("ZIDENT_ICODE4")->Draw("same");
550  //cc->cd(4);
551  histos.FindObject("ZIDENT_ICODE5")->Draw("same");
552  //cc->cd(5);
553  histos.FindObject("ZIDENT_ICODE6")->Draw("same");
554  //cc->cd(6);
555  histos.FindObject("ZIDENT_ICODE7")->Draw("same");
556  cc->BuildLegend();
557 
558  // close dialog
559  DoClose();
560 }
561 
562 
564 {
565  TPad* pp = (TPad*) cc->cd();
566 
567  Double_t marging = 0.001;
568  pp->SetTopMargin(marging);
569  pp->SetRightMargin(marging);
570  pp->SetBottomMargin(marging);
571  pp->SetLeftMargin(marging);
572 
573  KVNuclearChart* nucChar = new KVNuclearChart(nmin + 1, nmax, zmin, zmax);
574  nucChar->Draw("same");
575 
576  return;
577 }
578 
579 
580 
581 
582 
583 
584 
585 
int Int_t
unsigned int UInt_t
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
const Bool_t kFALSE
double Double_t
const Bool_t kTRUE
kRed
kBlack
kGreen
kMagenta
kCyan
kBlue
#define gClient
kDeepCleanup
kLHintsRight
kLHintsLeft
kLHintsCenterY
kLHintsNormal
kLHintsCenterX
kLHintsTop
kLHintsExpandX
kMBIconExclamation
#define gROOT
char * Form(const char *fmt,...)
R__EXTERN TStyle * gStyle
#define gPad
TCanvas with mouse-controlled dynamic zoom and pan & scan.
Definition: KVCanvas.h:53
Extended version of ROOT THashList.
Definition: KVHashList.h:28
Base class for particle identification in a 2D map.
Definition: KVIDGraph.h:31
virtual void TestIdentification(TH2F *data, KVHashList &histos, KVNameValueList &histo_names)
Definition: KVIDGraph.cpp:1691
virtual Bool_t HasMassIDCapability() const
Definition: KVIDGraph.h:163
const Char_t * GetName() const
Definition: KVIDGraph.cpp:1320
KVList * GetIdentifiers() const
Definition: KVIDGraph.h:285
Hybrid identification grid.
Base class for graphical cuts used in particle identification.
Definition: KVIDentifier.h:27
Extended TList class which owns its objects by default.
Definition: KVList.h:27
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
void SetValue(const Char_t *name, value_type value)
Used to draw nuclear chart.
void Draw(Option_t *option="")
virtual TObject * Last() const
virtual TObject * First() const
virtual void Add(TObject *obj)
virtual TObject * FindObject(const char *name) const
GUI for testing identification grids.
static TString fNameZvsE
TGNumberEntry * fHzrealXminEntry
TGNumberEntry * fHzvseXmaxEntry
TGTextButton * fTestButton
TGNumberEntry * fHzvseYmaxEntry
TGTextEntry * fHdataNameEntry
TGHProgressBar * fProgressBar
TGNumberEntry * fHzvseXBinsEntry
TGTextEntry * fHzvseNameEntry
Bool_t CheckNameOK(const TString &name)
TGNumberEntry * fHzrealXmaxEntry
TGNumberEntry * fHzvseXminEntry
static Double_t hzvsexmax
static TString fNameData
TGNumberEntry * fHzvseYminEntry
TGTextEntry * fHzrealNameEntry
TGTransientFrame * fMain
TGNumberEntry * fHzvseYBinsEntry
static Double_t hzvsexmin
static TString fNameZreal
TGTextButton * fCloseButton
void DrawChart(KVCanvas *cc, Int_t zmin, Int_t zmax, Int_t nmin, Int_t nmax)
TGNumberEntry * fHzrealBinsEntry
Stat_t GetSum() const
virtual void SetLabelOffset(Float_t offset=0.005)
virtual void SetNdivisions(Int_t n1, Int_t n2, Int_t n3, Bool_t optim=kTRUE)
virtual void SetTickLength(Float_t length=0.03)
virtual void SetFillColor(Color_t fcolor)
virtual void SetMarkerColor(Color_t mcolor=1)
virtual void SetBottomMargin(Float_t bottommargin)
virtual void SetLeftMargin(Float_t leftmargin)
virtual void SetRightMargin(Float_t rightmargin)
virtual void SetTopMargin(Float_t topmargin)
virtual Int_t GetEntries() const
virtual void SetEnabled(Bool_t e=kTRUE)
virtual Long_t GetIntNumber() const
virtual Double_t GetNumber() const
void SetRange(Float_t min, Float_t max)
virtual void Reset()
const char * GetText() const
virtual void SetTitle(const char *title)
TAxis * GetXaxis()
TAxis * GetYaxis()
TObject * Clone(const char *newname=0) const
virtual void SetMinimum(Double_t minimum=-1111)
virtual void Draw(Option_t *option="")
virtual void SetStats(Bool_t stats=kTRUE)
virtual const char * GetName() const
virtual const char * GetTitle() const
virtual Bool_t InheritsFrom(const char *classname) const
virtual void Draw(Option_t *option="")
const char * Data() const
void SetPalette(Int_t ncolors=kBird, Int_t *colors=0, Float_t alpha=1.)
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
int main(int argc, char **argv)
TH1 * h
const long double g
masses
Definition: KVUnits.h:72
const long double cc
volumes
Definition: KVUnits.h:83
constexpr Double_t C()