CXNucChart.h 2.18 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 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
#ifndef CXNucChart_H
#define CXNucChart_H

#include "TGFrame.h"
#include <RQ_OBJECT.h>

#include "LevelScheme.h"

class TGListBox;
class CXMainWindow;
class CXCanvas;
class TGStatusBar;
class TGComboBox;
class TH2D;
class NucData;
class TGTextEntry;

using namespace Gw;

class CXNucChart: public TGTransientFrame
{
    RQ_OBJECT("CXNucChart");
public:
    enum NucChartType {
        M_LifeTime,
        M_1stIsomer,
        M_2ndIsomer,
        M_1rstExcitedState,
        M_DecayMode,
        M_BE2E2B2,
        M_BE2WU,
        M_NucInfo,
        M_LevelsInfo,
        M_GammaInfos,
    };

private:

    CXMainWindow *fMainWindow;
    TGListBox *fInfoBox;
    CXCanvas *fCanvas;
    TGStatusBar *fStatusBar;
    TGComboBox *fViewMode;
    TGComboBox *fPrintMode;
    TGComboBox *fDataSetMode;

    Int_t fLastEventType;
    Int_t fLastEventX;
    Int_t fLastEventY;
    TObject *fLastSelected;

    Double_t fLastXPosition;
    Double_t fLastYPosition;

    Bool_t fCTRL = false;

    TH2D *fNucChartHist;

    std::map<TString, NucData*> fMapOfNuclei;

    TList *fMagicList;
    TList *fListOfBoxes;

    bool fPlotMagics = true;

    Double_t fNMin;
    Double_t fNMax;
    Double_t fZMin;
    Double_t fZMax;

    TString fLastSelectedBox;
    NucData *fSelectedNucleus = nullptr;
    LevelScheme *fSelectedLevelScheme = nullptr;
    TString fCurrentDataSet = "ADOPTED LEVELS, GAMMAS";

    TGTextEntry *fNucleusTextEntry;

    bool fDoUpdateRange = false;

public:

    CXNucChart(const TGWindow *p, const TGWindow *main, UInt_t w, UInt_t h, CXMainWindow *mainwindow);
    virtual ~CXNucChart();

    void UpdateNucChart();
    void PrintInListBox(TString mess, Int_t Type=-1);

    void ProcessedKeyEvent(Event_t *event);
    void HandleMovement(Int_t EventType, Int_t EventX, Int_t EventY, TObject *selected);
    void UpdateRange();
    void PrintInfos(bool inprompt = false);
    void NucNotValidated();
    void UpdateNucFromSymb();
94
    void UpdatePrintMode(){PrintInfos(true);}
Jérémie Dudouet's avatar
Jérémie Dudouet committed
95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111
    void UpdateDataSet();
    static void SetPalette(Int_t Mode);


protected:

    void SelectNucleus(Int_t Z, Int_t N);
    void ShowMagicNumbers(bool On=true);
    void PlotBoxes();

    ClassDef(CXNucChart,0)

};


#endif //CXNucChart_H