CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

L1GtTriggerMenuLiteProducer Class Reference

#include <L1GtTriggerMenuLiteProducer.h>

Inheritance diagram for L1GtTriggerMenuLiteProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 L1GtTriggerMenuLiteProducer (const edm::ParameterSet &)
 constructor(s)
virtual ~L1GtTriggerMenuLiteProducer ()
 destructor

Private Member Functions

virtual void beginJob ()
void beginRun (edm::Run &, const edm::EventSetup &)
virtual void endJob ()
void endRun (edm::Run &, const edm::EventSetup &)
virtual void produce (edm::Event &, const edm::EventSetup &)
void retrieveL1EventSetup (const edm::EventSetup &)

Private Attributes

const AlgorithmMapm_algorithmAliasMap
const AlgorithmMapm_algorithmMap
const L1GtTriggerMenum_l1GtMenu
unsigned long long m_l1GtMenuCacheID
const L1GtPrescaleFactorsm_l1GtPfAlgo
 prescale factors
unsigned long long m_l1GtPfAlgoCacheID
const L1GtPrescaleFactorsm_l1GtPfTech
unsigned long long m_l1GtPfTechCacheID
const L1GtStableParametersm_l1GtStablePar
 cached stuff
unsigned long long m_l1GtStableParCacheID
const L1GtTriggerMaskm_l1GtTmAlgo
 trigger masks
unsigned long long m_l1GtTmAlgoCacheID
const L1GtTriggerMaskm_l1GtTmTech
unsigned long long m_l1GtTmTechCacheID
unsigned int m_numberPhysTriggers
 number of physics triggers
unsigned int m_numberTechnicalTriggers
 number of technical triggers
unsigned int m_physicsDaqPartition
 index of physics DAQ partition
const std::vector< std::vector
< int > > * 
m_prescaleFactorsAlgoTrig
const std::vector< std::vector
< int > > * 
m_prescaleFactorsTechTrig
const AlgorithmMapm_technicalTriggerMap
const std::vector< unsigned int > * m_triggerMaskAlgoTrig
const std::vector< unsigned int > * m_triggerMaskTechTrig

Detailed Description

Description: L1GtTriggerMenuLite producer.

Implementation: Read the L1 trigger menu, the trigger masks and the prescale factor sets from event setup and save a lite version (top level menu, trigger masks for physics partition and prescale factor set) in Run Data.

Author:
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 44 of file L1GtTriggerMenuLiteProducer.h.


Constructor & Destructor Documentation

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

constructor(s)

Definition at line 55 of file L1GtTriggerMenuLiteProducer.cc.

                                       :
    m_l1GtStableParCacheID(0ULL), m_numberPhysTriggers(0),

    m_numberTechnicalTriggers(0),

    m_l1GtMenuCacheID(0ULL),

    m_l1GtTmAlgoCacheID(0ULL), m_l1GtTmTechCacheID(0ULL),

    m_l1GtPfAlgoCacheID(0ULL), m_l1GtPfTechCacheID(0ULL),

    m_physicsDaqPartition(0) {

    // EDM product in Run Data
    produces<L1GtTriggerMenuLite, edm::InRun>();

}
L1GtTriggerMenuLiteProducer::~L1GtTriggerMenuLiteProducer ( ) [virtual]

destructor

Definition at line 75 of file L1GtTriggerMenuLiteProducer.cc.

                                                          {

    // empty

}

Member Function Documentation

void L1GtTriggerMenuLiteProducer::beginJob ( void  ) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 199 of file L1GtTriggerMenuLiteProducer.cc.

                                           {
    // empty
}
void L1GtTriggerMenuLiteProducer::beginRun ( edm::Run iRun,
const edm::EventSetup evSetup 
) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 203 of file L1GtTriggerMenuLiteProducer.cc.

References L1GtTriggerMenu::gtScaleDbKey(), L1GtTriggerMenu::gtTriggerMenuImplementation(), L1GtTriggerMenu::gtTriggerMenuInterface(), L1GtTriggerMenu::gtTriggerMenuName(), edm::isDebugEnabled(), LogDebug, m_algorithmAliasMap, m_algorithmMap, m_l1GtMenu, m_numberPhysTriggers, m_numberTechnicalTriggers, m_physicsDaqPartition, m_prescaleFactorsAlgoTrig, m_prescaleFactorsTechTrig, m_technicalTriggerMap, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, edm::Run::put(), and retrieveL1EventSetup().

                                      {

    //

    retrieveL1EventSetup(evSetup);

    // produce the L1GtTriggerMenuLite
    std::auto_ptr<L1GtTriggerMenuLite> gtTriggerMenuLite(new L1GtTriggerMenuLite());

    // lite L1 trigger menu

    gtTriggerMenuLite->setGtTriggerMenuInterface(m_l1GtMenu->gtTriggerMenuInterface());
    gtTriggerMenuLite->setGtTriggerMenuName(m_l1GtMenu->gtTriggerMenuName());
    gtTriggerMenuLite->setGtTriggerMenuImplementation(m_l1GtMenu->gtTriggerMenuImplementation());

    gtTriggerMenuLite->setGtScaleDbKey(m_l1GtMenu->gtScaleDbKey());

    //
    L1GtTriggerMenuLite::L1TriggerMap algMap;
    for (CItAlgo itAlgo = m_algorithmMap->begin(); itAlgo
            != m_algorithmMap->end(); itAlgo++) {

        unsigned int bitNumber = (itAlgo->second).algoBitNumber();
        algMap[bitNumber] = itAlgo->first;

    }

    gtTriggerMenuLite->setGtAlgorithmMap(algMap);

    //
    L1GtTriggerMenuLite::L1TriggerMap algAliasMap;
    for (CItAlgo itAlgo = m_algorithmAliasMap->begin(); itAlgo
            != m_algorithmAliasMap->end(); itAlgo++) {

        unsigned int bitNumber = (itAlgo->second).algoBitNumber();
        algAliasMap[bitNumber] = itAlgo->first;

    }

    gtTriggerMenuLite->setGtAlgorithmAliasMap(algAliasMap);

    //
    L1GtTriggerMenuLite::L1TriggerMap techMap;
    for (CItAlgo itAlgo = m_technicalTriggerMap->begin(); itAlgo
            != m_technicalTriggerMap->end(); itAlgo++) {

        unsigned int bitNumber = (itAlgo->second).algoBitNumber();
        techMap[bitNumber] = itAlgo->first;

    }

    gtTriggerMenuLite->setGtTechnicalTriggerMap(techMap);

    // trigger masks
    std::vector<unsigned int> triggerMaskAlgoTrig(m_numberPhysTriggers, 0);
    int iBit = -1;

    for (std::vector<unsigned int>::const_iterator
            itBit = m_triggerMaskAlgoTrig->begin();
            itBit != m_triggerMaskAlgoTrig->end();
            itBit++) {

        iBit++;
        triggerMaskAlgoTrig[iBit] = (*itBit) & (1 << m_physicsDaqPartition);
    }
    gtTriggerMenuLite->setGtTriggerMaskAlgoTrig(triggerMaskAlgoTrig);

    //
    std::vector<unsigned int> triggerMaskTechTrig(m_numberTechnicalTriggers, 0);
    iBit = -1;

    for (std::vector<unsigned int>::const_iterator
            itBit = m_triggerMaskTechTrig->begin();
            itBit != m_triggerMaskTechTrig->end();
            itBit++) {

        iBit++;
        triggerMaskTechTrig[iBit] = (*itBit) & (1 << m_physicsDaqPartition);
    }
    gtTriggerMenuLite->setGtTriggerMaskTechTrig(triggerMaskTechTrig);


    //
    gtTriggerMenuLite->setGtPrescaleFactorsAlgoTrig(*m_prescaleFactorsAlgoTrig);
    gtTriggerMenuLite->setGtPrescaleFactorsTechTrig(*m_prescaleFactorsTechTrig);


    // print menu, trigger masks and prescale factors
    if (edm::isDebugEnabled()) {

        LogDebug("L1GtTriggerMenuLiteProducer") << *gtTriggerMenuLite;

    }

    // put records into event
    iRun.put(gtTriggerMenuLite);

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

Reimplemented from edm::EDProducer.

Definition at line 317 of file L1GtTriggerMenuLiteProducer.cc.

                                         {

    // empty now
}
void L1GtTriggerMenuLiteProducer::endRun ( edm::Run iRun,
const edm::EventSetup evSetup 
) [private, virtual]

Reimplemented from edm::EDProducer.

Definition at line 309 of file L1GtTriggerMenuLiteProducer.cc.

                                      {

    // empty

}
void L1GtTriggerMenuLiteProducer::produce ( edm::Event iEvent,
const edm::EventSetup evSetup 
) [private, virtual]

Implements edm::EDProducer.

Definition at line 303 of file L1GtTriggerMenuLiteProducer.cc.

                                      {


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

retrieve all the relevant L1 trigger event setup records and cache them to improve the speed

Definition at line 81 of file L1GtTriggerMenuLiteProducer.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_l1GtMenuCacheID, m_l1GtPfAlgo, m_l1GtPfAlgoCacheID, m_l1GtPfTech, m_l1GtPfTechCacheID, m_l1GtStablePar, m_l1GtStableParCacheID, m_l1GtTmAlgo, m_l1GtTmAlgoCacheID, m_l1GtTmTech, m_l1GtTmTechCacheID, m_numberPhysTriggers, m_numberTechnicalTriggers, m_prescaleFactorsAlgoTrig, m_prescaleFactorsTechTrig, m_technicalTriggerMap, m_triggerMaskAlgoTrig, m_triggerMaskTechTrig, and edm::ESHandle< T >::product().

Referenced by beginRun().

                                                                                   {

    // get / update the stable parameters from the EventSetup
    // local cache & check on cacheIdentifier

    unsigned long long l1GtStableParCacheID =
            evSetup.get<L1GtStableParametersRcd>().cacheIdentifier();

    if (m_l1GtStableParCacheID != l1GtStableParCacheID) {

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

        // number of physics triggers
        m_numberPhysTriggers = m_l1GtStablePar->gtNumberPhysTriggers();

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

        //
        m_l1GtStableParCacheID = l1GtStableParCacheID;

    }

    // get / update the prescale factors from the EventSetup
    // local cache & check on cacheIdentifier

    unsigned long long l1GtPfAlgoCacheID =
            evSetup.get<L1GtPrescaleFactorsAlgoTrigRcd>().cacheIdentifier();

    if (m_l1GtPfAlgoCacheID != l1GtPfAlgoCacheID) {

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

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

        m_l1GtPfAlgoCacheID = l1GtPfAlgoCacheID;

    }

    unsigned long long l1GtPfTechCacheID = evSetup.get<
            L1GtPrescaleFactorsTechTrigRcd>().cacheIdentifier();

    if (m_l1GtPfTechCacheID != l1GtPfTechCacheID) {

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

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

        m_l1GtPfTechCacheID = l1GtPfTechCacheID;

    }

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

    unsigned long long l1GtTmAlgoCacheID =
            evSetup.get<L1GtTriggerMaskAlgoTrigRcd>().cacheIdentifier();

    if (m_l1GtTmAlgoCacheID != l1GtTmAlgoCacheID) {

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

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

        m_l1GtTmAlgoCacheID = l1GtTmAlgoCacheID;

    }

    unsigned long long l1GtTmTechCacheID =
            evSetup.get<L1GtTriggerMaskTechTrigRcd>().cacheIdentifier();

    if (m_l1GtTmTechCacheID != l1GtTmTechCacheID) {

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

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

        m_l1GtTmTechCacheID = l1GtTmTechCacheID;

    }


    // 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();

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

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

        m_l1GtMenuCacheID = l1GtMenuCacheID;

    }

}

Member Data Documentation

Definition at line 88 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

Definition at line 87 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

Definition at line 84 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

unsigned long long L1GtTriggerMenuLiteProducer::m_l1GtMenuCacheID [private]

Definition at line 85 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

prescale factors

Definition at line 102 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

Definition at line 103 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

Definition at line 105 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

Definition at line 106 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

cached stuff

stable parameters

Definition at line 74 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

Definition at line 75 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

trigger masks

Definition at line 92 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

Definition at line 93 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

Definition at line 95 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

Definition at line 96 of file L1GtTriggerMenuLiteProducer.h.

Referenced by retrieveL1EventSetup().

number of physics triggers

Definition at line 78 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

number of technical triggers

Definition at line 81 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

index of physics DAQ partition

Definition at line 114 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun().

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

Definition at line 108 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

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

Definition at line 109 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

Definition at line 89 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

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

Definition at line 98 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().

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

Definition at line 99 of file L1GtTriggerMenuLiteProducer.h.

Referenced by beginRun(), and retrieveL1EventSetup().