ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
oncsSub_idmvtxv2.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file oncsSub_idmvtxv2.h
1 #ifndef __ONCSSUB_IDMVTXV2_H__
2 #define __ONCSSUB_IDMVTXV2_H__
3 
4 #include "oncsSubevent.h"
5 #include <vector>
6 
7 #ifndef __CINT__
9 #else
10  class oncsSub_idmvtxv2 : public oncsSubevent_w4 {
11 #endif
12 
13 #define IDMVTXV2_MAXRUID 8
14 #define IDMVTXV2_RUHEADER 0xE0
15 #define IDMVTXV2_RUTRAILER 0xF0
16 #define IDMVTXV2_MAXRUCHN 9
17 
18 #define NROW 512
19 #define NCOL 1024
20 
21 #define CHIPHEADER 1
22 #define CHIPEMPTYFRAME 2
23 #define DATASHORT 3
24 #define DATALONG0 4
25 #define DATALONG1 5
26 
27  public:
30 
31  int iValue(const int ruid, const char *what);
32  int iValue(const int ruid);
33  int iValue(const int ruid, const int ruchn, const char *what);
34  int iValue(const int ruid, const int ruchn);
35  int iValue(const int ruid, const int ruchn, const int i);
36 
37  //max 24 RUs
38  //max 28 ruchn/RU (each is a chip)
39  //ruid, what -> RU info
40  //ruid -> chn mask
41  //ruid, ruchn, what -> chip info
42  //ruid, ruchn -> chip hit count
43  //ruid, ruchn, i -> hit info
44  //hit info: 32 bits, 1024x512 -> 9 bits row, 10 bits col
45 
46  void dump ( OSTREAM& os = COUT) ;
47  void gdump ( const int how=EVT_HEXADECIMAL, OSTREAM& os = COUT) const; // add this to override the generic gdump
48 
49  int encode_hit(unsigned short row, unsigned short col) const;
50  unsigned short decode_row(int hit) const;
51  unsigned short decode_col(int hit) const;
52  bool mask_contains_ruchn(int mask, int ruchn);
53 
54  protected:
55  int *decode ();
56  bool checkBC(const int ruid);
57 
59 
62 
63  std::vector<int> _hit_vectors[IDMVTXV2_MAXRUID+1][IDMVTXV2_MAXRUCHN+1];
64 
67  int _bad_ruchns[IDMVTXV2_MAXRUID+1];
68  int _lanes_active[IDMVTXV2_MAXRUID+1];
69  int _lane_stops[IDMVTXV2_MAXRUID+1];
70  int _lane_timeouts[IDMVTXV2_MAXRUID+1];
71  int _inconsistent_bc[IDMVTXV2_MAXRUID+1];
72  int _chip_id[IDMVTXV2_MAXRUID+1][IDMVTXV2_MAXRUCHN+1];
73  int _bad_bytes[IDMVTXV2_MAXRUID+1][IDMVTXV2_MAXRUCHN+1];
74  int _excess_bytes[IDMVTXV2_MAXRUID+1][IDMVTXV2_MAXRUCHN+1];
75  int _bunchcounter[IDMVTXV2_MAXRUID+1][IDMVTXV2_MAXRUCHN+1];
76  bool _header_found[IDMVTXV2_MAXRUID+1][IDMVTXV2_MAXRUCHN+1];
77  bool _trailer_found[IDMVTXV2_MAXRUID+1][IDMVTXV2_MAXRUCHN+1];
78  int _readout_flags[IDMVTXV2_MAXRUID+1][IDMVTXV2_MAXRUCHN+1];
79 
80  void print_stuff(OSTREAM& out, unsigned int data, int width, int shift, bool blank = false) const;
81  };
82 
83 
84 
85 #endif /* __ONCSSUB_IDMVTXV2_H__ */