ATLAS Offline Software
BunchTrain.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 // $Id: BunchTrain.h 618129 2014-09-23 11:37:00Z krasznaa $
8 #ifndef TRIGBUNCHCROSSINGTOOL_BUNCHTRAIN_H
9 #define TRIGBUNCHCROSSINGTOOL_BUNCHTRAIN_H
10 
11 // System include(s):
12 #include <set>
13 #include <iosfwd>
14 
15 // Gaudi/Athena include(s):
16 #include "AsgMessaging/MsgStream.h"
17 
18 // Local include(s):
20 
21 namespace Trig {
22 
35  class BunchTrain : public std::set< BunchCrossing > {
36 
37  public:
39  BunchTrain();
41  BunchTrain( const BunchTrain& parent );
42 
44  BunchTrain& operator= ( const BunchTrain& rhs );
45 
47  int spacing() const;
49  int distance( const BunchCrossing& bc ) const;
51  bool isInside( const BunchCrossing& bc ) const;
52 
54  const_iterator train_front() const;
56  const_iterator train_back() const;
57 
59  bool validate();
60 
61  private:
62  int m_spacing;
63  const_iterator m_front;
64  const_iterator m_back;
65  bool m_gapFound;
66 
67  }; // class BunchTrain
68 
70  bool operator< ( const BunchTrain& bt1, const BunchTrain& bt2 );
71 
72 } // namespace Trig
73 
75 std::ostream& operator<< ( std::ostream& stream, const Trig::BunchTrain& bt );
77 MsgStream& operator<< ( MsgStream& stream, const Trig::BunchTrain& bt );
78 
79 #endif // TRIGBUNCHCROSSINGTOOL_BUNCHTRAIN_H
Trig::BunchTrain
A smart set of BunchCrossing objects.
Definition: BunchTrain.h:35
Trig::BunchTrain::isInside
bool isInside(const BunchCrossing &bc) const
Check if a bunch crossing is inside this train.
Definition: BunchTrain.cxx:125
Trig
The common trigger namespace for trigger analysis tools.
Definition: CaloTowerVecMon.h:44
Trig::BunchTrain::m_front
const_iterator m_front
Iterator pointing to the first bunch.
Definition: BunchTrain.h:63
Trig::BunchTrain::validate
bool validate()
Check the spacing of the bunches in the train.
Definition: BunchTrain.cxx:205
Trig::BunchTrain::train_back
const_iterator train_back() const
Iterator pointing to the last bunch in the train.
Definition: BunchTrain.cxx:185
AthenaPoolTestWrite.stream
string stream
Definition: AthenaPoolTestWrite.py:12
BunchCrossing.h
Trig::BunchTrain::operator=
BunchTrain & operator=(const BunchTrain &rhs)
Assignment operator.
Definition: BunchTrain.cxx:42
Trig::BunchTrain::m_gapFound
bool m_gapFound
Flag specifying if the train spreads over the "BCID turnover".
Definition: BunchTrain.h:65
Trig::BunchTrain::m_spacing
int m_spacing
Spacing of the bunches in nanoseconds.
Definition: BunchTrain.h:62
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trig::operator<
bool operator<(const BunchTrain &bt1, const BunchTrain &bt2)
This operator is here to be able to put BunchTrain objects into ordered containers like std::set and ...
Definition: BunchTrain.cxx:277
Trig::BunchTrain::distance
int distance(const BunchCrossing &bc) const
"Distance" of a bunch crossing from this bunch train
Definition: BunchTrain.cxx:92
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:224
Trig::BunchTrain::BunchTrain
BunchTrain()
Default constructor.
Definition: BunchTrain.cxx:22
Trig::BunchTrain::spacing
int spacing() const
Spacing of the bunches in this train in nanoseconds.
Definition: BunchTrain.cxx:75
Trig::BunchTrain::train_front
const_iterator train_front() const
Iterator pointing to the first bunch in the train.
Definition: BunchTrain.cxx:165
Trig::BunchTrain::m_back
const_iterator m_back
Iterator pointing to the last bunch.
Definition: BunchTrain.h:64
Trig::BunchCrossing
A smart integer class representing bunch crossings.
Definition: BunchCrossing.h:33
operator<<
std::ostream & operator<<(std::ostream &stream, const Trig::BunchTrain &bt)
Output operator for BunchTrain objects.
Definition: BunchTrain.cxx:295
MsgStream.h