Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef __ONCSSUB_IDINTTV0_H__
0002 #define __ONCSSUB_IDINTTV0_H__
0003 
0004 #include "oncsSubevent.h"
0005 #include <vector>
0006 #include <set>
0007 #include <map>
0008 #include <algorithm>
0009 #include <functional>
0010 #include <stdint.h>
0011 
0012 
0013 #ifndef __CINT__
0014 class WINDOWSEXPORT oncsSub_idinttv0 : public  oncsSubevent_w2 {
0015 #else
0016 class  oncsSub_idinttv0 : public  oncsSubevent_w2 {
0017 #endif
0018 
0019 public:
0020   oncsSub_idinttv0( subevtdata_ptr);
0021   ~oncsSub_idinttv0();
0022 
0023   //int    iValue(const int fee, const int ch, const int sample);
0024   //  int    iValue(const int fee, const int ch, const int sample, const char *what);
0025   int    iValue(const int hit, const int field);
0026   long long    lValue(const int hit, const int field);
0027 
0028   int    iValue(const int , const int, const char * what);
0029 
0030   int    iValue(const int hit,const char * what);
0031   long long    lValue(const int hit,const char * what);
0032 
0033   void  dump ( OSTREAM& os = COUT) ;
0034 
0035 
0036 protected:
0037   int intt_decode ();
0038 
0039   static const int MAX_FEECOUNT =16;
0040   
0041   unsigned short reverseBits(const unsigned short x) const;
0042   unsigned short crc16(const unsigned int fee, const unsigned int index, const int  l) const;
0043   int intt_decode_hitlist (std::vector<unsigned int> &hitlist , const int fee);
0044 
0045   int _broken;
0046   
0047   int _is_decoded;
0048 
0049   struct intt_hit
0050   {
0051     unsigned long long bco;
0052     unsigned short fee;
0053     unsigned short channel_id;
0054     unsigned short chip_id;
0055     unsigned short adc;
0056     unsigned short FPHX_BCO;
0057     unsigned short full_FPHX;
0058     unsigned short full_ROC;
0059     unsigned short amplitude;
0060     unsigned short full_fphx;
0061     unsigned int event_counter;
0062     unsigned int word;
0063   };
0064 
0065     
0066   std::vector<unsigned int> fee_data[MAX_FEECOUNT];
0067   std::vector<intt_hit *> intt_hits;
0068   std::set<unsigned long long> BCO_List;
0069 
0070   // we make here a list of FEEs that we found associated with a given BCO
0071   std::map<unsigned long long, std::set<unsigned int>> FEE_BCO_Association;
0072   //  std::set<unsigned int> FEE_List;
0073 
0074 };
0075 
0076  
0077 #endif /* __ONCSSUB_IDINTTV0_H__ */