ROOT logo
/////////////////////////////////////////////////////////////
//
//  HTrb3Unpacker
//
//  This is a base for decoding TRB data and filling arrays. 
//  Derived classes has to provide methods for filling 
//  Detector's Raw categories.
//
/////////////////////////////////////////////////////////////

#ifndef HTRB3UNPACKER_H
#define HTRB3UNPACKER_H

#include "hldunpack.h"
#include <vector>
#include "TString.h"


class HldSubEvt;

class HTrb3Unpacker : public HldUnpack {

protected:
  HTrb3Unpacker(vector<UInt_t>& ids);   //!
  virtual ~HTrb3Unpacker();
  vector<UInt_t> fsubEvtIds;            //! list of subevent id
  vector<HldSubEvt> fsubEvts;           //! list of subevent id
  UInt_t fCurrentsubEvtId;              //! current subevent id taken from the data stream
  UInt_t uHUBId;                        //! number like 0x9000 which works as envelope for external TDCs
  UInt_t uCTSId;                        //! number like 0x8000 which indicates CTS block in data
  Int_t  debugFlag;                     //! allows to print subevent information to the STDOUT
  Bool_t quietMode;                     //! do not print errors!
  Bool_t reportCritical;                //! report critical errors!
  void    setCurrentSubEvtId (UInt_t id) { fCurrentsubEvtId = id;}
  UInt_t  getCurrentSubEvtId ()          { return fCurrentsubEvtId;}
public:
  Int_t getSubEvtId(void)  { return getCurrentSubEvtId();}
  vector<UInt_t>& getSubEvtIds(void) { return fsubEvtIds;}
  void setHUBId(UInt_t id) { uHUBId = id; }
  void setCTSId(UInt_t id) { uCTSId = id; }

  void setDebugFlag(Int_t db) { debugFlag  = db; }
  Int_t getDebugFlag() { return debugFlag; }

  void setQuietMode(void)      { quietMode      = kTRUE; }
  void setReportCritical(void) { reportCritical = kTRUE; }

  Bool_t isQuietMode() const { return quietMode; }
  Bool_t isReportCritical() const { return reportCritical;}

  virtual Int_t  execute(void){ return 0;};
  virtual Bool_t init(void){ return kFALSE; };
  virtual Bool_t reinit(void) { return kTRUE; };

protected:
  virtual void   clearAll(void);
  Bool_t decode(void);
  virtual Bool_t decodeData(UInt_t trbaddr, UInt_t n, UInt_t * data) { return kFALSE; }

  ClassDef(HTrb3Unpacker,0); //Base class for TRB3 unpackers
};

#endif /* !HTRB3UNPACKER_H */


 htrb3unpacker.h:1
 htrb3unpacker.h:2
 htrb3unpacker.h:3
 htrb3unpacker.h:4
 htrb3unpacker.h:5
 htrb3unpacker.h:6
 htrb3unpacker.h:7
 htrb3unpacker.h:8
 htrb3unpacker.h:9
 htrb3unpacker.h:10
 htrb3unpacker.h:11
 htrb3unpacker.h:12
 htrb3unpacker.h:13
 htrb3unpacker.h:14
 htrb3unpacker.h:15
 htrb3unpacker.h:16
 htrb3unpacker.h:17
 htrb3unpacker.h:18
 htrb3unpacker.h:19
 htrb3unpacker.h:20
 htrb3unpacker.h:21
 htrb3unpacker.h:22
 htrb3unpacker.h:23
 htrb3unpacker.h:24
 htrb3unpacker.h:25
 htrb3unpacker.h:26
 htrb3unpacker.h:27
 htrb3unpacker.h:28
 htrb3unpacker.h:29
 htrb3unpacker.h:30
 htrb3unpacker.h:31
 htrb3unpacker.h:32
 htrb3unpacker.h:33
 htrb3unpacker.h:34
 htrb3unpacker.h:35
 htrb3unpacker.h:36
 htrb3unpacker.h:37
 htrb3unpacker.h:38
 htrb3unpacker.h:39
 htrb3unpacker.h:40
 htrb3unpacker.h:41
 htrb3unpacker.h:42
 htrb3unpacker.h:43
 htrb3unpacker.h:44
 htrb3unpacker.h:45
 htrb3unpacker.h:46
 htrb3unpacker.h:47
 htrb3unpacker.h:48
 htrb3unpacker.h:49
 htrb3unpacker.h:50
 htrb3unpacker.h:51
 htrb3unpacker.h:52
 htrb3unpacker.h:53
 htrb3unpacker.h:54
 htrb3unpacker.h:55
 htrb3unpacker.h:56
 htrb3unpacker.h:57
 htrb3unpacker.h:58
 htrb3unpacker.h:59
 htrb3unpacker.h:60
 htrb3unpacker.h:61
 htrb3unpacker.h:62
 htrb3unpacker.h:63
 htrb3unpacker.h:64
 htrb3unpacker.h:65