ROOT logo
//*-- AUTHOR : Jerzy Pietraszko, Ilse Koenig
//*-- Created : 03/02/2006

/////////////////////////////////////////////////////////////
//
//  HTrbBaseUnpacker
//
//  This is a base for decoding TRB data and filling arrays. 
//  Derived classes has to provide mathods for filling 
//	Detector's Raw categories.
//
/////////////////////////////////////////////////////////////

#ifndef HTRBBASEUNPACKER_H
#define HTRBBASEUNPACKER_H

#include "hldunpack.h"
class HTrbLookup;

class HTrbBaseUnpacker : public HldUnpack {

protected:
  HTrbBaseUnpacker(UInt_t id=0);
  virtual ~HTrbBaseUnpacker(){;}

  HTrbLookup* lookup;

  UInt_t subEvtId;                    
  Int_t trbDataVer; // data structure version:
                     // info: http://hades-wiki.gsi.de/cgi-bin/view/DaqSlowControl/RpcDataStructure
  Int_t trbLeadingTime[128][10];        
  Int_t trbTrailingTime[128][10];      
  Int_t trbADC[128][10];               
  Int_t trbLeadingMult[128];            
  Int_t trbTrailingMult[128];          
  Int_t trbTrailingTotalMult[128];  // FIXME: Pablos private version; total multiplicity for trailings        
  Int_t trbDataExtension[128];
  Int_t trbExtensionSize;
  Bool_t trbDataPairFlag;

  Int_t debugFlag;  //! allows to print subevent information
		    // to the STDOUT	
  Bool_t quietMode; //! do not print errors!
  Bool_t reportCritical;//! report critical errors!
public:
  

  Int_t getSubEvtId(void) const { return subEvtId; }
  Int_t getTrbDataVer(void) const { return trbDataVer; }
  virtual Int_t execute(void){ return 0;};
  virtual Bool_t init(void){ return kFALSE; };
  virtual Int_t decode(void);
  virtual Int_t correctOverflow(void);
  virtual Int_t correctRefTimeCh31(void);
  virtual Int_t correctRefTimeCh127(void);
  void clearAll(void);
  void setQuietMode(void){quietMode=kTRUE;}
  void setReportCritical(void){reportCritical=kTRUE;}

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

  void PrintTdcError(UInt_t e, UInt_t trbId);
  Bool_t fill_trail(Int_t ch,Int_t d);
  Bool_t fill_lead(Int_t ch,Int_t d);
  Bool_t fill_pair(Int_t ch,Int_t time,Int_t length);

public:
  ClassDef(HTrbBaseUnpacker,0) //Base class for TRB unpacker


};

#endif /* !HTRBBASEUNPACKER_H */


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