Back to home page

sPhenix code displayed by LXR

 
 

    


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

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