Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-03 08:20:36

0001 #ifndef __ONCSSUB_IDDREAMV0_H__
0002 #define __ONCSSUB_IDDREAMV0_H__
0003 
0004 #include "oncsSubevent.h"
0005 #include "vector"
0006 #include "map"
0007 
0008 #define MAX_FEU 8
0009 
0010 
0011 #ifndef __CINT__
0012 class WINDOWSEXPORT oncsSub_iddreamv0 : public  oncsSubevent_w4 {
0013 #else
0014 class  oncsSub_iddreamv0 : public  oncsSubevent_w2 {
0015 #endif
0016 
0017 public:
0018   oncsSub_iddreamv0( subevtdata_ptr);
0019   ~oncsSub_iddreamv0();
0020 
0021   int    iValue(const int channel, const char *);
0022   int    iValue(const int channel, const int sample);   //treating the 8 dreams as 512 contiguous channels 
0023   int    iValue(const int dreamchip, const int sample, const char *);
0024   int    iValue(const int dreamchip, const int channel, const int sample);
0025 
0026 
0027   void  dump ( OSTREAM& os = COUT) ;
0028 
0029 protected:
0030   
0031   struct FEU_decoded_data
0032   {
0033     int _feu_id;
0034     int _feu_P;  // pedestal subtraction on 
0035     int _feu_C;  // common noise suppression
0036     int _feu_Z;  // zero-suppressed format
0037 
0038     int _nr_dreams;
0039     int _nr_samples;
0040     int _dream_enabled[8];
0041     int samples [8][64][255];
0042     unsigned long long  cellids [8][255];
0043     //  std::vector<short> feu_rawdata;
0044   };
0045   
0046 
0047 
0048 
0049   int *decode ( int *);
0050   //  int decode_payload (FEU_decoded_data *fd);
0051   int decode_payload ( unsigned short *d, const int size);
0052   int decode_dream( FEU_decoded_data *fd, unsigned short *d, const int size, const unsigned int sample_nr);
0053   int decode_dream( FEU_decoded_data *fd, const int offset, const int size, const unsigned int sample_nr);
0054 
0055   std::map<int,struct FEU_decoded_data *> feu_map; 
0056 
0057 
0058     
0059   int _nr_feus;
0060 
0061   int _is_decoded;
0062 
0063 
0064   
0065   unsigned short *swapped_array;
0066   
0067 };
0068 
0069 
0070 #endif /* __ONCSSUB_IDDREAMV0_H__ */