CMS 3D CMS Logo

Public Member Functions | Private Attributes

HLTMuonCertSummary Class Reference

Inheritance diagram for HLTMuonCertSummary:
edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob ()
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
virtual void endJob ()
virtual void endRun (const edm::Run &, const edm::EventSetup &)
 HLTMuonCertSummary (const edm::ParameterSet &pset)
 ~HLTMuonCertSummary ()

Private Attributes

DQMStoredbe_
edm::ParameterSet parameters_
bool verbose_

Detailed Description

Definition at line 60 of file HLTMuonCertSummary.cc.


Constructor & Destructor Documentation

HLTMuonCertSummary::HLTMuonCertSummary ( const edm::ParameterSet pset) [explicit]

Definition at line 87 of file HLTMuonCertSummary.cc.

References dbe_, edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, and DQMStore::setVerbose().

{

  using namespace edm;
  dbe_ = 0;
  dbe_ = edm::Service<DQMStore>().operator->();
  if (!dbe_) {
    LogInfo ("DQMGenericClient") << "Can't find DQMStore, no results will be saved"
                           << endl;
  } else {
    dbe_->setVerbose(0);
  }
  
  parameters_ = pset;
  verbose_ = parameters_.getUntrackedParameter<bool>("verbose", false);
  
  if(verbose_) LogInfo ("HLTMuonVal")  << ">>> Constructor (HLTMuonCertSummary) <<<" << endl;

}
HLTMuonCertSummary::~HLTMuonCertSummary ( )

Definition at line 109 of file HLTMuonCertSummary.cc.

{
}

Member Function Documentation

void HLTMuonCertSummary::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 120 of file HLTMuonCertSummary.cc.

{
   using namespace edm;

   if(verbose_) LogInfo ("HLTMuonVal")  << ">>> Analyze (HLTMuonCertSummary) <<<" << std::endl;

}
void HLTMuonCertSummary::beginJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 130 of file HLTMuonCertSummary.cc.

{
}
void HLTMuonCertSummary::beginRun ( const edm::Run run,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file HLTMuonCertSummary.cc.

References edm::RunBase::id().

{

  using namespace edm;
  if(verbose_) LogInfo ("HLTMuonVal")  << ">>> BeginRun (HLTMuonCertSummary) <<<" << std::endl;
  if(verbose_) LogInfo ("HLTMuonVal")  << ">>> "<< run.id() << std::endl;

}
void HLTMuonCertSummary::endJob ( void  ) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 136 of file HLTMuonCertSummary.cc.

{
}
void HLTMuonCertSummary::endRun ( const edm::Run run,
const edm::EventSetup c 
) [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 153 of file HLTMuonCertSummary.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dbe_, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), MonitorElement::getQReports(), MonitorElement::getTH2F(), i, and DQMStore::setCurrentFolder().

{

  using namespace edm;
  if(verbose_) LogInfo ("HLTMuonVal")  << ">>> EndRun (HLTMuonCertSummary) <<<" << std::endl;

  if(!dbe_) {
    LogInfo ("DQMGenericClient") << "No dqmstore... skipping processing step" << endl;
    return;
  }
  
  std::vector<string> histoNameVector;

 
  //booking histograms according to naming conventions



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

  MonitorElement*  reportSummary = dbe_->bookFloat("HLT_MUON_REPORT_SUMMARY");

  int SummaryBitResult = 100;
  
  MonitorElement*  CertificationSummary = dbe_->bookFloat("HLT_MUON_CERTIFICATION_SUMMARY");

  

  //for now these will hold values from eta/phi tests for spikes/holes
  MonitorElement*  reportSummaryMap = dbe_->book2D("HLT_MUON_ReportSummaryMap","HLT_MUON: ReportSummaryMap",6,-0.5,5.5,1,-0.5,0.5);
  MonitorElement*  CertificationSummaryMap = dbe_->book2D("HLT_MUON_CertificationSummaryMap","HLT_MUON: CertificationSummaryMap",6,-0.5,5.5,1,-0.5,0.5);

  TH2 * reportSummaryMapTH2 = reportSummaryMap->getTH2F();

  reportSummaryMapTH2->GetXaxis()->SetBinLabel(1,"PhiEtaOccAll");
  reportSummaryMapTH2->GetXaxis()->SetBinLabel(2,"PhiEtaOccMatch");
  reportSummaryMapTH2->GetXaxis()->SetBinLabel(3,"PhiEtaEff");
  reportSummaryMapTH2->GetXaxis()->SetBinLabel(4,"PhiEff");
  reportSummaryMapTH2->GetXaxis()->SetBinLabel(5,"EtaEff");
  reportSummaryMapTH2->GetXaxis()->SetBinLabel(6,"PtEff");
  
  reportSummaryMapTH2->GetYaxis()->SetBinLabel(1,"HLT_Mu5_allMuons");


  TH2 * CertificationSummaryMapTH2 = CertificationSummaryMap->getTH2F();

  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(1,"PhiEtaOccAll");    
  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(2,"PhiEtaOccMatch");  
  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(3,"PhiEtaEff");       
  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(4,"PhiEff");          
  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(5,"EtaEff");          
  CertificationSummaryMapTH2->GetXaxis()->SetBinLabel(6,"PtEff");             
                                                                   
  CertificationSummaryMapTH2->GetYaxis()->SetBinLabel(1,"HLT_Mu5_allMuons");


  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recPhiVsRecEta_All");
  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recPhiVsRecEta_L3Filtered");
  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPhiVsEta_L3Filtered");
  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPt_L3Filtered");
  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffPhi_L3Filtered");
  histoNameVector.push_back("HLT/Muon/Distributions/HLT_Mu5/allMuons/recEffEta_L3Filtered");
  
  // to do:  what do we want in certification contents?
  //  dbe_->setCurrentFolder("Egamma/EventInfo/CertificationContents/"); 


  //   //looping over histograms to be tested
  if(verbose_) LogInfo ("HLTMuonVal")  << "\n>>> looping over histograms to be tested <<<\n\n";
  
  for(std::vector<string>::iterator it=histoNameVector.begin();it!=histoNameVector.end();++it){

    string HistoName = (*it);
    if(verbose_) LogInfo ("HLTMuonVal")  << ">>> " << HistoName;        
    

    MonitorElement * TestHist=0;

    TestHist = dbe_->get(HistoName);

    bool validMe = TestHist!=0;
    if(verbose_)  LogInfo ("HLTMuonVal")  << " is valid? " << validMe << "\n";
    if(!validMe) continue;

    string histNameNoPath =  TestHist->getName();
    
    if(verbose_)  LogInfo ("HLTMuonVal")  << ">>> TestHist Name: " << histNameNoPath << "\n\n";

  

    //get QReports associated to each ME
    std::vector<QReport *> myQReports = TestHist->getQReports();  
    if(verbose_)  LogInfo ("HLTMuonVal") << TestHist->getName() <<": myQReports.size() = " << myQReports.size() << "\n\n";
    for(uint i=0;i!=myQReports.size();++i) {
      
      std::string qtname = myQReports[i]->getQRName() ; // get QT name
      float qtresult = myQReports[i]->getQTresult(); // get QT result value
      int qtstatus = myQReports[i]->getStatus() ; // get QT status value 
      
      if(verbose_) LogInfo ("HLTMuonVal")  << "\tTest " << i << ":  qtname: " << qtname   << "\n";
      if(verbose_) LogInfo ("HLTMuonVal")  << "\tTest " << i << ":  qtresult: " << qtresult  << std::endl;
      if(verbose_) LogInfo ("HLTMuonVal")  << "\tTest " << i << ":  qtstatus: " << qtstatus    << "\n\n";

      
      //book and fill float for each test done
      dbe_->setCurrentFolder("HLT/EventInfo/muonQuality/");  
      MonitorElement * qValueInt  = dbe_->bookFloat(histNameNoPath+"_HLT_Mu5_"+qtname);
      qValueInt->Fill(qtstatus);

      // We're assuming that you want all of the bits to go into the decision


      if (HistoName.find("recPhiVsRecEta_All") != std::string::npos) {
        reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(1,1), qtstatus);
        CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(1,1), qtstatus );
        if ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
        if ( (qtstatus == 300) ) SummaryBitResult = 300;

      }

      if (HistoName.find("recPhiVsRecEta_L3Filtered") != std::string::npos) {
        reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(2,1), qtstatus);
        CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(2,1), qtstatus);
        if  ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
        if (qtstatus == 300 ) SummaryBitResult = 300;

      }
      
      if (HistoName.find("recEffPhiVsEta_L3Filtered") != std::string::npos) {
        reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(3,1), qtstatus );
        CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(3,1), qtstatus);
        if ( (qtstatus == 200) && (SummaryBitResult < 300)) SummaryBitResult = 200;
        if (qtstatus == 300 ) SummaryBitResult = 300;
      }

      if (HistoName.find("recEffPhi_L3Filtered") != std::string::npos) {
        reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(4,1), qtstatus);
        CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(4,1), qtstatus);
      }

      if (HistoName.find("recEffEta_L3Filtered") != std::string::npos) {
        reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(5,1), qtstatus);
        CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(5,1), qtstatus);
      }
      
      if (HistoName.find("recEffPt_L3Filtered") != std::string::npos) {
        reportSummaryMapTH2->SetBinContent(reportSummaryMapTH2->GetBin(6,1), qtstatus);
        CertificationSummaryMapTH2->SetBinContent(CertificationSummaryMapTH2->GetBin(6,1), qtstatus);
      }
      

    }
  }


  reportSummary->Fill(SummaryBitResult);
  CertificationSummary->Fill(SummaryBitResult);



  // Set the final bits

  dbe_->setCurrentFolder("HLT/EventInfo/reportSummaryContents");
  MonitorElement* muonHLTQualityBinaryBit = dbe_->bookFloat ("HLT_Muon");
  
  if (SummaryBitResult == 100){
    muonHLTQualityBinaryBit->Fill(1);
  } else {
    muonHLTQualityBinaryBit->Fill(0);
  }
  


}

Member Data Documentation

Definition at line 77 of file HLTMuonCertSummary.cc.

Definition at line 78 of file HLTMuonCertSummary.cc.

Definition at line 80 of file HLTMuonCertSummary.cc.