00001
00002
00003 #ifndef TRIGBUNCHCROSSINGTOOL_BUNCHTRAIN_H
00004 #define TRIGBUNCHCROSSINGTOOL_BUNCHTRAIN_H
00005
00006
00007 #include <set>
00008 #include <iosfwd>
00009
00010
00011 #include "AsgTools/MsgStream.h"
00012
00013
00014 #include "TrigBunchCrossingTool/BunchCrossing.h"
00015
00016 namespace Trig {
00017
00030 class BunchTrain : public std::set< BunchCrossing > {
00031
00032 public:
00034 BunchTrain();
00036 BunchTrain( const BunchTrain& parent );
00037
00039 BunchTrain& operator= ( const BunchTrain& rhs );
00040
00042 int spacing() const;
00044 int distance( const BunchCrossing& bc ) const;
00046 bool isInside( const BunchCrossing& bc ) const;
00047
00049 const_iterator train_front() const;
00051 const_iterator train_back() const;
00052
00054 bool validate();
00055
00056 private:
00057 int m_spacing;
00058 const_iterator m_front;
00059 const_iterator m_back;
00060 bool m_gapFound;
00061
00062 };
00063
00065 bool operator< ( const BunchTrain& bt1, const BunchTrain& bt2 );
00066
00067 }
00068
00070 std::ostream& operator<< ( std::ostream& stream, const Trig::BunchTrain& bt );
00072 MsgStream& operator<< ( MsgStream& stream, const Trig::BunchTrain& bt );
00073
00074 #endif // TRIGBUNCHCROSSINGTOOL_BUNCHTRAIN_H