Project
Loading...
Searching...
No Matches
MCEventLabel.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.
11
13#include <iomanip>
14#include <ios>
15#include <iostream>
16#include <cassert>
17#include <fmt/format.h>
18
19using namespace o2;
20
21//_____________________________________________
23{
24 // print itself
25 std::cout << (MCEventLabel) * this << std::endl;
26}
27
28//_____________________________________________
29std::string MCEventLabel::asString() const
30{
31 // stream itself
32 return isSet() ? fmt::format("[{}/{}/{}]", getSourceID(), getEventID(), getCorrWeight()) : "[unset]";
33}
34
35//_____________________________________________
36std::ostream& operator<<(std::ostream& os, const o2::MCEventLabel& c)
37{
38 // stream itself
39 if (c.isSet()) {
40 os << '[' << c.getSourceID() << '/' << c.getEventID() << '/' << c.getCorrWeight() << ']';
41 } else {
42 os << "[unset]";
43 }
44 return os;
45}
uint32_t c
Definition RawData.h:2
bool isSet() const
void print() const
std::string asString() const
float getCorrWeight() const
int getSourceID() const
int getEventID() const
MCEventLabel()=default
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)