pflib v3.15.1-5-ge6391b0
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
EcalECONTSample.h
1#pragma once
2#ifndef PFLIB_PACKING_ECALECONTCAPTUREFRAME_H
3#define PFLIB_PACKING_ECALECONTCAPTUREFRAME_H
4
5#include <bitset>
6#include <optional>
7
8#include "pflib/logging/Logging.h"
9#include "pflib/packing/ECONTCaptureHeader.h"
10#include "pflib/packing/Reader.h"
11
12namespace pflib::packing {
13
37 mutable ::pflib::logging::logger the_log_{::pflib::logging::get("decoding")};
38 static constexpr std::size_t N_TC = 18;
40 std::bitset<48> tc_ch_map_;
41 int sum_;
42 int bx_;
43
44 public:
45 static constexpr int WORD_LEN = 6;
46 void from(std::span<uint32_t> data);
48 int bx() const;
50 int sum() const;
52 int encoded_sum() const;
54 int encoded_tc(int i_tc) const;
56 int tc(int i_tc) const;
58 std::bitset<48> ch_map() const;
59 friend std::ostream& operator<<(std::ostream& o, const EcalECONTSample& self);
60};
61
62} // namespace pflib::packing
63
64#endif
Each Ecal ECON-T sample has the following struture, assuming.
Definition EcalECONTSample.h:36
std::bitset< 48 > ch_map() const
get the channel map showing which TC were included in readout
Definition EcalECONTSample.cxx:42
int encoded_sum() const
the raw value trasmitted by the ECON-T
Definition EcalECONTSample.cxx:40
int bx() const
bx counter for this sample of STC sums
Definition EcalECONTSample.cxx:36
int sum() const
decode the 5E+3M encoding into a linearized sum value
Definition EcalECONTSample.cxx:38
int tc(int i_tc) const
get TC sum for the input TC index
Definition EcalECONTSample.cxx:44
int encoded_tc(int i_tc) const
get TC encoded sum for the input TC index
logger get(const std::string &name)
Gets a logger with the input name for its channel.
Definition Logging.cxx:24