00001 /* Hey Emacs this is -*-C++-*- */ 00002 #ifndef EEfeeDataBlock_h 00003 #define EEfeeDataBlock_h 00004 /********************************************************************* 00005 * $Id: EEfeeDataBlock.h,v 1.12 2004/06/21 19:50:21 balewski Exp $ 00006 ********************************************************************* 00007 * Descripion: 00008 * STAR Endcap Electromagnetic Calorimeter Raw FEE Data Block 00009 ********************************************************************* 00010 */ 00011 #include "TObject.h" 00012 00013 class EEfeeDataBlock :public TObject { 00014 00015 public: 00016 enum { WRDCNT=0,ERRFLG=1,TOKEN=2,CRATE=3}; 00017 static const int DefaultMaxHead; 00018 static const int DefaultMaxData; 00019 00020 private: 00021 int MaxHead; 00022 int MaxData; 00023 UShort_t *head;//[MaxHead]; 00024 UShort_t *data;//[MaxData] 00025 UChar_t sanity;// encodes all corruptions, filled in fly 00026 00027 public: 00028 EEfeeDataBlock(); 00029 EEfeeDataBlock(const EEfeeDataBlock *b); 00030 00031 virtual ~EEfeeDataBlock(); 00032 void print(int flag=1); 00033 void clear(); 00034 void set (const EEfeeDataBlock *b); 00035 void setHead (const UShort_t* h ); 00036 void setData (int chan, UShort_t d); 00037 void setDataArray(const UShort_t *d, int size); 00038 00039 00040 UShort_t* getData() const { return data; }; 00041 UShort_t* getHead() const { return head; }; 00042 00043 int getDataLen() const { return MaxData; } 00044 int getValidDataLen() const {return getDataLen(); } //bckwd compat. 00045 int getHeadLen() const { return MaxHead; } 00046 00047 UShort_t getErrFlag() const { return head[ERRFLG] & 0x0FFF; } 00048 UShort_t getLenCount() const { return head[WRDCNT] & 0x0FFF; } 00049 UShort_t getToken() const { return head[TOKEN] & 0x0FFF; } 00050 UChar_t getTrigComm() const { return (head[CRATE] / 0x0100) &0x000F ; } 00051 UChar_t getCrateID() const { return head[CRATE] & 0x00FF ; } 00052 UChar_t getSanity() const { return sanity;} 00053 int getNData(int thres) const; 00054 void maskCrate() { sanity|=0x80;}// mark 7th (not used) bit 00055 void setCrateID(UShort_t id ) { head[CRATE]= (head[CRATE]&0xFF00) + ( id& 0x00FF);} 00056 int isValid() const {return !sanity;} 00057 UChar_t isHeadValid(int token, int crId, int len, int trigComm, int errFlag); 00058 00059 ClassDef(EEfeeDataBlock,3) // Endcap Emc event 00060 }; 00061 #endif 00062 00063 /* 00064 Date: Fri, 02 Apr 2004 00:10:36 -0500 00065 From: Gerard Visser <gvisser@iucf.indiana.edu> 00066 To: Jan Balewski <balewski@iucf.indiana.edu> 00067 Subject: Re: header 00068 00069 Hi Jan, 00070 First of all ALL numbers reported by ETOW and ESMD are 12-bits. DAQ 00071 reads them as 16, but only the 12 least significant come over the fiber. 00072 Tonko fills in the upper nibble with 0 but I don't know about any 00073 guarantees. 00074 The 0th word is the length count. ESMD has 192+4 words, length count is 00075 196=0x0c4. ETOW has 128+4 words, length count is 132=0xa4. 00076 The 1th word is the "error flags". 00077 The 2nd word is the token. 00078 The 3rd word is the trigger command nibble put together with the "RDO 00079 ID" or "crate ID". 00080 The 4th and following words are the data (ADC values). 00081 See 00082 http://www.iucf.indiana.edu/U/gvisser/STAR_EEMC/STAR_EEMC_DAQ_Data_Formats.pdf 00083 (page 2 for instance). 00084 00085 - Gerard 00086 00087 */ 00088 00089 00090 /* 00091 * $Log: EEfeeDataBlock.h,v $ 00092 * Revision 1.12 2004/06/21 19:50:21 balewski 00093 * mre detailed monitoring of data corruption 00094 * 00095 * Revision 1.11 2004/04/20 21:43:53 balewski 00096 * small change in data block header get now tagged 00097 * 00098 * Revision 1.10 2004/04/02 06:38:52 balewski 00099 * *** empty log message *** 00100 * 00101 * Revision 1.9 2004/03/25 16:54:59 balewski 00102 * cleanup of arguments 00103 * 00104 * Revision 1.8 2004/03/20 20:25:55 balewski 00105 * *** empty log message *** 00106 * 00107 * Revision 1.7 2004/01/27 15:13:57 balewski 00108 * it is tricky with BTOW 00109 * 00110 * Revision 1.6 2003/12/04 18:29:25 balewski 00111 * I forgot 00112 * 00113 * Revision 1.5 2003/12/02 17:22:08 balewski 00114 * fix after version mixup 00115 * 00116 * Revision 1.3 2003/11/24 05:40:55 balewski 00117 * new stuff for miniDaq 00118 * 00119 * Revision 1.2 2003/11/20 16:01:46 balewski 00120 * towars run 4 00121 * 00122 * Revision 1.1 2003/01/28 23:17:14 balewski 00123 * start 00124 * 00125 * Revision 1.5 2002/12/19 22:22:56 zolnie 00126 * fixed trig type bug 00127 * 00128 * Revision 1.4 2002/12/19 21:54:32 zolnie 00129 * updates for real fee data 00130 * 00131 * Revision 1.3 2002/12/04 19:13:16 zolnie 00132 * fixed bug in setData 00133 * 00134 * Revision 1.2 2002/12/03 23:48:52 zolnie 00135 * changed back to var length 00136 * 00137 * Revision 1.1 2002/11/30 20:04:37 balewski 00138 * start 00139 * 00140 * 00141 *********************************************************************/
1.5.9