gaps-online-software 0.10
online software for the TOF system for the GAPS experiment
Loading...
Searching...
No Matches
tof_event_header.hpp
1#ifndef TOFHEADER_H_DEFINED
2#define TOFHEADER_H_DEFINED
3
4#include "tof_typedefs.h"
5
7 static const u16 HEAD = 0xAAAA;
8 static const u16 TAIL = 0x5555;
10 static const usize SIZE = 47;
11
12 u32 run_id ;
13 u32 event_id ;
17 u16 timestamp16 ; // -> 14 byres
18
19 // reconstructed quantities
20 u16 primary_beta ;
21 u16 primary_beta_unc ;
22 u16 primary_charge ;
23 u16 primary_charge_unc ;
24 u16 primary_outer_tof_x ;
25 u16 primary_outer_tof_y ;
26 u16 primary_outer_tof_z ;
27 u16 primary_inner_tof_x ;
28 u16 primary_inner_tof_y ;
29 u16 primary_inner_tof_z ; //-> 20bytes primary
30
31 u8 nhit_outer_tof ;
32 // no need to save this, can be
33 // rereated from paddle_info.size() - nhit_outer_tof
34 u8 nhit_inner_tof ;
35
36 u8 trigger_info ;
37 u8 ctr_etx ;
38
39 // this field can be debated
40 // the reason we have it is
41 // that for de/serialization,
42 // we need to know the length
43 // of the expected bytestream.
44 u8 n_paddles ; // we don't have more than
45 // 256 paddles.
46
48 std::string to_string() const;
49
51 f64 get_timestamp48() const;
52
53 static TofEventHeader from_bytestream(const Vec<u8> &stream,
54 u64 &pos);
55
56}; // end TofEventHeader
57
58std::ostream& operator<<(std::ostream& os, const TofEventHeader& h);
59
60#endif
Definition tof_event_header.hpp:6
f64 get_timestamp48() const
get the timestamp
u32 timestamp32
Definition tof_event_header.hpp:16
static const usize SIZE
fixed size including head and tail
Definition tof_event_header.hpp:10
std::string to_string() const
String representation for printing to output.