// ----------------------------------------------------------------------------- // ----- ----- // ----- KRATUnpack2 ----- // ----- Created 17.05.2013 by S.Kupny ----- // ----- ----- // ---- Based on: ----- // ---- https://subversion.gsi.de/trac/fairroot/browser/r3broot/trunk/unpack/land/R3BLandUnpack.h ----- // ----------------------------------------------------------------------------- #ifndef KRATUNPACK_2_H #define KRATUNPACK_2_H #include "TClonesArray.h" #include "TSystem.h" #include "FairLogger.h" #include "FairUnpack.h" #include "FairLogger.h" #include "FairRootManager.h" #include "FairTask.h" #include "TKRATRawEvent.h" #include "TKRATEvent.h" //#include "TRootEvent.h" //#include "TEvtBuffer.h" class TKRATMapping; class TKRATRawEvent; class TClonesArray; class KRATUnpack2 : public FairUnpack { public: /** * KRATUnpack2 constructor * @param strMappingFile - file with mapping for KRATTA detector. * Leave empty for use default value * @param type MBS type id. For KRATTA default is 36 * @param subType MBS subtype id. For KRATTA default is 1 * @param iVerbose debug level: * 0 - no output to stdout * 1 - (default value) only interesting and important info * 2 - debug level 2 - write functions call sequence * 3 - debug level 3 - write some information about events * 4 - debug level 4 - write some information about events (but more?) * 5 - debug level 5 - write all information about events with all unpacked signals */ //KRATUnpack2(const char *strMappingFile = "", // Int_t type = 36, Int_t subType = 1, // Int_t iVerbose = 1); // Fairroot version: v-13.05 KRATUnpack2(const char *strMappingFile, Short_t type=36, Short_t subType=1, Short_t procId=-1, Short_t subCrate=-1, Short_t control=-1, Int_t iVerbose=1); // Fairroot version: v-13.12 virtual ~KRATUnpack2(); virtual Bool_t Init(); virtual Bool_t DoUnpack(Int_t *data, Int_t size); virtual void Reset(); virtual void Finish(); void SetDebugLevel( Int_t iNewDebugLvl ); Int_t GetDebugLevel( void ){ return fDebugModeLvl; }; /// Call this function when you want save unpacked data into the tree void WriteOutputToFile( Bool_t writeToFile=kTRUE ){ fWriteOutputDataToFile = writeToFile; }; private: TString fFileWithMapping; TKRATMapping *fKrattaMapping; TKRATRawEvent *fKratRaw_evt; TClonesArray *fKratRaw_evtCopy; ///Pointer to object from data be readed (how it looks in first unpacker) //TEvtBuffer *ffBuffer; //TClonesArray *ffBufferClone; Int_t fEventIndex; Int_t fDebugModeLvl; Bool_t fWriteOutputDataToFile; protected: virtual void Register(); public: ClassDef(KRATUnpack2, 0) }; #endif /// KRATUNPACK_2_H