CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1TEMUEventInfoClient Class Reference

#include <L1TEMUEventInfoClient.h>

Inheritance diagram for L1TEMUEventInfoClient:
edm::EDAnalyzer

List of all members.

Public Member Functions

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

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 analyze
void beginJob ()
 begin job
void beginLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 begin luminosity block
void beginRun (const edm::Run &, const edm::EventSetup &)
 begin run
void bookHistograms ()
 book histograms
void dumpContentMonitorElements ()
 dump the content of the monitoring elements defined in this module
void endJob ()
 end job
void endLuminosityBlock (const edm::LuminosityBlock &, const edm::EventSetup &)
 end luminosity block
void endRun (const edm::Run &, const edm::EventSetup &)
 end run
void initialize ()
 private methods
void readQtResults ()
 read quality test results

Private Attributes

DQMStorem_dbe
std::vector< edm::ParameterSetm_l1Objects
std::vector< edm::ParameterSetm_l1Systems
std::vector< std::string > m_maskL1Objects
std::vector< std::string > m_maskL1Systems
MonitorElementm_meReportSummary
 a summary report
std::vector< MonitorElement * > m_meReportSummaryContent
 monitor elements to report content for all quality tests
MonitorElementm_meReportSummaryMap
 report summary map
std::string m_monitorDir
size_t m_nrL1Objects
 number of L1 trigger objects
size_t m_nrL1Systems
 number of L1 trigger systems
std::vector< std::string > m_objectFolder
std::vector< std::string > m_objectLabel
std::vector< int > m_objectMask
std::vector< std::vector
< unsigned int > > 
m_objectQtSummaryEnabled
std::vector< std::vector
< std::string > > 
m_objectQualityTestHist
std::vector< std::vector
< std::string > > 
m_objectQualityTestName
Float_t m_reportSummary
 summary report
bool m_runInEndJob
bool m_runInEndLumi
bool m_runInEndRun
bool m_runInEventLoop
std::vector< int > m_summaryContent
Float_t m_summarySum
std::vector< std::string > m_systemFolder
std::vector< std::string > m_systemLabel
std::vector< std::string > m_systemLabelExt
std::vector< int > m_systemMask
std::vector< std::vector
< unsigned int > > 
m_systemQtSummaryEnabled
std::vector< std::vector
< std::string > > 
m_systemQualityTestHist
std::vector< std::vector
< std::string > > 
m_systemQualityTestName
size_t m_totalNrQtSummaryEnabled
bool m_verbose
 input parameters

Detailed Description

Description: fill L1 report summary for emulator DQM.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna

Re-designed and fully rewritten class. Original version and authors: see CVS history

Date:
2012/04/04 10:00:00
Revision:
1.10

Description: see header file.

Author:
: Vasile Mihai Ghete - HEPHY Vienna
Date:
2012/04/04 09:59:52
Revision:
1.20

Definition at line 42 of file L1TEMUEventInfoClient.h.


Constructor & Destructor Documentation

L1TEMUEventInfoClient::L1TEMUEventInfoClient ( const edm::ParameterSet parSet)

Constructor.

Definition at line 46 of file L1TEMUEventInfoClient.cc.

References initialize().

                                                                          :
            m_verbose(parSet.getUntrackedParameter<bool>("verbose", false)),
            m_monitorDir(parSet.getUntrackedParameter<std::string>("monitorDir", "")),
            m_runInEventLoop(parSet.getUntrackedParameter<bool>("runInEventLoop", false)),
            m_runInEndLumi(parSet.getUntrackedParameter<bool>("runInEndLumi", false)),
            m_runInEndRun(parSet.getUntrackedParameter<bool>("runInEndRun", false)),
            m_runInEndJob(parSet.getUntrackedParameter<bool>("runInEndJob", false)),
            m_l1Systems(parSet.getParameter<std::vector<edm::ParameterSet> >("L1Systems")),
            m_l1Objects(parSet.getParameter<std::vector<edm::ParameterSet> >("L1Objects")),
            m_maskL1Systems(parSet.getParameter<std::vector<std::string> >("MaskL1Systems")),
            m_maskL1Objects(parSet.getParameter<std::vector<std::string> >("MaskL1Objects")),
            m_nrL1Systems(0),
            m_nrL1Objects(0),
            m_totalNrQtSummaryEnabled(0) {

    initialize();
}
L1TEMUEventInfoClient::~L1TEMUEventInfoClient ( ) [virtual]

Destructor.

Definition at line 65 of file L1TEMUEventInfoClient.cc.

                                              {

    //empty

}

Member Function Documentation

void L1TEMUEventInfoClient::analyze ( const edm::Event iEvent,
const edm::EventSetup evSetup 
) [private, virtual]

analyze

Implements edm::EDAnalyzer.

Definition at line 315 of file L1TEMUEventInfoClient.cc.

References m_runInEventLoop, and readQtResults().

                                      {

    // there is no loop on events in the offline harvesting step
    // code here will not be executed offline

    if (m_runInEventLoop) {

        readQtResults();

    }
}
void L1TEMUEventInfoClient::beginJob ( void  ) [private, virtual]

begin job

Reimplemented from edm::EDAnalyzer.

Definition at line 292 of file L1TEMUEventInfoClient.cc.

References m_dbe, and cppFunctionSkipper::operator.

                                     {


    // get backend interface
    m_dbe = edm::Service<DQMStore>().operator->();

}
void L1TEMUEventInfoClient::beginLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup evSetup 
) [private, virtual]

begin luminosity block

Reimplemented from edm::EDAnalyzer.

Definition at line 309 of file L1TEMUEventInfoClient.cc.

                                                                         {

}
void L1TEMUEventInfoClient::beginRun ( const edm::Run run,
const edm::EventSetup evSetup 
) [private, virtual]

begin run

Reimplemented from edm::EDAnalyzer.

Definition at line 301 of file L1TEMUEventInfoClient.cc.

References bookHistograms().

void L1TEMUEventInfoClient::bookHistograms ( ) [private]

book histograms

Definition at line 465 of file L1TEMUEventInfoClient.cc.

References DQMStore::book2D(), DQMStore::bookFloat(), dqm::qstatus::DISABLED, MonitorElement::Fill(), DQMStore::get(), MonitorElement::getName(), m_dbe, m_meReportSummary, m_meReportSummaryContent, m_meReportSummaryMap, m_nrL1Objects, m_nrL1Systems, m_objectLabel, m_objectQualityTestName, m_summaryContent, m_systemLabel, m_systemQualityTestName, max(), DQMStore::removeElement(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

Referenced by beginRun().

                                           {

    m_dbe->setCurrentFolder("L1TEMU/EventInfo");

    // remove m_meReportSummary if it exists
    if ((m_meReportSummary = m_dbe->get("L1TEMU/EventInfo/reportSummary"))) {
        m_dbe->removeElement(m_meReportSummary->getName());
    }

    // ...and book it again
    m_meReportSummary = m_dbe->bookFloat("reportSummary");

    // initialize reportSummary to 1

    if (m_meReportSummary) {
        m_meReportSummary->Fill(1);
    }

    // define float histograms for reportSummaryContents (one histogram per quality test),
    // initialize them to zero
    // initialize also m_summaryContent to dqm::qstatus::DISABLED

    m_dbe->setCurrentFolder("L1TEMU/EventInfo/reportSummaryContents");

    char histoQT[100];

    // general counters:
    //   iAllQTest: all quality tests for all systems and objects
    //   iAllMon:   all monitored systems and objects
    int iAllQTest = 0;
    int iAllMon = 0;

    for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {

        m_summaryContent.push_back(dqm::qstatus::DISABLED);

        const std::vector<std::string>& sysQtName =
                m_systemQualityTestName[iMon];

        for (std::vector<std::string>::const_iterator itQtName =
                sysQtName.begin(); itQtName != sysQtName.end(); ++itQtName) {

            const std::string hStr = "L1TEMU_L1Sys_" +m_systemLabel[iMon] + "_" + (*itQtName);

            const char* cStr = hStr.c_str();
            sprintf(histoQT, cStr);

            m_meReportSummaryContent.push_back(m_dbe->bookFloat(histoQT));
            m_meReportSummaryContent[iAllQTest]->Fill(0.);

            iAllQTest++;
        }

        iAllMon++;
    }


    for (unsigned int iMon = 0; iMon < m_nrL1Objects; ++iMon) {

        m_summaryContent.push_back(dqm::qstatus::DISABLED);

        const std::vector<std::string>& objQtName =
                m_objectQualityTestName[iMon];

        for (std::vector<std::string>::const_iterator itQtName =
                objQtName.begin(); itQtName != objQtName.end(); ++itQtName) {

            const std::string hStr = "L1TEMU_L1Obj_" + m_objectLabel[iMon] + "_"
                    + (*itQtName);

            const char* cStr = hStr.c_str();
            sprintf(histoQT, cStr);

            m_meReportSummaryContent.push_back(m_dbe->bookFloat(histoQT));
            m_meReportSummaryContent[iAllQTest]->Fill(0.);

            iAllQTest++;
        }

        iAllMon++;

    }

    m_dbe->setCurrentFolder("L1TEMU/EventInfo");

    if ((m_meReportSummaryMap = m_dbe->get("L1TEMU/EventInfo/reportSummaryMap"))) {
        m_dbe->removeElement(m_meReportSummaryMap->getName());
    }

    // define a histogram with two bins on X and maximum of m_nrL1Systems, m_nrL1Objects on Y

    int nBinsY = std::max(m_nrL1Systems, m_nrL1Objects);

    m_meReportSummaryMap = m_dbe->book2D("reportSummaryMap",
            "reportSummaryMap", 2, 1, 3, nBinsY, 1, nBinsY + 1);

    m_meReportSummaryMap->setAxisTitle("", 1);
    m_meReportSummaryMap->setAxisTitle("", 2);

    m_meReportSummaryMap->setBinLabel(1, " ", 1);
    m_meReportSummaryMap->setBinLabel(2, " ", 1);

    for (int iBin = 0; iBin < nBinsY; ++iBin) {

        m_meReportSummaryMap->setBinLabel(iBin + 1, " ", 2);
    }

}
void L1TEMUEventInfoClient::dumpContentMonitorElements ( ) [private]

dump the content of the monitoring elements defined in this module

Definition at line 379 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, DQMStore::get(), MonitorElement::getName(), MonitorElement::getTH2F(), estimatePileup::hist, m_dbe, m_meReportSummaryContent, m_meReportSummaryMap, m_nrL1Objects, m_nrL1Systems, m_objectLabel, m_objectMask, m_summaryContent, m_systemLabel, m_systemLabelExt, and m_systemMask.

Referenced by endJob(), endLuminosityBlock(), and endRun().

                                                       {

    std::cout << "\nSummary report " << std::endl;

    // summary content

    MonitorElement* me = m_dbe->get(m_meReportSummaryMap->getName());

    std::cout
            << "\nSummary content per system and object as filled in histogram\n  "
            << m_meReportSummaryMap->getName() << std::endl;

    if (!me) {

        std::cout << "\nNo histogram " << m_meReportSummaryMap->getName()
                << "\nNo summary content per system and object as filled in histogram.\n  "
                << std::endl;
        return;

    }

    TH2F* hist = me->getTH2F();

    const int nBinsX = hist->GetNbinsX();
    const int nBinsY = hist->GetNbinsY();
    std::cout << nBinsX << " " << nBinsY;

    std::vector<std::vector<int> > meReportSummaryMap(nBinsX, std::vector<int>(
            nBinsY));

//    for (int iBinX = 0; iBinX < nBinsX; iBinX++) {
//        for (int iBinY = 0; iBinY < nBinsY; iBinY++) {
//            meReportSummaryMap[iBinX][iBinY]
//                    = static_cast<int>(me->GetBinContent(iBinX + 1, iBinY + 1));
//        }
//    }

    std::cout << "\nL1 systems: " << m_nrL1Systems << " systems included\n"
            << "\n Summary content size: " << (m_summaryContent.size())
            << std::endl;

    for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {

        std::cout << std::setw(10) << m_systemLabel[iSys] << std::setw(10)
                << m_systemLabelExt[iSys] << " \t" << m_systemMask[iSys]
                << " \t" << std::setw(25) << " m_summaryContent["
                << std::setw(2) << iSys << "] = " << meReportSummaryMap[0][iSys]
                << std::endl;
    }

    std::cout << "\n L1 trigger objects: " << m_nrL1Objects
            << " objects included\n" << std::endl;

    for (unsigned int iMon = m_nrL1Systems; iMon < m_nrL1Systems
            + m_nrL1Objects; ++iMon) {

        std::cout << std::setw(20) << m_objectLabel[iMon - m_nrL1Systems]
                << " \t" << m_objectMask[iMon - m_nrL1Systems] << " \t"
                << std::setw(25) << " m_summaryContent[" << std::setw(2)
                << iMon << "] = \t" << m_summaryContent[iMon] << std::endl;
    }

    std::cout << std::endl;

    // quality tests

    std::cout << "\nQuality test results as filled in "
            << "\n  L1TEMU/EventInfo/reportSummaryContents\n"
            << "\n  Total number of quality tests: "
            << (m_meReportSummaryContent.size()) << "\n" << std::endl;

    for (std::vector<MonitorElement*>::const_iterator itME =
            m_meReportSummaryContent.begin(); itME
            != m_meReportSummaryContent.end(); ++itME) {

        std::cout << std::setw(50) << (*itME)->getName() << " \t"
                << std::setw(25) << (*itME)->getFloatValue() << std::endl;

    }

    std::cout << std::endl;

}
void L1TEMUEventInfoClient::endJob ( void  ) [private, virtual]

end job

Reimplemented from edm::EDAnalyzer.

Definition at line 364 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, dumpContentMonitorElements(), m_runInEndJob, m_verbose, and readQtResults().

                                   {

    if (m_runInEndJob) {

        readQtResults();

        if (m_verbose) {

            std::cout << "\n  L1TEMUEventInfoClient::endRun\n" << std::endl;
            dumpContentMonitorElements();
        }
    }
}
void L1TEMUEventInfoClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup evSetup 
) [private, virtual]

end luminosity block

Reimplemented from edm::EDAnalyzer.

Definition at line 329 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, dumpContentMonitorElements(), m_runInEndLumi, m_verbose, and readQtResults().

                                                                         {

    if (m_runInEndLumi) {

        readQtResults();

        if (m_verbose) {

            std::cout << "\n  L1TEMUEventInfoClient::endLuminosityBlock\n"
                    << std::endl;
            dumpContentMonitorElements();
        }

    }
}
void L1TEMUEventInfoClient::endRun ( const edm::Run run,
const edm::EventSetup evSetup 
) [private, virtual]

end run

Reimplemented from edm::EDAnalyzer.

Definition at line 347 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, dumpContentMonitorElements(), m_runInEndRun, m_verbose, and readQtResults().

                                      {

    if (m_runInEndRun) {

        readQtResults();

        if (m_verbose) {

            std::cout << "\n  L1TEMUEventInfoClient::endRun\n" << std::endl;
            dumpContentMonitorElements();
        }

    }
}
void L1TEMUEventInfoClient::initialize ( ) [private]

private methods

initialize properly all elements

Definition at line 71 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, Exception, estimatePileup::hist, m_dbe, m_l1Objects, m_l1Systems, m_maskL1Objects, m_maskL1Systems, m_meReportSummaryContent, m_monitorDir, m_nrL1Objects, m_nrL1Systems, m_objectFolder, m_objectLabel, m_objectMask, m_objectQtSummaryEnabled, m_objectQualityTestHist, m_objectQualityTestName, m_summaryContent, m_systemFolder, m_systemLabel, m_systemLabelExt, m_systemMask, m_systemQtSummaryEnabled, m_systemQualityTestHist, m_systemQualityTestName, m_totalNrQtSummaryEnabled, m_verbose, and cppFunctionSkipper::operator.

Referenced by L1TEMUEventInfoClient().

                                       {

    // get back-end interface
    m_dbe = edm::Service<DQMStore>().operator->();

    if (m_verbose) {
        std::cout << "\nMonitor directory =             " << m_monitorDir
                << std::endl;
    }

    //

    m_nrL1Systems = m_l1Systems.size();

    m_systemLabel.reserve(m_nrL1Systems);
    m_systemLabelExt.reserve(m_nrL1Systems);
    m_systemMask.reserve(m_nrL1Systems);
    m_systemFolder.reserve(m_nrL1Systems);

    // on average two quality test per system - just a best guess
    m_systemQualityTestName.reserve(2*m_nrL1Systems);
    m_systemQualityTestHist.reserve(2*m_nrL1Systems);
    m_systemQtSummaryEnabled.reserve(2*m_nrL1Systems);

    int indexSys = 0;

    int totalNrQualityTests = 0;

    for (std::vector<edm::ParameterSet>::const_iterator itSystem =
            m_l1Systems.begin(); itSystem != m_l1Systems.end(); ++itSystem) {

        m_systemLabel.push_back(itSystem->getParameter<std::string>(
                "SystemLabel"));

        m_systemLabelExt.push_back(itSystem->getParameter<std::string>(
                "HwValLabel"));

        m_systemMask.push_back(itSystem->getParameter<unsigned int>(
                "SystemMask"));
        // check the additional mask from m_maskL1Systems
        for (std::vector<std::string>::const_iterator itSys =
                m_maskL1Systems.begin(); itSys != m_maskL1Systems.end(); ++itSys) {

            if (*itSys == m_systemLabel[indexSys]) {
                m_systemMask[indexSys] = 1;

            }
        }

        //
        std::string sysFolder = itSystem->getParameter<std::string> (
                "SystemFolder");
        m_systemFolder.push_back(sysFolder);

        //
        std::vector<std::string> qtNames = itSystem->getParameter<
                std::vector<std::string> >("QualityTestName");
        m_systemQualityTestName.push_back(qtNames);

        totalNrQualityTests = totalNrQualityTests + qtNames.size();

        //
        std::vector<std::string> qtHists = itSystem->getParameter<
                std::vector<std::string> > ("QualityTestHist");

        std::vector<std::string> qtFullPathHists;
        qtFullPathHists.reserve(qtHists.size());

        for (std::vector<std::string>::const_iterator itQtHist =
                qtHists.begin(); itQtHist != qtHists.end(); ++itQtHist) {

            std::string hist = *itQtHist;

            if (sysFolder == "") {
                hist = "L1TEMU/" + m_systemLabel[indexSys] + "/" + hist;
            } else {
                hist = sysFolder + "/" + hist;
            }

            qtFullPathHists.push_back(hist);
        }

        m_systemQualityTestHist.push_back(qtFullPathHists);

         //
        std::vector<unsigned int> qtSumEnabled = itSystem->getParameter<
                std::vector<unsigned int> >("QualityTestSummaryEnabled");
        m_systemQtSummaryEnabled.push_back(qtSumEnabled);

        for (std::vector<unsigned int>::const_iterator itQtSumEnabled =
                qtSumEnabled.begin(); itQtSumEnabled != qtSumEnabled.end(); ++itQtSumEnabled) {

            m_totalNrQtSummaryEnabled++;
        }

        // consistency check - throw exception, it will crash anyway if not consistent
        if (
                (qtNames.size() != qtHists.size()) ||
                (qtNames.size() != qtSumEnabled.size()) ||
                (qtHists.size() != qtSumEnabled.size())) {

            throw cms::Exception("FailModule")
                    << "\nError: inconsistent size of input vector parameters"
                    << "\n  QualityTestName, QualityTestHistQuality, TestSummaryEnabled"
                    << "\nfor system " << m_systemLabel[indexSys]
                    << "\n They must have equal size.\n"
                    << std::endl;
        }


        indexSys++;

    }

    // L1 objects

    //
    m_nrL1Objects = m_l1Objects.size();

    m_objectLabel.reserve(m_nrL1Objects);
    m_objectMask.reserve(m_nrL1Objects);
    m_objectFolder.reserve(m_nrL1Objects);

    // on average two quality test per object - just a best guess
    m_objectQualityTestName.reserve(2*m_nrL1Objects);
    m_objectQualityTestHist.reserve(2*m_nrL1Objects);
    m_objectQtSummaryEnabled.reserve(2*m_nrL1Objects);

    int indexObj = 0;

    for (std::vector<edm::ParameterSet>::const_iterator itObject =
            m_l1Objects.begin(); itObject != m_l1Objects.end(); ++itObject) {

        m_objectLabel.push_back(itObject->getParameter<std::string>(
                "ObjectLabel"));

        m_objectMask.push_back(itObject->getParameter<unsigned int>(
                "ObjectMask"));
        // check the additional mask from m_maskL1Objects
        for (std::vector<std::string>::const_iterator itObj =
                m_maskL1Objects.begin(); itObj != m_maskL1Objects.end(); ++itObj) {

            if (*itObj == m_objectLabel[indexObj]) {
                m_objectMask[indexObj] = 1;

            }
        }

        //
        std::string objFolder = itObject->getParameter<std::string> (
                "ObjectFolder");
        m_objectFolder.push_back(objFolder);

        //
        std::vector<std::string> qtNames = itObject->getParameter<
                std::vector<std::string> >("QualityTestName");
        m_objectQualityTestName.push_back(qtNames);

        totalNrQualityTests = totalNrQualityTests + qtNames.size();

        //
        std::vector<std::string> qtHists = itObject->getParameter<
                std::vector<std::string> > ("QualityTestHist");

        std::vector<std::string> qtFullPathHists;
        qtFullPathHists.reserve(qtHists.size());

        for (std::vector<std::string>::const_iterator itQtHist =
                qtHists.begin(); itQtHist != qtHists.end(); ++itQtHist) {

            std::string hist = *itQtHist;

            if (objFolder == "") {
                hist = "L1TEMU/" + m_objectLabel[indexObj] + "/" + hist;
            } else {
                hist = objFolder + hist;
            }

            qtFullPathHists.push_back(hist);
        }

        m_objectQualityTestHist.push_back(qtFullPathHists);

         //
        std::vector<unsigned int> qtSumEnabled = itObject->getParameter<
                std::vector<unsigned int> >("QualityTestSummaryEnabled");
        m_objectQtSummaryEnabled.push_back(qtSumEnabled);

        for (std::vector<unsigned int>::const_iterator itQtSumEnabled =
                qtSumEnabled.begin(); itQtSumEnabled != qtSumEnabled.end(); ++itQtSumEnabled) {

            m_totalNrQtSummaryEnabled++;
        }

        // consistency check - throw exception, it will crash anyway if not consistent
        if (
                (qtNames.size() != qtHists.size()) ||
                (qtNames.size() != qtSumEnabled.size()) ||
                (qtHists.size() != qtSumEnabled.size())) {

            throw cms::Exception("FailModule")
                    << "\nError: inconsistent size of input vector parameters"
                    << "\n  QualityTestName, QualityTestHistQuality, TestSummaryEnabled"
                    << "\nfor object " << m_objectLabel[indexObj]
                    << "\nThe three vectors must have equal size.\n"
                    << std::endl;
        }




        indexObj++;

    }

    m_summaryContent.reserve(m_nrL1Systems + m_nrL1Objects);
    m_meReportSummaryContent.reserve(totalNrQualityTests);

}
void L1TEMUEventInfoClient::readQtResults ( ) [private]

read quality test results

Definition at line 575 of file L1TEMUEventInfoClient.cc.

References gather_cfg::cout, dqm::qstatus::DISABLED, MonitorElement::Fill(), DQMStore::get(), QReport::getMessage(), MonitorElement::getName(), MonitorElement::getQReport(), MonitorElement::getQReports(), QReport::getQTresult(), QReport::getStatus(), INVALID, m_dbe, m_meReportSummary, m_meReportSummaryContent, m_meReportSummaryMap, m_nrL1Objects, m_nrL1Systems, m_objectQtSummaryEnabled, m_objectQualityTestHist, m_objectQualityTestName, m_reportSummary, m_summaryContent, m_summarySum, m_systemQtSummaryEnabled, m_systemQualityTestHist, m_systemQualityTestName, m_totalNrQtSummaryEnabled, m_verbose, and MonitorElement::setBinContent().

Referenced by analyze(), endJob(), endLuminosityBlock(), and endRun().

                                          {

    // initialize summary content, summary sum and ReportSummaryContent float histograms
    // for all L1 systems and L1 objects

    for (std::vector<int>::iterator it = m_summaryContent.begin(); it
            != m_summaryContent.end(); ++it) {

        (*it) = dqm::qstatus::DISABLED;

    }

    m_summarySum = 0.;

    for (std::vector<MonitorElement*>::iterator itME =
            m_meReportSummaryContent.begin(); itME
            != m_meReportSummaryContent.end(); ++itME) {

        (*itME)->Fill(0.);

    }


    // general counters:
    //   iAllQTest: all quality tests for all systems and objects
    //   iAllMon:   all monitored systems and objects
    int iAllQTest = 0;
    int iAllMon = 0;


    // quality tests for all L1 systems

    for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {

        // get the reports for each quality test

        const std::vector<std::string>& sysQtName =
                m_systemQualityTestName[iSys];
        const std::vector<std::string>& sysQtHist =
                m_systemQualityTestHist[iSys];
        const std::vector<unsigned int>& sysQtSummaryEnabled =
                m_systemQtSummaryEnabled[iSys];

        // pro system counter for quality tests
        int iSysQTest = 0;

        for (std::vector<std::string>::const_iterator itQtName =
                sysQtName.begin(); itQtName != sysQtName.end(); ++itQtName) {

            // get results, status and message

            MonitorElement* qHist = m_dbe->get(sysQtHist[iSysQTest]);

            if (qHist) {
                const std::vector<QReport*> qtVec = qHist->getQReports();
                const std::string hName = qHist->getName();

                if (m_verbose) {

                    std::cout << "\nNumber of quality tests "
                            << " for histogram " << sysQtHist[iSysQTest]
                            << ": " << qtVec.size() << "\n" << std::endl;
                }

                const QReport* sysQReport = qHist->getQReport(*itQtName);
                if (sysQReport) {
                    const float sysQtResult = sysQReport->getQTresult();
                    const int sysQtStatus = sysQReport->getStatus();
                    const std::string& sysQtMessage = sysQReport->getMessage();

                    if (m_verbose) {
                        std::cout << "\n" << (*itQtName) << " quality test:"
                                << "\n  result:  " << sysQtResult
                                << "\n  status:  " << sysQtStatus
                                << "\n  message: " << sysQtMessage << "\n"
                                << "\nFilling m_meReportSummaryContent["
                                << iAllQTest << "] with value "
                                << sysQtResult << "\n" << std::endl;
                    }

                    m_meReportSummaryContent[iAllQTest]->Fill(sysQtResult);

                    // for the summary map, keep the highest status value ("ERROR") of all tests
                    // which are considered for the summary plot
                    if (sysQtSummaryEnabled[iSysQTest]) {

                        if (sysQtStatus > m_summaryContent[iAllMon]) {
                            m_summaryContent[iAllMon] = sysQtStatus;
                        }

                        m_summarySum += sysQtResult;
                    }


                } else {

                    // for the summary map, if the test was not found but it is assumed to be
                    // considered for the summary plot, set it to dqm::qstatus::INVALID

                    int sysQtStatus = dqm::qstatus::INVALID;

                    if (sysQtSummaryEnabled[iSysQTest]) {

                        if (sysQtStatus > m_summaryContent[iAllMon]) {
                            m_summaryContent[iAllMon] = sysQtStatus;
                        }
                    }

                    m_meReportSummaryContent[iAllQTest]->Fill(0.);

                    if (m_verbose) {

                        std::cout << "\n" << (*itQtName)
                                << " quality test not found\n" << std::endl;
                    }
                }

            } else {
                // for the summary map, if the histogram was not found but it is assumed
                // to have a test be considered for the summary plot, set it to dqm::qstatus::INVALID

                int sysQtStatus = dqm::qstatus::INVALID;

                if (sysQtSummaryEnabled[iSysQTest]) {

                    if (sysQtStatus > m_summaryContent[iAllMon]) {
                        m_summaryContent[iAllMon] = sysQtStatus;
                    }
                }

                m_meReportSummaryContent[iAllQTest]->Fill(0.);

                if (m_verbose) {

                    std::cout << "\nHistogram " << sysQtHist[iSysQTest]
                            << " not found\n" << std::endl;
                }

            }

            // increase counters for quality tests
            iSysQTest++;
            iAllQTest++;

        }

        iAllMon++;

    }

    // quality tests for all L1 objects

    for (unsigned int iObj = 0; iObj < m_nrL1Objects; ++iObj) {

        // get the reports for each quality test

        const std::vector<std::string>& objQtName =
                m_objectQualityTestName[iObj];
        const std::vector<std::string>& objQtHist =
                m_objectQualityTestHist[iObj];
        const std::vector<unsigned int>& objQtSummaryEnabled =
                m_objectQtSummaryEnabled[iObj];

        // pro object counter for quality tests
        int iObjQTest = 0;

        for (std::vector<std::string>::const_iterator itQtName =
                objQtName.begin(); itQtName != objQtName.end(); ++itQtName) {

            // get results, status and message

            MonitorElement* qHist = m_dbe->get(objQtHist[iObjQTest]);

            if (qHist) {
                const std::vector<QReport*> qtVec = qHist->getQReports();
                const std::string hName = qHist->getName();

                if (m_verbose) {

                    std::cout << "\nNumber of quality tests "
                            << " for histogram " << objQtHist[iObjQTest]
                            << ": " << qtVec.size() << "\n" << std::endl;
                }

                const QReport* objQReport = qHist->getQReport(*itQtName);
                if (objQReport) {
                    const float objQtResult = objQReport->getQTresult();
                    const int objQtStatus = objQReport->getStatus();
                    const std::string& objQtMessage = objQReport->getMessage();

                    if (m_verbose) {
                        std::cout << "\n" << (*itQtName) << " quality test:"
                                << "\n  result:  " << objQtResult
                                << "\n  status:  " << objQtStatus
                                << "\n  message: " << objQtMessage << "\n"
                                << "\nFilling m_meReportSummaryContent["
                                << iAllQTest << "] with value "
                                << objQtResult << "\n" << std::endl;
                    }

                    m_meReportSummaryContent[iAllQTest]->Fill(objQtResult);

                    // for the summary map, keep the highest status value ("ERROR") of all tests
                    // which are considered for the summary plot
                    if (objQtSummaryEnabled[iObjQTest]) {

                        if (objQtStatus > m_summaryContent[iAllMon]) {
                            m_summaryContent[iAllMon] = objQtStatus;
                        }

                        m_summarySum += objQtResult;
                    }

                } else {

                    // for the summary map, if the test was not found but it is assumed to be
                    // considered for the summary plot, set it to dqm::qstatus::INVALID

                    int objQtStatus = dqm::qstatus::INVALID;

                    if (objQtSummaryEnabled[iObjQTest]) {

                        if (objQtStatus > m_summaryContent[iAllMon]) {
                            m_summaryContent[iAllMon] = objQtStatus;
                        }
                    }

                    m_meReportSummaryContent[iAllQTest]->Fill(0.);

                    if (m_verbose) {

                        std::cout << "\n" << (*itQtName)
                                << " quality test not found\n" << std::endl;
                    }

                }

            } else {
                // for the summary map, if the histogram was not found but it is assumed
                // to have a test be considered for the summary plot, set it to dqm::qstatus::INVALID

                int objQtStatus = dqm::qstatus::INVALID;

                if (objQtSummaryEnabled[iObjQTest]) {

                    if (objQtStatus > m_summaryContent[iAllMon]) {
                        m_summaryContent[iAllMon] = objQtStatus;
                    }
                }

                m_meReportSummaryContent[iAllQTest]->Fill(0.);

                if (m_verbose) {
                    std::cout << "\nHistogram " << objQtHist[iObjQTest]
                            << " not found\n" << std::endl;
                }

            }

            // increase counters for quality tests
            iObjQTest++;
            iAllQTest++;
        }

        iAllMon++;

    }



    // reportSummary value
    m_reportSummary = m_summarySum / float(m_totalNrQtSummaryEnabled);
    if (m_meReportSummary) {
        m_meReportSummary->Fill(m_reportSummary);
    }

    // fill the ReportSummaryMap for L1 systems (bin 1 on X)
    for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {

        double summCont = static_cast<double>(m_summaryContent[iSys]);
        m_meReportSummaryMap->setBinContent(1, iSys + 1, summCont);
    }

    // fill the ReportSummaryMap for L1 objects (bin 2 on X)
    for (unsigned int iMon = m_nrL1Systems; iMon < m_nrL1Systems
            + m_nrL1Objects; ++iMon) {

        double summCont = static_cast<double>(m_summaryContent[iMon]);
        m_meReportSummaryMap->setBinContent(2, iMon - m_nrL1Systems + 1, summCont);

    }

}

Member Data Documentation

Definition at line 90 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

Definition at line 89 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_maskL1Objects [private]

Definition at line 92 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_maskL1Systems [private]

Definition at line 91 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

a summary report

Definition at line 143 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), and readQtResults().

monitor elements to report content for all quality tests

Definition at line 146 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), initialize(), and readQtResults().

report summary map

Definition at line 149 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), and readQtResults().

std::string L1TEMUEventInfoClient::m_monitorDir [private]

Definition at line 82 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

number of L1 trigger objects

Definition at line 112 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), initialize(), and readQtResults().

number of L1 trigger systems

Definition at line 109 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), initialize(), and readQtResults().

std::vector<std::string> L1TEMUEventInfoClient::m_objectFolder [private]

Definition at line 129 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_objectLabel [private]

Definition at line 128 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), and initialize().

std::vector<int> L1TEMUEventInfoClient::m_objectMask [private]

Definition at line 127 of file L1TEMUEventInfoClient.h.

Referenced by dumpContentMonitorElements(), and initialize().

std::vector<std::vector<unsigned int> > L1TEMUEventInfoClient::m_objectQtSummaryEnabled [private]

Definition at line 133 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

std::vector<std::vector<std::string> > L1TEMUEventInfoClient::m_objectQualityTestHist [private]

Definition at line 132 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

std::vector<std::vector<std::string> > L1TEMUEventInfoClient::m_objectQualityTestName [private]

Definition at line 131 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), initialize(), and readQtResults().

summary report

Definition at line 137 of file L1TEMUEventInfoClient.h.

Referenced by readQtResults().

Definition at line 87 of file L1TEMUEventInfoClient.h.

Referenced by endJob().

Definition at line 85 of file L1TEMUEventInfoClient.h.

Referenced by endLuminosityBlock().

Definition at line 86 of file L1TEMUEventInfoClient.h.

Referenced by endRun().

Definition at line 84 of file L1TEMUEventInfoClient.h.

Referenced by analyze().

std::vector<int> L1TEMUEventInfoClient::m_summaryContent [private]

Definition at line 138 of file L1TEMUEventInfoClient.h.

Referenced by readQtResults().

std::vector<std::string> L1TEMUEventInfoClient::m_systemFolder [private]

Definition at line 121 of file L1TEMUEventInfoClient.h.

Referenced by initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_systemLabel [private]

Definition at line 118 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), dumpContentMonitorElements(), and initialize().

std::vector<std::string> L1TEMUEventInfoClient::m_systemLabelExt [private]

Definition at line 119 of file L1TEMUEventInfoClient.h.

Referenced by dumpContentMonitorElements(), and initialize().

std::vector<int> L1TEMUEventInfoClient::m_systemMask [private]

Definition at line 120 of file L1TEMUEventInfoClient.h.

Referenced by dumpContentMonitorElements(), and initialize().

std::vector<std::vector<unsigned int> > L1TEMUEventInfoClient::m_systemQtSummaryEnabled [private]

Definition at line 125 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

std::vector<std::vector<std::string> > L1TEMUEventInfoClient::m_systemQualityTestHist [private]

Definition at line 124 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

std::vector<std::vector<std::string> > L1TEMUEventInfoClient::m_systemQualityTestName [private]

Definition at line 123 of file L1TEMUEventInfoClient.h.

Referenced by bookHistograms(), initialize(), and readQtResults().

total number of quality tests enabled for summary report for L1 trigger systems and L1 trigger objects

Definition at line 116 of file L1TEMUEventInfoClient.h.

Referenced by initialize(), and readQtResults().

input parameters

Definition at line 81 of file L1TEMUEventInfoClient.h.

Referenced by endJob(), endLuminosityBlock(), endRun(), initialize(), and readQtResults().