CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1EmulatorErrorFlagClient Class Reference

#include <L1EmulatorErrorFlagClient.h>

Inheritance diagram for L1EmulatorErrorFlagClient:
edm::EDAnalyzer edm::EDConsumerBase

List of all members.

Public Member Functions

 L1EmulatorErrorFlagClient (const edm::ParameterSet &)
 Constructor.
virtual ~L1EmulatorErrorFlagClient ()
 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 &)
void beginRun (const edm::Run &, const edm::EventSetup &)
 begin run
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
Float_t setSummary (const unsigned int &) const

Private Attributes

DQMStorem_dbe
std::vector< edm::ParameterSetm_l1Systems
std::vector< std::string > m_maskL1Systems
MonitorElementm_meSummaryErrorFlagMap
size_t m_nrL1Systems
 number of L1 trigger systems
bool m_runInEndJob
bool m_runInEndLumi
bool m_runInEndRun
bool m_runInEventLoop
std::vector< Float_t > m_summaryContent
 summary report
std::vector< std::string > m_systemErrorFlag
std::vector< std::string > m_systemFolder
std::vector< std::string > m_systemLabel
std::vector< std::string > m_systemLabelExt
std::vector< int > m_systemMask
bool m_verbose
 input parameters

Detailed Description

Definition at line 19 of file L1EmulatorErrorFlagClient.h.


Constructor & Destructor Documentation

L1EmulatorErrorFlagClient::L1EmulatorErrorFlagClient ( const edm::ParameterSet parSet)

Constructor.

Definition at line 25 of file L1EmulatorErrorFlagClient.cc.

References initialize().

                                                                                  :
            m_verbose(parSet.getUntrackedParameter<bool>("verbose", false)),
            m_l1Systems(parSet.getParameter<std::vector<edm::ParameterSet> >("L1Systems")),
            m_nrL1Systems(0) {

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

Destructor.

Definition at line 33 of file L1EmulatorErrorFlagClient.cc.

                                                      {

    //empty

}

Member Function Documentation

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

analyze

Implements edm::EDAnalyzer.

Definition at line 204 of file L1EmulatorErrorFlagClient.cc.

                                      {

    // there is no loop on events in the offline harvesting step
    // do not put any code here, it will not be executed

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

begin job

Reimplemented from edm::EDAnalyzer.

Definition at line 93 of file L1EmulatorErrorFlagClient.cc.

References DQMStore::book1D(), DQMStore::get(), MonitorElement::getName(), m_dbe, m_meSummaryErrorFlagMap, m_nrL1Systems, m_systemLabel, cppFunctionSkipper::operator, DQMStore::removeElement(), MonitorElement::setAxisTitle(), MonitorElement::setBinLabel(), and DQMStore::setCurrentFolder().

                                         {


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

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

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

    // define a histogram
    m_meSummaryErrorFlagMap = m_dbe->book1D("L1SummaryErrorFlagMap",
            "L1SummaryErrorFlagMap", m_nrL1Systems, 1, m_nrL1Systems + 1);

    m_meSummaryErrorFlagMap->setAxisTitle("Agreement fraction", 2);

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

        m_meSummaryErrorFlagMap->setBinLabel(iSys + 1, m_systemLabel[iSys], 1);
    }

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

Reimplemented from edm::EDAnalyzer.

Definition at line 126 of file L1EmulatorErrorFlagClient.cc.

                                                                         {
    // optionally reset histograms here
}
void L1EmulatorErrorFlagClient::beginRun ( const edm::Run run,
const edm::EventSetup evSetup 
) [private, virtual]

begin run

Reimplemented from edm::EDAnalyzer.

Definition at line 119 of file L1EmulatorErrorFlagClient.cc.

                                      {

    // empty
}
void L1EmulatorErrorFlagClient::endJob ( void  ) [private, virtual]

end job

Reimplemented from edm::EDAnalyzer.

Definition at line 218 of file L1EmulatorErrorFlagClient.cc.

                                       {
    //empty
}
void L1EmulatorErrorFlagClient::endLuminosityBlock ( const edm::LuminosityBlock lumiSeg,
const edm::EventSetup evSetup 
) [private, virtual]

end luminosity block

Reimplemented from edm::EDAnalyzer.

Definition at line 131 of file L1EmulatorErrorFlagClient.cc.

References gather_cfg::cout, m_meSummaryErrorFlagMap, m_nrL1Systems, m_summaryContent, m_systemLabel, m_systemLabelExt, m_systemMask, m_verbose, MonitorElement::setBinContent(), and setSummary().

                                                                         {

    // reset the summary content values
    for (unsigned int iMon = 0; iMon < m_nrL1Systems; ++iMon) {

        m_summaryContent[iMon] = 0.;
    }

    // for masked systems and objects, set the summary content to -1

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

        if (m_systemMask[iMon] != 0) {
            m_summaryContent[iMon] = -1;
        }
    }

    // then fill content for unmasked systems

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

        float percAgree = -1.;

        if (m_systemMask[iSys] == 0) {
            percAgree = setSummary(iSys);

            if ((percAgree == -1) && m_verbose) {
                std::cout << "\nWarning: ErrorFlag histogram for system "
                        << m_systemLabel[iSys] << " empty!" << std::endl;
            }
        }

        m_summaryContent[iSys] = percAgree;

    }

    int numUnMaskedSystems = 0;
    for (unsigned int iMon = 0; iMon < m_nrL1Systems; iMon++) {
        if (m_summaryContent[iMon] != -1) {
            numUnMaskedSystems++;

        }
    }



    // fill the SummaryErrorFlagMap histogram for L1 systems
    // (bin 0 - underflow, bin iSys + 1 overflow)
    for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
        m_meSummaryErrorFlagMap->setBinContent(iSys + 1, m_summaryContent[iSys]);
    }

    if (m_verbose) {
        std::cout << "\nSummary report L1EmulatorErrorFlagClient" << std::endl;

        std::cout << "\nL1 systems: " << m_nrL1Systems << " systems included\n"
                << 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 << "] = " << m_summaryContent[iSys]
                    << std::endl;
        }

    }

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

end run

Reimplemented from edm::EDAnalyzer.

Definition at line 213 of file L1EmulatorErrorFlagClient.cc.

                                      {
    //empty
}
void L1EmulatorErrorFlagClient::initialize ( ) [private]

private methods

Definition at line 39 of file L1EmulatorErrorFlagClient.cc.

References m_dbe, m_l1Systems, m_nrL1Systems, m_summaryContent, m_systemErrorFlag, m_systemFolder, m_systemLabel, m_systemLabelExt, m_systemMask, cppFunctionSkipper::operator, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by L1EmulatorErrorFlagClient().

                                           {


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

    //

    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);
    m_systemErrorFlag.reserve(m_nrL1Systems);

    int indexSys = 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"));

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

        indexSys++;

    }

    // [SYS]ErrorFlag histogram
    for (unsigned int iSys = 0; iSys < m_nrL1Systems; ++iSys) {
        if (m_systemFolder[iSys] == "") {
            m_systemErrorFlag.push_back("L1TEMU/" + m_systemLabel[iSys] + "/"
                    + m_systemLabelExt[iSys] + "ErrorFlag");
        } else {
            m_systemErrorFlag.push_back(m_systemFolder[iSys] + "/"
                    + m_systemLabelExt[iSys] + "ErrorFlag");
        }
    }


    m_summaryContent.reserve(m_nrL1Systems);

}
Float_t L1EmulatorErrorFlagClient::setSummary ( const unsigned int &  iMon) const [private]

Definition at line 223 of file L1EmulatorErrorFlagClient.cc.

References data, DQMStore::get(), MonitorElement::getBinContent(), MonitorElement::getNbinsX(), i, m_dbe, and m_systemErrorFlag.

Referenced by endLuminosityBlock().

                                                                            {

    MonitorElement* QHist = m_dbe->get(m_systemErrorFlag[iMon].data());

    int ntot = 0;
    for (int i = 0; i < QHist->getNbinsX(); i++) {
        ntot += QHist->getBinContent(i + 1);
    }

    bool isEmpty = (ntot == 0);

    //errflag bins: agree, loc agree, loc disagree, data only, emul only

    return isEmpty ? -1. : ((QHist->getBinContent(1)) / (ntot));
}

Member Data Documentation

Definition at line 91 of file L1EmulatorErrorFlagClient.h.

Referenced by beginJob(), initialize(), and setSummary().

Definition at line 58 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize().

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

Definition at line 59 of file L1EmulatorErrorFlagClient.h.

Definition at line 87 of file L1EmulatorErrorFlagClient.h.

Referenced by beginJob(), and endLuminosityBlock().

number of L1 trigger systems

Definition at line 75 of file L1EmulatorErrorFlagClient.h.

Referenced by beginJob(), endLuminosityBlock(), and initialize().

Definition at line 64 of file L1EmulatorErrorFlagClient.h.

Definition at line 62 of file L1EmulatorErrorFlagClient.h.

Definition at line 63 of file L1EmulatorErrorFlagClient.h.

Definition at line 61 of file L1EmulatorErrorFlagClient.h.

std::vector<Float_t> L1EmulatorErrorFlagClient::m_summaryContent [private]

summary report

Definition at line 86 of file L1EmulatorErrorFlagClient.h.

Referenced by endLuminosityBlock(), and initialize().

std::vector<std::string> L1EmulatorErrorFlagClient::m_systemErrorFlag [private]

Definition at line 82 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize(), and setSummary().

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

Definition at line 80 of file L1EmulatorErrorFlagClient.h.

Referenced by initialize().

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

Definition at line 77 of file L1EmulatorErrorFlagClient.h.

Referenced by beginJob(), endLuminosityBlock(), and initialize().

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

Definition at line 78 of file L1EmulatorErrorFlagClient.h.

Referenced by endLuminosityBlock(), and initialize().

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

Definition at line 79 of file L1EmulatorErrorFlagClient.h.

Referenced by endLuminosityBlock(), and initialize().

input parameters

Definition at line 57 of file L1EmulatorErrorFlagClient.h.

Referenced by endLuminosityBlock().