ATLAS Offline Software
BunchCrossing.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: BunchCrossing.h 618129 2014-09-23 11:37:00Z krasznaa $
8 #ifndef TRIGBUNCHCROSSINGTOOL_BUNCHCROSSING_H
9 #define TRIGBUNCHCROSSINGTOOL_BUNCHCROSSING_H
10 
11 // System include(s):
12 #include <iosfwd>
13 
14 // Gaudi/Athena include(s):
15 #include "AsgMessaging/MsgStream.h"
16 
17 namespace Trig {
18 
33  class BunchCrossing {
34 
35  public:
37  BunchCrossing( int bcid = 0, float intBeam1 = 1.0, float intBeam2 = 1.0 );
39  BunchCrossing( unsigned int bcid, float intBeam1 = 1.0,
40  float intBeam2 = 1.0 );
43 
46 
48  static const int BUNCH_SPACING;
50  static const int MAX_BCID;
51 
53  operator int&();
55  operator const int&() const;
56 
61 
66 
71 
73  int distance( const BunchCrossing& bc ) const;
75  int gapFrom( const BunchCrossing& bc ) const;
77  int gapTo( const BunchCrossing& bc ) const;
78 
80  int bcid() const;
82  void setBCID( int bcid );
83 
85  float intensityBeam1() const;
87  void setIntensityBeam1( float intensity );
88 
90  float intensityBeam2() const;
92  void setIntensityBeam2( float intensity );
93 
95  bool operator== ( const BunchCrossing& bc ) const;
96 
97  private:
98  int m_bcid;
99  float m_intensityBeam1;
103 
104  }; // class BunchCrossing
105 
107  BunchCrossing operator+ ( const BunchCrossing& bc1, const BunchCrossing& bc2 );
109  BunchCrossing operator- ( const BunchCrossing& bc1, const BunchCrossing& bc2 );
110 
112  int distance( const BunchCrossing bc1, const BunchCrossing bc2 );
113 
114 } // namespace Trig
115 
117 std::ostream& operator<< ( std::ostream& out, const Trig::BunchCrossing& bc );
119 MsgStream& operator<< ( MsgStream& out, const Trig::BunchCrossing& bc );
120 
121 #endif // TRIGBUNCHCROSSINGTOOL_BUNCHCROSSING_H
Trig::BunchCrossing::setIntensityBeam1
void setIntensityBeam1(float intensity)
Set the "intensity" of beam 1 in this bunch crossing.
Definition: BunchCrossing.cxx:300
Trig::BunchCrossing::operator++
BunchCrossing & operator++()
Operator pushing the object to the next bunch crossing.
Definition: BunchCrossing.cxx:164
Trig::BunchCrossing::gapFrom
int gapFrom(const BunchCrossing &bc) const
Distance from a previous bunch crossing.
Definition: BunchCrossing.cxx:238
Trig::BunchCrossing::MAX_BCID
static const int MAX_BCID
The maximum number of bunches that can be in the LHC.
Definition: BunchCrossing.h:50
Trig::BunchCrossing::operator=
BunchCrossing & operator=(const BunchCrossing &parent)
Assignment operator.
Definition: BunchCrossing.cxx:88
Trig
The common trigger namespace for trigger analysis tools.
Definition: CaloTowerVecMon.h:44
Trig::BunchCrossing::m_intensityBeam1
float m_intensityBeam1
Intensity of the bunch in "beam 1" some measure.
Definition: BunchCrossing.h:100
Trig::BunchCrossing::m_intensityBeam2
float m_intensityBeam2
Intensity of the bunch in "beam 2" some measure.
Definition: BunchCrossing.h:102
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
Trig::distance
int distance(const BunchCrossing bc1, const BunchCrossing bc2)
I need this function only for technical reasons.
Definition: BunchCrossing.cxx:402
Trig::BunchCrossing::operator==
bool operator==(const BunchCrossing &bc) const
Equality operator for bunch crossings.
Definition: BunchCrossing.cxx:354
Trig::BunchCrossing::BUNCH_SPACING
static const int BUNCH_SPACING
Minimum spacing between the bunches, in nanoseconds.
Definition: BunchCrossing.h:48
Trig::BunchCrossing::m_bcid
int m_bcid
The BCID of this bunch crossing.
Definition: BunchCrossing.h:98
Trig::BunchCrossing::setIntensityBeam2
void setIntensityBeam2(float intensity)
Set the "intensity" of beam 2 in this bunch crossing.
Definition: BunchCrossing.cxx:330
Trig::BunchCrossing::bcid
int bcid() const
Get the BCID of this bunch crossing.
Definition: BunchCrossing.cxx:267
Trig::BunchCrossing::distance
int distance(const BunchCrossing &bc) const
The distance from another bunch crossing.
Definition: BunchCrossing.cxx:216
test_pyathena.parent
parent
Definition: test_pyathena.py:15
Trig::BunchCrossing::intensityBeam1
float intensityBeam1() const
Get the "intensity" of beam 1 in this bunch crossing.
Definition: BunchCrossing.cxx:291
Trig::BunchCrossing::BunchCrossing
BunchCrossing(int bcid=0, float intBeam1=1.0, float intBeam2=1.0)
Constructor with a value.
Definition: BunchCrossing.cxx:33
Trig::BunchCrossing::intensityBeam2
float intensityBeam2() const
Get the "intensity" of beam 2 in this bunch crossing.
Definition: BunchCrossing.cxx:321
operator<<
std::ostream & operator<<(std::ostream &out, const Trig::BunchCrossing &bc)
Output operator for printing BunchCrossing objects.
Definition: BunchCrossing.cxx:417
Trig::operator+
BunchCrossing operator+(const BunchCrossing &bc1, const BunchCrossing &bc2)
Convenience operator taking advantage of the += operator defined in the BunchCrossing class.
Definition: BunchCrossing.cxx:367
Trig::BunchCrossing::operator--
BunchCrossing & operator--()
Operator pushing the object to the previous bunch crossing.
Definition: BunchCrossing.cxx:188
Trig::BunchCrossing::setBCID
void setBCID(int bcid)
Set the BCID of this bunch crossing.
Definition: BunchCrossing.cxx:278
Trig::BunchCrossing::operator-=
BunchCrossing & operator-=(const BunchCrossing &bc)
Operator subtracting another BunchCrossing object.
Definition: BunchCrossing.cxx:148
Trig::BunchCrossing
A smart integer class representing bunch crossings.
Definition: BunchCrossing.h:33
Trig::BunchCrossing::gapTo
int gapTo(const BunchCrossing &bc) const
Distance to a following bunch crossing.
Definition: BunchCrossing.cxx:255
Trig::BunchCrossing::operator+=
BunchCrossing & operator+=(const BunchCrossing &bc)
Operator adding another BunchCrossing object.
Definition: BunchCrossing.cxx:131
Trig::operator-
BunchCrossing operator-(const BunchCrossing &bc1, const BunchCrossing &bc2)
Convenience operator taking advantage of the -= operator defined in the BunchCrossing class.
Definition: BunchCrossing.cxx:383
MsgStream.h