ROOT logo
#ifndef HRich700Trb3Unpacker_H
#define HRich700Trb3Unpacker_H

#include "hlocation.h"
#include "htrb3tdcunpacker.h"


#include <vector>

class HRich700Trb3Lookup;
class HRich700ThresholdPar;
class HRich700DigiPar;

class HRich700Trb3Unpacker: public HTrb3TdcUnpacker {
protected:
  HLocation fRawLoc;          //< current location of raw pixel object (pmt,pixel)
  HLocation fCalLoc;          //< current location of calibrated object (sector, row, column)

  HRich700Trb3Lookup* fLookup;       // TRB3 lookup table
  HRich700ThresholdPar* fThresholds; // TRB3 lookup table
  HRich700DigiPar* fDigiPar;         //
  Bool_t fTimeRef;                   // use reference time ?
  Bool_t fDoTimeCut;                 // use time cuts time (default kFALSE)
  Bool_t fDoToTCut;                  // use time cuts on ToT (default kTRUE)
  Bool_t fFillCal;                   // fill Cal      (default kFALSE)
  static Bool_t fHasPrintedTDC;      //
  HCategory* fCalCat;                // category for calibrated event data, output of unpacker


  // add hit to the raw category at the current raw location cursor
  Int_t addRawHit(Double_t t_leading, Double_t t_trailing, Double_t tot,
		  Int_t sec, Int_t col, Int_t row, UInt_t flag = 0b11);

  // add hit of specified charge to cal category at specified location
  Int_t addCalHitCharge(Int_t sector, Int_t col, Int_t row,
			Float_t time,Float_t tot);


public:
  HRich700Trb3Unpacker(vector<UInt_t>& ids);
  virtual ~HRich700Trb3Unpacker(void) {}

  virtual Bool_t init(void);
  virtual Bool_t reinit(void);
  virtual Int_t execute(void);

  void setUseTimeCuts(Bool_t doCut )  {fDoTimeCut = doCut;}
  void setUseToTCuts(Bool_t doCut )  {fDoToTCut = doCut;}
  void setFillCal    (Bool_t doFill ) {fFillCal   = doFill;}
  void disableTimeRef(void) { fTimeRef = kFALSE ; }

  ClassDef(HRich700Trb3Unpacker, 0) // TRB3 unpacker for the start detector
};

#endif /* !HRich700Trb3Unpacker_H */
 hrich700trb3unpacker.h:1
 hrich700trb3unpacker.h:2
 hrich700trb3unpacker.h:3
 hrich700trb3unpacker.h:4
 hrich700trb3unpacker.h:5
 hrich700trb3unpacker.h:6
 hrich700trb3unpacker.h:7
 hrich700trb3unpacker.h:8
 hrich700trb3unpacker.h:9
 hrich700trb3unpacker.h:10
 hrich700trb3unpacker.h:11
 hrich700trb3unpacker.h:12
 hrich700trb3unpacker.h:13
 hrich700trb3unpacker.h:14
 hrich700trb3unpacker.h:15
 hrich700trb3unpacker.h:16
 hrich700trb3unpacker.h:17
 hrich700trb3unpacker.h:18
 hrich700trb3unpacker.h:19
 hrich700trb3unpacker.h:20
 hrich700trb3unpacker.h:21
 hrich700trb3unpacker.h:22
 hrich700trb3unpacker.h:23
 hrich700trb3unpacker.h:24
 hrich700trb3unpacker.h:25
 hrich700trb3unpacker.h:26
 hrich700trb3unpacker.h:27
 hrich700trb3unpacker.h:28
 hrich700trb3unpacker.h:29
 hrich700trb3unpacker.h:30
 hrich700trb3unpacker.h:31
 hrich700trb3unpacker.h:32
 hrich700trb3unpacker.h:33
 hrich700trb3unpacker.h:34
 hrich700trb3unpacker.h:35
 hrich700trb3unpacker.h:36
 hrich700trb3unpacker.h:37
 hrich700trb3unpacker.h:38
 hrich700trb3unpacker.h:39
 hrich700trb3unpacker.h:40
 hrich700trb3unpacker.h:41
 hrich700trb3unpacker.h:42
 hrich700trb3unpacker.h:43
 hrich700trb3unpacker.h:44
 hrich700trb3unpacker.h:45
 hrich700trb3unpacker.h:46
 hrich700trb3unpacker.h:47
 hrich700trb3unpacker.h:48
 hrich700trb3unpacker.h:49
 hrich700trb3unpacker.h:50
 hrich700trb3unpacker.h:51
 hrich700trb3unpacker.h:52
 hrich700trb3unpacker.h:53
 hrich700trb3unpacker.h:54
 hrich700trb3unpacker.h:55