CXLevelSchemePlayer.h 2.36 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 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 94 95 96 97 98 99 100 101 102 103 104

    Color_t fColorWheel[48];

    Color_t fCurrentColor;

    TList *fListOfArrows = nullptr;
    TList *fListOfLatex = nullptr;
    TList *fListOfBoxes = nullptr;

    TList *fListOfDatabase = nullptr;

    Bool_t fCanReplot;
    Bool_t fLevelDraw;

public:

    CXLevelSchemePlayer(const char* name, const char *title);
    virtual ~CXLevelSchemePlayer();

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

    void DrawArrows(TString ListOfNuclei, TH1 *h);
    void DrawArrowsForNuc(TString NucName);

    Bool_t CanReplot(){return fCanReplot;}

    LevelScheme *ImportExpData(const char *NucSymbol);
    LevelScheme *ImportENSDFData(const char *NucSymbol);

    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");

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