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
18#ifndef GPUCA_ALIGPUCODE
19
20std::string InteractionRecord::asString() const
21{
22 return isDummy() ? std::string{"NotSet"} : fmt::format("BCid: {:4d} Orbit: {:6d}", bc, orbit);
23}
24
25std::ostream& operator<<(std::ostream& stream, o2::InteractionRecord const& ir)
26{
27 stream << ir.asString();
28 return stream;
29}
30
32{
33 return isDummy() ? InteractionRecord::asString() : InteractionRecord::asString() + fmt::format(" |T in BC(ns): {:.3f}", timeInBCNS);
34}
35
36std::ostream& operator<<(std::ostream& stream, o2::InteractionTimeRecord const& ir)
37{
38 stream << ir.asString();
39 return stream;
40}
41
43{
44 std::cout << (*this) << std::endl;
45}
46
48{
49 std::cout << (*this) << std::endl;
50}
51
52#endif
53
54} // 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)