Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef __ONCSSUB_IDTPCFEEV2_H__
0002 #define __ONCSSUB_IDTPCFEEV2_H__
0003 
0004 #include "oncsSubevent.h"
0005 #include <vector>
0006 #include <set>
0007 #include <algorithm>
0008 #include <functional>
0009 
0010 #ifndef __CINT__
0011 class WINDOWSEXPORT oncsSub_idtpcfeev2 : public  oncsSubevent_w2 {
0012 #else
0013 class  oncsSub_idtpcfeev2 : public  oncsSubevent_w2 {
0014 #endif
0015 
0016 public:
0017   oncsSub_idtpcfeev2( subevtdata_ptr);
0018   ~oncsSub_idtpcfeev2();
0019 
0020   int    iValue(const int fee, const int ch, const int sample);
0021   int    iValue(const int fee, const int ch, const int sample, const char *what);
0022   int    iValue(const int ch, const int sample);
0023   int    iValue(const int , const int, const char * what);
0024   int    iValue(const int ,const char * what);
0025 
0026   void  dump ( OSTREAM& os = COUT) ;
0027 
0028 
0029 protected:
0030   int tpc_decode ();
0031 
0032   static const int MAX_FEECOUNT=8;
0033   static const int MAX_FEECHANNELS=256;
0034 
0035   
0036   unsigned short reverseBits(const unsigned short x) const;
0037   unsigned short crc16(const unsigned int fee, const unsigned int index, const int  l) const;
0038 
0039   int _broken;
0040   
0041   int _is_decoded;
0042 
0043   typedef struct
0044   {
0045     unsigned int bx_time;
0046     unsigned int bx_time_raw;
0047     unsigned short adc;
0048   } tpc_sample;
0049   
0050 
0051   unsigned int _max_samples[MAX_FEECOUNT];
0052   unsigned int _lowest_bx[MAX_FEECOUNT];
0053   unsigned int _highest_bx[MAX_FEECOUNT];
0054 
0055   std::vector<unsigned short> fee_data[MAX_FEECOUNT];
0056 
0057   //  std::vector<bx> fee_bx[MAX_FEECOUNT][MAX_FEECHANNELS]; 
0058   std::vector<tpc_sample> fee_samples[MAX_FEECOUNT][MAX_FEECHANNELS];  
0059 
0060 };
0061 
0062  
0063 #endif /* __ONCSSUB_IDTPCFEEV2_H__ */