CXBgdUtility.h 1.98 KB
Newer Older
Jérémie Dudouet's avatar
Jérémie Dudouet committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
#ifndef CXBgdUtility_H
#define CXBgdUtility_H

#include "TGFrame.h"
#include "TGButton.h"
#include "RQ_OBJECT.h"

#include "CXMainWindow.h"

class TH2;
class TGLabel;
class TGNumberEntry;
class CXBgdUtility : public  TGVerticalFrame
{
    RQ_OBJECT("CXBgdUtility");

public:

protected:

private:

J. Dudouet's avatar
J. Dudouet committed
23
    CXMainWindow      *fMainWindow{};
Jérémie Dudouet's avatar
Jérémie Dudouet committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

    TGLabel *fLabel;
    TGGroupFrame *fGroupFrame;
    TGCompositeFrame *fHorizontalFrame;

    TGCheckButton *fActivate;
    TGCheckButton *fDoSmoothing;
    TGCheckButton *fDoCompton;

    int fNumberIterations1D;
    int fNumberIterations2DX;
    int fNumberIterations2DY;

    int fDirection1D;
    int fDirection2D;

    int fFilterOrder1D;
    int fFilterOrder2D;
    bool fSmoothing;
    int fSmoothingWindow;
    bool fCompton;

    TGNumberEntry *fNItersButton1D;
J. Dudouet's avatar
J. Dudouet committed
47
    TGNumberEntry *fNItersButton2D[2]={};
Jérémie Dudouet's avatar
Jérémie Dudouet committed
48

J. Dudouet's avatar
J. Dudouet committed
49
    TGRadioButton *fDirectionButton1D[2]={};
50

Jérémie Dudouet's avatar
Jérémie Dudouet committed
51 52
    array<TGRadioButton*,4> fFilterOrderButton1D={};
    array<TGRadioButton*,7> fSmoothingButton1D={};
Jérémie Dudouet's avatar
Jérémie Dudouet committed
53 54 55 56

    TGTextButton *fSubtractButton;
    TGTextButton *f2DEvalButton;

J. Dudouet's avatar
J. Dudouet committed
57 58
    TGRadioButton *fDirectionButton2D[2]={};
    TGRadioButton *fFilterOrderButton2D[2]={};
Jérémie Dudouet's avatar
Jérémie Dudouet committed
59 60 61 62 63 64 65 66

    TList *fListOfButtons1D = nullptr;


    TH2 *fCurrent2DHist = nullptr;
    TH2 *fCurrent2DBackd = nullptr;
    TH2 *fCurrent2DSubtract = nullptr;

J. Dudouet's avatar
J. Dudouet committed
67 68 69
    ULong_t red={};
    ULong_t blue={};
    ULong_t black={};
Jérémie Dudouet's avatar
Jérémie Dudouet committed
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98

public:
    CXBgdUtility(const TGCompositeFrame *MotherFrame, UInt_t w, UInt_t h);
        ~CXBgdUtility();

    Bool_t IsActivated(){return fActivate->GetState();}
    void DoActivate(){fActivate->SetState(EButtonState::kButtonDown,true);}

    void SetMainWindow(CXMainWindow *w){fMainWindow = w;}

    void ToggleBckSupp();
    void HandleWindowButtons(Int_t id=-1);
    void HandleFilterButtons(Int_t id=-1);
    void HandleSmoothButtons(Int_t id=-1);
    void GetParams();
    void DoSubtract();

    void Do2DEvaluation(TH1 *hist_in=nullptr);

protected:

private:

    void SetButtonsStatus(bool on);

    ClassDef(CXBgdUtility,0)
};

#endif