21 template <
typename T = std::u
int64_t>
22 struct TimestampDumper { T timestamp; };
25 TimestampDumper<T> dumpTimestamp(T timestamp)
26 {
return { timestamp }; }
29 std::ostream& operator<< (std::ostream& out, TimestampDumper<T> wrapper) {
30 T
const timestamp = wrapper.timestamp;
32 out << (timestamp / 1
'000'000
'000) << "."
33 << std::setfill('0
') << std::setw(9) << (timestamp % 1'000
'000'000)
42 struct TriggerIDdumper {
unsigned int ID; };
44 TriggerIDdumper dumpTriggerID(
unsigned int ID) {
return { ID }; }
46 std::ostream&
operator<< (std::ostream& out, TriggerIDdumper wrapper) {
47 unsigned int const ID = wrapper.ID;
55 struct TriggerCountDumper {
unsigned int count; };
57 TriggerCountDumper dumpTriggerCount(
unsigned int count) {
return { count }; }
59 std::ostream&
operator<< (std::ostream& out, TriggerCountDumper wrapper) {
60 unsigned int const count = wrapper.count;
68 long long int timestampDiff(std::uint64_t timestamp, std::uint64_t ref) {
69 return static_cast<long long int>
70 ((timestamp > ref)? (timestamp - ref): (ref - timestamp));
76 struct LVDSmaskDumper { std::uint64_t bits; };
78 LVDSmaskDumper dumpLVDSmask(std::uint64_t bits) {
return { bits }; }
80 std::ostream&
operator<< (std::ostream& out, LVDSmaskDumper wrapper) {
81 std::uint64_t
const bits { wrapper.bits };
83 auto dumpBoard = [&out](std::uint8_t bits)
85 static constexpr
char symbols[2] = {
'-',
'x' };
86 std::uint8_t
mask = 0x80;
87 do { out << symbols[(bits & mask)? 1: 0]; } while (mask >>= 1);
89 auto boardBits = [](std::uint64_t bits,
short int board) -> std::uint8_t
90 {
return static_cast<std::uint8_t
>((bits >> (board * 8)) & 0xFF); };
93 dumpBoard(boardBits(bits, 6));
95 dumpBoard(boardBits(bits, 5));
97 dumpBoard(boardBits(bits, 4));
100 dumpBoard(boardBits(bits, 2));
102 dumpBoard(boardBits(bits, 1));
104 dumpBoard(boardBits(bits, 0));
123 <<
"trigger ID=" << dumpTriggerID(info.
triggerID)
127 <<
" on beam gate ID=" << dumpTriggerID(info.
gateID)
134 <<
" ns before the gate)"
136 <<
"counts from this source: trigger="
138 <<
" beam=" << dumpTriggerCount(info.
gateCount)
140 <<
"previous trigger from this source at "
142 <<
", triggers since: "
148 <<
" from this same source)"
150 <<
"most recent trigger was from source "
165 <<
" gates from any source have opened since"
168 out <<
"\nCorrection applied to the timestamps: "
172 out <<
"\nLocation(s) of trigger:";
176 out <<
"\nWest cryostat: "
177 << info.
cryostats[ExtraTriggerInfo::WestCryostat].triggerCount
179 if (
auto const& cryo = info.
cryostats[ExtraTriggerInfo::WestCryostat];
184 << dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::WestPMTwall])
186 << dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::EastPMTwall])
190 out <<
"\nEast cryostat: "
191 << info.
cryostats[ExtraTriggerInfo::EastCryostat].triggerCount
193 if (
auto const& cryo = info.
cryostats[ExtraTriggerInfo::EastCryostat];
198 << dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::WestPMTwall])
200 << dumpLVDSmask(cryo.LVDSstatus[ExtraTriggerInfo::EastPMTwall])
then echo echo For and will not be changed by echo further linking echo echo B echo The symbol is in the uninitialized data multiple common symbols may appear with the echo same name If the symbol is defined the common echo symbols are treated as undefined references For more echo details on common symbols
std::ostream & operator<<(std::ostream &out, sbn::PMTconfiguration const &config)
Prints the configuration into a stream with default verbosity.
std::string bitName(triggerSource bit)
Returns a mnemonic short name of the beam type.
constexpr mask_t< EnumType > mask(EnumType bit, OtherBits...otherBits)
Returns a mask with all specified bits set.
static const std::vector< std::string > names
std::size_t count(Cont const &cont)
std::ostream & operator<<(std::ostream &out, lar::example::CheatTrack const &track)