Back to home page

sPhenix code displayed by LXR

 
 

    


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

0001 #ifndef __ONCSSUB_IDMVTXV1_H__
0002 #define __ONCSSUB_IDMVTXV1_H__
0003 
0004 #include "oncsSubevent.h"
0005 #include <vector>
0006 
0007 #ifndef __CINT__
0008 class WINDOWSEXPORT oncsSub_idmvtxv1 : public  oncsSubevent_w4 {
0009 #else
0010     class  oncsSub_idmvtxv1 : public  oncsSubevent_w4 {
0011 #endif
0012 
0013 #define IDMVTXV1_MAXRUID       4
0014 #define IDMVTXV1_RUHEADER      0xE0
0015 #define IDMVTXV1_RUTRAILER     0xF0
0016 #define IDMVTXV1_MAXRUCHN      28
0017 
0018         public:
0019             oncsSub_idmvtxv1( subevtdata_ptr);
0020             ~oncsSub_idmvtxv1();
0021 
0022             int    iValue(const int ruid, const char *what);
0023             int    iValue(const int ruid);
0024             int    iValue(const int ruid, const int ruchn, const char *what);
0025             int    iValue(const int ruid, const int ruchn);
0026             int    iValue(const int ruid, const int ruchn, const int i);
0027 
0028             //max 24 RUs
0029             //max 28 ruchn/RU (each is a chip)
0030             //ruid, what -> RU info
0031             //ruid -> chn mask
0032             //ruid, ruchn, what -> chip info
0033             //ruid, ruchn -> chip hit count
0034             //ruid, ruchn, i -> hit info
0035             //hit info: 32 bits, 1024x512 -> 9 bits row, 10 bits col
0036 
0037             void  dump ( OSTREAM& os = COUT) ;
0038             void  gdump ( const int how=EVT_HEXADECIMAL, OSTREAM& os = COUT) const; // add this to override the generic gdump
0039 
0040             int encode_hit(unsigned short row, unsigned short col) const;
0041             unsigned short decode_row(int hit) const;
0042             unsigned short decode_col(int hit) const;
0043             bool mask_contains_ruchn(int mask, int ruchn);
0044 
0045         protected:
0046             int *mvtx_decode ();
0047 
0048             int _is_decoded;
0049 
0050             int _highest_ruid;
0051 
0052             std::vector<int> _hit_vectors[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
0053 
0054             int _unexpected_felix_counters;
0055             int _bad_ruids;
0056             int _bad_ruchns[IDMVTXV1_MAXRUID+1];
0057             int _lanes_active[IDMVTXV1_MAXRUID+1];
0058             int _lane_stops[IDMVTXV1_MAXRUID+1];
0059             int _lane_timeouts[IDMVTXV1_MAXRUID+1];
0060             int _chip_id[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
0061             int _bad_bytes[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
0062             int _excess_bytes[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
0063             int _bunchcounter[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
0064             bool _header_found[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
0065             bool _trailer_found[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
0066             int _readout_flags[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
0067 
0068             int decode_thebit(int the_row, int encoder_id, int address) const; //helper function to decode the column number
0069             void print_stuff(OSTREAM& out, unsigned int data, int width, int shift, bool blank = false) const;
0070     };
0071 
0072 
0073 
0074 #endif /* __ONCSSUB_IDMVTXV1_H__ */