CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Attributes

ESDcsInfoTask Class Reference

#include <ESDcsInfoTask.h>

Inheritance diagram for ESDcsInfoTask:
edm::EDAnalyzer

List of all members.

Public Member Functions

 ESDcsInfoTask (const edm::ParameterSet &ps)
 Constructor.
virtual ~ESDcsInfoTask ()
 Destructor.

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Analyze.
void beginJob (void)
 BeginJob.
void beginLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
 BeginLuminosityBlock.
void cleanup (void)
 Cleanup.
void endJob (void)
 EndJob.
void endLuminosityBlock (const edm::LuminosityBlock &lumiBlock, const edm::EventSetup &iSetup)
 EndLuminosityBlock.
void reset (void)
 Reset.

Private Attributes

edm::InputTag dcsStatuslabel_
DQMStoredqmStore_
bool enableCleanup_
int ievt_
MonitorElementmeESDcsActiveMap_
MonitorElementmeESDcsFraction_
bool mergeRuns_
std::string prefixME_

Detailed Description

Definition at line 11 of file ESDcsInfoTask.h.


Constructor & Destructor Documentation

ESDcsInfoTask::ESDcsInfoTask ( const edm::ParameterSet ps)

Constructor.

Definition at line 22 of file ESDcsInfoTask.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and cppFunctionSkipper::operator.

                                                   {

   dqmStore_ = Service<DQMStore>().operator->();

   prefixME_ = ps.getUntrackedParameter<string>("prefixME", "");

   enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup", false);

   mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns", false);

   dcsStatuslabel_      = ps.getParameter<InputTag>("DcsStatusLabel");

   meESDcsFraction_ = 0;
   meESDcsActiveMap_ = 0;

}
ESDcsInfoTask::~ESDcsInfoTask ( ) [virtual]

Destructor.

Definition at line 39 of file ESDcsInfoTask.cc.

                              {

}

Member Function Documentation

void ESDcsInfoTask::analyze ( const edm::Event e,
const edm::EventSetup c 
) [protected, virtual]

Analyze.

Implements edm::EDAnalyzer.

Definition at line 107 of file ESDcsInfoTask.cc.

References DcsStatus::ESm, DcsStatus::ESp, edm::Event::getByLabel(), and edm::HandleBase::isValid().

                                                              { 

   ievt_++;

   float ESpDcsStatus = 0;
   float ESmDcsStatus = 0;

   Handle<DcsStatusCollection> dcsStatus;
   e.getByLabel(dcsStatuslabel_, dcsStatus);
   if (dcsStatus.isValid()) {
     for (DcsStatusCollection::const_iterator dcsStatusItr = dcsStatus->begin(); dcsStatusItr != dcsStatus->end(); ++dcsStatusItr) {
       ESpDcsStatus = dcsStatusItr->ready(DcsStatus::ESp);
       ESmDcsStatus = dcsStatusItr->ready(DcsStatus::ESm);
     }

     ESpDcsStatus = (ESpDcsStatus + float(ievt_-1)*meESDcsActiveMap_->getBinContent(1))/float(ievt_);   
     ESmDcsStatus = (ESmDcsStatus + float(ievt_-1)*meESDcsActiveMap_->getBinContent(2))/float(ievt_);
   }

   meESDcsActiveMap_->setBinContent(1, ESpDcsStatus);   
   meESDcsActiveMap_->setBinContent(2, ESmDcsStatus);

   meESDcsFraction_->Fill( (ESpDcsStatus + ESmDcsStatus)/2. );

}
void ESDcsInfoTask::beginJob ( void  ) [protected, virtual]

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 43 of file ESDcsInfoTask.cc.

References timingPdfMaker::histo.

                                {

   char histo[200];

   if ( dqmStore_ ) {

      dqmStore_->setCurrentFolder(prefixME_ + "/EventInfo");

      sprintf(histo, "DCSSummary");
      meESDcsFraction_ = dqmStore_->bookFloat(histo);
      meESDcsFraction_->Fill(-1.0);

      sprintf(histo, "DCSSummaryMap");
      meESDcsActiveMap_ = dqmStore_->book1D(histo,histo, 2, 0., 2.);
      meESDcsActiveMap_->setAxisTitle("(ES+/ES-)", 1);


   }

}
void ESDcsInfoTask::beginLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
) [protected, virtual]

BeginLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file ESDcsInfoTask.cc.

References i, and reset().

                                                                                                         {

   this->reset();

   for( int i = 0; i < 2; i++) {
      meESDcsActiveMap_->setBinContent(i+1 , -1.0);
   }        

}
void ESDcsInfoTask::cleanup ( void  ) [protected]
void ESDcsInfoTask::endJob ( void  ) [protected, virtual]

EndJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 64 of file ESDcsInfoTask.cc.

References edm::cleanup().

                               {

   if ( enableCleanup_ ) this->cleanup();

}
void ESDcsInfoTask::endLuminosityBlock ( const edm::LuminosityBlock lumiBlock,
const edm::EventSetup iSetup 
) [protected, virtual]

EndLuminosityBlock.

Reimplemented from edm::EDAnalyzer.

Definition at line 80 of file ESDcsInfoTask.cc.

                                                                                                         {

}
void ESDcsInfoTask::reset ( void  ) [protected]

Reset.

Definition at line 84 of file ESDcsInfoTask.cc.


Member Data Documentation

Definition at line 54 of file ESDcsInfoTask.h.

Definition at line 46 of file ESDcsInfoTask.h.

Definition at line 50 of file ESDcsInfoTask.h.

int ESDcsInfoTask::ievt_ [private]

Definition at line 59 of file ESDcsInfoTask.h.

Definition at line 57 of file ESDcsInfoTask.h.

Definition at line 56 of file ESDcsInfoTask.h.

bool ESDcsInfoTask::mergeRuns_ [private]

Definition at line 52 of file ESDcsInfoTask.h.

std::string ESDcsInfoTask::prefixME_ [private]

Definition at line 48 of file ESDcsInfoTask.h.