CDFMonitoringModuleImp Class Reference

List of all members.

Public Member Functions

 CDFMonitoringModuleImp (int port, const char *name, int refresh)
 ~CDFMonitoringModuleImp ()
void Update ()
void AddObject (TObject *o, string path="")

Private Attributes

ConsumerExport fConsExp
TConsumerInfo fConsInfo
const char * fPath
int fCount
int fRefreshPeriod
map< string, TObject * > fObjectMap

Detailed Description

Definition at line 33 of file CDFMonitoringModule.cxx.


Constructor & Destructor Documentation

CDFMonitoringModuleImp::CDFMonitoringModuleImp ( int  port,
const char *  name,
int  refresh 
)

Definition at line 56 of file CDFMonitoringModule.cxx.

00058     : fConsExp(port)
00059     , fConsInfo(name,0)
00060     , fPath(name)
00061     , fCount(0)
00062     , fRefreshPeriod(refresh)
00063 {
00064 }

CDFMonitoringModuleImp::~CDFMonitoringModuleImp (  ) 

Definition at line 65 of file CDFMonitoringModule.cxx.

00066 {
00067 }


Member Function Documentation

void CDFMonitoringModuleImp::AddObject ( TObject *  o,
string  path = "" 
)

Definition at line 69 of file CDFMonitoringModule.cxx.

References TConsumerInfo::addObject(), fConsInfo, fObjectMap, it, Msg::kDebug, Msg::kVerbose, Msg::kWarning, and MSG.

Referenced by Update().

00070 {
00071     TFolder* f = dynamic_cast<TFolder*>(o);
00072 
00073     if (f) {                    // it's a folder
00074 
00075         if (string("private") == f->GetName()) {
00076             MSG("BD",Msg::kVerbose) << "skipping private folder\n";
00077             return;
00078         }
00079 
00080         TCollection* sf = f->GetListOfFolders();
00081         if (!sf) return;                // empty
00082 
00083         if (path != "") path += "/";
00084         path += f->GetName();
00085 
00086         MSG("BD",Msg::kVerbose)
00087             << "iterating on folder \"" << f->GetName() << "\"\n";
00088 
00089         TIter it(sf->MakeIterator());
00090         TObject* obj=0;
00091         while ( (obj=it()) ) this->AddObject(obj,path);
00092         return;
00093     }
00094 
00095     // not a folder
00096 
00097     string objpath = path;
00098     if (objpath != "") objpath += "/";
00099     objpath += o->GetName();
00100     TObject* other = fObjectMap[objpath];
00101 
00102     if (! other) {              // haven't seen it yet
00103         fObjectMap[objpath] = o;
00104         fConsInfo.addObject(o->GetName(), path.c_str(), 0, o);
00105         MSG("BD",Msg::kDebug)
00106             << "adding object \"" << o->GetName() << "\" of type \"" <<
00107             o->Class_Name() << "\" to \""
00108             << path << "\" and saving  at \"" << objpath << "\"\n";
00109         return;
00110     }
00111     if (other != o) {   // exists but differs
00112         MSG("BD",Msg::kWarning)
00113             << "pre-existing object at " << objpath << endl;
00114         return;
00115     }
00116     return;                     // already added and is same
00117 }

void CDFMonitoringModuleImp::Update (  ) 

Definition at line 119 of file CDFMonitoringModule.cxx.

References AddObject(), HistMan::BaseFolder(), fConsExp, fConsInfo, fCount, fPath, fRefreshPeriod, Msg::kVerbose, Msg::kWarning, MSG, and ConsumerExport::send().

Referenced by CDFMonitoringModule::Ana().

00120 {
00121     if (fCount < fRefreshPeriod && fCount % fRefreshPeriod) return;
00122     MSG("BD",Msg::kVerbose)
00123         << "refreshing at " << fCount << " with period " << fRefreshPeriod << endl;
00124 
00125     HistMan hm(fPath);
00126 
00127     TFolder& f = hm.BaseFolder();
00128     TFolder* folder = dynamic_cast<TFolder*>(f.FindObject(fPath));
00129     if (!folder) {
00130         MSG("BD",Msg::kWarning)
00131             << "Failed to find folder " << fPath << endl;
00132     }
00133 
00134     this->AddObject(folder);
00135 
00136     fConsExp.send(&fConsInfo);
00137 }


Member Data Documentation

Definition at line 34 of file CDFMonitoringModule.cxx.

Referenced by Update().

Definition at line 35 of file CDFMonitoringModule.cxx.

Referenced by AddObject(), and Update().

Definition at line 37 of file CDFMonitoringModule.cxx.

Referenced by Update().

map<string,TObject*> CDFMonitoringModuleImp::fObjectMap [private]

Definition at line 39 of file CDFMonitoringModule.cxx.

Referenced by AddObject().

const char* CDFMonitoringModuleImp::fPath [private]

Definition at line 36 of file CDFMonitoringModule.cxx.

Referenced by Update().

Definition at line 37 of file CDFMonitoringModule.cxx.

Referenced by Update().


The documentation for this class was generated from the following file:

Generated on 15 Jul 2018 for loon by  doxygen 1.6.1