Project
Loading...
Searching...
No Matches
MCCompLabel.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
12
#include "
SimulationDataFormat/MCCompLabel.h
"
13
#include <iomanip>
14
#include <ios>
15
#include <iostream>
16
#include <cassert>
17
#include <fmt/format.h>
18
19
namespace
o2
20
{
21
22
//_____________________________________________
23
std::ostream&
operator<<
(std::ostream& os,
MCCompLabel
const
&
c
)
24
{
25
// stream itself
26
if
(
c
.isValid()) {
27
os <<
'['
<<
c
.getSourceID() <<
'/'
<<
c
.getEventID() <<
'/'
28
<< (
c
.isFake() ?
'-'
:
'+'
) << std::setw(6) <<
c
.getTrackID() <<
']'
;
29
}
else
{
30
os << (
c
.isNoise() ?
"[noise]"
:
"[unset]"
);
31
}
32
return
os;
33
}
34
35
//_____________________________________________
36
std::string
MCCompLabel::asString
()
const
37
{
38
// describe itself
39
if
(
isValid
()) {
40
return
fmt::format(
"[{}/{}{}/{:6d}]"
,
getSourceID
(),
getEventID
(),
isFake
() ?
'-'
:
'+'
,
getTrackID
());
41
}
42
return
isNoise
() ?
"[noise]"
:
"[unset]"
;
43
}
44
45
//_____________________________________________
46
void
MCCompLabel::print
()
const
47
{
48
// print itself
49
std::cout << (
MCCompLabel
) *
this
<< std::endl;
50
}
51
52
}
// namespace o2
MCCompLabel.h
c
uint32_t c
Definition
RawData.h:2
o2::MCCompLabel
Definition
MCCompLabel.h:24
o2::MCCompLabel::isFake
bool isFake() const
Definition
MCCompLabel.h:78
o2::MCCompLabel::isNoise
bool isNoise() const
Definition
MCCompLabel.h:73
o2::MCCompLabel::getTrackID
int getTrackID() const
Definition
MCCompLabel.h:127
o2::MCCompLabel::print
void print() const
Definition
MCCompLabel.cxx:46
o2::MCCompLabel::getSourceID
int getSourceID() const
Definition
MCCompLabel.h:130
o2::MCCompLabel::getEventID
int getEventID() const
Definition
MCCompLabel.h:129
o2::MCCompLabel::isValid
bool isValid() const
Definition
MCCompLabel.h:75
o2::MCCompLabel::asString
std::string asString() const
Definition
MCCompLabel.cxx:36
o2
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...
Definition
BitstreamReader.h:24
o2::operator<<
std::ostream & operator<<(std::ostream &stream, o2::InteractionRecord const &ir)
Definition
InteractionRecord.cxx:25
DataFormats
simulation
src
MCCompLabel.cxx
Generated on Tue Feb 25 2025 17:02:54 for Project by
1.9.8