ATLAS Offline Software
Loading...
Searching...
No Matches
PileUpTimeEventIndex.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4
5#include "GaudiKernel/GaudiException.h"
6#include "GaudiKernel/MsgStream.h"
8#include <cassert>
9
10#include <iostream>
11
12const std::string&
14 static const std::string typNam[PileUpTimeEventIndex::NTYPES + 1] =
15 {
16 "Unknown" /*-1*/, "Signal" /*0*/, "MinimumBias" /*1*/, "Cavern" /*2*/,
17 "HaloGas" /*3*/, "HighPtMinimumBias" /*4*/, "ZeroBias"/*5*/
18 };
19
20 assert(typ < PileUpTimeEventIndex::NTYPES);
21 return typNam[typ + 1];
22}
23
27 switch (uType) {
28 case 0: puType = PileUpTimeEventIndex::Signal;
29 break;
30
31 case 1: puType = PileUpTimeEventIndex::MinimumBias;
32 break;
33
34 case 2: puType = PileUpTimeEventIndex::Cavern;
35 break;
36
37 case 3: puType = PileUpTimeEventIndex::HaloGas;
38 break;
39
41 break;
42
43 case 5: puType = PileUpTimeEventIndex::ZeroBias;
44 break;
45
46 default:
47 std::ostringstream merr;
48 merr <<
49 "PileUpTimeEventIndex::ushortToType FATAL: invalid PileUpType specified "
50 << uType;
51 std::cerr << merr.str() << std::endl;
52 throw GaudiException(merr.str(), "PileUpTimeEventIndex::ushortToType", StatusCode::FAILURE);
53 }
54 return puType;
55}
56
58
61
64
67 m_time((short) time), m_index((short) index), m_type(typ) {}
68
69
72 return m_time;
73}
74
79
82 return m_type;
83}
84
85std::ostream&
86operator << (std::ostream& os,
87 const PileUpTimeEventIndex& idx) {
88 return os << "event xing time (ns): " << idx.time()
89 << " - PileUpEventInfo subevt index: " << idx.index()
90 << " - PileupEventInfo subevt type: " << PileUpTimeEventIndex::typeName(idx.type());
91}
92
93MsgStream&
94operator << (MsgStream& os,
95 const PileUpTimeEventIndex& idx) {
96 return os << "event xing time (ns): " << idx.time()
97 << " - PileUpEventInfo subevt index: " << idx.index()
98 << " - PileupEventInfo subevt type: " << PileUpTimeEventIndex::typeName(idx.type());
99}
unsigned int index_type
std::ostream & operator<<(std::ostream &os, const PileUpTimeEventIndex &idx)
Definition index.py:1
a struct encapsulating the identifier of a pile-up event
index_type index() const
the index of the component event in PileUpEventInfo
static PileUpType ushortToType(unsigned short)
PileUpType type() const
the pileup type - minbias, cavern, beam halo, signal?
time_type time() const
bunch xing time in ns
static const std::string & typeName(PileUpType typ)