#ifndef TMHistogramming_H
#define TMHistogramming_H

#include <Rtypes.h>

struct eventHeaderStruct;
class HenrikClusterFinderSPD;
class AliITSRawStreamSPD;
class TPad;
class TGTextView;

class TMHistogramming {
 public:
  TMHistogramming();
  virtual ~TMHistogramming();

  virtual void   StartEvent(eventHeaderStruct *event, UInt_t globalEventNumber);
  virtual void   ProcessEvent(eventHeaderStruct *event);
  virtual void   ProcessPixel(UInt_t eq, UInt_t hs, UInt_t chip, UInt_t col, UInt_t row);
  virtual void   ProcessCluster(Float_t x, Float_t y, Float_t z, UInt_t module, UInt_t size, UInt_t widz, UInt_t widphi, UInt_t type);
  virtual void   ProcessClusters(HenrikClusterFinderSPD* clFinder);
  virtual void   EndEvent(AliITSRawStreamSPD *str, UInt_t globalEventNumber);

  virtual void   Draw(TPad *pad);
  virtual void   Dump(TGTextView *textview);
  virtual Bool_t NeedRedraw() {return fNeedRedraw;}
  virtual Bool_t NeedRedump() {return fNeedRedump;}

  virtual void   Reset();
  virtual void   ResetAuto();

  virtual void   SetAutoReset(Bool_t setval) {fAutoReset=setval;}
  virtual Bool_t GetAutoReset() {return fAutoReset;}
  virtual void   SetPaused(Bool_t setval) {fPaused=setval;}
  virtual Bool_t GetPaused() {return fPaused;}

  virtual UInt_t GetNrEvents() {return fNrEvents;}
  virtual UInt_t GetLastEventNumber() {return fLastEventNumber;}

  virtual ULong_t GetTriggerMask(UInt_t index);
  virtual void    SetTriggerMask(ULong_t word0, ULong_t word1);

 protected:

  UInt_t fNrEvents;
  UInt_t fLastEventNumber;
  Bool_t fAutoReset;
  Bool_t fPaused;
  Bool_t fNeedRedraw;
  Bool_t fNeedRedump;

  ULong_t fTrigMask[2];
  Bool_t  fEventAccept;

};

#endif
