ROOT logo
#ifndef HRICH700RAW_H
#define HRICH700RAW_H

#include "TObject.h"

#define  NMAXRAWRICH 15

/*
 * a single tdc hit. Inspired by testbeam code from C.Pauly
 * JAM (j.adamczewski@gsi.de) 8-Jun-2017
 * JoF (j.foertsch@uni-wuppertal.de) updated 18-Dec-2018
 */
class HRich700hit_t : public TObject
{

public:
	HRich700hit_t(Double_t leading=0, Double_t trailing=0, Double_t tot=0, UInt_t flag=0):
		fLeadingEdgeTime(leading), fTrailingEdgeTime(trailing), fToT(tot), fFlag(flag){}
 	Double_t fLeadingEdgeTime;
 	Double_t fTrailingEdgeTime;
 	Double_t fToT;
 	UInt_t fFlag; //bit 0b10: valid rising edge, bit 0b01: valid falling edge
	void set(Double_t leading,Double_t trailing,Double_t tot,UInt_t flag) {
	    fLeadingEdgeTime  = leading;
	    fTrailingEdgeTime = trailing;
	    fToT              = tot;
	    fFlag             = flag;
	}
	void clear(){
	    fLeadingEdgeTime  = 0;
	    fTrailingEdgeTime = 0;
	    fToT              = 0;
	    fFlag             = 0;
	}
      ClassDef(HRich700hit_t, 1)

};


/*
 * raw data of a single rich700 pixel. Is kept in rich700raw category.
 * contains the list of tdc hits during the event.
 * JAM (j.adamczewski@gsi.de) 8-Jun-2017
 *
 */

class HRich700Raw : public TObject {
private:
   Int_t   fPMT;        // global RICH700 PMT id
   Int_t   fPixel;      // local pixel id on the PMT
   Int_t   fSector;
   Int_t   fCol;
   Int_t   fRow;
   HRich700hit_t fHitlist[NMAXRAWRICH]; // list of hits in this pixel during the event
   UInt_t   fnHits;
public:
   HRich700Raw() : TObject(), fPMT(-1), fPixel(-1) ,fSector(-1),fCol(-1),fRow(-1)
    {
	clearHits();
    }
   virtual ~HRich700Raw() {}

   Int_t   getMultiplicity()    const {return fnHits;}
   Int_t   getPMT()             const {return fPMT;};
   Int_t   getPixel()           const {return fPixel;}
   const HRich700hit_t* getHit(const UInt_t n)  const {  return (n<fnHits ? &fHitlist[n] : 0 );}

   void    setPMT(Int_t p)   {fPMT=p;}
   void    setPixel(Int_t p) {fPixel=p;}
   void    setSector(Int_t s){fSector = s;}
   void    setCol(Int_t c){fCol = c;}
   void    setRow(Int_t r){fRow = r;}
   void    setAddress(const Int_t pmt, const Int_t pixel, const Int_t sec, const Int_t col, const Int_t row)
   {
	   fPMT   = pmt;
	   fPixel = pixel;
	   fSector= sec;
	   fCol   = col;
	   fRow   = row;
   }

   void    getAddress(Int_t& pmt, Int_t& pix, Int_t& sec,Int_t& col,Int_t& row)
   {
      pmt = fPMT;
      pix = fPixel;
      sec = fSector;
      col = fCol;
      row = fRow;
   }

   void addHit(Double_t leading, Double_t trailing, Double_t tot, UInt_t flag=3)
   {
       if(fnHits<NMAXRAWRICH-1) {
	   fHitlist[fnHits].set(leading,trailing,tot,flag);
           fnHits++;
       }
   }

   void clearHits()
   {
       for(Int_t i=0;i<NMAXRAWRICH; i++) fHitlist [i].clear();
       fnHits = 0 ;
   }

   ClassDef(HRich700Raw, 1) // raw data of RICH700 detector using TRB3/dirich for readout
};



#endif /* ! HRich700Raw_H */
 hrich700raw.h:1
 hrich700raw.h:2
 hrich700raw.h:3
 hrich700raw.h:4
 hrich700raw.h:5
 hrich700raw.h:6
 hrich700raw.h:7
 hrich700raw.h:8
 hrich700raw.h:9
 hrich700raw.h:10
 hrich700raw.h:11
 hrich700raw.h:12
 hrich700raw.h:13
 hrich700raw.h:14
 hrich700raw.h:15
 hrich700raw.h:16
 hrich700raw.h:17
 hrich700raw.h:18
 hrich700raw.h:19
 hrich700raw.h:20
 hrich700raw.h:21
 hrich700raw.h:22
 hrich700raw.h:23
 hrich700raw.h:24
 hrich700raw.h:25
 hrich700raw.h:26
 hrich700raw.h:27
 hrich700raw.h:28
 hrich700raw.h:29
 hrich700raw.h:30
 hrich700raw.h:31
 hrich700raw.h:32
 hrich700raw.h:33
 hrich700raw.h:34
 hrich700raw.h:35
 hrich700raw.h:36
 hrich700raw.h:37
 hrich700raw.h:38
 hrich700raw.h:39
 hrich700raw.h:40
 hrich700raw.h:41
 hrich700raw.h:42
 hrich700raw.h:43
 hrich700raw.h:44
 hrich700raw.h:45
 hrich700raw.h:46
 hrich700raw.h:47
 hrich700raw.h:48
 hrich700raw.h:49
 hrich700raw.h:50
 hrich700raw.h:51
 hrich700raw.h:52
 hrich700raw.h:53
 hrich700raw.h:54
 hrich700raw.h:55
 hrich700raw.h:56
 hrich700raw.h:57
 hrich700raw.h:58
 hrich700raw.h:59
 hrich700raw.h:60
 hrich700raw.h:61
 hrich700raw.h:62
 hrich700raw.h:63
 hrich700raw.h:64
 hrich700raw.h:65
 hrich700raw.h:66
 hrich700raw.h:67
 hrich700raw.h:68
 hrich700raw.h:69
 hrich700raw.h:70
 hrich700raw.h:71
 hrich700raw.h:72
 hrich700raw.h:73
 hrich700raw.h:74
 hrich700raw.h:75
 hrich700raw.h:76
 hrich700raw.h:77
 hrich700raw.h:78
 hrich700raw.h:79
 hrich700raw.h:80
 hrich700raw.h:81
 hrich700raw.h:82
 hrich700raw.h:83
 hrich700raw.h:84
 hrich700raw.h:85
 hrich700raw.h:86
 hrich700raw.h:87
 hrich700raw.h:88
 hrich700raw.h:89
 hrich700raw.h:90
 hrich700raw.h:91
 hrich700raw.h:92
 hrich700raw.h:93
 hrich700raw.h:94
 hrich700raw.h:95
 hrich700raw.h:96
 hrich700raw.h:97
 hrich700raw.h:98
 hrich700raw.h:99
 hrich700raw.h:100
 hrich700raw.h:101
 hrich700raw.h:102
 hrich700raw.h:103
 hrich700raw.h:104
 hrich700raw.h:105
 hrich700raw.h:106
 hrich700raw.h:107
 hrich700raw.h:108
 hrich700raw.h:109
 hrich700raw.h:110