00001 /* 00002 * AbsTimeCut.cpp 00003 * 00004 * Created on: 22-mag-2009 00005 * Author: Nicola Mori 00006 */ 00007 00010 #include "AbsTimeCut.h" 00011 00012 int AbsTimeCut::Check(PamLevel2 *event) { 00013 00014 _time.Set(event->GetOrbitalInfo()->absTime, kFALSE, 0, kFALSE); 00015 // TTimestamp::GetDate() returns date in format YYYYMMDD so to compare it 00016 // with 6-digits dates we must subtract 20000000 00017 unsigned int date = _time.GetDate(kFALSE) - 20000000; 00018 unsigned int time = _time.GetTime(kFALSE); 00019 00020 cout << date << " " << time << endl; 00021 00022 if (date < _initDate) 00023 return ABSTIMECUT_TOOEARLY; 00024 if (date == _initDate && time < _initTime) 00025 return ABSTIMECUT_TOOEARLY; 00026 00027 if (date > _endDate) 00028 return ABSTIMECUT_TOOLATE; 00029 if (date == _endDate && time > _endTime) 00030 return ABSTIMECUT_TOOLATE; 00031 00032 return CUTOK; 00033 }