00001 //----------------------------------------------------------------------------- 00002 // $Id: TUpdater.cxx,v 1.4 2010/03/31 09:58:59 liucy Exp $ 00003 //----------------------------------------------------------------------------- 00004 // Filename : TUpdater.cc 00005 // Section : Tracking 00006 // Owner : Yoshi Iwasaki 00007 // Email : yoshihito.iwasaki@kek.jp 00008 //----------------------------------------------------------------------------- 00009 // Description : A class to handle update timing of static objects of tracking. 00010 // See http://bsunsrv1.kek.jp/~yiwasaki/tracking/ 00011 //----------------------------------------------------------------------------- 00012 00013 //#include "panther/panther.h" 00014 #include "TrkReco/TUpdater.h" 00015 //#include BELLETDF_H 00016 //#include "tables/bestdf.h" 00017 #include <iostream> 00018 00019 TUpdater::TUpdater() : _expN(0), _runN(0), _evtN(0), _init(false) { 00020 } 00021 00022 TUpdater::~TUpdater() { 00023 } 00024 00025 void 00026 TUpdater::dump(const std::string & msg, const std::string & pre) const { 00027 std::cout << pre; 00028 00029 std::cout << "updated:" << updated(); 00030 std::cout << ",exp=" << _expN; 00031 std::cout << ",run=" << _runN; 00032 std::cout << ",evt=" << _evtN; 00033 std::cout << std::endl; 00034 } 00035 00036 void 00037 TUpdater::update(void) { 00038 if (updated()) return; 00039 00040 /* 00041 struct belle_event * ev = 00042 (struct belle_event *) BsGetEnt(BELLE_EVENT, 1, BBS_No_Index); 00043 00044 //...No BELLE_EVENT ???... 00045 if (! ev) return; 00046 00047 _expN = ev->m_ExpNo; 00048 _runN = ev->m_RunNo; 00049 _evtN = ev->m_EvtNo; 00050 */ 00051 _expN = 1; 00052 _runN = 1; 00053 _evtN = 1; 00054 } 00055 00056 bool 00057 TUpdater::updated(void) const { 00058 /* 00059 struct belle_event * ev = 00060 (struct belle_event *) BsGetEnt(BELLE_EVENT, 1, BBS_No_Index); 00061 00062 //...No BELLE_EVENT ???... 00063 if (! ev) return false; 00064 00065 //...Same event?... 00066 if (_expN == ev->m_ExpNo && 00067 _runN == ev->m_RunNo && 00068 _evtN == ev->m_EvtNo) return true; 00069 */ 00070 00071 if (_expN == 1 && 00072 _runN == 1 && 00073 _evtN == 1) return true; 00074 00075 return false; 00076 }