ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
oncsSub_idmvtxv1.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file oncsSub_idmvtxv1.h
1 #ifndef __ONCSSUB_IDMVTXV1_H__
2 #define __ONCSSUB_IDMVTXV1_H__
3 
4 #include "oncsSubevent.h"
5 #include <vector>
6 
7 #ifndef __CINT__
9 #else
10  class oncsSub_idmvtxv1 : public oncsSubevent_w4 {
11 #endif
12 
13 #define IDMVTXV1_MAXRUID 4
14 #define IDMVTXV1_RUHEADER 0xE0
15 #define IDMVTXV1_RUTRAILER 0xF0
16 #define IDMVTXV1_MAXRUCHN 28
17 
18  public:
21 
22  int iValue(const int ruid, const char *what);
23  int iValue(const int ruid);
24  int iValue(const int ruid, const int ruchn, const char *what);
25  int iValue(const int ruid, const int ruchn);
26  int iValue(const int ruid, const int ruchn, const int i);
27 
28  //max 24 RUs
29  //max 28 ruchn/RU (each is a chip)
30  //ruid, what -> RU info
31  //ruid -> chn mask
32  //ruid, ruchn, what -> chip info
33  //ruid, ruchn -> chip hit count
34  //ruid, ruchn, i -> hit info
35  //hit info: 32 bits, 1024x512 -> 9 bits row, 10 bits col
36 
37  void dump ( OSTREAM& os = COUT) ;
38  void gdump ( const int how=EVT_HEXADECIMAL, OSTREAM& os = COUT) const; // add this to override the generic gdump
39 
40  int encode_hit(unsigned short row, unsigned short col) const;
41  unsigned short decode_row(int hit) const;
42  unsigned short decode_col(int hit) const;
43  bool mask_contains_ruchn(int mask, int ruchn);
44 
45  protected:
46  int *mvtx_decode ();
47 
49 
51 
52  std::vector<int> _hit_vectors[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
53 
56  int _bad_ruchns[IDMVTXV1_MAXRUID+1];
57  int _lanes_active[IDMVTXV1_MAXRUID+1];
58  int _lane_stops[IDMVTXV1_MAXRUID+1];
59  int _lane_timeouts[IDMVTXV1_MAXRUID+1];
60  int _chip_id[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
61  int _bad_bytes[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
62  int _excess_bytes[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
63  int _bunchcounter[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
64  bool _header_found[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
65  bool _trailer_found[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
66  int _readout_flags[IDMVTXV1_MAXRUID+1][IDMVTXV1_MAXRUCHN+1];
67 
68  int decode_thebit(int the_row, int encoder_id, int address) const; //helper function to decode the column number
69  void print_stuff(OSTREAM& out, unsigned int data, int width, int shift, bool blank = false) const;
70  };
71 
72 
73 
74 #endif /* __ONCSSUB_IDMVTXV1_H__ */