00001 #ifndef HVSTATUSFINDER_H 00002 #define HVSTATUSFINDER_H 00003 00004 #include "DatabaseInterface/DbiResultPtr.h" 00005 #include "Validity/VldContext.h" 00006 00007 #include "DbuHvFromSingles.h" 00008 #include "HvStatus.h" 00009 00010 #include "TObject.h" 00011 00012 class HvStatusFinder : public TObject { 00013 00014 public: 00015 static HvStatusFinder& Instance(); 00016 00017 virtual ~HvStatusFinder(); 00018 00019 HvStatus::HvStatus_t GetHvStatus(const VldContext& context, Int_t window=60, Int_t task=1); 00020 00021 private: 00022 HvStatusFinder(); 00023 00024 DbiResultPtr<DbuHvFromSingles> fHvTable; 00025 00026 Int_t fTask; 00027 Int_t fWindow; 00028 00029 Int_t fMinTime; 00030 Int_t fMaxTime; 00031 Int_t fMinTimeExt; 00032 Int_t fMaxTimeExt; 00033 00034 HvStatus::HvStatus_t fStatus; 00035 00036 HvStatus::HvStatus_t kStatusNearOK; 00037 HvStatus::HvStatus_t kStatusFarOK; 00038 00039 void ExtendedQuery(const VldContext& context); 00040 void LocalQuery(const VldContext& context); 00041 void Reset(); 00042 00043 // Cleaner struct used to clean up singleton at end of job 00044 struct Cleaner { 00045 void UseMe() { } 00046 ~Cleaner() { 00047 if( HvStatusFinder::fMyInstance != 0 ){ 00048 delete HvStatusFinder::fMyInstance; 00049 HvStatusFinder::fMyInstance = 0; 00050 } 00051 } 00052 }; 00053 friend struct Cleaner; 00054 static HvStatusFinder* fMyInstance; 00055 00056 ClassDef(HvStatusFinder,1) 00057 }; 00058 00059 #endif
1.3.9.1