CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_3/src/DQM/HcalMonitorClient/src/SubTaskSummaryStatus.cc

Go to the documentation of this file.
00001 #include "DQM/HcalMonitorClient/interface/SubTaskSummaryStatus.h"
00002 
00003 SubTaskSummaryStatus::SubTaskSummaryStatus(bool onoffval)
00004 {
00005   onoff=onoffval;
00006   for (unsigned int i=0;i<5;++i)
00007     {
00008       status[i]=-1;  //initial status is unknown
00009       ALLstatus=-1;
00010       problemName="";
00011       problemDir="";
00012     }      
00013 } // constructor
00014 
00015 SubTaskSummaryStatus::~SubTaskSummaryStatus(){}
00016 
00017 /*
00018 void SubTaskSummaryStatus::SetOnOff(bool onoffval)
00019 {
00020   onoff=onoffval;
00021   return;
00022 } // SetOnOff(bool onoffval)
00023 */
00024 
00025 bool SubTaskSummaryStatus::IsOn()
00026 {
00027   return onoff;
00028 } // IsOn()
00029 
00030 void SubTaskSummaryStatus::Setup(std::string Dir, 
00031                                  std::string Name,
00032                                  std::string OverName,
00033                                  std::string ID, 
00034                                  double t=0.)
00035 {
00036   problemDir=Dir; // directory where depth histos are stored
00037   problemName=Name; // base name of depth histos
00038   summaryName=OverName; // name of summary Problem plot (including directory)
00039   id=ID;
00040   thresh=t;
00041 }
00042 
00043 
00044 void SubTaskSummaryStatus::WriteThreshold(DQMStore* dbe, std::string basedir)
00045 {
00046   if (onoff==false)
00047     return;
00048   MonitorElement* me;
00049   const std::string prev= dbe->pwd();
00050   dbe->setCurrentFolder(basedir+"/"+problemDir);
00051   std::string name="ProblemThreshold_";
00052   name+=problemName;
00053   me = dbe->get(problemDir+"/"+name.c_str());
00054   if (me)
00055     dbe->removeElement(me->getName());
00056   me = dbe->bookFloat(name.c_str());
00057   me->Fill(thresh);
00058   dbe->setCurrentFolder(prev);
00059   return;
00060 }