CMS 3D CMS Logo

DQMInstance.h

Go to the documentation of this file.
00001 #ifndef _DQMInstance_h
00002 #define _DQMInstance_h
00003 
00004 /*
00005    Author: William Badgett, FNAL
00006 
00007    Description:
00008      Container class for one snapshot instance of a collection of 
00009      collated DQM objects
00010 
00011    $Id: DQMInstance.h,v 1.8 2008/12/19 22:28:22 biery Exp $
00012 */
00013 
00014 #include <string>
00015 #include <vector>
00016 #include <map>
00017 
00018 #include "FWCore/PluginManager/interface/ProblemTracker.h"
00019 #include "FWCore/Utilities/interface/Exception.h"
00020 #include "FWCore/MessageService/interface/MessageServicePresence.h"
00021 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00022 
00023 //#include "PluginManager/PluginManager.h"
00024 
00025 #include "TFile.h"
00026 #include "TTimeStamp.h"
00027 #include "TObject.h"
00028 
00029 namespace stor 
00030 {
00031   class DQMFolder
00032   {
00033     public:
00034       DQMFolder();
00035      ~DQMFolder();
00036       std::map<std::string, TObject *> dqmObjects_;
00037   }; 
00038 
00039   class DQMGroup
00040   {
00041     public:
00042       DQMGroup(int readyTime);
00043      ~DQMGroup();
00044       std::map<std::string, DQMFolder *> dqmFolders_;
00045       int getNUpdates()             { return(nUpdates_);}
00046       int getReadyTime()            { return(readyTime_);}
00047       int getLastEvent()            { return(lastEvent_);}
00048       void setLastEvent(int lastEvent) { lastEvent_=lastEvent;}
00049       TTimeStamp * getFirstUpdate() { return(firstUpdate_);}
00050       TTimeStamp * getLastUpdate()  { return(lastUpdate_);}
00051       TTimeStamp * getLastServed()  { return(lastServed_);}
00052       bool isReady(int currentTime);
00053       bool wasServedSinceUpdate()   { return(wasServedSinceUpdate_);}
00054       void setServedSinceUpdate()   { wasServedSinceUpdate_=true;}
00055       void incrementUpdates();
00056       void setLastServed()          { lastServed_->Set();}
00057 
00058     protected:
00059       TTimeStamp            *firstUpdate_;
00060       TTimeStamp            *lastUpdate_;
00061       TTimeStamp            *lastServed_;
00062       int                    nUpdates_;
00063       int                    readyTime_;
00064       int                    lastEvent_;
00065       bool                   wasServedSinceUpdate_;
00066   }; 
00067 
00068   class DQMInstance
00069   {
00070     public:
00071       DQMInstance(int runNumber, 
00072                   int lumiSection, 
00073                   int instance,
00074                   int purgeTime,
00075                   int readyTime);
00076 
00077      ~DQMInstance();
00078 
00079       int getRunNumber()            { return(runNumber_);}
00080       int getLastEvent()            { return(lastEvent_);}
00081       int getLumiSection()          { return(lumiSection_);}
00082       int getInstance()             { return(instance_);}
00083       int getPurgeTime()            { return(purgeTime_);}
00084       int getReadyTime()            { return(readyTime_);}
00085 
00086       TTimeStamp * getFirstUpdate() { return(firstUpdate_);}
00087       TTimeStamp * getLastUpdate()  { return(lastUpdate_);}
00088       int updateObject(std::string groupName,
00089                        std::string objectDirectory,
00090                        TObject   * object,
00091                        int         eventNumber);
00092       int writeFile(std::string filePrefix, bool endRunFlag);
00093       DQMGroup * getDQMGroup(std::string groupName);
00094       bool isReady(int currentTime);
00095       bool isStale(int currentTime);
00096       std::map<std::string, DQMGroup *> dqmGroups_;
00097 
00098       static std::string getSafeMEName(TObject *object);
00099 
00100     protected:  
00101       int                    runNumber_;
00102       int                    lastEvent_;
00103       int                    lumiSection_;
00104       int                    instance_;
00105       TTimeStamp            *firstUpdate_;
00106       TTimeStamp            *lastUpdate_;
00107       int                    nUpdates_;
00108       int                    purgeTime_;
00109       int                    readyTime_;
00110   }; 
00111 
00112   class DQMGroupDescriptor
00113   {
00114     public:
00115       DQMGroupDescriptor(DQMInstance *instance,DQMGroup *group);
00116      ~DQMGroupDescriptor();
00117       DQMInstance *instance_;
00118       DQMGroup    *group_;
00119   };
00120 }
00121 
00122 
00123 #endif

Generated on Tue Jun 9 17:34:52 2009 for CMSSW by  doxygen 1.5.4