CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes

HLTEventInfoClient Class Reference

#include <HLTEventInfoClient.h>

Inheritance diagram for HLTEventInfoClient:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Protected Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c)
 Fake Analyze.
void beginJob ()
 BeginJob.
void beginLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &context)
void beginRun (const edm::Run &r, const edm::EventSetup &c)
 BeginRun.
void endJob ()
 Endjob.
void endLuminosityBlock (const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
 DQM Client Diagnostic.
void endRun (const edm::Run &r, const edm::EventSetup &c)
 EndRun.

Private Member Functions

TH1F * get1DHisto (std::string meName, DQMStore *dbi)
TProfile * get1DProfile (std::string meName, DQMStore *dbi)
TH2F * get2DHisto (std::string meName, DQMStore *dbi)
TProfile2D * get2DProfile (std::string meName, DQMStore *dbi)
void initialize ()

Private Attributes

int counterEvt_
 counter
int counterLS_
DQMStoredbe_
std::string monitorDir_
int nChannels
 prescale on number of events
edm::ParameterSet parameters_
int prescaleEvt_
 units of lumi sections
int prescaleLS_
 counter
Float_t reportSummary
MonitorElementreportSummary_
MonitorElementreportSummaryContent_ [20]
MonitorElementreportSummaryMap_
Float_t summaryContent [20]
Float_t summarySum
bool verbose_

Detailed Description

Definition at line 23 of file HLTEventInfoClient.h.


Constructor & Destructor Documentation

HLTEventInfoClient::HLTEventInfoClient ( const edm::ParameterSet ps)

Constructor.

Definition at line 34 of file HLTEventInfoClient.cc.

HLTEventInfoClient::~HLTEventInfoClient ( ) [virtual]

Destructor.

Definition at line 40 of file HLTEventInfoClient.cc.

References gather_cfg::cout.

                                       {
 if(verbose_) std::cout <<"[TriggerDQM]: ending... " << std::endl;
}

Member Function Documentation

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

Fake Analyze.

Implements edm::EDAnalyzer.

Definition at line 268 of file HLTEventInfoClient.cc.

References gather_cfg::cout.

                                                                         {
   
   counterEvt_++;
   if (prescaleEvt_<1) return;
   if (prescaleEvt_>0 && counterEvt_%prescaleEvt_ != 0) return;

   if(verbose_) std::cout << "HLTEventInfoClient::analyze" << std::endl;


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

BeginJob.

Reimplemented from edm::EDAnalyzer.

Definition at line 70 of file HLTEventInfoClient.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), gather_cfg::cout, dbe_, MonitorElement::Fill(), DQMStore::get(), interpolateCardsSimple::histo, gen::k, n, cppFunctionSkipper::operator, DQMStore::removeElement(), MonitorElement::setAxisTitle(), and DQMStore::setCurrentFolder().

                                 {

  if(verbose_) std::cout <<"[TriggerDQM]: Begin Job" << std::endl;
  // get backendinterface  
  dbe_ = Service<DQMStore>().operator->();

  dbe_->setCurrentFolder("HLT/EventInfo");

//  sprintf(histo, "reportSummary");
  reportSummary_ = dbe_->get("HLT/EventInfo/reportSumamry");
  if ( reportSummary_ ) {
      dbe_->removeElement(reportSummary_->getName()); 
   }
  
  reportSummary_ = dbe_->bookFloat("reportSummary");

  int nPDs = 20;

 //initialize reportSummary to 1
  if (reportSummary_) reportSummary_->Fill(1);

  dbe_->setCurrentFolder("HLT/EventInfo/reportSummaryContents");

  
  char histo[100];
  
  for (int n = 0; n < nPDs; n++) {    

  switch(n){
  case 0 :   sprintf(histo,"hlt_dqm_EGamma");   break;
  case 1 :   sprintf(histo,"hlt_dqm_Muon");     break;
  case 2 :   sprintf(histo,"hlt_dqm_JetMet");   break;
  case 3 :   sprintf(histo,"hlt_dqm_BJets");    break;
  case 4 :   sprintf(histo,"hlt_dqm_Tau");      break;
  case 5 :   sprintf(histo,"hlt_dqm_Test1");    break;
  case 6 :   sprintf(histo,"hlt_dqm_Test2");    break;
  case 7 :   sprintf(histo,"hlt_dqm_Test3");    break;
  case 8 :   sprintf(histo,"hlt_dqm_Test4");    break;
  case 9 :   sprintf(histo,"hlt_dqm_Test5");    break;
  case 10 :  sprintf(histo,"hlt_dqm_Test6");    break;
  case 11 :  sprintf(histo,"hlt_dqm_Test7");    break;
  case 12 :  sprintf(histo,"hlt_dqm_Test8");    break;
  case 13 :  sprintf(histo,"hlt_dqm_Test9");    break;
  case 14 :  sprintf(histo,"hlt_dqm_Test10");   break;
  case 15 :  sprintf(histo,"hlt_dqm_Test11");   break;
  case 16 :  sprintf(histo,"hlt_dqm_Test12");   break;
  case 17 :  sprintf(histo,"hlt_dqm_Test13");   break;
  case 18 :  sprintf(histo,"hlt_dqm_Test14");   break;
  case 19 :  sprintf(histo,"hlt_dqm_Test15");   break;
  }
  

  
//  if( reportSummaryContent_[i] = dbe_->get("HLT/EventInfo/reportSummaryContents/" + histo) ) 
//  {
//       dbe_->removeElement(reportSummaryContent_[i]->getName());
//   }
  
   reportSummaryContent_[n] = dbe_->bookFloat(histo);
  }

  //initialize reportSummaryContents to 1
  for (int k = 0; k < nPDs; k++) {
    summaryContent[k] = 1;
    reportSummaryContent_[k]->Fill(1.);
  }  


  dbe_->setCurrentFolder("HLT/EventInfo");

  reportSummaryMap_ = dbe_->get("HLT/EventInfo/reportSummaryMap");
  if ( reportSummaryMap_ ) {
  dbe_->removeElement(reportSummaryMap_->getName());
  }


  reportSummaryMap_ = dbe_->book2D("reportSummaryMap", "reportSummaryMap", 1, 1, 2, 10, 1, 11);
  reportSummaryMap_->setAxisTitle("", 1);
  reportSummaryMap_->setAxisTitle("", 2);
  reportSummaryMap_->setBinLabel(1,"SingleElectron",2);
  reportSummaryMap_->setBinLabel(2,"DoubleElectron",2);
  reportSummaryMap_->setBinLabel(3,"SingleMu",2);
  reportSummaryMap_->setBinLabel(4,"DoubleMu",2);
  reportSummaryMap_->setBinLabel(5,"Photon",2);
  reportSummaryMap_->setBinLabel(6,"Tau",2);
  reportSummaryMap_->setBinLabel(7,"BTag",2);
  reportSummaryMap_->setBinLabel(8,"HT",2);
  reportSummaryMap_->setBinLabel(9,"Jet",2);
  reportSummaryMap_->setBinLabel(10,"MET",2);
  reportSummaryMap_->setBinLabel(1," ",1);

}
void HLTEventInfoClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup context 
) [protected, virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 168 of file HLTEventInfoClient.cc.

                                                                                                             {
   // optionally reset histograms here
}
void HLTEventInfoClient::beginRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

BeginRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 164 of file HLTEventInfoClient.cc.

                                                                         {
}
void HLTEventInfoClient::endJob ( void  ) [protected, virtual]

Endjob.

Reimplemented from edm::EDAnalyzer.

Definition at line 284 of file HLTEventInfoClient.cc.

                               {
}
void HLTEventInfoClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup c 
) [protected, virtual]

DQM Client Diagnostic.

Reimplemented from edm::EDAnalyzer.

Definition at line 172 of file HLTEventInfoClient.cc.

References dbe_, DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), i, edm::LuminosityBlockBase::id(), j, gen::k, edm::LuminosityBlockID::luminosityBlock(), and m.

                                                                                                     {


  int ilumi =  int(lumiSeg.id().luminosityBlock());

  const int nPDs = 10;
  MonitorElement* Pass_Hists[nPDs];
  int nPathsPD[nPDs];
  double PDResult[nPDs];
  int nTotPD[nPDs];
  for( int i = 0; i < nPDs; i++ ) {
    PDResult[i] = 1.0;
    nTotPD[i] = 0.0;
  }
  bool isCollision = true;

  for( int i = 0; i < nPDs; i++ ) {
    if( i == 0 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_SingleElectron_Pass_Any"); // SingleElectron
    if( i == 1 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_DoubleElectron_Pass_Any"); // DoubleElectron
    if( i == 2 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_SingleMu_Pass_Any"); // SingleMu
    if( i == 3 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_DoubleMu_Pass_Any"); // DoubleMu
    if( i == 4 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_Photon_Pass_Any"); // Photon
    if( i == 5 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_Tau_Pass_Any"); // Tau
    if( i == 6 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_BTag_Pass_Any"); // BTag
    if( i == 7 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_HT_Pass_Any"); // HT
    if( i == 8 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_Jet_Pass_Any"); // Jet
    if( i == 9 ) Pass_Hists[i] = dbe_->get("HLT/FourVector/PathsSummary/HLT_MET_Pass_Any"); // MET

    if( Pass_Hists[i] ) {
      if( i == 5 && !isCollision ) continue;
      nPathsPD[i] = Pass_Hists[i]->getNbinsX();
      int noBins = 2;
      if( i == 1 ) noBins = 3; // the last trigger is low rate
      if( i == 8 ) noBins = 4; // two last triggers are low rate

      for( int j = 0; j < nPathsPD[i]-noBins; j++ ) {
        // if triggers in each PD are too much prescaled (or low rate), skip in the summary
        
        if( i == 1 && (j == 0) ) continue; // DoubleElectron
        if( i == 3 && (j == 1 || j == 4) ) continue; // DoubleMu
        if( i == 4 && (j > 1) ) continue; // Photon
        if( i == 5 && (j > 4) ) continue; // Tau
        if( i == 7 && (j == 7) ) continue; // HT
        if( i == 8 && (j == 8) ) continue; // Jet
        if( i == 9 && (j == 8 || j == 13 || j == 15) ) continue; // MET

        double val = Pass_Hists[i]->getBinContent(j+1);
        if( val == 0 ) {
          if( ilumi > 5 ) PDResult[i] = 0.5;
        }
        nTotPD[i] += val;
      }
      if( nTotPD[i] == 0 ) {
        if( ilumi > 5 ) PDResult[i] = 0.0; 
      }
    }
    else {
      isCollision = false;
    }
  }
  
  for (int k = 0; k < nPDs; k++) {
    if( k < 10 ) {
      summaryContent[k] = PDResult[k];
      reportSummaryContent_[k]->Fill(PDResult[k]);
    }
    else {
      summaryContent[k] = 1;
      reportSummaryContent_[k]->Fill(1.);
    }
  }
  summarySum = 0;

  for (int m = 0; m < nPDs; m++) {    
    summarySum += summaryContent[m];
  }


  reportSummary = summarySum / nPDs;;
  if (reportSummary_) reportSummary_->Fill(reportSummary);


  reportSummaryMap_->setBinContent(1,1,summaryContent[0]);//SingleElectron
  reportSummaryMap_->setBinContent(1,2,summaryContent[1]);//DoubleElectron
  reportSummaryMap_->setBinContent(1,3,summaryContent[2]);//SingleMu
  reportSummaryMap_->setBinContent(1,4,summaryContent[3]);//DoubleMu
  reportSummaryMap_->setBinContent(1,5,summaryContent[4]);//Photon
  reportSummaryMap_->setBinContent(1,6,summaryContent[5]);//Tau
  reportSummaryMap_->setBinContent(1,7,summaryContent[6]);//BTag
  reportSummaryMap_->setBinContent(1,8,summaryContent[7]);//HT
  reportSummaryMap_->setBinContent(1,9,summaryContent[8]);//Jet
  reportSummaryMap_->setBinContent(1,10,summaryContent[9]);//MET

}
void HLTEventInfoClient::endRun ( const edm::Run r,
const edm::EventSetup c 
) [protected, virtual]

EndRun.

Reimplemented from edm::EDAnalyzer.

Definition at line 280 of file HLTEventInfoClient.cc.

                                                                      {
}
TH1F * HLTEventInfoClient::get1DHisto ( std::string  meName,
DQMStore dbi 
) [private]

Definition at line 289 of file HLTEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getTH1F(), and NULL.

{

  MonitorElement * me_ = dbi->get(meName);

  if (!me_) { 
    if(verbose_) std::cout << "ME NOT FOUND." << std::endl;
    return NULL;
  }

  return me_->getTH1F();
}
TProfile * HLTEventInfoClient::get1DProfile ( std::string  meName,
DQMStore dbi 
) [private]

Definition at line 333 of file HLTEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getTProfile(), and NULL.

{


  MonitorElement * me_ = dbi->get(meName);

  if (!me_) { 
    if(verbose_) std::cout << "ME NOT FOUND." << std::endl;
    return NULL;
  }

  return me_->getTProfile();
}
TH2F * HLTEventInfoClient::get2DHisto ( std::string  meName,
DQMStore dbi 
) [private]

Definition at line 302 of file HLTEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getTH2F(), and NULL.

{


  MonitorElement * me_ = dbi->get(meName);

  if (!me_) { 
    if(verbose_) std::cout << "ME NOT FOUND." << std::endl;
    return NULL;
  }

  return me_->getTH2F();
}
TProfile2D * HLTEventInfoClient::get2DProfile ( std::string  meName,
DQMStore dbi 
) [private]

Definition at line 318 of file HLTEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getTProfile2D(), and NULL.

{


  MonitorElement * me_ = dbi->get(meName);

  if (!me_) { 
     if(verbose_) std::cout << "ME NOT FOUND." << std::endl;
   return NULL;
  }

  return me_->getTProfile2D();
}
void HLTEventInfoClient::initialize ( ) [private]

Definition at line 45 of file HLTEventInfoClient.cc.

References gather_cfg::cout, dbe_, and cppFunctionSkipper::operator.

                                   { 

  counterLS_=0; 
  counterEvt_=0; 
  
  // get back-end interface
  dbe_ = Service<DQMStore>().operator->();
  
  // base folder for the contents of this job
  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
  
  monitorDir_ = parameters_.getUntrackedParameter<std::string>("monitorDir","");
  if(verbose_) std::cout << "Monitor dir = " << monitorDir_ << std::endl;
    
  prescaleLS_ = parameters_.getUntrackedParameter<int>("prescaleLS", -1);
  if(verbose_) std::cout << "DQM lumi section prescale = " << prescaleLS_ << " lumi section(s)"<< std::endl;
  
  prescaleEvt_ = parameters_.getUntrackedParameter<int>("prescaleEvt", -1);
  if(verbose_) std::cout << "DQM event prescale = " << prescaleEvt_ << " events(s)"<< std::endl;
  

      
}

Member Data Documentation

counter

Definition at line 70 of file HLTEventInfoClient.h.

Definition at line 69 of file HLTEventInfoClient.h.

Definition at line 66 of file HLTEventInfoClient.h.

std::string HLTEventInfoClient::monitorDir_ [private]

Definition at line 67 of file HLTEventInfoClient.h.

prescale on number of events

Definition at line 73 of file HLTEventInfoClient.h.

Definition at line 64 of file HLTEventInfoClient.h.

units of lumi sections

Definition at line 72 of file HLTEventInfoClient.h.

counter

Definition at line 71 of file HLTEventInfoClient.h.

Definition at line 74 of file HLTEventInfoClient.h.

Definition at line 79 of file HLTEventInfoClient.h.

Definition at line 80 of file HLTEventInfoClient.h.

Definition at line 81 of file HLTEventInfoClient.h.

Float_t HLTEventInfoClient::summaryContent[20] [private]

Definition at line 76 of file HLTEventInfoClient.h.

Float_t HLTEventInfoClient::summarySum [private]

Definition at line 75 of file HLTEventInfoClient.h.

Definition at line 68 of file HLTEventInfoClient.h.