CMS 3D CMS Logo

Public Member Functions | Private Attributes

HcalLSbyLSMonitor Class Reference

#include <HcalLSbyLSMonitor.h>

Inheritance diagram for HcalLSbyLSMonitor:
HcalBaseDQMonitor edm::EDAnalyzer

List of all members.

Public Member Functions

void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void beginRun (const edm::Run &run, const edm::EventSetup &c)
void cleanup (void)
void done ()
void endJob ()
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
void endRun (const edm::Run &run, const edm::EventSetup &c)
 HcalLSbyLSMonitor (const edm::ParameterSet &ps)
void periodicReset ()
void reset ()
void setup ()
 ~HcalLSbyLSMonitor ()

Private Attributes

int minEvents_
std::vector< std::string > TaskList_

Detailed Description

Date:
2010/05/07 17:38:16
Revision:
1.2
Author:
J. Temple - Univ. of Maryland

Definition at line 25 of file HcalLSbyLSMonitor.h.


Constructor & Destructor Documentation

HcalLSbyLSMonitor::HcalLSbyLSMonitor ( const edm::ParameterSet ps)

Definition at line 10 of file HcalLSbyLSMonitor.cc.

References HcalBaseDQMonitor::AllowedCalibTypes_, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::enableCleanup_, edm::ParameterSet::getUntrackedParameter(), HcalBaseDQMonitor::makeDiagnostics_, HcalBaseDQMonitor::mergeRuns_, minEvents_, HcalBaseDQMonitor::NLumiBlocks_, HcalBaseDQMonitor::Online_, HcalBaseDQMonitor::prefixME_, HcalBaseDQMonitor::skipOutOfOrderLS_, HcalBaseDQMonitor::subdir_, and TaskList_.

{
  Online_                = ps.getUntrackedParameter<bool>("online",false);
  mergeRuns_             = ps.getUntrackedParameter<bool>("mergeRuns",false);
  enableCleanup_         = ps.getUntrackedParameter<bool>("enableCleanup",false);
  debug_                 = ps.getUntrackedParameter<int>("debug",0);
  prefixME_              = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
    prefixME_.append("/");
  subdir_                = ps.getUntrackedParameter<std::string>("TaskFolder","LSbyLSMonitor_Hcal"); 
  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
    subdir_.append("/");
  subdir_=prefixME_+subdir_;
  AllowedCalibTypes_     = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
  skipOutOfOrderLS_      = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",true);
  NLumiBlocks_           = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
  makeDiagnostics_       = ps.getUntrackedParameter<bool>("makeDiagnostics",false);

  // Specify the directories where the tasks to be check reside
  TaskList_              = ps.getUntrackedParameter<std::vector<std::string> >("TaskDirectories");
  // Minimum number of events per lumi section that must be present for checks to be made.  *ALL* tasks must contain at least this many events
  minEvents_             = ps.getUntrackedParameter<int>("minEvents",500);
}
HcalLSbyLSMonitor::~HcalLSbyLSMonitor ( )

Definition at line 34 of file HcalLSbyLSMonitor.cc.

{
} //destructor

Member Function Documentation

void HcalLSbyLSMonitor::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [virtual]
void HcalLSbyLSMonitor::beginRun ( const edm::Run run,
const edm::EventSetup c 
) [virtual]

Reimplemented from HcalBaseDQMonitor.

Definition at line 52 of file HcalLSbyLSMonitor.cc.

References gather_cfg::cout, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::mergeRuns_, reset(), setup(), and HcalBaseDQMonitor::tevt_.

{
  if (debug_>1) std::cout <<"HcalLSbyLSMonitor::beginRun"<<std::endl;
  HcalBaseDQMonitor::beginRun(run,c);

  if (tevt_==0) this->setup(); // set up histograms if they have not been created before
  if (mergeRuns_==false)
    this->reset();

  return;
} //void HcalLSbyLSMonitor::beginRun(...)
void HcalLSbyLSMonitor::cleanup ( void  ) [virtual]
void HcalLSbyLSMonitor::done ( )

Definition at line 144 of file HcalLSbyLSMonitor.cc.

{
  // moved database dumps to client; we want to be able to sum over results in offline
  return;

} // void HcalLSbyLSMonitor::done()
void HcalLSbyLSMonitor::endJob ( void  ) [virtual]

Reimplemented from HcalBaseDQMonitor.

Definition at line 152 of file HcalLSbyLSMonitor.cc.

References cleanup(), gather_cfg::cout, HcalBaseDQMonitor::debug_, and HcalBaseDQMonitor::enableCleanup_.

{
  if (debug_>0) std::cout <<"HcalLSbyLSMonitor::endJob()"<<std::endl;
  if (enableCleanup_) cleanup(); // when do we force cleanup?
}
void HcalLSbyLSMonitor::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [virtual]

Reimplemented from HcalBaseDQMonitor.

Definition at line 80 of file HcalLSbyLSMonitor.cc.

References gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, DQMStore::get(), MonitorElement::getBinContent(), i, max(), minEvents_, mergeVDriftHistosByStation::name, HcalBaseDQMonitor::prefixME_, HcalBaseDQMonitor::ProblemsCurrentLB, MonitorElement::setBinContent(), DQMStore::setCurrentFolder(), and TaskList_.

{
  // Processing should go here
  if (!dbe_) return;
  bool enoughEvents=true;
  int Nevents=0;
  int TotalEvents=0;
  int badHB=0;
  int badHE=0;
  int badHO=0;
  int badHF=0;
  int badHO0=0;
  int badHO12=0;
  int badHFLUMI=0;
  
  for (unsigned int i=0;i<TaskList_.size();++i)
    {
      std::string name=prefixME_+TaskList_[i]+"LSvalues/";
      dbe_->setCurrentFolder(name.c_str());
      // Do we need the 'name' prefix here?
      MonitorElement *me=dbe_->get(name+"ProblemsThisLS");
      if (me==0)
        {
          if (debug_>0) std::cout <<"<HcalLSbyLSMonitor>  Error!  Could not get histogram "<<name.c_str()<<std::endl;
          enoughEvents=false;
          break;
        }

      Nevents=(int)me->getBinContent(-1);
      if (Nevents<minEvents_)
        {
          if (debug_>0) 
            std::cout <<"<HcalLSbyLSMonitor>  Error!  Number of events "<<Nevents<<" for histogram "<<name.c_str()<<" is less than the required minimum of "<<minEvents_<<std::endl;
          enoughEvents=false;
          break;
        }
      // Total events is the number of events processed in this LS
      TotalEvents=std::max(TotalEvents,Nevents);
      // errors are sum over all tests.  This WILL lead to double counting in some subdetectors!
      badHB+=(int)me->getBinContent(1,1);
      badHE+=(int)me->getBinContent(2,1);
      badHO+=(int)me->getBinContent(3,1);
      badHF+=(int)me->getBinContent(4,1);
      badHO0+=(int)me->getBinContent(5,1);
      badHO12+=(int)me->getBinContent(6,1);
      badHFLUMI+=(int)me->getBinContent(7,1);
    }
  if (enoughEvents==false)  // not enough events to make a decision
    {
      return;
    }
  ProblemsCurrentLB->setBinContent(-1,-1,TotalEvents);
  ProblemsCurrentLB->setBinContent(1,1,badHB);
  ProblemsCurrentLB->setBinContent(2,1,badHE);
  ProblemsCurrentLB->setBinContent(3,1,badHO);
  ProblemsCurrentLB->setBinContent(4,1,badHF);
  ProblemsCurrentLB->setBinContent(5,1,badHO0);
  ProblemsCurrentLB->setBinContent(6,1,badHO12);
  ProblemsCurrentLB->setBinContent(7,1,badHFLUMI);
  return;
}
void HcalLSbyLSMonitor::endRun ( const edm::Run run,
const edm::EventSetup c 
) [inline, virtual]

Reimplemented from HcalBaseDQMonitor.

Definition at line 34 of file HcalLSbyLSMonitor.h.

{};
void HcalLSbyLSMonitor::periodicReset ( ) [inline]

Definition at line 52 of file HcalLSbyLSMonitor.h.

{};
void HcalLSbyLSMonitor::reset ( void  ) [virtual]

Reimplemented from HcalBaseDQMonitor.

Definition at line 65 of file HcalLSbyLSMonitor.cc.

References HcalBaseDQMonitor::ProblemsCurrentLB, and MonitorElement::Reset().

Referenced by beginRun(), and setup().

{
  HcalBaseDQMonitor::reset();
  ProblemsCurrentLB->Reset();
}  // reset function is empty for now
void HcalLSbyLSMonitor::setup ( void  ) [virtual]

Reimplemented from HcalBaseDQMonitor.

Definition at line 38 of file HcalLSbyLSMonitor.cc.

References gather_cfg::cout, HcalBaseDQMonitor::dbe_, HcalBaseDQMonitor::debug_, HcalBaseDQMonitor::ProblemsCurrentLB, reset(), DQMStore::setCurrentFolder(), MonitorElement::setLumiFlag(), and HcalBaseDQMonitor::subdir_.

Referenced by beginRun().

{
  // Call base class setup
  HcalBaseDQMonitor::setup();

  if (debug_>1)
    std::cout <<"<HcalLSbyLSMonitor::setup>  Setting up histograms"<<std::endl;

  dbe_->setCurrentFolder(subdir_);
  // This will cause this information to be kept for every lumi block
  if (ProblemsCurrentLB)
    ProblemsCurrentLB->setLumiFlag();
  this->reset();
}

Member Data Documentation

Definition at line 52 of file HcalLSbyLSMonitor.h.

Referenced by endLuminosityBlock(), and HcalLSbyLSMonitor().

std::vector<std::string> HcalLSbyLSMonitor::TaskList_ [private]

Definition at line 57 of file HcalLSbyLSMonitor.h.

Referenced by endLuminosityBlock(), and HcalLSbyLSMonitor().