#ifndef HMATCHUUNPACKER_H
#define HMATCHUUNPACKER_H
#include "hldunpack.h"
#include "hlocation.h"
#include "hmatchutof.h"
#include "hmuleptons.h"
#include "hshowerunpackparam.h"
#include "hshowersubidpar.h"
#include "hrecevent.h"
#include "hmudata.h"
#include "hmuscalers.h"
#include "hrichpad.h"
#include "hrichgeometrypar.h"
#include "hspecgeompar.h"
#include "hgeomvector.h"
#include "hgeomvector2.h"
#include "hgeomvolume.h"
#include "hshowergeometry.h"
#include "hmatchushower.h"
class HCategory;
class HTriggerParShowerMap;
class HTriggerParRichMap;
class HTriggerSetup;
class HMatchUSubEvtHdr {
public:
Int_t length;
Int_t bigEndianFlag;
Int_t muId;
Int_t triggerTag;
Int_t triggerCode;
};
typedef struct {
Int_t dataw1;
Int_t dataw2;
} EXPAND;
class HMatchUUnpacker : public HldUnpack {
private:
Int_t evt;
Int_t tofNr;
Int_t tofLep;
Int_t showerNr;
Int_t showerLep;
HLocation fLoc;
HCategory *fCatRich;
HCategory *fCatShower;
HCategory *fCatTof;
HCategory *fCatLeptons;
HCategory *fCatDiLeptons;
HCategory *fCatScalers;
HMUData* muData;
HMUScalers *muScalers;
TIterator *iterLepton;
TArrayC *Rich_Sector_Map;
HRecEvent* event;
Int_t fUnit;
FILE* fMU_logfile;
Int_t fLog;
Bool_t isCompressed;
Int_t version;
Int_t TofIpuNr;
Int_t Row_Offset;
Int_t MUDataFormat;
Bool_t isInitialized;
Int_t hitpersec[6];
Int_t nShower[6];
Int_t nTof[6];
Int_t sec_old;
EXPAND expand;
UInt_t *data;
Int_t triggerCode;
UInt_t sec_count;
UInt_t RichSecPatternMask;
UInt_t ShowerSecPatternMask;
UInt_t TofSecPatternMask;
UInt_t MU_sec_pattern_Rich;
UInt_t MU_sec_pattern_Shower;
UInt_t MU_sec_pattern_Tof;
Int_t mapNrTof[6][100];
Int_t mapNrShower[6][100];
Int_t mapNrRich[6][100];
HShowerUnpackParam* fShowerParam;
HTriggerParShowerMap *fTrigParSho;
HTriggerParRichMap *fTrigParRich;
HTriggerSetup *fTrigSetup;
Int_t decodeMUData(UInt_t *pData,Int_t maxLength);
Int_t decodeRich(UInt_t *pData,Int_t maxLength);
Int_t decodeIpuRich(UInt_t *pData,Int_t maxLength);
Int_t decodeIpuShower(UInt_t *pData,Int_t maxLength);
Int_t decodeShower(UInt_t *pData,Int_t maxLength);
Int_t decodeShowerOld(UInt_t *pData,Int_t maxLength);
Int_t decodeTof(UInt_t *pData,Int_t maxLength);
Int_t decodeIpuTof(UInt_t *pData,Int_t maxLength);
Int_t getRichSize(UInt_t d) {return ((d >> 8) & 0x00ff);};
Bool_t checkRichMSW(UInt_t d) {return ((d & 0x0F00) == 0)?kTRUE:kFALSE; };
Bool_t checkRichLSW(UInt_t d) {return ((d & 0xE380) == 0)?kTRUE:kFALSE; };
Int_t getRichFifoNb(UInt_t d) {return (d & 0xF00) >> 8; };
Int_t getRichColumPattern(UInt_t d) { return (d & 0x00FF); };
Int_t getRichSegId(UInt_t d) { return ((d >> 10 ) & 0x7); };
Int_t getRichRow(UInt_t d) { return (d & 0x7F); };
UInt_t getRichSecHeader(UInt_t d) { return ( (d>>10) & 0x7); };
Int_t getShowColumn( Int_t d) { return (( d >> 16 ) & 0x1F); };
Int_t getShowRowPattern( Int_t d) { return ( d & 0xFFFF); };
Int_t getShowBuildID( Int_t d) {return ( (d >> 16) & 0xfff ) ; };
Bool_t isShowTrailer(UInt_t d) { return ( d ==0x0000A511)?kTRUE:kFALSE;};
Int_t getShowFrameCount( Int_t d) { return ( d & 0x1f ); };
Int_t storeShowElements(Int_t buildID, Int_t rowPattern, Int_t col);
HShowerSubIdPar* showerParamConfigure( HShowerUnpackParam* param, Int_t subEvtId);
Int_t getTofTriggerTag(UInt_t d){ return (d & 0x7f); };
Int_t getTofTriggerCode(UInt_t d){return ( (d>>8) & 0xf); };
Int_t getTofId(UInt_t d){ return ( (d>>13) & 0x1); };
Int_t getTofVeto(UInt_t d){return ( (d>>12) & 0x1); };
Int_t fillTofData(HMatchUTof *mtof, UInt_t dataWord);
Int_t getLeptonSector(Int_t d) { return (d & 0xF);};
Int_t getLeptonRichNr(Int_t d) { return ( (d >> 4) & 0x7f ); };
Int_t getLeptonMetaNr(Int_t d) { return ( (d >> 12) & 0xff ); };
Int_t getLeptonDetBit(Int_t d) { return ( ( d >> 20) & 0x1 ); };
Int_t getLeptonFlag(Int_t d) { return ( ( d >> 21) & 0x1 ); };
Float_t getLeptonMom(Int_t d) { return ( (d >> 24) & 0xff);};
Int_t getScaler(UInt_t d) { return (d & 0xffffffff);};
Int_t mapAngles(void);
void getExpanded( Int_t d) {
Int_t data1 = d>>16 & 0xff;
Int_t data2 = d&0xff;
expand.dataw2=data1;
expand.dataw1=data2;
};
UInt_t *expansion(UInt_t* d, Int_t longueur);
void setDefaults(void);
void setLogging(void);
protected:
Int_t kSubEvtId;
Bool_t fDebugMode;
Bool_t fRichDebugMode;
Bool_t fShowerDebugMode;
Int_t richc;
public:
HMatchUUnpacker(Int_t unites=0,Bool_t compression=kFALSE, Int_t flog=0,TString vers="aug04");
HMatchUUnpacker(Int_t id, Int_t units, Bool_t compression=kFALSE);
virtual ~HMatchUUnpacker(void);
virtual Bool_t init(void);
virtual Bool_t reinit(void);
virtual Int_t execute(void);
Bool_t isDebugMode(void) { return fDebugMode; };
Int_t getSubEvtId(void) const {return kSubEvtId;};
void setDebugMode(Bool_t dm) { fDebugMode = dm; };
void setRichDebugMode(Bool_t dm) { fRichDebugMode = dm; };
void setShowerDebugMode(Bool_t dm) { fShowerDebugMode = dm; };
void setLoggingMode(Bool_t flog) { fLog = flog; };
Int_t getRichEmptyCount(){ return richc+1; };
ClassDef(HMatchUUnpacker,0)
};
#endif
Last change: Sat May 22 12:59:26 2010
Last generated: 2010-05-22 12:59
This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.