CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
MonitorElementMgr Class Reference

#include <MonitorElementMgr.h>

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.

17 {
18 
19 }
MonitorElementMgr::~MonitorElementMgr ( )

Definition at line 22 of file MonitorElementMgr.cc.

23 {
24  //~MonitorElement is protected => delete doesnt work...
25  /*
26  mime::const_iterator iter;
27  for( iter = theMonitorElements.begin(); iter != theMonitorElements.end(); iter++ ){
28  delete (*iter).second;
29  }
30  */
31 }

Member Function Documentation

bool MonitorElementMgr::addME ( MonitorElement ime)

Definition at line 69 of file MonitorElementMgr.cc.

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

70 {
71  const char* str = const_cast<char *>((sih->getName()).c_str());
72  int ih = atoi(str);
73  theMonitorElements[ih] = sih;
74  std::cout << " addME " << sih->getName() << " = " << ih << std::endl;
75 
76  return true;
77 }
tuple cout
Definition: gather_cfg.py:121
MonitorElement * MonitorElementMgr::getME ( int  ime)

Definition at line 79 of file MonitorElementMgr.cc.

References dtNoiseDBValidation_cfg::cerr, cppFunctionSkipper::exception, and theMonitorElements.

80 {
81  MonitorElement* me = 0;
82  mime::const_iterator ite = theMonitorElements.find( ime );
83  if( ite != theMonitorElements.end() ) {
84  me = (*ite).second;
85  } else {
86  std::cerr << "!!!! FATAL ERROR MonitorElement does not exist " << ime << std::endl;
88  }
89  return me;
90 }
MonitorElement * MonitorElementMgr::getMEFromSecondFile ( const char *  hnam)

Definition at line 92 of file MonitorElementMgr.cc.

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

93 {
94  std::cout << "still to be added for ME" << std::endl;
95  MonitorElement* me = 0;
96  std::cerr << "!!!! FATAL ERROR MonitorElement does not exist " << std::endl;
98  return me;
99 }
tuple cout
Definition: gather_cfg.py:121
void MonitorElementMgr::openSecondFile ( const std::string &  name)

Definition at line 49 of file MonitorElementMgr.cc.

References theFileRef.

50 {
51 
52  theFileRef = new TFile(name.c_str());
53 
54  /* std::vector<std::string> objectNames = theStoreIn->listObjectNames();
55  std::vector<std::string> objectTypes = theStoreIn->listObjectTypes();
56  unsigned int siz = objectNames.size();
57  for( unsigned int ii = 0; ii < siz; ii++ ) {
58  // std::cout << " HISTOS IN FILE " << std::endl;
59 
60  // std::cout << " HISTO: " << objectNames[ii] << " " << objectTypes[ii] << std::endl;
61  }*/
62 }
void MonitorElementMgr::printComparisonResult ( int  ime)

Definition at line 64 of file MonitorElementMgr.cc.

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

Definition at line 34 of file MonitorElementMgr.cc.

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

35 {
36 
37  std::cout << "=== save user histos ===" << std::endl;
38  TFile fout(name.c_str(),"recreate");
39  // write out the histos
40 mime::const_iterator iter;
41  std::cout << "Should save " << theMonitorElements.size() << " MEs" << std::endl;
42  /*
43  for( iter = theMonitorElements.begin(); iter != theMonitorElements.end(); iter++ ){
44  delete (*iter).second;
45  }
46  */
47 }
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

TFile* MonitorElementMgr::theFileRef
private

Definition at line 30 of file MonitorElementMgr.h.

Referenced by openSecondFile().

mime MonitorElementMgr::theMonitorElements
private

Definition at line 28 of file MonitorElementMgr.h.

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