#ifndef MARS_MHEvent
#define MARS_MHEvent

#ifndef MARS_MH
#include "MH.h"
#endif

class MHCamera;
class MRawEvtData;
class MRawRunHeader;
class MRawEvtHeader;

class MTime;
class MMcEvt;
class MMcTrig;
class MSignalCam;
class MImgCleanStd;

class MHEvent : public MH
{
public:
    enum EventType_t {
        kEvtSignalRaw, kEvtSignalDensity,
        kEvtPedestal, kEvtPedestalRMS,
        kEvtPedPhot, kEvtPedPhotRMS,
        kEvtCleaningLevels, kEvtCleaningData,
        kEvtIdxMax, kEvtArrTime, kEvtArrTimeCleaned,
        kEvtTrigPix, kEvtIslandIndex
    };

private:
    MRawEvtData   *fRawEvtData;    //!
    MRawRunHeader *fRawRunHeader;  //!
    MRawEvtHeader *fRawEvtHeader;  //!

    MTime         *fTime;          //!
    MMcEvt        *fMcEvt;         //!
    MMcTrig       *fMcTrig;        //!
    MSignalCam    *fCerPhotEvt;    //!
    MImgCleanStd  *fImgCleanStd;   //!

    MRawEvtData   *fClone;         //->

    MHCamera *fHist;

    EventType_t fType;

    Double_t fMinimum;
    Double_t fMaximum;

    TH1 *GetHistByName(const TString name) const { return (TH1*)fHist; }

    Bool_t SetupFill(const MParList *plist);
    Bool_t Fill(const MParContainer *par, const Stat_t weight=1);

public:
    MHEvent(EventType_t type=kEvtSignalRaw);
    ~MHEvent();

    void SetMinimum(Double_t min=-1111) { fMinimum=min; }
    void SetMaximum(Double_t max=-1111) { fMaximum=max; }

    MHCamera *GetHist() { return fHist; }

    void Draw(Option_t *o="");
    void Paint(Option_t *o="");
 
    ClassDef(MHEvent, 1)
};

#endif
