CMS 3D CMS Logo

ME_MAP Class Reference

#include <DQM/TrackerCommon/interface/ME_MAP.h>

List of all members.

Public Member Functions

void add (std::string name, MonitorElement *me_p)
 add the ME named "name" to the map
void add (std::string name, MonitorElement *me_p)
 add the ME named "name" to the map
void clean_old (std::string gif_name)
 clean old eps and gif files by the same name
void clean_old (std::string gif_name)
 clean old eps and gif files by the same name
void clear ()
void clear ()
void create_gif (std::string name)
 create the gif file
void create_gif (std::string name)
 create the gif file
void divide_canvas (int num_elements, TCanvas &canvas)
 divide the canvas according to the number of elements to display
void divide_canvas (int num_elements, TCanvas &canvas)
 divide the canvas according to the number of elements to display
me_map get_me_map () const
me_map get_me_map () const
 ME_MAP ()
 ME_MAP ()
int operator== (const ME_MAP &other) const
int operator== (const ME_MAP &other) const
void print (std::string name)
 remove the ME named "name" from the map void remove(std::string name);
void print (std::string name)
 remove the ME named "name" from the map void remove(std::string name);
 ~ME_MAP ()
 ~ME_MAP ()

Protected Attributes

me_map mymap
 a map of pointers to a subset of the MEs in contents:


Detailed Description

Definition at line 11 of file ME_MAP.h.


Constructor & Destructor Documentation

ME_MAP::ME_MAP (  )  [inline]

Definition at line 20 of file ME_MAP.h.

References mymap.

00021     { 
00022       mymap.clear();
00023     }

ME_MAP::~ME_MAP (  )  [inline]

Definition at line 25 of file ME_MAP.h.

00025 {}

ME_MAP::ME_MAP (  )  [inline]

Definition at line 20 of file ME_MAP.h.

References mymap.

00021     { 
00022       mymap.clear();
00023     }

ME_MAP::~ME_MAP (  )  [inline]

Definition at line 25 of file ME_MAP.h.

00025 {}


Member Function Documentation

void ME_MAP::add ( std::string  name,
MonitorElement me_p 
)

add the ME named "name" to the map

void ME_MAP::add ( std::string  name,
MonitorElement me_p 
)

add the ME named "name" to the map

Definition at line 8 of file ME_MAP.cc.

References mymap.

Referenced by WebInterface::DrawGif().

00009 {
00010   entry newentry(name, me_p);
00011   mymap.insert(newentry);
00012 }

void ME_MAP::clean_old ( std::string  gif_name  ) 

clean old eps and gif files by the same name

void ME_MAP::clean_old ( std::string  gif_name  ) 

clean old eps and gif files by the same name

Definition at line 31 of file ME_MAP.cc.

Referenced by print().

00032 {
00033   ::unlink(gif_name.c_str());
00034 }

void ME_MAP::clear ( void   )  [inline]

Definition at line 55 of file ME_MAP.h.

References mymap.

00056     {
00057       mymap.clear();
00058     }

void ME_MAP::clear ( void   )  [inline]

Definition at line 55 of file ME_MAP.h.

References mymap.

00056     {
00057       mymap.clear();
00058     }

void ME_MAP::create_gif ( std::string  name  ) 

create the gif file

void ME_MAP::create_gif ( std::string  name  ) 

create the gif file

Definition at line 54 of file ME_MAP.cc.

References dbtoconf::command, divide_canvas(), i, it, and mymap.

Referenced by print().

00055 { 
00056   int num_elements = mymap.size();
00057       
00058   // If we (still) don't have anything, create empty eps
00059   if (num_elements == 0) 
00060     {
00061       std::string command = "cp empty.eps " + name; 
00062       ::system(command.c_str());
00063      // std::cout << "ME_MAP has no elements" << std::endl;
00064       return;
00065     }
00066       
00067   else
00068     {
00069       
00070      // std::cout << "ME_MAP has " << mymap.size() << " elements" << std::endl;
00071 
00072       TCanvas canvas("display");
00073                 
00074       divide_canvas(num_elements, canvas);
00075           
00076       int i = 0;
00077       me_map::iterator it;
00078       for (it = mymap.begin(); it != mymap.end(); it++)
00079         {
00080           // move to the next place in the canvas
00081           TVirtualPad * current_pad = canvas.cd(i + 1);
00082           Color_t color = TColor::GetColor("000000");
00083           if (it->second->hasOtherReport()) color = TColor::GetColor ("#FCD116");
00084           if (it->second->hasWarning()) color = TColor::GetColor ("#FF8000");
00085           if (it->second->hasError()) color = TColor::GetColor ("#CC0000");
00086           current_pad->HighLight(color, kTRUE);
00087           it->second->getRootObject()->Draw();
00088           i++;
00089         }
00090           
00091       canvas.SaveAs(name.c_str());
00092     }
00093 }

void ME_MAP::divide_canvas ( int  num_elements,
TCanvas &  canvas 
)

divide the canvas according to the number of elements to display

void ME_MAP::divide_canvas ( int  num_elements,
TCanvas &  canvas 
)

divide the canvas according to the number of elements to display

Definition at line 36 of file ME_MAP.cc.

References rows, and funct::sqrt().

Referenced by create_gif().

00037 {
00038   if (num_elements < 2) 
00039     {
00040       canvas.Divide(1, 1);
00041       return;
00042     }
00043   if (num_elements == 2) 
00044     {
00045       canvas.Divide(2, 1);
00046       return;
00047     }
00048       
00049   int columns = static_cast<int>(sqrt(static_cast<float>(num_elements)));
00050   int rows = static_cast<int>(ceil(static_cast<float>(num_elements) / columns));
00051   canvas.Divide(columns, rows); 
00052 }

me_map ME_MAP::get_me_map (  )  const [inline]

Definition at line 27 of file ME_MAP.h.

References mymap.

00028     {
00029       return mymap;
00030     }

me_map ME_MAP::get_me_map (  )  const [inline]

Definition at line 27 of file ME_MAP.h.

References mymap.

Referenced by operator==().

00028     {
00029       return mymap;
00030     }

int ME_MAP::operator== ( const ME_MAP other  )  const [inline]

Definition at line 32 of file ME_MAP.h.

References get_me_map().

00033     {
00034       return (get_me_map() == other.get_me_map());
00035     }

int ME_MAP::operator== ( const ME_MAP other  )  const [inline]

Definition at line 32 of file ME_MAP.h.

References get_me_map().

00033     {
00034       return (get_me_map() == other.get_me_map());
00035     }

void ME_MAP::print ( std::string  name  ) 

remove the ME named "name" from the map void remove(std::string name);

print the map into a gif named "name"

void ME_MAP::print ( std::string  name  ) 

remove the ME named "name" from the map void remove(std::string name);

print the map into a gif named "name"

Definition at line 22 of file ME_MAP.cc.

References clean_old(), and create_gif().

Referenced by WebInterface::printMap().

00023 {
00024   std::string gif_name = name + ".gif";
00025       
00026   clean_old(gif_name);
00027       
00028   create_gif(gif_name);
00029 }


Member Data Documentation

me_map ME_MAP::mymap [protected]

a map of pointers to a subset of the MEs in contents:

Definition at line 16 of file ME_MAP.h.

Referenced by add(), clear(), create_gif(), get_me_map(), and ME_MAP().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:28:10 2009 for CMSSW by  doxygen 1.5.4