SCC/TFndSCCRaw.h

00001 // @(#)fROOT/SCC:$Name:  $:$Id: TFndSCCRaw.h,v 1.16 2007/09/05 10:34:58 Diego_Faso Exp $
00002 // Author: Diego Faso <mailto:faso@to.infn.it>, 2006/03/03
00003 
00004 #ifndef FROOT_TFndSCCRaw
00005 #define FROOT_TFndSCCRaw
00006 
00008 //                                                                 //
00009 //  Class for the FINUDA Slow Control Raw events decoding/encoding //
00010 //                                                                 //
00012 
00013 //#include <Riostream.h>
00014 
00015 /* #include "Scc.h" */
00016 #include "TFndSlowCntSilRecode.h"
00017 
00018 /* using namespace FROOT; */
00019 /* using namespace Scc; */
00020 
00021 class TFndSCCRaw: public TObject
00022 {
00023  protected:
00024   
00025   UInt_t fEvCounter;
00026 
00027   UInt_t fGlobalHdr[K_SCC_HDR_SIZE/4];
00028   UInt_t fGlobalEvent[K_N_SLOWS * K_SLOW_SOCK_LEN]; // complete event buffer (to be saved)
00029 
00030   UInt_t fSingleRawData[K_N_SLOWS][K_SLOW_SOCK_LEN]; // raw data buffers
00031 
00032   Int_t fDataReady[K_N_SLOWS]; // values ===>  0:not ready; >0:number of received data from last reset
00033 
00034   TString fMsgPart[K_N_SLOWS];
00035   UInt_t fMiscArray[K_N_SLOWS][K_MISC_MAX_SIZE];
00036   TDatime fDatime[K_N_SLOWS];
00037 
00038   TFndSlowCntSilRecode *fSilRecode; // used in order to re-encode the striong received from SIL
00039 
00040  private:
00041   void StoreMessagePart(Int_t slow_det); // store message parts into the dedicated data member
00042   void StoreMiscPart(Int_t slow_det); // store miscellaneous information parts into the dedicated data member
00043 
00044  protected:
00045   Bool_t IsDataReady(const Int_t &slow_det);
00046 
00047  public:
00048   TFndSCCRaw();
00049   ~TFndSCCRaw();
00050   
00051   TFndSlowCntSilRecode *GetSilRecode() { return fSilRecode; }
00052 
00053   void SetSingleRawData(Int_t slow_det,UInt_t *DataArray,Int_t part = 0); // part is used by SIL only
00054   TString GetMessagePart(Int_t slow_det);
00055   UInt_t GetMiscInfo(Int_t slow_det,Int_t num); // num starts from zero
00056 
00057   Int_t GetChannelData(Int_t slow_det,Int_t ch,Bool_t &power,UInt_t &voltage,UInt_t &current,Bool_t &trip); // ch starts from 1
00058   static void DecodeDataElement(UInt_t entry,Bool_t &power,UInt_t &voltage,UInt_t &current,Bool_t &trip);
00059 
00060   static TString GetChannelName(Int_t slow_det,Int_t ch); // get channel name depending on the raw-data structure
00061   
00062   void PrintHeader(Int_t slow_det); // slow_det = -1  not accepted
00063   void PrintBuffer(Int_t slow_det); // slow_det = -1  not accepted
00064 
00065   // GLOBAL EVENT MANAGEMENT
00066   void PrintGlobalHeader();
00067 
00068  private:
00069   Int_t BuildGlobalHeader(TString &message);
00070  public:
00071   Int_t BuildGlobalEvent(TString &message);
00072 
00073   ClassDef(TFndSCCRaw,1)
00074 };
00075 
00076 #endif // FROOT_TFndSCCRaw

Generated on Tue Oct 16 15:40:48 2007 by  doxygen 1.5.2