pflib v3.15.1-5-ge6391b0
Pretty Fine HGCROC Interaction Library
Loading...
Searching...
No Matches
MultiSampleECONDEventPacket.h
1#pragma once
2
3#include "pflib/packing/ECONDEventPacket.h"
4#include "pflib/packing/Reader.h"
5
6namespace pflib::packing {
7
9class SingleECONDRocErxMapping;
10
24 mutable ::pflib::logging::logger the_log_{::pflib::logging::get("decoding")};
27
28 public:
29 /*
30 * Corruption bits
31 *
32 * Index | Description
33 * ------|------------
34 * 0 | full packet header flag mismatch
35 std::array<bool, 1> corruption;
36 */
37
47 uint64_t timestamp;
49 const ECONDEventPacket& soi() const;
53 MultiSampleECONDEventPacket(int n_links);
60 void from(std::span<uint32_t> data, bool expect_ldmx_ror_header = false,
61 int only_econd = -1);
63 Reader& read(Reader& r);
64
67
71
87 void to_csv(std::ofstream& f,
88 const SingleECONDRocErxMapping* mapping = nullptr,
89 bool with_cm = false) const;
90};
91
92} // namespace pflib::packing
Single ECON-D event packet.
Definition ECONDEventPacket.h:30
Unpack an event that has potentially more than one sample collected from a single ECOND.
Definition MultiSampleECONDEventPacket.h:22
int subsys_id
subsystem ID
Definition MultiSampleECONDEventPacket.h:45
Reader & read(Reader &r)
read into this structure from the input Reader
Definition MultiSampleECONDEventPacket.cxx:157
void from(std::span< uint32_t > data, bool expect_ldmx_ror_header=false, int only_econd=-1)
unpack the given data into this structure
Definition MultiSampleECONDEventPacket.cxx:86
int n_links_
number of links connected to the ECOND
Definition MultiSampleECONDEventPacket.h:26
static const std::string to_csv_header_with_mapping
header string if using MultiSampleECONDEventPacket::to_csv with an input mapping
Definition MultiSampleECONDEventPacket.h:70
std::vector< ECONDEventPacket > samples
samples from ECOND stored in order of transmission
Definition MultiSampleECONDEventPacket.h:51
mutable::pflib::logging::logger the_log_
handle to logging source
Definition MultiSampleECONDEventPacket.h:24
int econd_id
ID for this econ.
Definition MultiSampleECONDEventPacket.h:41
static const std::string to_csv_header
header string if using MultiSampleECONDEventPacket::to_csv
Definition MultiSampleECONDEventPacket.h:66
const ECONDEventPacket & soi() const
get the sample of interest
Definition MultiSampleECONDEventPacket.cxx:192
void to_csv(std::ofstream &f, const SingleECONDRocErxMapping *mapping=nullptr, bool with_cm=false) const
write out all of the samples into the input CSV file
Definition MultiSampleECONDEventPacket.cxx:21
uint64_t timestamp
timestamp from RoR
Definition MultiSampleECONDEventPacket.h:47
int contrib_id
contributor ID
Definition MultiSampleECONDEventPacket.h:43
std::size_t i_soi
index of the sample of interest (SOI)
Definition MultiSampleECONDEventPacket.h:39
MultiSampleECONDEventPacket(int n_links)
constructor defining how many links are connected to this ECOND
Definition MultiSampleECONDEventPacket.cxx:10
Reading a raw data stream with some underlying backend.
Definition Reader.h:19
Mapping for link/channel IDs for single ECON-D collection.
Definition SingleECONDRocErxMapping.h:35
logger get(const std::string &name)
Gets a logger with the input name for its channel.
Definition Logging.cxx:24