CMS 3D CMS Logo

Public Member Functions | Private Types | Private Member Functions | Private Attributes

L1GtTriggerMenuTester Class Reference

#include <L1GtTriggerMenuTester.h>

Inheritance diagram for L1GtTriggerMenuTester:
edm::EDAnalyzer

List of all members.

Public Member Functions

 L1GtTriggerMenuTester (const edm::ParameterSet &)
virtual ~L1GtTriggerMenuTester ()

Private Types

typedef std::map< std::string,
const L1GtAlgorithm * >
::const_iterator 
CItAlgoP
 constant iterator

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &)
 analyze
void associateL1SeedsHltPath (const edm::Run &, const edm::EventSetup &)
 L1 seed - HLT path association.
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 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 printTriggerGroup (const std::string &trigGroupName, const std::map< std::string, const L1GtAlgorithm * > &trigGroup, const bool compactPrint, const bool printPfsRates)
 printing template for a trigger group
void printWiki ()
 printing in Wiki format
void retrieveL1EventSetup (const edm::EventSetup &)
 retrieve all the relevant L1 trigger event setup records

Private Attributes

const AlgorithmMapm_algorithmAliasMap
const AlgorithmMapm_algorithmMap
std::vector< std::string > m_algoTriggerSeedNotInL1Menu
 vector of algorithm or technical triggers not in the L1 menu
HLTConfigProvider m_hltConfig
 The instance of the HLTConfigProvider as a data member.
std::vector< std::vector
< std::string > > 
m_hltPathsForL1AlgorithmTrigger
 vector of HLT paths seeded by a L1 algorithm trigger - vector index corresponds to the bit number
std::vector< std::vector
< std::string > > 
m_hltPathsForL1TechnicalTrigger
 vector of HLT paths seeded by a L1 technical trigger - vector index corresponds to the bit number
std::string m_hltProcessName
 process name of HLT process for which to get HLT configuration
std::string m_hltTableName
 HLT menu was used to associate the HLT path to the L1 algorithm triggers.
std::string m_htmlFile
 name of HTML file attached to the wiki page
int m_indexPfSet
 index of prescale factor set to be printed
const L1GtTriggerMenum_l1GtMenu
const L1GtPrescaleFactorsm_l1GtPfAlgo
 prescale factors
const L1GtPrescaleFactorsm_l1GtPfTech
const L1GtStableParametersm_l1GtStablePar
 event setup cached stuff
const L1GtTriggerMaskm_l1GtTmAlgo
 trigger masks & veto masks
const L1GtTriggerMaskm_l1GtTmTech
const L1GtTriggerMaskm_l1GtTmVetoAlgo
const L1GtTriggerMaskm_l1GtTmVetoTech
bool m_noThrowIncompatibleMenu
unsigned int m_numberAlgorithmTriggers
 number of algorithm triggers
unsigned int m_numberTechnicalTriggers
 number of technical triggers
bool m_overwriteHtmlFile
 input parameters
const std::vector< std::vector
< int > > * 
m_prescaleFactorsAlgoTrig
const std::vector< std::vector
< int > > * 
m_prescaleFactorsTechTrig
bool m_printPfsRates
 print prescale factors and rates
const AlgorithmMapm_technicalTriggerMap
std::vector< std::string > m_techTriggerSeedNotInL1Menu
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
const std::vector< unsigned int > * m_triggerMaskTechTrig
const std::vector< unsigned int > * m_triggerMaskVetoAlgoTrig
const std::vector< unsigned int > * m_triggerMaskVetoTechTrig
bool m_useHltMenu
 use a HLT menu for L1 seed - HLT path association

Detailed Description

Description: test analyzer for L1 GT trigger menu.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 45 of file L1GtTriggerMenuTester.h.


Member Typedef Documentation

typedef std::map<std::string, const L1GtAlgorithm*>::const_iterator L1GtTriggerMenuTester::CItAlgoP [private]

constant iterator

Definition at line 100 of file L1GtTriggerMenuTester.h.


Constructor & Destructor Documentation

L1GtTriggerMenuTester::L1GtTriggerMenuTester ( const edm::ParameterSet parSet) [explicit]

Definition at line 61 of file L1GtTriggerMenuTester.cc.

                                                                          :
            m_overwriteHtmlFile(parSet.getParameter<bool> ("OverwriteHtmlFile")),
            m_htmlFile(parSet.getParameter<std::string> ("HtmlFile")),
            m_useHltMenu(parSet.getParameter<bool> ("UseHltMenu")),
            m_hltProcessName(parSet.getParameter<std::string> ("HltProcessName")),
            m_noThrowIncompatibleMenu(
                    parSet.getParameter<bool> ("NoThrowIncompatibleMenu")),
            m_printPfsRates(parSet.getParameter<bool> ("PrintPfsRates")),
            m_indexPfSet(parSet.getParameter<int> ("IndexPfSet")),
            m_numberAlgorithmTriggers(0), m_numberTechnicalTriggers(0) {

    // empty

}
L1GtTriggerMenuTester::~L1GtTriggerMenuTester ( ) [virtual]

Definition at line 77 of file L1GtTriggerMenuTester.cc.

                                              {
    // empty
}

Member Function Documentation

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

analyze

Implements edm::EDAnalyzer.

Definition at line 146 of file L1GtTriggerMenuTester.cc.

                                      {

    // empty

}
void L1GtTriggerMenuTester::associateL1SeedsHltPath ( const edm::Run iRun,
const edm::EventSetup evSetup 
) [private]

L1 seed - HLT path association.

Definition at line 244 of file L1GtTriggerMenuTester.cc.

References Exception, L1GtLogicParser::expressionSeedsOperandList(), L1GtTriggerMenu::gtTriggerMenuName(), HLTConfigProvider::hltL1GTSeeds(), i, HLTConfigProvider::init(), m_algorithmAliasMap, m_algoTriggerSeedNotInL1Menu, m_hltConfig, m_hltPathsForL1AlgorithmTrigger, m_hltPathsForL1TechnicalTrigger, m_hltProcessName, m_hltTableName, m_l1GtMenu, m_noThrowIncompatibleMenu, m_numberAlgorithmTriggers, m_numberTechnicalTriggers, m_techTriggerSeedNotInL1Menu, edm::second(), HLTConfigProvider::size(), HLTConfigProvider::tableName(), and HLTConfigProvider::triggerName().

Referenced by beginRun().

                                      {

    bool hltChanged = true;

    if (m_hltConfig.init(iRun, evSetup, m_hltProcessName, hltChanged)) {

        // if init returns TRUE, initialization has succeeded!
        if (hltChanged) {

            // HLT configuration has actually changed wrt the previous run
            m_hltTableName = m_hltConfig.tableName();

            edm::LogVerbatim("L1GtTriggerMenuTester")
                    << "\nHLT ConfDB menu name: \n   " << m_hltTableName
                    << std::endl;

            // loop over trigger paths, get the HLTLevel1GTSeed logical expression, and add the path to
            // each L1 trigger

            m_hltPathsForL1AlgorithmTrigger.resize(m_numberAlgorithmTriggers);
            m_hltPathsForL1TechnicalTrigger.resize(m_numberTechnicalTriggers);

            m_algoTriggerSeedNotInL1Menu.reserve(m_numberAlgorithmTriggers);
            m_techTriggerSeedNotInL1Menu.reserve(m_numberTechnicalTriggers);

            for (unsigned int iHlt = 0; iHlt < m_hltConfig.size(); ++iHlt) {

                const std::string& hltPathName = m_hltConfig.triggerName(iHlt);

                const std::vector<std::pair<bool, std::string> >& hltL1Seed =
                        m_hltConfig.hltL1GTSeeds(hltPathName);

                unsigned int numberHltL1GTSeeds = hltL1Seed.size();

                edm::LogVerbatim("L1GtTriggerMenuTester") << "\nPath: "
                        << hltPathName << " :    <== " << numberHltL1GTSeeds
                        << " HLTLevel1GTSeed module(s)" << std::endl;

                for (unsigned int iSeedModule = 0; iSeedModule
                        < numberHltL1GTSeeds; ++iSeedModule) {

                    // one needs a non-const logical expression... TODO check why
                    std::string m_l1SeedsLogicalExpression =
                            (hltL1Seed[iSeedModule]).second;

                    edm::LogVerbatim("L1GtTriggerMenuTester") << "      '"
                            << m_l1SeedsLogicalExpression << "'";

                    // parse logical expression

                    if (m_l1SeedsLogicalExpression != "L1GlobalDecision") {

                        // check also the logical expression - add/remove spaces if needed
                        L1GtLogicParser m_l1AlgoLogicParser = L1GtLogicParser(
                                m_l1SeedsLogicalExpression);

                        // list of required algorithms for seeding
                        std::vector<L1GtLogicParser::OperandToken>
                                m_l1AlgoSeeds =
                                        m_l1AlgoLogicParser.expressionSeedsOperandList();
                        size_t l1AlgoSeedsSize = m_l1AlgoSeeds.size();

                        edm::LogVerbatim("L1GtTriggerMenuTester")
                                << " :    <== " << l1AlgoSeedsSize
                                << " L1 seeds" << std::endl;

                        // for each algorithm trigger, check if it is in the L1 menu, get the bit number
                        // and add path to the vector of strings for that bit number

                        for (size_t i = 0; i < l1AlgoSeedsSize; ++i) {

                            const std::string& trigNameOrAlias =
                                    (m_l1AlgoSeeds[i]).tokenName;

                            CItAlgo itAlgo = m_algorithmAliasMap->find(
                                    trigNameOrAlias);
                            if (itAlgo != m_algorithmAliasMap->end()) {

                                int bitNr = (itAlgo->second).algoBitNumber();

                                (m_hltPathsForL1AlgorithmTrigger.at(bitNr)).push_back(
                                        hltPathName);

                                edm::LogVerbatim("L1GtTriggerMenuTester")
                                        << "         " << trigNameOrAlias
                                        << " bit " << bitNr << std::endl;

                            } else {

                                if (m_noThrowIncompatibleMenu) {
                                    edm::LogVerbatim("L1GtTriggerMenuTester")
                                            << "         " << trigNameOrAlias
                                            << " trigger not in L1 menu "
                                            << m_l1GtMenu->gtTriggerMenuName()
                                            << std::endl;

                                    m_algoTriggerSeedNotInL1Menu.push_back(
                                            trigNameOrAlias);

                                } else {
                                    throw cms::Exception("FailModule")
                                            << "\nAlgorithm  "
                                            << trigNameOrAlias
                                            << ", requested as seed by a HLT path, not found in the L1 trigger menu\n   "
                                            << m_l1GtMenu->gtTriggerMenuName()
                                            << "\nIncompatible L1 and HLT menus.\n"
                                            << std::endl;

                                }
                            }
                        }

                    }
                }

            }
        }
    } else {
        // if init returns FALSE, initialization has NOT succeeded, which indicates a problem
        // with the file and/or code and needs to be investigated!
        edm::LogError("MyAnalyzer")
                << " HLT config extraction failure with process name "
                << m_hltProcessName;
    }

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

begin job

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file L1GtTriggerMenuTester.cc.

                                     {

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

begin luminosity block

Reimplemented from edm::EDAnalyzer.

Definition at line 140 of file L1GtTriggerMenuTester.cc.

                                      {

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

begin run

Reimplemented from edm::EDAnalyzer.

Definition at line 87 of file L1GtTriggerMenuTester.cc.

References associateL1SeedsHltPath(), m_algoTriggerSeedNotInL1Menu, m_l1GtMenu, m_noThrowIncompatibleMenu, m_useHltMenu, L1GtTriggerMenu::print(), printWiki(), and retrieveL1EventSetup().

                                      {

    // retrieve L1 trigger configuration
    retrieveL1EventSetup(evSetup);

    // print with various level of verbosity

    // define an output stream to print into
    // it can then be directed to whatever log level is desired
    std::ostringstream myCout;

    int printVerbosity = 0;
    m_l1GtMenu->print(myCout, printVerbosity);
    myCout << std::flush << std::endl;

    printVerbosity = 1;
    m_l1GtMenu->print(myCout, printVerbosity);
    myCout << std::flush << std::endl;

    printVerbosity = 2;
    m_l1GtMenu->print(myCout, printVerbosity);
    myCout << std::flush << std::endl;

    // redirect myCout to edm::LogVerbatim TODO - parameter to choose the log
    edm::LogVerbatim("L1GtTriggerMenuTester") << myCout.str() << std::endl;

    // prepare L1 - HLT
    if (m_useHltMenu) {
        associateL1SeedsHltPath(iRun, evSetup);

        if (m_noThrowIncompatibleMenu) {
            edm::LogVerbatim("L1GtTriggerMenuTester")
                    << "\n List of algorithm triggers used as L1 seeds but not in L1 menu"
                    << std::endl;

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

                edm::LogVerbatim("L1GtTriggerMenuTester") << "   "
                        << (*strIter) << std::endl;
            }

        }
    }

    // print in wiki format
    printWiki();

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

end job

Reimplemented from edm::EDAnalyzer.

Definition at line 165 of file L1GtTriggerMenuTester.cc.

                                   {

}
void L1GtTriggerMenuTester::endLuminosityBlock ( const edm::LuminosityBlock iLumiBlock,
const edm::EventSetup evSetup 
) [private, virtual]

end luminosity block

Reimplemented from edm::EDAnalyzer.

Definition at line 154 of file L1GtTriggerMenuTester.cc.

                                      {

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

end run

Reimplemented from edm::EDAnalyzer.

Definition at line 160 of file L1GtTriggerMenuTester.cc.

                                                                              {

}
void L1GtTriggerMenuTester::printTriggerGroup ( const std::string &  trigGroupName,
const std::map< std::string, const L1GtAlgorithm * > &  trigGroup,
const bool  compactPrint,
const bool  printPfsRates 
) [private]

printing template for a trigger group

Definition at line 373 of file L1GtTriggerMenuTester.cc.

References CreateSqliteForCondDB_cfg::hltPaths, m_hltPathsForL1AlgorithmTrigger, m_htmlFile, m_numberAlgorithmTriggers, m_numberTechnicalTriggers, and m_useHltMenu.

Referenced by printWiki().

                                                           {

    // FIXME get values - either read from a specific L1 menu file, or from
    std::string lumiVal1 = "5.0E33";
    std::string lumiVal2 = "7.0E33";
    std::string trigComment;

    int trigPfVal1 = 0;
    int trigPfVal2 = 0;

    int trigRateVal1 = 0;
    int trigRateVal2 = 0;

    // cumulative list of L1 triggers not used as seed by HLT
    std::vector < std::string > algoTriggerNotSeed;
    algoTriggerNotSeed.reserve(m_numberAlgorithmTriggers);

    std::vector < std::string > techTriggerNotSeed;
    techTriggerNotSeed.reserve(m_numberTechnicalTriggers);

    // force a page break before each group
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "<p style=\"page-break-before: always\">&nbsp;</p>";

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---++++ "
            << trigGroupName << "\n" << std::endl;

    if (compactPrint) {
        edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
                << "|  *Trigger Name*  |  *Trigger Alias*  |  *Bit*  |  *Comments*  |"
                << std::endl;

    } else {

        if (printPfsRates) {
            edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
                    << "|  *Trigger Name*  |  *Trigger Alias*  |  *Bit*  |  *Luminosity*  ||||  *Seed for !HLT path(s)*  |  *Comments*  |"
                    << std::endl;

            edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|^|^|^|  *"
                    << lumiVal1 << "*  ||  *" << lumiVal2
                    << "*  ||  **  |  **  |" << std::endl;

            edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
                    << "|^|^|^|  *PF*  |  *Rate*  |  *PF*  |  *Rate*  |  ** |  **  |"
                    << std::endl;

        } else {

            edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
                    << "|  *Trigger Name*  |  *Trigger Alias*  |  *Bit*  |  *Seed for !HLT path(s)*  |"
                    << std::endl;
        }

    }

    for (CItAlgoP itAlgo = trigGroup.begin(); itAlgo != trigGroup.end(); itAlgo++) {

        const std::string& aName = (itAlgo->second)->algoName();
        const std::string& aAlias = (itAlgo->second)->algoAlias();
        const int& bitNumber = (itAlgo->second)->algoBitNumber();


        // concatenate in a string, to simplify the next print instruction
        std::string seedsHlt;
        if (m_useHltMenu) {
            const std::vector<std::string> & hltPaths =
                    m_hltPathsForL1AlgorithmTrigger.at(bitNumber);

            if (hltPaths.size() < 1) {
                algoTriggerNotSeed.push_back(aAlias);
                seedsHlt
                        = "<font color = \"red\">Not used as seed by any !HLT path</font>";
            } else {

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

                    seedsHlt = seedsHlt + (*strIter) + "<BR>";
                }
            }

        }

        if (compactPrint) {
            edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|" << std::left
                    << "[[" << (m_htmlFile + "#" + aName) << "][ " << aName
                    << "]] " << "  |" << aAlias << "  |  " << bitNumber << "| |"
                    << std::endl;

        } else {

            if (printPfsRates) {
                edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|"
                        << std::left << "[[" << (m_htmlFile + "#" + aName)
                        << "][ " << aName << "]] " << "  |" << aAlias
                        << "  |  " << bitNumber << "|  "
                        << ((trigPfVal1 != 0) ? trigPfVal1 : 0) << "  |  "
                        << ((trigRateVal1 != 0) ? trigRateVal1 : 0) << "  |  "
                        << ((trigPfVal2 != 0) ? trigPfVal2 : 0) << "  |  "
                        << ((trigRateVal2 != 0) ? trigRateVal2 : 0) << "  |  "
                        << seedsHlt << "  |  " << trigComment << "  |"
                        << std::endl;

            } else {

                edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|"
                        << std::left << "[[" << (m_htmlFile + "#" + aName)
                        << "][ " << aName << "]] " << "  |" << aAlias
                        << "  |  " << bitNumber << "|" << seedsHlt << "  |  "
                        << std::endl;
            }

        }

    }

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n" << trigGroupName
            << ": " << (trigGroup.size()) << " bits defined." << std::endl;

    if (m_useHltMenu && (!compactPrint)) {
        edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
                << "\n Algorithm triggers from " << trigGroupName
                << " not used as seeds by !HLT:" << std::endl;

        if (algoTriggerNotSeed.size() != 0) {
            for (std::vector<std::string>::const_iterator strIter =
                    algoTriggerNotSeed.begin(); strIter
                    != algoTriggerNotSeed.end(); ++strIter) {

                edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "   * "
                        << (*strIter) << std::endl;
            }

        } else {
            edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "   * none"
                    << std::endl;
        }
    }

}
void L1GtTriggerMenuTester::printWiki ( ) [private]

printing in Wiki format

Definition at line 518 of file L1GtTriggerMenuTester.cc.

References asciidump::at, BPTX, CenJet, CondExternal, ETM, ETT, Exception, ForJet, L1GtTriggerMenu::gtConditionMap(), GtExternal, L1GtTriggerMenu::gtScaleDbKey(), L1GtTriggerMenu::gtTriggerMenuImplementation(), L1GtTriggerMenu::gtTriggerMenuInterface(), L1GtTriggerMenu::gtTriggerMenuName(), HfBitCounts, HfRingEtSums, HTM, HTT, i, IsoEG, JetCounts, m_algorithmMap, m_hltTableName, m_htmlFile, m_indexPfSet, m_l1GtMenu, m_numberAlgorithmTriggers, m_numberTechnicalTriggers, m_overwriteHtmlFile, m_prescaleFactorsAlgoTrig, m_prescaleFactorsTechTrig, m_printPfsRates, m_technicalTriggerMap, m_useHltMenu, Mu, NoIsoEG, L1GtLogicParser::OP_OPERAND, printTriggerGroup(), linker::replace(), TauJet, and TechTrig.

Referenced by beginRun().

                                      {

    //
    // print menu, prescale factors and trigger mask in wiki format
    //

    // L1 GT prescale factors for algorithm triggers

    std::vector<int> prescaleFactorsAlgoTrig = m_prescaleFactorsAlgoTrig->at(
            m_indexPfSet);

    // L1 GT prescale factors for technical triggers

    std::vector<int> prescaleFactorsTechTrig = m_prescaleFactorsTechTrig->at(
            m_indexPfSet);

    // use another map <int, L1GtAlgorithm> to get the menu sorted after bit number
    // both algorithm and bit numbers are unique
    typedef std::map<int, const L1GtAlgorithm*>::const_iterator CItBit;

    //    algorithm triggers

    std::map<int, const L1GtAlgorithm*> algoBitToAlgo;

    std::map<std::string, const L1GtAlgorithm*> jetAlgoTrig;
    std::map<std::string, const L1GtAlgorithm*> egammaAlgoTrig;
    std::map<std::string, const L1GtAlgorithm*> esumAlgoTrig;
    std::map<std::string, const L1GtAlgorithm*> muonAlgoTrig;
    std::map<std::string, const L1GtAlgorithm*> crossAlgoTrig;
    std::map<std::string, const L1GtAlgorithm*> bkgdAlgoTrig;

    int algoTrigNumber = 0;
    int freeAlgoTrigNumber = 0;

    int jetAlgoTrigNumber = 0;
    int egammaAlgoTrigNumber = 0;
    int esumAlgoTrigNumber = 0;
    int muonAlgoTrigNumber = 0;
    int crossAlgoTrigNumber = 0;
    int bkgdAlgoTrigNumber = 0;

    for (CItAlgo itAlgo = m_algorithmMap->begin(); itAlgo
            != m_algorithmMap->end(); itAlgo++) {

        const int bitNumber = (itAlgo->second).algoBitNumber();
        const std::string& algName = (itAlgo->second).algoName();

        algoBitToAlgo[bitNumber] = &(itAlgo->second);

        algoTrigNumber++;

        // per category

        const ConditionMap& conditionMap = (m_l1GtMenu->gtConditionMap()).at(
                (itAlgo->second).algoChipNumber());

        const std::vector<L1GtLogicParser::TokenRPN>& rpnVector =
                (itAlgo->second).algoRpnVector();
        const L1GtLogicParser::OperationType condOperand =
                L1GtLogicParser::OP_OPERAND;

        std::list<L1GtObject> listObjects;

        for (size_t i = 0; i < rpnVector.size(); ++i) {

            if ((rpnVector[i]).operation == condOperand) {

                const std::string& cndName = (rpnVector[i]).operand;

                // search the condition in the condition list

                bool foundCond = false;

                CItCond itCond = conditionMap.find(cndName);
                if (itCond != conditionMap.end()) {
                    foundCond = true;

                    // loop through object types and add them to the list

                    const std::vector<L1GtObject>& objType =
                            (itCond->second)->objectType();

                    for (std::vector<L1GtObject>::const_iterator itObject =
                            objType.begin(); itObject != objType.end(); itObject++) {
                        listObjects.push_back(*itObject);

                        edm::LogVerbatim("L1GtTriggerMenuTester")
                                << (*itObject) << std::endl;
                    }

                    // FIXME for XML parser, add GtExternal to objType correctly
                    if ((itCond->second)->condCategory() == CondExternal) {
                        listObjects.push_back(GtExternal);
                    }

                }

                if (!foundCond) {

                    // it should never be happen, all conditions are in the maps
                    throw cms::Exception("FailModule") << "\nCondition "
                            << cndName << " not found in the condition map"
                            << " for chip number "
                            << ((itAlgo->second).algoChipNumber()) << std::endl;
                }

            }

        }

        // eliminate duplicates
        listObjects.sort();
        listObjects.unique();

        // add the algorithm to the corresponding group

        bool jetGroup = false;
        bool egammaGroup = false;
        bool esumGroup = false;
        bool muonGroup = false;
        bool crossGroup = false;
        bool bkgdGroup = false;

        for (std::list<L1GtObject>::const_iterator itObj = listObjects.begin(); itObj
                != listObjects.end(); ++itObj) {

            switch (*itObj) {
                case Mu: {
                    muonGroup = true;
                }

                    break;
                case NoIsoEG: {
                    egammaGroup = true;
                }

                    break;
                case IsoEG: {
                    egammaGroup = true;
                }

                    break;
                case CenJet: {
                    jetGroup = true;
                }

                    break;
                case ForJet: {
                    jetGroup = true;
                }

                    break;
                case TauJet: {
                    jetGroup = true;
                }

                    break;
                case ETM: {
                    esumGroup = true;

                }

                    break;
                case ETT: {
                    esumGroup = true;

                }

                    break;
                case HTT: {
                    esumGroup = true;

                }

                    break;
                case HTM: {
                    esumGroup = true;

                }

                    break;
                case JetCounts: {
                    // do nothing - not available
                }

                    break;
                case HfBitCounts: {
                    bkgdGroup = true;
                }

                    break;
                case HfRingEtSums: {
                    bkgdGroup = true;
                }

                    break;
                case GtExternal: {
                    bkgdGroup = true;
                }

                    break;
                case TechTrig:
                case Castor:
                case BPTX:
                default: {
                    // should not arrive here

                    edm::LogVerbatim("L1GtTriggerMenuTester")
                            << "\n      Unknown object of type " << *itObj
                            << std::endl;
                }
                    break;
            }

        }

        int sumGroup = jetGroup + egammaGroup + esumGroup + muonGroup
                + crossGroup + bkgdGroup;

        if (sumGroup > 1) {
            crossAlgoTrig[algName] = &(itAlgo->second);
        } else {

            if (jetGroup) {
                jetAlgoTrig[algName] = &(itAlgo->second);

            } else if (egammaGroup) {
                egammaAlgoTrig[algName] = &(itAlgo->second);

            } else if (esumGroup && (listObjects.size() > 1)) {
                crossAlgoTrig[algName] = &(itAlgo->second);

            } else if (esumGroup) {
                esumAlgoTrig[algName] = &(itAlgo->second);

            } else if (muonGroup) {
                muonAlgoTrig[algName] = &(itAlgo->second);

            } else if (bkgdGroup) {
                bkgdAlgoTrig[algName] = &(itAlgo->second);

            } else {
                // do nothing
            }

        }

        edm::LogVerbatim("L1GtTriggerMenuTester") << algName << " sum: "
                << sumGroup << " size: " << listObjects.size() << std::endl;

    }

    freeAlgoTrigNumber = m_numberAlgorithmTriggers - algoTrigNumber;

    jetAlgoTrigNumber = jetAlgoTrig.size();
    egammaAlgoTrigNumber = egammaAlgoTrig.size();
    esumAlgoTrigNumber = esumAlgoTrig.size();
    muonAlgoTrigNumber = muonAlgoTrig.size();
    crossAlgoTrigNumber = crossAlgoTrig.size();
    bkgdAlgoTrigNumber = bkgdAlgoTrig.size();

    //    technical triggers
    std::map<int, const L1GtAlgorithm*> techBitToAlgo;

    int techTrigNumber = 0;
    int freeTechTrigNumber = 0;

    for (CItAlgo itAlgo = m_technicalTriggerMap->begin(); itAlgo
            != m_technicalTriggerMap->end(); itAlgo++) {

        int bitNumber = (itAlgo->second).algoBitNumber();
        techBitToAlgo[bitNumber] = &(itAlgo->second);

        techTrigNumber++;
    }

    freeTechTrigNumber = m_numberTechnicalTriggers - techTrigNumber;

    // name of the attached HTML file
    if (!m_overwriteHtmlFile) {
        std::string menuName = m_l1GtMenu->gtTriggerMenuImplementation();

        // replace "/" with "_"
        std::replace(menuName.begin(), menuName.end(), '/', '_');
        m_htmlFile = "%ATTACHURL%/" + menuName + ".html";
    } else {
        m_htmlFile = "%ATTACHURL%/" + m_htmlFile;
    }

    // header for printing algorithms

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "\n   ********** L1 Trigger Menu - printing in wiki format  ********** \n\n"
            << "\n---+++ L1 menu identification\n"
            << "\n|L1 Trigger Menu Interface: |!"
            << m_l1GtMenu->gtTriggerMenuInterface() << " |"
            << "\n|L1 Trigger Menu Name: |!" << m_l1GtMenu->gtTriggerMenuName()
            << " |" << "\n|L1 Trigger Menu Implementation: |!"
            << m_l1GtMenu->gtTriggerMenuImplementation() << " |"
            << "\n|Associated L1 scale DB key: |!"
            << m_l1GtMenu->gtScaleDbKey() << " |" << "\n\n" << std::flush
            << std::endl;

    // Overview page
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "\n---+++ Summary\n"
            << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "   * Number of algorithm triggers: " << algoTrigNumber
            << " defined, 128 possible." << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "   * Number of technical triggers: " << techTrigNumber
            << " defined,  64 possible.<BR><BR>" << std::endl;

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "   * Number of free bits for algorithm triggers: "
            << freeAlgoTrigNumber << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "   * Number of free bits for technical triggers: "
            << freeTechTrigNumber << "<BR>" << std::endl;

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "\nNumber of algorithm triggers per trigger group\n"
            << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "    | *Trigger group* | *Number of bits used*|" << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "    | Jet algorithm triggers: |  " << jetAlgoTrigNumber << "|"
            << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "    | EGamma algorithm triggers: |  " << egammaAlgoTrigNumber
            << "|" << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "    | Energy sum algorithm triggers: |  " << esumAlgoTrigNumber
            << "|" << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "    | Muon algorithm triggers: |  " << muonAlgoTrigNumber
            << "|" << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "    | Cross algorithm triggers: |  " << crossAlgoTrigNumber
            << "|" << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "    | Background algorithm triggers: |  " << bkgdAlgoTrigNumber
            << "|" << std::endl;

    // force a page break
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "<p style=\"page-break-before: always\">&nbsp;</p>";

    // compact print - without HLT path
    bool compactPrint = true;

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "\n---+++ List of algorithm triggers sorted by trigger groups\n"
            << std::endl;

    // Jet algorithm triggers
    printTriggerGroup("Jet algorithm triggers", jetAlgoTrig, compactPrint,
            m_printPfsRates);

    // EGamma algorithm triggers
    printTriggerGroup("EGamma algorithm triggers", egammaAlgoTrig,
            compactPrint, m_printPfsRates);

    // Energy sum algorithm triggers
    printTriggerGroup("Energy sum algorithm triggers", esumAlgoTrig,
            compactPrint, m_printPfsRates);

    // Muon algorithm triggers
    printTriggerGroup("Muon algorithm triggers", muonAlgoTrig, compactPrint,
            m_printPfsRates);

    // Cross algorithm triggers
    printTriggerGroup("Cross algorithm triggers", crossAlgoTrig, compactPrint,
            m_printPfsRates);

    // Background algorithm triggers
    printTriggerGroup("Background algorithm triggers", bkgdAlgoTrig,
            compactPrint, m_printPfsRates);

    // force a page break
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "<p style=\"page-break-before: always\">&nbsp;</p>";

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "\n---+++ List of algorithm triggers sorted by bits\n"
            << std::endl;

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "| *Algorithm* | *Alias* | *Bit number* |" << std::endl;

    for (CItBit itBit = algoBitToAlgo.begin(); itBit != algoBitToAlgo.end(); itBit++) {

        int bitNumber = itBit->first;
        std::string aName = (itBit->second)->algoName();
        std::string aAlias = (itBit->second)->algoAlias();

        edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|" << std::left
                << "[[" << (m_htmlFile + "#" + aName) << "][ " << aName
                << "]] " << "  |" << aAlias << "  |  " << bitNumber << "| |"
                << std::endl;

    }

    // force a page break
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "<p style=\"page-break-before: always\">&nbsp;</p>";
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "\n---+++ List of technical triggers\n" << std::endl;

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "| *Technical trigger* | *Bit number* |" << std::endl;

    for (CItBit itBit = techBitToAlgo.begin(); itBit != techBitToAlgo.end(); itBit++) {

        int bitNumber = itBit->first;
        std::string aName = (itBit->second)->algoName();
        std::string aAlias = (itBit->second)->algoAlias();

        edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << "|!" << std::left
                << aName << "  |  " << std::right << bitNumber << " |"
                << std::endl;
    }

    // force a page break
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "<p style=\"page-break-before: always\">&nbsp;</p>";

    // compact print false: with HLT path association, if the parameter m_useHltMenu is true
    // otherwise, we have no association computed

    if (m_useHltMenu) {
        compactPrint = false;
    } else {
        return;
    }

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "\n---+++ List of algorithm triggers sorted by trigger groups, including !HLT path association \n"
            << std::endl;

    edm::LogVerbatim("L1GtTriggerMenuTesterWiki")
            << "\n The following !HLT menu was used to associate the !HLT path to the L1 algorithm triggers:\n    "
            << std::endl;
    edm::LogVerbatim("L1GtTriggerMenuTesterWiki") << m_hltTableName
            << std::endl;

    // Jet algorithm triggers
    printTriggerGroup("Jet algorithm triggers", jetAlgoTrig, compactPrint,
            m_printPfsRates);

    // EGamma algorithm triggers
    printTriggerGroup("EGamma algorithm triggers", egammaAlgoTrig,
            compactPrint, m_printPfsRates);

    // Energy sum algorithm triggers
    printTriggerGroup("Energy sum algorithm triggers", esumAlgoTrig,
            compactPrint, m_printPfsRates);

    // Muon algorithm triggers
    printTriggerGroup("Muon algorithm triggers", muonAlgoTrig, compactPrint,
            m_printPfsRates);

    // Cross algorithm triggers
    printTriggerGroup("Cross algorithm triggers", crossAlgoTrig, compactPrint,
            m_printPfsRates);

    // Background algorithm triggers
    printTriggerGroup("Background algorithm triggers", bkgdAlgoTrig,
            compactPrint, m_printPfsRates);

}
void L1GtTriggerMenuTester::retrieveL1EventSetup ( const edm::EventSetup evSetup) [private]

retrieve all the relevant L1 trigger event setup records

Definition at line 169 of file L1GtTriggerMenuTester.cc.

References edm::EventSetup::get(), L1GtTriggerMenu::gtAlgorithmAliasMap(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtStableParameters::gtNumberPhysTriggers(), L1GtStableParameters::gtNumberTechnicalTriggers(), L1GtPrescaleFactors::gtPrescaleFactors(), L1GtTriggerMenu::gtTechnicalTriggerMap(), L1GtTriggerMask::gtTriggerMask(), m_algorithmAliasMap, m_algorithmMap, m_l1GtMenu, m_l1GtPfAlgo, m_l1GtPfTech, m_l1GtStablePar, m_l1GtTmAlgo, m_l1GtTmTech, m_l1GtTmVetoAlgo, m_l1GtTmVetoTech, m_numberAlgorithmTriggers, m_numberTechnicalTriggers, m_prescaleFactorsAlgoTrig, m_prescaleFactorsTechTrig, m_technicalTriggerMap, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, m_triggerMaskVetoAlgoTrig, m_triggerMaskVetoTechTrig, and edm::ESHandle< T >::product().

Referenced by beginRun().

                                                                             {

    // get / update the stable parameters from the EventSetup

    edm::ESHandle<L1GtStableParameters> l1GtStablePar;
    evSetup.get<L1GtStableParametersRcd> ().get(l1GtStablePar);
    m_l1GtStablePar = l1GtStablePar.product();

    // number of algorithm triggers
    m_numberAlgorithmTriggers = m_l1GtStablePar->gtNumberPhysTriggers();

    // number of technical triggers
    m_numberTechnicalTriggers = m_l1GtStablePar->gtNumberTechnicalTriggers();

//    int maxNumberTrigger = std::max(m_numberAlgorithmTriggers,
//            m_numberTechnicalTriggers);

//    m_triggerMaskSet.reserve(maxNumberTrigger);
//    m_prescaleFactorSet.reserve(maxNumberTrigger);

    // get / update the prescale factors from the EventSetup


    edm::ESHandle<L1GtPrescaleFactors> l1GtPfAlgo;
    evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd> ().get(l1GtPfAlgo);
    m_l1GtPfAlgo = l1GtPfAlgo.product();

    m_prescaleFactorsAlgoTrig = &(m_l1GtPfAlgo->gtPrescaleFactors());

    edm::ESHandle<L1GtPrescaleFactors> l1GtPfTech;
    evSetup.get<L1GtPrescaleFactorsTechTrigRcd> ().get(l1GtPfTech);
    m_l1GtPfTech = l1GtPfTech.product();

    m_prescaleFactorsTechTrig = &(m_l1GtPfTech->gtPrescaleFactors());

    // get / update the trigger mask from the EventSetup

    edm::ESHandle<L1GtTriggerMask> l1GtTmAlgo;
    evSetup.get<L1GtTriggerMaskAlgoTrigRcd> ().get(l1GtTmAlgo);
    m_l1GtTmAlgo = l1GtTmAlgo.product();

    m_triggerMaskAlgoTrig = &(m_l1GtTmAlgo->gtTriggerMask());

    edm::ESHandle<L1GtTriggerMask> l1GtTmTech;
    evSetup.get<L1GtTriggerMaskTechTrigRcd> ().get(l1GtTmTech);
    m_l1GtTmTech = l1GtTmTech.product();

    m_triggerMaskTechTrig = &(m_l1GtTmTech->gtTriggerMask());

    edm::ESHandle<L1GtTriggerMask> l1GtTmVetoAlgo;
    evSetup.get<L1GtTriggerMaskVetoAlgoTrigRcd> ().get(l1GtTmVetoAlgo);
    m_l1GtTmVetoAlgo = l1GtTmVetoAlgo.product();

    m_triggerMaskVetoAlgoTrig = &(m_l1GtTmVetoAlgo->gtTriggerMask());

    edm::ESHandle<L1GtTriggerMask> l1GtTmVetoTech;
    evSetup.get<L1GtTriggerMaskVetoTechTrigRcd> ().get(l1GtTmVetoTech);
    m_l1GtTmVetoTech = l1GtTmVetoTech.product();

    m_triggerMaskVetoTechTrig = &(m_l1GtTmVetoTech->gtTriggerMask());

    // get / update the trigger menu from the EventSetup

    edm::ESHandle<L1GtTriggerMenu> l1GtMenu;
    evSetup.get<L1GtTriggerMenuRcd> ().get(l1GtMenu);
    m_l1GtMenu = l1GtMenu.product();
    (const_cast<L1GtTriggerMenu*> (m_l1GtMenu))->buildGtConditionMap();

    m_algorithmMap = &(m_l1GtMenu->gtAlgorithmMap());
    m_algorithmAliasMap = &(m_l1GtMenu->gtAlgorithmAliasMap());

    m_technicalTriggerMap = &(m_l1GtMenu->gtTechnicalTriggerMap());

}

Member Data Documentation

Definition at line 167 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath(), and retrieveL1EventSetup().

Definition at line 166 of file L1GtTriggerMenuTester.h.

Referenced by printWiki(), and retrieveL1EventSetup().

std::vector<std::string> L1GtTriggerMenuTester::m_algoTriggerSeedNotInL1Menu [private]

vector of algorithm or technical triggers not in the L1 menu

Definition at line 185 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath(), and beginRun().

The instance of the HLTConfigProvider as a data member.

Definition at line 173 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath().

std::vector<std::vector<std::string> > L1GtTriggerMenuTester::m_hltPathsForL1AlgorithmTrigger [private]

vector of HLT paths seeded by a L1 algorithm trigger - vector index corresponds to the bit number

Definition at line 179 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath(), and printTriggerGroup().

std::vector<std::vector<std::string> > L1GtTriggerMenuTester::m_hltPathsForL1TechnicalTrigger [private]

vector of HLT paths seeded by a L1 technical trigger - vector index corresponds to the bit number

Definition at line 182 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath().

process name of HLT process for which to get HLT configuration

Definition at line 117 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath().

HLT menu was used to associate the HLT path to the L1 algorithm triggers.

Definition at line 176 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath(), and printWiki().

std::string L1GtTriggerMenuTester::m_htmlFile [private]

name of HTML file attached to the wiki page

Definition at line 111 of file L1GtTriggerMenuTester.h.

Referenced by printTriggerGroup(), and printWiki().

index of prescale factor set to be printed

Definition at line 127 of file L1GtTriggerMenuTester.h.

Referenced by printWiki().

prescale factors

Definition at line 143 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

Definition at line 145 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

event setup cached stuff

stable parameters

Definition at line 134 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

trigger masks & veto masks

Definition at line 151 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

Definition at line 152 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

Definition at line 154 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

Definition at line 155 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

do not throw an exceptions if a L1 trigger requested as seed is not available in the L1 menu, just report this

Definition at line 121 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath(), and beginRun().

number of algorithm triggers

Definition at line 137 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath(), printTriggerGroup(), printWiki(), and retrieveL1EventSetup().

number of technical triggers

Definition at line 140 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath(), printTriggerGroup(), printWiki(), and retrieveL1EventSetup().

input parameters

overwrite name of the HTML file containing the detailed L1 menu with the name given in m_htmlFile

Definition at line 108 of file L1GtTriggerMenuTester.h.

Referenced by printWiki().

const std::vector<std::vector<int> >* L1GtTriggerMenuTester::m_prescaleFactorsAlgoTrig [private]

Definition at line 147 of file L1GtTriggerMenuTester.h.

Referenced by printWiki(), and retrieveL1EventSetup().

const std::vector<std::vector<int> >* L1GtTriggerMenuTester::m_prescaleFactorsTechTrig [private]

Definition at line 148 of file L1GtTriggerMenuTester.h.

Referenced by printWiki(), and retrieveL1EventSetup().

print prescale factors and rates

Definition at line 124 of file L1GtTriggerMenuTester.h.

Referenced by printWiki().

Definition at line 168 of file L1GtTriggerMenuTester.h.

Referenced by printWiki(), and retrieveL1EventSetup().

std::vector<std::string> L1GtTriggerMenuTester::m_techTriggerSeedNotInL1Menu [private]

Definition at line 186 of file L1GtTriggerMenuTester.h.

Referenced by associateL1SeedsHltPath().

const std::vector<unsigned int>* L1GtTriggerMenuTester::m_triggerMaskAlgoTrig [private]

Definition at line 157 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

const std::vector<unsigned int>* L1GtTriggerMenuTester::m_triggerMaskTechTrig [private]

Definition at line 158 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

const std::vector<unsigned int>* L1GtTriggerMenuTester::m_triggerMaskVetoAlgoTrig [private]

Definition at line 160 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

const std::vector<unsigned int>* L1GtTriggerMenuTester::m_triggerMaskVetoTechTrig [private]

Definition at line 161 of file L1GtTriggerMenuTester.h.

Referenced by retrieveL1EventSetup().

use a HLT menu for L1 seed - HLT path association

Definition at line 114 of file L1GtTriggerMenuTester.h.

Referenced by beginRun(), printTriggerGroup(), and printWiki().