PandaRoot
DalitzGUI.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 // --------------------------------------------------------------------------
14 // DalitzGui - ROOT based tool to plot 3body decay's with resonant behaviour
15 // --------------------------------------------------------------------------
16 //
17 // Check accompanying README file for infos how to use
18 //
19 // Original author: Klaus Goetzen - GSI Darmstadt
20 // Last modified : 2014/08/15
21 // --------------------------------------------------------------------------
22 #pragma once
23 
24 #include "TRandom3.h"
25 #include <TQObject.h>
26 #include <RQ_OBJECT.h>
27 //#include "stdafx.h"
28 
29 class TH2F;
30 class TH1D;
31 class TRootEmbeddedCanvas;
32 class TGLayoutHints;
33 class TGHorizontalFrame;
34 // class TGVerticalFrame;
35 class TGLabel;
36 class TGHSlider;
37 class TGTextButton;
38 class TGCheckButton;
39 class TGTextEntry;
40 class TGTextBuffer;
41 class TGComboBox;
42 class TGraph;
43 class CRes;
44 class TGMainFrame;
45 class TGWindow;
46 class TGMenuBar;
47 class TGPopupMenu;
48 class TGDockableFrame;
49 // class TGTransientFrame;
50 // class TGDoubleHSlider;
51 // class TGButton;
52 
53 class TDalitzGui {
54  RQ_OBJECT("TDalitzGui")
55 
56  private:
57  TGMainFrame *fMain;
58  TRootEmbeddedCanvas *fCanvas;
59  TGLayoutHints *fLcan;
60 
61  TH2F *fHDalitz; // coherent (correct) Dalitz Plot
62  TH2F *fHDalitzSct; // coherent (correct) Dalitz Plot (scatter plot)
63  TH2F *fHDalitzI; // incoherent Dalitz Plot
64  TH2F *fHDalitzD; // difference coherent-incoherent
65  TH2F *fHDalitzPh; // total absoluted phase of resulting amplitude
66 
67  TH1D *fHs1Proj, *fHs2Proj, *fHs3Proj; // 1D projections of squared masses
68  TH1D *fHs1M, *fHs2M, *fHs3M; // 1D projections of inv. masses (generated randomly from projections)
69  TH1D *fHs1Ph, *fHs2Ph; // 1D phases for s1 and s2
70 
71  TGMenuBar *fMenuBar;
72  TGPopupMenu *fMenuFile;
73  TGDockableFrame *fMenuDock;
74 
75  TGHorizontalFrame *fVframe[4];
76  TGLayoutHints *fBly, *fBfly1, *fBfly2, *fBfly3, *fMenuBarItemLayout, *fMenuBarLayout;
77  TGLabel *fLab[7];
78  TGHSlider *fHslider1, *fHslider2, *fHslider3;
79  TGTextButton *fButResize;
80  TGCheckButton *fCheckResize, *fCheckColor, *fCheckLog;
81 
82  TGTextEntry *fTeh1;
83  TGTextBuffer *fTbh1;
84  TGTextEntry *fTeh2;
85  TGTextBuffer *fTbh2;
86 
87  TGLabel *fLabRN[3], *fLabRA[6], *fLabRph[6];
88 
89  TGComboBox *fComRes[6];
90  TGCheckButton *fChRes[6];
91 
92  TGHSlider *fSlResA[6], *fSlResph[6];
93 
94  TGHSlider *fSlOcc;
95 
96  TGComboBox *fComFin[3];
97 
98  TGComboBox *fComPlot;
99 
100  TGraph *fGraphKin;
101 
102  CRes *fRes[6];
103 
104  Int_t fnR[3];
105 
106  //
107  Double_t fM;
108  Double_t fm1;
109  Double_t fm2;
110  Double_t fm3;
111 
112  TString fn1, fn2, fn3; // Print names of particles
113 
114  Int_t ndbins;
115 
116  TRandom3 fRand;
117  Int_t fOcc;
118 
119  TString fActiveRes;
120 
121  public:
122  TDalitzGui(const TGWindow *p, UInt_t w, UInt_t h);
123  virtual ~TDalitzGui();
124 
125  // signal handler
126  void CloseWindow();
127  void DoSlider(Int_t pos);
128  void DoParmSlider(Int_t pos);
129  void DoResize();
130  void DoText();
131  void DoCombo(Int_t id);
132  void DoCheckRes() { DoParmSlider(0); }
133  void HandleMenu(Int_t id);
134  void Rebin();
135  Int_t IdToSelection(Int_t id, int mode = 1);
136 
137  // other functions
138  void CreateGraph(TGraph *g, const Int_t n, const Double_t m, const Double_t m1, const Double_t m2, const Double_t m3);
139  void CreateDalitz();
140  void InitParams();
141  void DrawMainPlot();
142  void DrawPlot();
143  void ReadOutGui();
144  void ComputeCache(Int_t ri = 1);
145  void MakeAnimatedGif();
146 
147  void ConfigPlot();
148  void ResetPlots();
149  void ConfigComboFin(TGComboBox *b);
150  void ConfigComboRes(TGComboBox *b);
151  void ConfigSliderRes(TGHSlider *a, TGHSlider *p); //, TGHSlider *J);
152 
153  void LoadConfiguration(TString filename);
154  void SaveConfiguration(TString filename);
155 
156  void SwitchColor();
157  // void HandleButtons();
158 
159  ClassDef(TDalitzGui, 1)
160 };
virtual ~TDalitzGui()
void InitParams()
void ConfigSliderRes(TGHSlider *a, TGHSlider *p)
void DoCheckRes()
Definition: DalitzGUI.h:132
void DoParmSlider(Int_t pos)
Definition: CRes.h:33
void ConfigPlot()
__m128 m
Definition: P4_F32vec4.h:38
void Rebin()
void DoText()
void SaveConfiguration(TString filename)
void LoadConfiguration(TString filename)
void DoCombo(Int_t id)
Int_t IdToSelection(Int_t id, int mode=1)
void CloseWindow()
void CreateGraph(TGraph *g, const Int_t n, const Double_t m, const Double_t m1, const Double_t m2, const Double_t m3)
void ResetPlots()
void DoSlider(Int_t pos)
void DoResize()
void DrawMainPlot()
TDalitzGui(const TGWindow *p, UInt_t w, UInt_t h)
void DrawPlot()
void HandleMenu(Int_t id)
void ReadOutGui()
void SwitchColor()
void MakeAnimatedGif()
void CreateDalitz()
void ComputeCache(Int_t ri=1)
void ConfigComboFin(TGComboBox *b)
void ConfigComboRes(TGComboBox *b)