Project
Loading...
Searching...
No Matches
InteractionRecord.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
12#include <iostream>
13#include <fmt/printf.h>
14
15namespace o2
16{
17
18std::string InteractionRecord::asString() const
19{
20 return isDummy() ? std::string{"NotSet"} : fmt::format("BCid: {:4d} Orbit: {:6d}", bc, orbit);
21}
22
23std::ostream& operator<<(std::ostream& stream, o2::InteractionRecord const& ir)
24{
25 stream << ir.asString();
26 return stream;
27}
28
30{
31 return isDummy() ? InteractionRecord::asString() : InteractionRecord::asString() + fmt::format(" |T in BC(ns): {:.3f}", timeInBCNS);
32}
33
34std::ostream& operator<<(std::ostream& stream, o2::InteractionTimeRecord const& ir)
35{
36 stream << ir.asString();
37 return stream;
38}
39
41{
42 std::cout << (*this) << std::endl;
43}
44
46{
47 std::cout << (*this) << std::endl;
48}
49
50} // namespace o2
GLuint GLuint stream
Definition glcorearb.h:1806
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
std::ostream & operator<<(std::ostream &stream, o2::InteractionRecord const &ir)
uint32_t orbit
LHC orbit.
std::string asString() const
uint16_t bc
bunch crossing ID of interaction
double timeInBCNS
time in NANOSECONDS relative to orbit/bc
o2::InteractionRecord ir(0, 0)