00001 // Dear emacs, this is -*- c++ -*- 00002 // $Id: BunchCrossing.h 618129 2014-09-23 11:37:00Z krasznaa $ 00003 #ifndef TRIGBUNCHCROSSINGTOOL_BUNCHCROSSING_H 00004 #define TRIGBUNCHCROSSINGTOOL_BUNCHCROSSING_H 00005 00006 // System include(s): 00007 #include <iosfwd> 00008 00009 // Gaudi/Athena include(s): 00010 #include "AsgTools/MsgStream.h" 00011 00012 namespace Trig { 00013 00028 class BunchCrossing { 00029 00030 public: 00032 BunchCrossing( int bcid = 0, float intBeam1 = 1.0, float intBeam2 = 1.0 ); 00034 BunchCrossing( unsigned int bcid, float intBeam1 = 1.0, 00035 float intBeam2 = 1.0 ); 00037 BunchCrossing( const BunchCrossing& parent ); 00038 00040 BunchCrossing& operator=( const BunchCrossing& parent ); 00041 00043 static const int BUNCH_SPACING; 00045 static const int MAX_BCID; 00046 00048 operator int&(); 00050 operator const int&() const; 00051 00053 BunchCrossing& operator+= ( const BunchCrossing& bc ); 00055 BunchCrossing& operator-= ( const BunchCrossing& bc ); 00056 00058 BunchCrossing& operator++ (); 00060 BunchCrossing operator++ ( int ); 00061 00063 BunchCrossing& operator-- (); 00065 BunchCrossing operator-- ( int ); 00066 00068 int distance( const BunchCrossing& bc ) const; 00070 int gapFrom( const BunchCrossing& bc ) const; 00072 int gapTo( const BunchCrossing& bc ) const; 00073 00075 int bcid() const; 00077 void setBCID( int bcid ); 00078 00080 float intensityBeam1() const; 00082 void setIntensityBeam1( float intensity ); 00083 00085 float intensityBeam2() const; 00087 void setIntensityBeam2( float intensity ); 00088 00090 bool operator== ( const BunchCrossing& bc ) const; 00091 00092 private: 00093 int m_bcid; 00094 00095 float m_intensityBeam1; 00097 float m_intensityBeam2; 00098 00099 }; // class BunchCrossing 00100 00102 BunchCrossing operator+ ( const BunchCrossing& bc1, const BunchCrossing& bc2 ); 00104 BunchCrossing operator- ( const BunchCrossing& bc1, const BunchCrossing& bc2 ); 00105 00107 int distance( const BunchCrossing bc1, const BunchCrossing bc2 ); 00108 00109 } // namespace Trig 00110 00112 std::ostream& operator<< ( std::ostream& out, const Trig::BunchCrossing& bc ); 00114 MsgStream& operator<< ( MsgStream& out, const Trig::BunchCrossing& bc ); 00115 00116 #endif // TRIGBUNCHCROSSINGTOOL_BUNCHCROSSING_H