File indexing completed on 2023-03-17 10:41:31
0001 #ifndef METimeInterval_hh
0002 #define METimeInterval_hh
0003
0004 #include <list>
0005 #include <TString.h>
0006
0007 #include "../../interface/ME.h"
0008
0009 class METimeInterval
0010 {
0011 public:
0012
0013 static int instances;
0014
0015
0016 METimeInterval( ME::Time firstTime, ME::Time lastTime );
0017
0018
0019 void split( const std::list<ME::Time>& times );
0020
0021
0022 virtual ~METimeInterval();
0023
0024
0025 METimeInterval* get( ME::Time time, unsigned level=1000 );
0026
0027
0028 METimeInterval* first( unsigned level );
0029 METimeInterval* last( unsigned level );
0030
0031
0032 unsigned level() { return _level; }
0033 ME::Time firstTime() const { return _firstTime; }
0034 ME::Time lastTime() const { return _lastTime; }
0035 bool isGood() const { return _good; }
0036
0037
0038 METimeInterval* above() { return _above; }
0039 METimeInterval* next();
0040 METimeInterval* previous();
0041 METimeInterval* firstIn();
0042 METimeInterval* lastIn();
0043
0044
0045 void print( unsigned level );
0046
0047
0048 void oneLine();
0049
0050
0051 TString inBrackets();
0052
0053 private :
0054
0055
0056 METimeInterval( ME::Time firstTime, ME::Time lastTime, METimeInterval* previous, METimeInterval* above, bool OK=true );
0057
0058
0059 METimeInterval* cut( ME::Time time );
0060
0061
0062 ME::Time _firstTime;
0063 ME::Time _lastTime;
0064
0065
0066 METimeInterval* _previous;
0067 METimeInterval* _next;
0068 METimeInterval* _above;
0069 METimeInterval* _below;
0070
0071
0072 unsigned _level;
0073
0074 bool _good;
0075
0076 ClassDef(METimeInterval,0)
0077 };
0078
0079 #endif