KaliVeda
Toolkit for HIC analysis
KVItvFinderDialog.h
1 
4 #ifndef __KVITVFINDERDIALOG_H
5 #define __KVITVFINDERDIALOG_H
6 
7 #include "RQ_OBJECT.h"
8 #include "TGFrame.h"
9 #include "TGButton.h"
10 #include <TGComboBox.h>
11 #include <TGLabel.h>
12 #include <TGNumberEntry.h>
13 #include <TGTextEntry.h>
14 #include <TGProgressBar.h>
15 #include "TCanvas.h"
16 #include "KVList.h"
17 #include "KVListView.h"
18 #include "KVIDZAFromZGrid.h"
19 #include "TGToolBar.h"
20 #include "TGButton.h"
21 #include <TSpectrum.h>
22 #include <TROOT.h>
23 #include <TF1.h>
24 #include "KVPIDIntervalPainter.h"
25 
35  RQ_OBJECT("KVZAFinderDialog");
36 
37  TGTransientFrame* fMain;
38  TCanvas* fCanvas;
39  TVirtualPad* fPad;
40 
41  TGToolBar* fToolBar;
42  TGToolBar* fToolBar2;
43  TGButton* fTBbuttons[50];
44  Int_t fNbButtons;
45 
46 
47  KVList* fCustoms;
48  KVListView* fIntervalSetListView;
49  KVListView* fIntervalListView;
50 
51  KVIDZAFromZGrid* fGrid;
52  TH2* fHisto;
53  TH1* fLinearHisto;
54 
55  KVList fItvPaint;
56 
57  TSpectrum fSpectrum;
58  TGraph* fPoints;
59  Int_t fNPoints;
60  TList fFunc;
61  Int_t fNpeaks[30];
62 
63  Int_t fNextIntervalZ;
64 
65  Double_t fSig, fRat;
66 
67  KVPIDIntervalPainter* last_drawn_interval;
68  void delete_painter_from_painter_list(KVPIDIntervalPainter*);
69 
70  interval_set* current_interval_set = nullptr;// interval selected by ZoomOnCanvas()
71 
72  static KVNameValueList mass_fit_parameters;
73  void remove_interval_from_interval_set(interval_set* itvs, interval* itv, bool remove_fit = true);
74 
75  bool negative_bkg_slope_changed = false;
76 public:
77  enum {
83  M_UNZOOM
84  };
85 
88  {
89  fMain->CloseWindow();
90  }
91 
93  {
94  return fNextIntervalZ;
95  }
96  void SetNextIntevalZ(int zz)
97  {
98  fNextIntervalZ = zz;
99  }
100 
101  void DisplayPIDint();
102  void SelectionITVChanged();
103  void UpdatePIDList();
104 
105  void ZoomOnCanvas();
106  void DrawIntervals();
107  void DrawInterval(interval_set* itvs, bool label = 0);
108 
109  void ClearInterval(interval_set* itvs);
110 
112  void LinearizeHisto(int nbins);
113 
114  void DoClose()
115  {
116  gROOT->ProcessLine("KVItvFinderDialog* _dummy_itv=nullptr");
117  delete this;
118  }
119 
120  void Identify();//{ProcessIdentification(1,25);}//{Info("SaveGrid","Not yet implemented");}
121  void Identify(double sigma, double ratio);//{ProcessIdentification(1,25);}//{Info("SaveGrid","Not yet implemented");}
122  void SaveGrid();//{fGrid->GetIntervalSets()->ls(); fGrid->GetParameters()->ls();}
123  void ExportToGrid();
124  void NewInterval();//{Info("NewInterval","Not yet implemented");}
125  void AddInterval(double pid);
126  void NewIntervalSet();//{Info("NewIntervalSet","Not yet implemented");}
127  void RemoveInterval();//{Info("RemoveInterval","Not yet implemented");}
128  void MassesUp();//{Info("ChangeMasses","Not yet implemented");}
129  void MassesDown();//{Info("ChangeMasses","Not yet implemented");}
130  void UpdateLists();//{cout << "toto" << endl;}
131  void TestIdent();//;{cout << "TestIdent()" << endl;}
132  void SetLogy();
133  void UnzoomHisto();
134  void FitIsotopes();
135  void SetFitParameters();
136  void RemoveFit();
137 
138  void HandleKey();
139  void PrintHelp();
140 
141  void ProcessIdentification(Int_t zmin = -1, Int_t zmax = -1);
142  void FindPIDIntervals(Int_t zz);
143  Double_t fpeaks(Double_t* x, Double_t* par);
144  ClassDef(KVItvFinderDialog, 1) //gui to KVPIDIntevalFinder
145 };
146 
147 
150 
155 
158 
163 
165 
168 
169 #endif
int Int_t
double Double_t
#define ClassDef(name, id)
#define gROOT
Hybrid charge & mass identification grid.
GUI for finding/fixing mass identification intervals.
void DrawInterval(interval_set *itvs, bool label=0)
void ClearInterval(interval_set *itvs)
void ProcessIdentification(Int_t zmin=-1, Int_t zmax=-1)
void AddInterval(double pid)
virtual ~KVItvFinderDialog()
void Identify()
KVBase::OpenContextMenu("Identify(double,double)",this);.
void SetFitParameters()
Open dialog to modify parameters for multigauss mass fit.
void FindPIDIntervals(Int_t zz)
KVItvFinderDialog(KVIDZAFromZGrid *gg, TH2 *hh)
void RemoveFit()
Remove fit of currently selected interval set from pad.
void ExportToGrid()
Write all PID intervals in grid parameters "PIDRANGE", "PIDRANGE%d", etc.
void TestIdent()
fGrid->SetOnlyZId(0);
void SetNextIntevalZ(int zz)
void LinearizeHisto(int nbins)
Double_t fpeaks(Double_t *x, Double_t *par)
void ZoomOnCanvas()
Display the interval set for a given Z when the user double clicks on it.
Enhanced version of ROOT TGListView widget.
Definition: KVListView.h:147
Extended TList class which owns its objects by default.
Definition: KVList.h:22
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Graphical representation of a PID interval in the KVIDZAFromZGrid mass assignation GUI.
virtual void CloseWindow()