CMS 3D CMS Logo

Public Member Functions | Private Attributes

L1GlobalTriggerGTL Class Reference

#include <L1GlobalTriggerGTL.h>

List of all members.

Public Member Functions

const std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > & 
getAlgorithmOR () const
 return algorithm OR decision
const std::vector< const
L1MuGMTCand * > * 
getCandL1Mu () const
 return global muon trigger candidate
const std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers > & 
getDecisionWord () const
 return decision
void init (const int nrL1Mu, const int numberPhysTriggers)
 initialize the class (mainly reserve)
 L1GlobalTriggerGTL ()
void printGmtData (const int iBxInEvent) const
 print received Muon dataWord
void receiveGmtObjectData (edm::Event &, const edm::InputTag &, const int iBxInEvent, const bool receiveMu, const int nrL1Mu)
 receive data from Global Muon Trigger
void reset ()
 clear GTL
void run (edm::Event &iEvent, const edm::EventSetup &evSetup, const L1GlobalTriggerPSB *ptrGtPSB, const bool produceL1GtObjectMapRecord, const int iBxInEvent, std::auto_ptr< L1GlobalTriggerObjectMapRecord > &gtObjectMapRecord, const unsigned int numberPhysTriggers, const int nrL1Mu, const int nrL1NoIsoEG, const int nrL1IsoEG, const int nrL1CenJet, const int nrL1ForJet, const int nrL1TauJet, const int nrL1JetCounts, const int ifMuEtaNumberBits, const int ifCaloEtaNumberBits)
 run the GTL
void setVerbosity (const int verbosity)
virtual ~L1GlobalTriggerGTL ()

Private Attributes

std::vector< const L1MuGMTCand * > * m_candL1Mu
L1GtEtaPhiConversionsm_gtEtaPhiConversions
std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers
m_gtlAlgorithmOR
std::bitset
< L1GlobalTriggerReadoutSetup::NumberPhysTriggers
m_gtlDecisionWord
bool m_isDebugEnabled
const L1CaloGeometrym_l1CaloGeometry
unsigned long long m_l1CaloGeometryCacheID
const L1GtTriggerMenum_l1GtMenu
unsigned long long m_l1GtMenuCacheID
const L1MuTriggerScalesm_l1MuTriggerScales
unsigned long long m_l1MuTriggerScalesCacheID
int m_verbosity
 verbosity level

Detailed Description

Description: Global Trigger Logic board.

Implementation: <TODO: enter implementation details>

Author:
: M. Fierro - HEPHY Vienna - ORCA version
: Vasile Mihai Ghete - HEPHY Vienna - CMSSW version

$Date$ $Revision$

Description: Global Trigger Logic board, see header file for details.

Implementation: <TODO: enter implementation details>

Author:
: M. Fierro - HEPHY Vienna - ORCA version
: Vasile Mihai Ghete - HEPHY Vienna - CMSSW version

$Date$ $Revision$

Definition at line 45 of file L1GlobalTriggerGTL.h.


Constructor & Destructor Documentation

L1GlobalTriggerGTL::L1GlobalTriggerGTL ( )

Definition at line 79 of file L1GlobalTriggerGTL.cc.

References m_gtEtaPhiConversions, m_gtlAlgorithmOR, m_gtlDecisionWord, m_l1CaloGeometryCacheID, m_l1GtMenuCacheID, and m_l1MuTriggerScalesCacheID.

                                       :
    m_candL1Mu( new std::vector<const L1MuGMTCand*>),
    m_isDebugEnabled(edm::isDebugEnabled())
{

    m_gtlAlgorithmOR.reset();
    m_gtlDecisionWord.reset();

    // initialize cached IDs
    m_l1GtMenuCacheID = 0ULL;
    m_l1CaloGeometryCacheID = 0ULL;
    m_l1MuTriggerScalesCacheID = 0ULL;

    // pointer to conversion - actually done in the event loop (cached)
    m_gtEtaPhiConversions = new L1GtEtaPhiConversions();

}
L1GlobalTriggerGTL::~L1GlobalTriggerGTL ( ) [virtual]

Definition at line 98 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtEtaPhiConversions, and reset().

                                        {

    reset();
    delete m_candL1Mu;
    delete m_gtEtaPhiConversions;

}

Member Function Documentation

const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers>& L1GlobalTriggerGTL::getAlgorithmOR ( ) const [inline]

return algorithm OR decision

Definition at line 96 of file L1GlobalTriggerGTL.h.

References m_gtlAlgorithmOR.

Referenced by L1GlobalTriggerFDL::run().

    {
        return m_gtlAlgorithmOR;
    }
const std::vector<const L1MuGMTCand*>* L1GlobalTriggerGTL::getCandL1Mu ( ) const [inline]

return global muon trigger candidate

Definition at line 102 of file L1GlobalTriggerGTL.h.

References m_candL1Mu.

Referenced by L1GtCorrelationCondition::evaluateCondition(), L1GtMuonCondition::evaluateCondition(), and L1GtMuonCondition::getCandidate().

    {
        return m_candL1Mu;
    }
const std::bitset<L1GlobalTriggerReadoutSetup::NumberPhysTriggers>& L1GlobalTriggerGTL::getDecisionWord ( ) const [inline]

return decision

Definition at line 90 of file L1GlobalTriggerGTL.h.

References m_gtlDecisionWord.

    {
        return m_gtlDecisionWord;
    }
void L1GlobalTriggerGTL::init ( const int  nrL1Mu,
const int  numberPhysTriggers 
)

initialize the class (mainly reserve)

Definition at line 107 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu.

Referenced by L1GlobalTrigger::produce().

                                                                            {

    m_candL1Mu->reserve(nrL1Mu);

    // FIXME move from bitset to std::vector<bool> to be able to use
    // numberPhysTriggers from EventSetup

    //m_gtlAlgorithmOR.reserve(numberPhysTriggers);
    //m_gtlAlgorithmOR.assign(numberPhysTriggers, false);

    //m_gtlDecisionWord.reserve(numberPhysTriggers);
    //m_gtlDecisionWord.assign(numberPhysTriggers, false);

}
void L1GlobalTriggerGTL::printGmtData ( const int  iBxInEvent) const

print received Muon dataWord

Definition at line 727 of file L1GlobalTriggerGTL.cc.

References LogTrace, and m_candL1Mu.

Referenced by receiveGmtObjectData().

                                                                {

    LogTrace("L1GlobalTriggerGTL")
            << "\nL1GlobalTrigger: GMT data received for BxInEvent = "
            << iBxInEvent << std::endl;

    int nrL1Mu = m_candL1Mu->size();
    LogTrace("L1GlobalTriggerGTL")
            << "Number of GMT muons = " << nrL1Mu << "\n"
            << std::endl;

    for (std::vector<const L1MuGMTCand*>::const_iterator iter =
            m_candL1Mu->begin(); iter != m_candL1Mu->end(); iter++) {

        LogTrace("L1GlobalTriggerGTL") << *(*iter) << std::endl;

    }

    LogTrace("L1GlobalTriggerGTL") << std::endl;

}
void L1GlobalTriggerGTL::receiveGmtObjectData ( edm::Event iEvent,
const edm::InputTag muGmtInputTag,
const int  iBxInEvent,
const bool  receiveMu,
const int  nrL1Mu 
)

receive data from Global Muon Trigger

Definition at line 123 of file L1GlobalTriggerGTL.cc.

References edm::Event::getByLabel(), edm::HandleBase::isValid(), LogDebug, m_isDebugEnabled, m_verbosity, printGmtData(), and reset().

Referenced by L1GlobalTrigger::produce().

                      {

    if (m_verbosity) {
        LogDebug("L1GlobalTriggerGTL")
                << "\n**** L1GlobalTriggerGTL receiving muon data for BxInEvent = "
                << iBxInEvent << "\n     from input tag " << muGmtInputTag << "\n"
                << std::endl;

    }

    reset();

    // get data from Global Muon Trigger
    if (receiveMu) {

        edm::Handle<std::vector<L1MuGMTCand> > muonData;
        iEvent.getByLabel(muGmtInputTag, muonData);

        if (!muonData.isValid()) {
            if (m_verbosity) {
                edm::LogWarning("L1GlobalTriggerGTL")
                        << "\nWarning: std::vector<L1MuGMTCand> with input tag "
                        << muGmtInputTag
                        << "\nrequested in configuration, but not found in the event.\n"
                        << std::endl;
            }
        } else {

            std::vector<L1MuGMTCand>::const_iterator itMuon;
            for (itMuon = muonData->begin(); itMuon != muonData->end(); itMuon++) {
                if ((*itMuon).bx() == iBxInEvent) {

                    (*m_candL1Mu).push_back(&(*itMuon));
                    //LogTrace("L1GlobalTriggerGTL") << (*itMuon)
                    //        << std::endl;

                }

            }

        }
    }

    if (m_verbosity && m_isDebugEnabled) {
        printGmtData(iBxInEvent);
    }

}
void L1GlobalTriggerGTL::reset ( void  )

clear GTL

Definition at line 717 of file L1GlobalTriggerGTL.cc.

References m_candL1Mu, m_gtlAlgorithmOR, and m_gtlDecisionWord.

Referenced by L1GlobalTrigger::produce(), receiveGmtObjectData(), and ~L1GlobalTriggerGTL().

                               {

    m_candL1Mu->clear();

    m_gtlDecisionWord.reset();
    m_gtlAlgorithmOR.reset();

}
void L1GlobalTriggerGTL::run ( edm::Event iEvent,
const edm::EventSetup evSetup,
const L1GlobalTriggerPSB ptrGtPSB,
const bool  produceL1GtObjectMapRecord,
const int  iBxInEvent,
std::auto_ptr< L1GlobalTriggerObjectMapRecord > &  gtObjectMapRecord,
const unsigned int  numberPhysTriggers,
const int  nrL1Mu,
const int  nrL1NoIsoEG,
const int  nrL1IsoEG,
const int  nrL1CenJet,
const int  nrL1ForJet,
const int  nrL1TauJet,
const int  nrL1JetCounts,
const int  ifMuEtaNumberBits,
const int  ifCaloEtaNumberBits 
)

run the GTL

Definition at line 175 of file L1GlobalTriggerGTL.cc.

References CenJet, L1GtCorrelationTemplate::cond0Category(), L1GtCorrelationTemplate::cond0Index(), L1GtCorrelationTemplate::cond1Category(), L1GtCorrelationTemplate::cond1Index(), CondBptx, CondCalo, CondCastor, CondCorrelation, CondEnergySum, CondExternal, CondHfBitCounts, CondHfRingEtSums, CondJetCounts, CondMuon, CondNull, L1GtEtaPhiConversions::convert(), L1GtTriggerMenu::corCaloTemplate(), L1GtTriggerMenu::corEnergySumTemplate(), L1GtTriggerMenu::corMuonTemplate(), L1GtAlgorithmEvaluation::evaluateAlgorithm(), L1GtConditionEvaluation::evaluateConditionStoreResult(), ForJet, edm::EventSetup::get(), L1GtAlgorithmEvaluation::gtAlgoCombinationVector(), L1GtAlgorithmEvaluation::gtAlgoResult(), L1GtTriggerMenu::gtAlgorithmMap(), L1GtTriggerMenu::gtConditionMap(), IsoEG, l1CaloGeometry_cfi::l1CaloGeometry, LogTrace, m_gtEtaPhiConversions, m_gtlAlgorithmOR, m_isDebugEnabled, m_l1CaloGeometry, m_l1CaloGeometryCacheID, m_l1GtMenu, m_l1GtMenuCacheID, m_l1MuTriggerScales, m_l1MuTriggerScalesCacheID, m_verbosity, NoIsoEG, L1GtCondition::objectType(), L1GtLogicParser::operandTokenVector(), L1GtCaloCondition::print(), L1GtExternalCondition::print(), L1GtMuonCondition::print(), L1GtHfBitCountsCondition::print(), L1GtEnergySumCondition::print(), L1GtCorrelationCondition::print(), L1GlobalTriggerObjectMap::print(), L1GtAlgorithmEvaluation::print(), reco::print(), L1GtBptxCondition::print(), L1GtCastorCondition::print(), L1GtHfRingEtSumsCondition::print(), L1GtJetCountsCondition::print(), edm::ESHandle< T >::product(), L1GlobalTriggerObjectMap::setAlgoBitNumber(), L1GlobalTriggerObjectMap::setAlgoGtlResult(), L1GlobalTriggerObjectMap::setAlgoName(), L1GlobalTriggerObjectMap::setCombinationVector(), L1GlobalTriggerObjectMap::setOperandTokenVector(), L1GtConditionEvaluation::setVerbosity(), and TauJet.

Referenced by L1GlobalTrigger::produce().

                                                                    {


        // get / update the trigger menu from the EventSetup
    // local cache & check on cacheIdentifier

    unsigned long long l1GtMenuCacheID = evSetup.get<L1GtTriggerMenuRcd>().cacheIdentifier();

    if (m_l1GtMenuCacheID != l1GtMenuCacheID) {

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

        m_l1GtMenuCacheID = l1GtMenuCacheID;

    }

    const std::vector<ConditionMap>& conditionMap = m_l1GtMenu->gtConditionMap();
    const AlgorithmMap& algorithmMap = m_l1GtMenu->gtAlgorithmMap();

    const std::vector<std::vector<L1GtMuonTemplate> >& corrMuon =
            m_l1GtMenu->corMuonTemplate();

    const std::vector<std::vector<L1GtCaloTemplate> >& corrCalo =
            m_l1GtMenu->corCaloTemplate();

    const std::vector<std::vector<L1GtEnergySumTemplate> >& corrEnergySum =
            m_l1GtMenu->corEnergySumTemplate();

    // conversion needed for correlation conditions
    // waste time - done also when no correlation template is in the menu
    // TODO timing against "search the conditionMap for correlation conditions,
    //      execute it conditionally?"
    bool convertScale = false;

    // get / update the calorimeter geometry from the EventSetup
    // local cache & check on cacheIdentifier
    unsigned long long l1CaloGeometryCacheID =
            evSetup.get<L1CaloGeometryRecord>().cacheIdentifier();

    if (m_l1CaloGeometryCacheID != l1CaloGeometryCacheID) {

        edm::ESHandle<L1CaloGeometry> l1CaloGeometry;
        evSetup.get<L1CaloGeometryRecord>().get(l1CaloGeometry) ;
        m_l1CaloGeometry =  l1CaloGeometry.product();

        m_l1CaloGeometryCacheID = l1CaloGeometryCacheID;
        convertScale = true;

    }

    // get / update the eta and phi muon trigger scales from the EventSetup
    // local cache & check on cacheIdentifier
    unsigned long long l1MuTriggerScalesCacheID =
            evSetup.get<L1MuTriggerScalesRcd>().cacheIdentifier();

    if (m_l1MuTriggerScalesCacheID != l1MuTriggerScalesCacheID) {

        edm::ESHandle< L1MuTriggerScales> l1MuTriggerScales;
        evSetup.get< L1MuTriggerScalesRcd>().get(l1MuTriggerScales);
        m_l1MuTriggerScales = l1MuTriggerScales.product();

        m_l1MuTriggerScalesCacheID = l1MuTriggerScalesCacheID;
        convertScale = true;
    }

    if (convertScale) {
        m_gtEtaPhiConversions->convert(m_l1CaloGeometry, m_l1MuTriggerScales,
                ifCaloEtaNumberBits, ifMuEtaNumberBits);
    }


    // loop over condition maps (one map per condition chip)
    // then loop over conditions in the map
    // save the results in temporary maps


    std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap> conditionResultMaps;
    conditionResultMaps.reserve(conditionMap.size());

    int iChip = -1;

    for (std::vector<ConditionMap>::const_iterator
                itCondOnChip = conditionMap.begin(); itCondOnChip != conditionMap.end(); itCondOnChip++) {

        iChip++;

        //L1GtAlgorithmEvaluation::ConditionEvaluationMap cMapResults;
        L1GtAlgorithmEvaluation::ConditionEvaluationMap cMapResults((*itCondOnChip).size()); // hash map

        for (CItCond itCond = itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {

            // evaluate condition
            switch ((itCond->second)->condCategory()) {
                case CondMuon: {

                    L1GtMuonCondition* muCondition = new L1GtMuonCondition(itCond->second, this,
                            nrL1Mu, ifMuEtaNumberBits);

                    muCondition->setVerbosity(m_verbosity);
                    muCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = muCondition;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        muCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }

                    //delete muCondition;

                }
                    break;
                case CondCalo: {

                    L1GtCaloCondition* caloCondition = new L1GtCaloCondition(
                            itCond->second, ptrGtPSB,
                            nrL1NoIsoEG,
                            nrL1IsoEG,
                            nrL1CenJet,
                            nrL1ForJet,
                            nrL1TauJet,
                            ifCaloEtaNumberBits);

                    caloCondition->setVerbosity(m_verbosity);
                    caloCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = caloCondition;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        caloCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }
                    //                    delete caloCondition;

                }
                    break;
                case CondEnergySum: {
                    L1GtEnergySumCondition* eSumCondition = new L1GtEnergySumCondition(
                            itCond->second, ptrGtPSB);

                    eSumCondition->setVerbosity(m_verbosity);
                    eSumCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = eSumCondition;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        eSumCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }
                    //                    delete eSumCondition;

                }
                    break;
                case CondJetCounts: {
                    L1GtJetCountsCondition* jcCondition = new L1GtJetCountsCondition(
                            itCond->second, ptrGtPSB, nrL1JetCounts);

                    jcCondition->setVerbosity(m_verbosity);
                    jcCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = jcCondition;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        jcCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }

                    //                  delete jcCondition;

                }
                    break;
                case CondHfBitCounts: {
                    L1GtHfBitCountsCondition* bcCondition = new L1GtHfBitCountsCondition(
                            itCond->second, ptrGtPSB);

                    bcCondition->setVerbosity(m_verbosity);
                    bcCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = bcCondition;

                    if (m_isDebugEnabled ) {
                        std::ostringstream myCout;
                        bcCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }

                    //                  delete bcCondition;

                }
                    break;
                case CondHfRingEtSums: {
                    L1GtHfRingEtSumsCondition* etCondition = new L1GtHfRingEtSumsCondition(
                            itCond->second, ptrGtPSB);

                    etCondition->setVerbosity(m_verbosity);
                    etCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = etCondition;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        etCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }

                    //                  delete etCondition;

                }
                    break;
                case CondCastor: {
                    bool castorCondResult = false;

                    // FIXME need a solution to read CASTOR
                    //if (castorConditionFlag) {
                    //    castorCondResult = castorData->conditionResult(itCond->first);
                    //}

                    L1GtCastorCondition* castorCondition = new L1GtCastorCondition(
                            itCond->second, castorCondResult);

                    castorCondition->setVerbosity(m_verbosity);
                    castorCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = castorCondition;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        castorCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }

                    //                  delete castorCondition;

                }
                    break;
                case CondBptx: {
                    bool bptxCondResult = true;

                    // FIXME need a solution to read BPTX with real value

                    L1GtBptxCondition* bptxCondition = new L1GtBptxCondition(
                            itCond->second, bptxCondResult);

                    bptxCondition->setVerbosity(m_verbosity);
                    bptxCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = bptxCondition;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        bptxCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }

                    //                  delete bptxCondition;

                }
                    break;
                case CondExternal: {
                    bool externalCondResult = true;

                    // FIXME need a solution to read External with real value

                    L1GtExternalCondition* externalCondition = new L1GtExternalCondition(
                            itCond->second, externalCondResult);

                    externalCondition->setVerbosity(m_verbosity);
                    externalCondition->evaluateConditionStoreResult();

                    cMapResults[itCond->first] = externalCondition;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        externalCondition->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }

                    //                  delete externalCondition;

                }
                    break;
                case CondCorrelation: {

                    // get first the sub-conditions
                    const L1GtCorrelationTemplate* corrTemplate =
                        static_cast<const L1GtCorrelationTemplate*>(itCond->second);
                    const L1GtConditionCategory cond0Categ = corrTemplate->cond0Category();
                    const L1GtConditionCategory cond1Categ = corrTemplate->cond1Category();
                    const int cond0Ind = corrTemplate->cond0Index();
                    const int cond1Ind = corrTemplate->cond1Index();

                    const L1GtCondition* cond0Condition = 0;
                    const L1GtCondition* cond1Condition = 0;

                    // maximum number of objects received for evaluation of Type1s condition
                    int cond0NrL1Objects = 0;
                    int cond1NrL1Objects = 0;

                    int cond0EtaBits = 0;
                    int cond1EtaBits = 0;

                    switch (cond0Categ) {
                        case CondMuon: {
                            cond0Condition = &((corrMuon[iChip])[cond0Ind]);
                            cond0NrL1Objects = nrL1Mu;
                            cond0EtaBits = ifMuEtaNumberBits;
                        }
                            break;
                        case CondCalo: {
                            cond0Condition = &((corrCalo[iChip])[cond0Ind]);

                            switch ((cond0Condition->objectType())[0]) {
                                case NoIsoEG:
                                    cond0NrL1Objects= nrL1NoIsoEG;
                                    break;
                                case IsoEG:
                                    cond0NrL1Objects = nrL1IsoEG;
                                    break;
                                case CenJet:
                                    cond0NrL1Objects = nrL1CenJet;
                                    break;
                                case ForJet:
                                    cond0NrL1Objects = nrL1ForJet;
                                    break;
                                case TauJet:
                                    cond0NrL1Objects = nrL1TauJet;
                                    break;
                                default:
                                    cond0NrL1Objects = 0;
                                    break;
                            }

                            cond0EtaBits = ifCaloEtaNumberBits;
                        }
                            break;
                        case CondEnergySum: {
                            cond0Condition = &((corrEnergySum[iChip])[cond0Ind]);
                            cond0NrL1Objects = 1;
                        }
                            break;
                        default: {
                            // do nothing, should not arrive here
                        }
                            break;
                    }

                    switch (cond1Categ) {
                        case CondMuon: {
                            cond1Condition = &((corrMuon[iChip])[cond1Ind]);
                            cond1NrL1Objects = nrL1Mu;
                            cond1EtaBits = ifMuEtaNumberBits;
                        }
                            break;
                        case CondCalo: {
                            cond1Condition = &((corrCalo[iChip])[cond1Ind]);

                            switch ((cond1Condition->objectType())[0]) {
                                case NoIsoEG:
                                    cond1NrL1Objects= nrL1NoIsoEG;
                                    break;
                                case IsoEG:
                                    cond1NrL1Objects = nrL1IsoEG;
                                    break;
                                case CenJet:
                                    cond1NrL1Objects = nrL1CenJet;
                                    break;
                                case ForJet:
                                    cond1NrL1Objects = nrL1ForJet;
                                    break;
                                case TauJet:
                                    cond1NrL1Objects = nrL1TauJet;
                                    break;
                                default:
                                    cond1NrL1Objects = 0;
                                    break;
                            }

                             cond1EtaBits = ifCaloEtaNumberBits;
                        }
                            break;
                        case CondEnergySum: {
                            cond1Condition = &((corrEnergySum[iChip])[cond1Ind]);
                            cond1NrL1Objects = 1;
                        }
                            break;
                        default: {
                            // do nothing, should not arrive here
                        }
                            break;
                    }

                    L1GtCorrelationCondition* correlationCond =
                        new L1GtCorrelationCondition(itCond->second,
                            cond0Condition, cond1Condition,
                            cond0NrL1Objects, cond1NrL1Objects,
                            cond0EtaBits, cond1EtaBits,
                            this, ptrGtPSB, m_gtEtaPhiConversions);

                    correlationCond->evaluateConditionStoreResult();
                    correlationCond->setVerbosity(m_verbosity);

                    cMapResults[itCond->first] = correlationCond;

                    if (m_verbosity && m_isDebugEnabled) {
                        std::ostringstream myCout;
                        correlationCond->print(myCout);

                        LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
                    }

                    //                  delete correlationCond;

                }
                    break;
                case CondNull: {

                    // do nothing

                }
                    break;
                default: {

                    // do nothing

                }
                    break;
            }

        }

        conditionResultMaps.push_back(cMapResults);

    }

    // loop over algorithm map

    // empty vector for object maps - filled during loop
    std::vector<L1GlobalTriggerObjectMap> objMapVec;
    objMapVec.reserve(numberPhysTriggers);

    for (CItAlgo itAlgo = algorithmMap.begin(); itAlgo != algorithmMap.end(); itAlgo++) {

        L1GtAlgorithmEvaluation gtAlg(itAlgo->second);
        gtAlg.evaluateAlgorithm((itAlgo->second).algoChipNumber(), conditionResultMaps);

        int algBitNumber = (itAlgo->second).algoBitNumber();
        bool algResult = gtAlg.gtAlgoResult();

        if (algResult) {
            m_gtlAlgorithmOR.set(algBitNumber);
        }

        // object maps only for BxInEvent = 0
        if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {

            // set object map
            L1GlobalTriggerObjectMap objMap;

            objMap.setAlgoName(itAlgo->first);
            objMap.setAlgoBitNumber(algBitNumber);
            objMap.setAlgoGtlResult(algResult);
            objMap.setOperandTokenVector(gtAlg.operandTokenVector());
            objMap.setCombinationVector(*(gtAlg.gtAlgoCombinationVector()));

            if (m_verbosity && m_isDebugEnabled) {
                std::ostringstream myCout1;
                objMap.print(myCout1);

                LogTrace("L1GlobalTriggerGTL") << myCout1.str() << std::endl;
            }

            objMapVec.push_back(objMap);

        }

        if (m_verbosity && m_isDebugEnabled) {
            std::ostringstream myCout;
            ( itAlgo->second ).print(myCout);
            gtAlg.print(myCout);

            LogTrace("L1GlobalTriggerGTL") << myCout.str() << std::endl;
        }

    }

    // object maps only for BxInEvent = 0
    if (produceL1GtObjectMapRecord && (iBxInEvent == 0)) {
        gtObjectMapRecord->setGtObjectMap(objMapVec);
    }

    // loop over condition maps (one map per condition chip)
    // then loop over conditions in the map
    // delete the conditions created with new, clear all
    for (std::vector<L1GtAlgorithmEvaluation::ConditionEvaluationMap>::iterator
        itCondOnChip = conditionResultMaps.begin(); itCondOnChip != conditionResultMaps.end();
        itCondOnChip++) {

        for (L1GtAlgorithmEvaluation::ItEvalMap itCond =
            itCondOnChip->begin(); itCond != itCondOnChip->end(); itCond++) {

            if (itCond->second != 0) {
                delete itCond->second;
            }
            itCond->second = 0;

        }

        itCondOnChip->clear();
    }

    conditionResultMaps.clear();

}
void L1GlobalTriggerGTL::setVerbosity ( const int  verbosity) [inline]

Definition at line 109 of file L1GlobalTriggerGTL.h.

References m_verbosity, and verbosity.

Referenced by L1GlobalTrigger::L1GlobalTrigger().


Member Data Documentation

std::vector<const L1MuGMTCand*>* L1GlobalTriggerGTL::m_candL1Mu [private]

Definition at line 133 of file L1GlobalTriggerGTL.h.

Referenced by getCandL1Mu(), init(), printGmtData(), reset(), and ~L1GlobalTriggerGTL().

Definition at line 129 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), run(), and ~L1GlobalTriggerGTL().

Definition at line 135 of file L1GlobalTriggerGTL.h.

Referenced by getAlgorithmOR(), L1GlobalTriggerGTL(), reset(), and run().

Definition at line 136 of file L1GlobalTriggerGTL.h.

Referenced by getDecisionWord(), L1GlobalTriggerGTL(), and reset().

Definition at line 142 of file L1GlobalTriggerGTL.h.

Referenced by receiveGmtObjectData(), and run().

Definition at line 122 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1CaloGeometryCacheID [private]

Definition at line 123 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

Definition at line 118 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1GtMenuCacheID [private]

Definition at line 119 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

Definition at line 125 of file L1GlobalTriggerGTL.h.

Referenced by run().

unsigned long long L1GlobalTriggerGTL::m_l1MuTriggerScalesCacheID [private]

Definition at line 126 of file L1GlobalTriggerGTL.h.

Referenced by L1GlobalTriggerGTL(), and run().

verbosity level

Definition at line 141 of file L1GlobalTriggerGTL.h.

Referenced by receiveGmtObjectData(), run(), and setVerbosity().