CXLevelSchemePlayer.h 2.88 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
#ifndef CXLevelSchemePlayer_H
#define CXLevelSchemePlayer_H

#include "TNamed.h"
#include "TLatex.h"

#include "GammaLink.h"
#include "LevelScheme.h"
#include "NuclearLevel.h"

#include "CXNucleus.h"
#include "CXBashColor.h"

using namespace Gw;

class CXMainWindow;
class CXGuiLSPlayer;
class TH1;

class CXLevelSchemePlayer : public TNamed
{

private:

    CXMainWindow *fMainWindow = nullptr;
    CXGuiLSPlayer *fGuiLSPlayer = nullptr;

    TString fExpDataDir;
    TString fENSDFDataDir;

    CXBashColor *fBashColor = nullptr;

    Int_t fMinStrenght;
    Int_t fMaxStrenght;

    Int_t fMinSpin;
    Int_t fMaxSpin;

    Float_t fRangeXMin;
    Float_t fRangeXMax;

    map<Int_t, Float_t> fYrastEnergies;

    Float_t fMinELevel;
    Float_t fMaxELevel;

    Float_t fMinLifeTime;
    Float_t fMaxLifeTime;

50
    TH1 *fCurrentHist = nullptr;
Jérémie Dudouet's avatar
Jérémie Dudouet committed
51 52 53 54 55 56 57 58

    Color_t fColorWheel[48];

    Color_t fCurrentColor;

    TList *fListOfArrows = nullptr;
    TList *fListOfLatex = nullptr;
    TList *fListOfBoxes = nullptr;
59
    TList *fListOfCXArrows = nullptr;
Jérémie Dudouet's avatar
Jérémie Dudouet committed
60 61 62 63 64 65 66 67

    TList *fListOfDatabase = nullptr;

    Bool_t fCanReplot;
    Bool_t fLevelDraw;

public:

Jérémie Dudouet's avatar
Jérémie Dudouet committed
68
    CXLevelSchemePlayer(const char* name="", const char *title="");
Jérémie Dudouet's avatar
Jérémie Dudouet committed
69 70 71 72 73
    virtual ~CXLevelSchemePlayer();

    void SetMainWindow(CXMainWindow *w){fMainWindow = w;}
    void SetGuiLSPlayer(CXGuiLSPlayer *player){fGuiLSPlayer = player;}

Jérémie Dudouet's avatar
Jérémie Dudouet committed
74 75
    LevelScheme *DrawArrows(TString ListOfNuclei, TH1 *h, TString DataSet);
    LevelScheme *DrawArrowsForNuc(TString NucName, TString DataSet);
Jérémie Dudouet's avatar
Jérémie Dudouet committed
76 77 78 79

    Bool_t CanReplot(){return fCanReplot;}

    LevelScheme *ImportExpData(const char *NucSymbol);
Jérémie Dudouet's avatar
Jérémie Dudouet committed
80
    LevelScheme *ImportENSDFData(const char *NucSymbol, bool quietmode=false, TString dataset="");
Jérémie Dudouet's avatar
Jérémie Dudouet committed
81 82 83 84 85 86

    void ProcessedEventLevelScheme(Int_t eventType, Int_t eventX, Int_t eventY, TObject*obj);
    void RemoveArrow(Int_t ArrowIndex);

    void PlotLevelScheme(TString NucName, TString Type="ENSDF");

Jérémie Dudouet's avatar
Jérémie Dudouet committed
87 88 89 90 91 92 93 94
    TString PrintNucleusLevels(Int_t Z, Int_t N, bool print = false);
    TString PrintNucleusLevels(LevelScheme *lev, TString NucName, bool print = false);

    TString PrintNucleusGammas(Int_t Z, Int_t N, bool print = false);
    TString PrintNucleusGammas(LevelScheme *lev, TString NucName, bool print = false);

    LevelScheme *GetLevelScheme(TString Symb, bool print = false, TString dataset="");

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 112 113
private:

    void DrawArrow(TH1 *hist, const Gw::GammaLink *gamma, CXNucleus Nuc, TString DataType);
    void ConnectCanvas();

    void CalcYrast(LevelScheme *lev);

    TString GetSpinFromLev(NuclearLevel *nuclev);
    NuclearLevel *GetLevel(NuclearLevel *nuclev, LevelScheme *ls);
    void DrawLink(LevelScheme *ls, GammaLink *gammalink);
    void ShiftLink(GammaLink *link,Float_t XShift);
    void GetLimits(GammaLink *link, Float_t &xmin,Float_t &xmax,Float_t &ymin,Float_t &ymax);
    void ResizeNucLev(NuclearLevel *nuclev,Float_t width);


    ClassDef(CXLevelSchemePlayer,0)
};

#endif // CXLevelSchemePlayer_H