FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairEveRecoTracksExampleEditor.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2020 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 /*
9  * FairEveRecoTracksExampleEditor.cxx
10  *
11  * Created on: 27 sie 2020
12  * Author: Daniel Wielanek
13  * E-mail: daniel.wielanek@gmail.com
14  * Warsaw University of Technology, Faculty of Physics
15  */
16 
18 
19 #include "FairEveCut.h"
21 #include "FairEveTracks.h"
22 
23 #include <GuiTypes.h>
24 #include <RtypesCore.h>
25 #include <TGButton.h>
26 #include <TGLayout.h>
27 #include <TGWindow.h>
28 
30  Int_t width,
31  Int_t height,
32  UInt_t options,
33  Pixel_t back)
34  : TGedFrame(p, width, height, options | kVerticalFrame, back)
35  , fRecoTracks(nullptr)
36 {
37  MakeTitle("FairRecoTracksEditor");
38  SetName("RecoTracksEditor");
39 
40  TGVerticalFrame *kinFrame = CreateEditorTabSubFrame("Kin");
41  fPtCut = std::unique_ptr<FairEveMinMaxCut>(new FairEveMinMaxCut(this, kinFrame, "Pt", width));
42  fEtaCut = std::unique_ptr<FairEveMinMaxCut>(new FairEveMinMaxCut(this, kinFrame, "Eta", width));
43  fEnergyCut = std::unique_ptr<FairEveMinMaxCut>(new FairEveMinMaxCut(this, kinFrame, "E", width));
44  fPtCut->Init();
45  fEtaCut->Init();
46  fEnergyCut->Init();
47  fPtCut->AddUpdateButton();
48 
49  TGVerticalFrame *statFrame = CreateEditorTabSubFrame("Status");
50 
51  fDrawMC = std::unique_ptr<FairEveBoolCut>(new FairEveBoolCut(this, statFrame, "Draw MC", 1));
52  fDrawMC->UpdateWhenChanged();
53  fDrawMC->Init();
54 
55  TGCompositeFrame *ToogleFrame = new TGCompositeFrame(statFrame, width, 20, kHorizontalFrame | kFixedWidth);
56  TGTextButton *ToogleButton = new TGTextButton(ToogleFrame, "Toggle Tracks");
57  ToogleButton->Connect("Clicked()", this->ClassName(), this, "ToggleTracks()");
58  ToogleFrame->AddFrame(ToogleButton, new TGLayoutHints(kLHintsRight | kLHintsExpandX, 1, 1, 2, 1));
59  statFrame->AddFrame(ToogleFrame, new TGLayoutHints(kLHintsTop, 1, 1, 2, 1));
60 }
61 
63 {
64  fRecoTracks = dynamic_cast<FairEveRecoTracksExample *>(obj);
65 }
66 
68 {
69  if (fRecoTracks)
70  fRecoTracks->ToggleTracks();
71 }
72 
74 {
75  Double_t min, max;
76  Bool_t use = fPtCut->GetValues(min, max);
77  fRecoTracks->SetPtCut(min, max, use);
78  use = fEtaCut->GetValues(min, max);
79  fRecoTracks->SetEtaCut(min, max, use);
80  use = fEnergyCut->GetValues(min, max);
81  fRecoTracks->SetEnergyCut(min, max, use);
82  fRecoTracks->SetDrawMC(fDrawMC->GetValue());
83  TGedFrame::Update();
84  fRecoTracks->Repaint();
85 }
86 
void SetPtCut(Double_t min, Double_t max, Bool_t use)
Definition: FairEveTracks.h:87
void SetEtaCut(Double_t min, Double_t max, Bool_t use)
Definition: FairEveTracks.h:99
FairEveRecoTracksExampleEditor(const TGWindow *p=0, Int_t width=170, Int_t height=30, UInt_t options=kChildFrame, Pixel_t back=GetDefaultFrameBackground())
void SetEnergyCut(Double_t min, Double_t max, Bool_t use)