CMS 3D CMS Logo

Public Member Functions | Private Attributes

MonitorElementMgr Class Reference

#include <MonitorElementMgr.h>

List of all members.

Public Member Functions

bool addME (MonitorElement *ime)
MonitorElementgetME (int ime)
MonitorElementgetMEFromSecondFile (const char *hnam)
 MonitorElementMgr ()
void openSecondFile (const std::string &name)
void printComparisonResult (int ime)
void save (const std::string &name)
 ~MonitorElementMgr ()

Private Attributes

TFile * theFileRef
mime theMonitorElements

Detailed Description

Definition at line 11 of file MonitorElementMgr.h.


Constructor & Destructor Documentation

MonitorElementMgr::MonitorElementMgr ( )

Definition at line 16 of file MonitorElementMgr.cc.

{

}
MonitorElementMgr::~MonitorElementMgr ( )

Definition at line 22 of file MonitorElementMgr.cc.

{
  //~MonitorElement is protected => delete doesnt work...
  /*
  mime::const_iterator iter;
  for( iter = theMonitorElements.begin(); iter != theMonitorElements.end(); iter++ ){ 
    delete (*iter).second;
  }
  */
}

Member Function Documentation

bool MonitorElementMgr::addME ( MonitorElement ime)

Definition at line 69 of file MonitorElementMgr.cc.

References gather_cfg::cout, MonitorElement::getName(), and theMonitorElements.

{
  const char* str = const_cast<char *>((sih->getName()).c_str());
  int ih = atoi(str);
  theMonitorElements[ih] = sih;
  std::cout << " addME " << sih->getName() << " = " << ih << std::endl;

  return true;
}
MonitorElement * MonitorElementMgr::getME ( int  ime)

Definition at line 79 of file MonitorElementMgr.cc.

References dtNoiseDBValidation_cfg::cerr, exception, and theMonitorElements.

{
  MonitorElement* me = 0;
  mime::const_iterator ite = theMonitorElements.find( ime );
  if( ite != theMonitorElements.end() ) {
    me = (*ite).second;
  } else {
    std::cerr << "!!!! FATAL ERROR MonitorElement does not exist " << ime << std::endl;
    std::exception();
  }
  return me;
}
MonitorElement * MonitorElementMgr::getMEFromSecondFile ( const char *  hnam)

Definition at line 92 of file MonitorElementMgr.cc.

References dtNoiseDBValidation_cfg::cerr, gather_cfg::cout, and exception.

{
  std::cout << "still to be added for ME" << std::endl;
  MonitorElement* me = 0;
  std::cerr << "!!!! FATAL ERROR MonitorElement does not exist " << std::endl;
  std::exception();
  return me;
}
void MonitorElementMgr::openSecondFile ( const std::string &  name)

Definition at line 49 of file MonitorElementMgr.cc.

References theFileRef.

{

  theFileRef = new TFile(name.c_str());

  /*  std::vector<std::string> objectNames = theStoreIn->listObjectNames();
  std::vector<std::string> objectTypes = theStoreIn->listObjectTypes(); 
  unsigned int siz = objectNames.size();
  for( unsigned int ii = 0; ii < siz; ii++ ) {
    //    std::cout << " HISTOS IN FILE " << std::endl;

    //   std::cout << " HISTO: " << objectNames[ii] << " " << objectTypes[ii] << std::endl;
    }*/
}
void MonitorElementMgr::printComparisonResult ( int  ime)

Definition at line 64 of file MonitorElementMgr.cc.

{
  //still to be implemented for MonitorElements
}
void MonitorElementMgr::save ( const std::string &  name)

Definition at line 34 of file MonitorElementMgr.cc.

References gather_cfg::cout, groupFilesInBlocks::fout, and theMonitorElements.

{

  std::cout << "=== save user histos ===" << std::endl;
  TFile fout(name.c_str(),"recreate");
  // write out the histos
mime::const_iterator iter;
 std::cout << "Should save " << theMonitorElements.size() << " MEs" << std::endl;
 /*
   for( iter = theMonitorElements.begin(); iter != theMonitorElements.end(); iter++ ){ 
   delete (*iter).second;
   }
 */
}

Member Data Documentation

Definition at line 30 of file MonitorElementMgr.h.

Referenced by openSecondFile().

Definition at line 28 of file MonitorElementMgr.h.

Referenced by addME(), getME(), and save().