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();
47 g->GetIdentifiers()->Sort();
48 hzrealxmin = ((
KVIDentifier*)
g->GetIdentifiers()->First())->GetPID() - 1.0;
49 hzrealxmax = ((
KVIDentifier*)
g->GetIdentifiers()->Last())->GetPID() + 1.0;
50 hzvseymin = hzrealxmin;
51 hzvseymax = hzrealxmax;
53 if (
g->HasMassIDCapability() && !
g->InheritsFrom(
"KVIDZAFromZGrid")) {
54 hzrealbins = 150 * (hzrealxmax - hzrealxmin);
55 hzvseybins = hzrealbins;
60 fMain->Connect(
"CloseWindow()",
"KVTestIDGridDialog",
this,
62 fMain->DontCallClose();
70 fHdataNameLabel =
new TGLabel(fHdataFrame,
"Name of data histo (TH2F)");
71 fHdataNameEntry =
new TGTextEntry(fNameData, fHdataFrame);
72 fHdataNameEntry->SetWidth(150);
73 fHdataFrame->AddFrame(fHdataNameEntry,
75 fHdataFrame->AddFrame(fHdataNameLabel,
82 new TGLabel(fHzrealNameFrame,
"Name of PID histo (TH1F)");
83 fHzrealNameEntry =
new TGTextEntry(fNameZreal, fHzrealNameFrame);
84 fHzrealNameEntry->SetWidth(150);
85 fHzrealNameFrame->AddFrame(fHzrealNameEntry,
87 fHzrealNameFrame->AddFrame(fHzrealNameLabel,
90 fHzrealBinsLabel =
new TGLabel(fHzrealBinsFrame,
"nbins");
95 fHzrealXminLabel =
new TGLabel(fHzrealBinsFrame,
"xmin");
100 fHzrealXmaxLabel =
new TGLabel(fHzrealBinsFrame,
"xmax");
105 fHzrealBinsFrame->AddFrame(fHzrealXmaxEntry,
107 fHzrealBinsFrame->AddFrame(fHzrealXmaxLabel,
109 fHzrealBinsFrame->AddFrame(fHzrealXminEntry,
111 fHzrealBinsFrame->AddFrame(fHzrealXminLabel,
113 fHzrealBinsFrame->AddFrame(fHzrealBinsEntry,
115 fHzrealBinsFrame->AddFrame(fHzrealBinsLabel,
117 fHzrealFrame->AddFrame(fHzrealNameFrame,
119 fHzrealFrame->AddFrame(fHzrealBinsFrame,
123 fHzvseFrame =
new TGGroupFrame(fMain,
"PID vs. E histo");
125 fHzvseNameLabel =
new TGLabel(fHzvseNameFrame,
"Name of histo (TH2F)");
126 fHzvseNameEntry =
new TGTextEntry(fNameZvsE, fHzvseNameFrame);
127 fHzvseNameEntry->SetWidth(150);
128 fHzvseNameFrame->AddFrame(fHzvseNameEntry,
130 fHzvseNameFrame->AddFrame(fHzvseNameLabel,
133 fHzvseXBinsLabel =
new TGLabel(fHzvseXBinsFrame,
"nbins");
138 fHzvseXminLabel =
new TGLabel(fHzvseXBinsFrame,
"E : min");
142 fHzvseXmaxLabel =
new TGLabel(fHzvseXBinsFrame,
"max");
146 fHzvseXBinsFrame->AddFrame(fHzvseXmaxEntry,
148 fHzvseXBinsFrame->AddFrame(fHzvseXmaxLabel,
150 fHzvseXBinsFrame->AddFrame(fHzvseXminEntry,
152 fHzvseXBinsFrame->AddFrame(fHzvseXminLabel,
154 fHzvseXBinsFrame->AddFrame(fHzvseXBinsEntry,
156 fHzvseXBinsFrame->AddFrame(fHzvseXBinsLabel,
159 fHzvseYBinsLabel =
new TGLabel(fHzvseYBinsFrame,
"nbins");
164 fHzvseYminLabel =
new TGLabel(fHzvseYBinsFrame,
"PID : min");
169 fHzvseYmaxLabel =
new TGLabel(fHzvseYBinsFrame,
"max");
174 fHzvseYBinsFrame->AddFrame(fHzvseYmaxEntry,
176 fHzvseYBinsFrame->AddFrame(fHzvseYmaxLabel,
178 fHzvseYBinsFrame->AddFrame(fHzvseYminEntry,
180 fHzvseYBinsFrame->AddFrame(fHzvseYminLabel,
182 fHzvseYBinsFrame->AddFrame(fHzvseYBinsEntry,
184 fHzvseYBinsFrame->AddFrame(fHzvseYBinsLabel,
186 fHzvseFrame->AddFrame(fHzvseNameFrame,
188 fHzvseFrame->AddFrame(fHzvseXBinsFrame,
190 fHzvseFrame->AddFrame(fHzvseYBinsFrame,
196 fProgressBar->ShowPosition();
197 fProgressBar->SetBarColor(
"red");
202 fTestButton->Connect(
"Clicked()",
"KVTestIDGridDialog",
this,
204 fCloseButton =
new TGTextButton(fButtonsFrame,
"&Close");
205 fCloseButton->Connect(
"Clicked()",
"KVTestIDGridDialog",
this,
208 fButtonsFrame->AddFrame(fTestButton,
212 fButtonsFrame->AddFrame(fCloseButton,
217 fMain->AddFrame(fHdataFrame,
220 fMain->AddFrame(fHzrealFrame,
223 fMain->AddFrame(fHzvseFrame,
226 fMain->AddFrame(fProgressBar,
229 fMain->AddFrame(fButtonsFrame,
234 fMain->MapSubwindows();
235 fMain->Resize(fMain->GetDefaultSize());
238 fMain->CenterOnParent();
240 fMain->SetWindowName(
"Test ID grid");
257 KVTestIDGridDialog::~KVTestIDGridDialog()
351 auto mapzrealxmin = 0;
352 auto hazreal =
new TH2F(
"AZMap",
"N vs. Z [Z&A identified]", 30 * (hnmax - hnmin + 1.5), hnmin - 0.5, hnmax + 2, 30 * (
hzrealxmax - mapzrealxmin + 1), mapzrealxmin - 1,
hzrealxmax + 1);
354 histo_names.
SetValue(
"Z_A_REAL",
"AZMap");
357 auto adist_aident =
new TH2F(
"ZADIST_AIDENT",
"A vs. Z distribution [Z&A identified]", hzmax - hzmin + 1, hzmin - .5, hzmax + .5, hamax - hamin + 1, hamin - .5, hamax + .5);
358 histo_names.
SetValue(
"ZADIST_AIDENT",
"ZADIST_AIDENT");
361 auto hzreal_aident =
new TH1F(
"ID_REAL_AIDENT",
"PID distribution [Z&A identified]",
363 histo_names.
SetValue(
"ID_REAL_AIDENT",
"ID_REAL_AIDENT");
366 auto hzreal_zident =
new TH1F(
"ID_REAL_ZIDENT",
"PID distribution [only Z identified]",
368 histo_names.
SetValue(
"ID_REAL_ZIDENT",
"ID_REAL_ZIDENT");
382 histo_names.
SetValue(
"ID_REAL_VS_ERES_AIDENT",
"ID_REAL_VS_ERES_AIDENT");
389 histo_names.
SetValue(
"ID_REAL_VS_ERES_ZIDENT",
"ID_REAL_VS_ERES_ZIDENT");
396 fSelectedGrid->Connect(
"Increment(Float_t)",
"TGHProgressBar",
398 #ifdef __WITHOUT_TGBUTTON_SETENABLED
399 #define SetEnabled(flag) \
400 SetState( flag ? kButtonUp : kButtonDisabled )
407 #ifdef __WITHOUT_TGBUTTON_SETENABLED
411 "SetPosition(Float_t)");
421 cc->SetWindowPosition(100, 100);
422 cc->SetWindowSize(1000, 1300);
426 cc->SetWindowPosition(100, 100);
427 cc->SetWindowSize(1000, 500);
433 auto pad =
cc->cd(ipad++);
437 hzreal->Draw(
"hist");
441 pad =
cc->cd(ipad++);
451 pad =
cc->cd(ipad++);
456 hzreal->Draw(
"hist");
460 pad =
cc->cd(ipad++);
470 pad =
cc->cd(ipad++);
475 hzreal->Draw(
"hist");
479 pad =
cc->cd(ipad++);
491 kvc->SetWindowPosition(1000, 100);
492 kvc->SetWindowSize(900, 900);
495 hazreal->
Draw(
"col");
498 ax = hazreal->GetXaxis();
503 ax = hazreal->GetYaxis();
507 hazreal->SetMinimum(1);
526 nucChar->
Draw(
"same");
ClassImp(KVPartitionList) void KVPartitionList
Initialisation.
R__EXTERN TStyle * gStyle
TCanvas with mouse-controlled dynamic zoom and pan & scan.
Base class for particle identification in a 2D map.
virtual void TestIdentification(TH2F *data, KVHashList &histos, KVNameValueList &histo_names)
virtual Bool_t HasMassIDCapability() const
const KVList * GetIdentifiers() const
Hybrid charge & mass identification grid.
Base class for graphical cuts used in particle identification.
Extended TList class which owns its objects by default.
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 SetShowSymbol(Int_t value=1)
void Draw(Option_t *option="")
T * get_object(const TString &name) const
virtual TObject * Last() const
virtual void Clear(Option_t *option="")
virtual TObject * First() const
GUI for testing identification grids.
std::unique_ptr< KVCanvas > resultsKVCanvas
TGNumberEntry * fHzrealXminEntry
TGNumberEntry * fHzvseXmaxEntry
TGTextButton * fTestButton
TGNumberEntry * fHzvseYmaxEntry
TGTextEntry * fHdataNameEntry
TGHProgressBar * fProgressBar
TGNumberEntry * fHzvseXBinsEntry
void DrawChart(TVirtualPad *cc, Int_t zmin, Int_t zmax, Int_t nmin, Int_t nmax)
TGTextEntry * fHzvseNameEntry
KVIDGraph * fSelectedGrid
Bool_t CheckNameOK(const TString &name)
TGNumberEntry * fHzrealXmaxEntry
TGNumberEntry * fHzvseXminEntry
static Double_t hzvsexmax
TGNumberEntry * fHzvseYminEntry
TGTextEntry * fHzrealNameEntry
std::unique_ptr< TCanvas > resultsCanvas
TGNumberEntry * fHzvseYBinsEntry
static Double_t hzvsexmin
static TString fNameZreal
TGTextButton * fCloseButton
TGNumberEntry * fHzrealBinsEntry
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 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 Long_t GetIntNumber() const
virtual Double_t GetNumber() const
void SetRange(Float_t min, Float_t max)
const char * GetText() const
virtual void Draw(Option_t *option="")
virtual void SetStats(Bool_t stats=kTRUE)
virtual Bool_t InheritsFrom(const char *classname) const
const char * Data() const
void SetOptTitle(Int_t tit=1)
static void SingleShot(Int_t milliSec, const char *receiver_class, void *receiver, const char *method)
int main(int argc, char **argv)
const long double g
masses
const long double cc
volumes