Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
InttMapping.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file InttMapping.h
1 #ifndef INTT_MAPPING_H
2 #define INTT_MAPPING_H
3 
4 #include <cstdint>
5 #include <map>
6 
7 class Packet;
8 class InttRawHit;
9 
10 namespace InttNameSpace
11 {
12  extern const std::map<int, int> Packet_Id;
13  int FelixFromPacket(int);
14 
15  struct RawData_s
16  {
17  int felix_server = 0;
18  int felix_channel = 0;
19  int chip = 0;
20  int channel = 0;
21  };
22 
23  typedef uint32_t OnlineKey_t;
24  struct Online_s
25  {
26  int lyr = 0;
27  int ldr = 0;
28  int arm = 0;
29  int chp = 0;
30  int chn = 0;
31  };
32 
33  struct Offline_s
34  {
35  int layer = 0;
36  int ladder_phi = 0;
37  int ladder_z = 0;
38  int strip_x = 0;
39  int strip_y = 0;
40  };
41 
42  struct InttNameSpace::RawData_s RawFromPacket(int const, int const, Packet*);
44 
45  // nontrivial
46  struct Online_s ToOnline(struct Offline_s const&);
47  struct Offline_s ToOffline(struct Online_s const&);
48 
49  struct RawData_s ToRawData(struct Online_s const&);
50  struct Online_s ToOnline(struct RawData_s const&);
51 
52  // trivial
53  struct RawData_s ToRawData(struct Offline_s const&);
54  struct Offline_s ToOffline(struct RawData_s const&);
55 
57  {
58  bool operator()(struct RawData_s const&, struct RawData_s const&) const;
59  };
60 
62  {
63  bool operator()(struct Online_s const&, struct Online_s const&) const;
64  };
65 
67  {
68  bool operator()(struct Offline_s const&, struct Offline_s const&) const;
69  };
70 
71  // Eigen::Affine3d GetTransform(TTree*, struct Offline_s const&);
72  // Eigen::Vector4d GetLocalPos(struct Offline_s const&);
73 }; // namespace InttNameSpace
74 
75 bool operator==(struct InttNameSpace::RawData_s const&, struct InttNameSpace::RawData_s const&);
76 bool operator==(struct InttNameSpace::Online_s const&, struct InttNameSpace::Online_s const&);
77 bool operator==(struct InttNameSpace::Offline_s const&, struct InttNameSpace::Offline_s const&);
78 
79 bool operator!=(struct InttNameSpace::RawData_s const&, struct InttNameSpace::RawData_s const&);
80 bool operator!=(struct InttNameSpace::Online_s const&, struct InttNameSpace::Online_s const&);
81 bool operator!=(struct InttNameSpace::Offline_s const&, struct InttNameSpace::Offline_s const&);
82 
83 bool operator<(struct InttNameSpace::RawData_s const&, struct InttNameSpace::RawData_s const&);
84 bool operator<(struct InttNameSpace::Online_s const&, struct InttNameSpace::Online_s const&);
85 bool operator<(struct InttNameSpace::Offline_s const&, struct InttNameSpace::Offline_s const&);
86 
87 bool operator>(struct InttNameSpace::RawData_s const&, struct InttNameSpace::RawData_s const&);
88 bool operator>(struct InttNameSpace::Online_s const&, struct InttNameSpace::Online_s const&);
89 bool operator>(struct InttNameSpace::Offline_s const&, struct InttNameSpace::Offline_s const&);
90 
91 bool operator<=(struct InttNameSpace::RawData_s const&, struct InttNameSpace::RawData_s const&);
92 bool operator<=(struct InttNameSpace::Online_s const&, struct InttNameSpace::Online_s const&);
93 bool operator<=(struct InttNameSpace::Offline_s const&, struct InttNameSpace::Offline_s const&);
94 
95 bool operator>=(struct InttNameSpace::RawData_s const&, struct InttNameSpace::RawData_s const&);
96 bool operator>=(struct InttNameSpace::Online_s const&, struct InttNameSpace::Online_s const&);
97 bool operator>=(struct InttNameSpace::Offline_s const&, struct InttNameSpace::Offline_s const&);
98 
99 #endif // INTT_MAPPING_H
100 
101 // Ladder Structure //
102 //======================================//
103 // U14 U1 Type B North //
104 // U15 U2 . . //
105 // U16 U3 . . //
106 // U17 U4 . . //
107 // U18 U5 Type B . //
108 //------------------------------ . //
109 // U19 U6 Type A . //
110 // U20 U7 . . //
111 // U21 U8 . . //
112 // U22 U9 . . //
113 // U23 U10 . . //
114 // U24 U11 . . //
115 // U25 U12 . . //
116 // U26 U13 Type A North //
117 //--------------------------------------//
118 // U13 U26 Type A South //
119 // U12 U25 . . //
120 // U11 U24 . . //
121 // U10 U23 . . //
122 // U9 U22 . . //
123 // U8 U21 . . //
124 // U7 U20 . . //
125 // U6 U19 Type A . //
126 //------------------------------ . //
127 // U5 U18 Type B . //
128 // U4 U17 . . //
129 // U3 U16 . . //
130 // U2 U15 . . //
131 // U1 U14 Type B South //
132 //======================================//
133 
134 //|<- South | North ->|
135 //| B | A | A | B |
136 //+----------------+--------------------------+-------------------------+----------------+
137 //| 1 | 0 | 2 | 3 | ladder_z (offline)
138 //| 0 1 2 3 4 | 0 1 2 3 4 5 6 7 | 0 1 2 3 4 5 6 7 | 0 1 2 3 4 | strip_x (offline)
139 //+----------------+--------------------------+-------------------------+----------------+
140 //| 0 1 2 3 4 | 5 6 7 8 9 10 11 12 | 25 24 23 22 21 20 19 18 | 17 16 15 14 13 | chp (online)
141 //| 13 14 15 16 17 | 18 19 20 21 22 23 24 25 | 12 11 10 9 8 7 6 5 | 4 3 2 1 0 | chp (online)