CMS 3D CMS Logo

Public Member Functions | Private Attributes

L1GtTriggerMaskVetoTechTrigConfigOnlineProd Class Reference

#include <L1GtTriggerMaskVetoTechTrigConfigOnlineProd.h>

Inheritance diagram for L1GtTriggerMaskVetoTechTrigConfigOnlineProd:
L1ConfigOnlineProdBase< L1GtTriggerMaskVetoTechTrigRcd, L1GtTriggerMask > edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

 L1GtTriggerMaskVetoTechTrigConfigOnlineProd (const edm::ParameterSet &)
 constructor
virtual boost::shared_ptr
< L1GtTriggerMask
newObject (const std::string &objectKey)
 public methods
 ~L1GtTriggerMaskVetoTechTrigConfigOnlineProd ()
 destructor

Private Attributes

int m_partitionNumber
 partition number

Detailed Description

Description: online producer for L1GtTriggerMaskVetoTechTrigRcd.

Implementation: <TODO: enter implementation details>

Author:
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Definition at line 34 of file L1GtTriggerMaskVetoTechTrigConfigOnlineProd.h.


Constructor & Destructor Documentation

L1GtTriggerMaskVetoTechTrigConfigOnlineProd::L1GtTriggerMaskVetoTechTrigConfigOnlineProd ( const edm::ParameterSet parSet)

constructor

Definition at line 27 of file L1GtTriggerMaskVetoTechTrigConfigOnlineProd.cc.

L1GtTriggerMaskVetoTechTrigConfigOnlineProd::~L1GtTriggerMaskVetoTechTrigConfigOnlineProd ( )

destructor

Definition at line 37 of file L1GtTriggerMaskVetoTechTrigConfigOnlineProd.cc.

                                                                                          {

    // empty

}

Member Function Documentation

boost::shared_ptr< L1GtTriggerMask > L1GtTriggerMaskVetoTechTrigConfigOnlineProd::newObject ( const std::string &  objectKey) [virtual]

public methods

Implements L1ConfigOnlineProdBase< L1GtTriggerMaskVetoTechTrigRcd, L1GtTriggerMask >.

Definition at line 45 of file L1GtTriggerMaskVetoTechTrigConfigOnlineProd.cc.

References l1t::OMDSReader::basicQuery(), l1t::OMDSReader::columnNames(), l1t::OMDSReader::QueryResults::fillVariable(), i, edm::isDebugEnabled(), LogTrace, L1ConfigOnlineProdBase< L1GtTriggerMaskVetoTechTrigRcd, L1GtTriggerMask >::m_omdsReader, m_partitionNumber, l1t::OMDSReader::QueryResults::queryFailed(), python::entryComment::results, and l1t::OMDSReader::singleAttribute().

                                    {

    // shared pointer for L1GtTriggerMask
    boost::shared_ptr<L1GtTriggerMask> pL1GtTriggerMask = boost::shared_ptr<L1GtTriggerMask>(
            new L1GtTriggerMask());

    // l1GtTriggerMaskVetoTechTrig: VETO_TT_FK key in GT_PARTITION_VETO_TT

    const std::string gtSchema = "CMS_GT";

    // SQL query:
    //
    // select * from CMS_GT.GT_PARTITION_VETO_TT WHERE GT_PARTITION_VETO_TT.ID = objectKey

    const std::vector<std::string>& columns = m_omdsReader.columnNames(
            gtSchema, "GT_PARTITION_VETO_TT");

    if (edm::isDebugEnabled()) {
        for (std::vector<std::string>::const_iterator iter = columns.begin(); iter != columns.end(); iter++) {
            LogTrace("L1GtTriggerMaskVetoTechTrigConfigOnlineProd") << ( *iter ) << std::endl;

        }
    }

    l1t::OMDSReader::QueryResults results = m_omdsReader.basicQuery(
            columns, gtSchema, "GT_PARTITION_VETO_TT", "GT_PARTITION_VETO_TT.ID",
            m_omdsReader.singleAttribute(objectKey));

    // check if query was successful
    if (results.queryFailed()) {
        edm::LogError("L1-O2O") << "Problem with L1GtTriggerMaskVetoTechTrigRcd key:" << objectKey;
        return pL1GtTriggerMask;
    }

    // mask for other partitions than m_partitionNumber set to 1 (algorithm masked)
    int maskSize = columns.size() - 1; // table ID is also in columns
    std::vector<bool> trigMaskBool(maskSize, false);
    std::vector<unsigned int> trigMask(maskSize, 0);

    for (int i = 0; i < maskSize; i++) {
        bool tMask = trigMaskBool[i];
        results.fillVariable(columns[i + 1], tMask);
        trigMask[i] = 0xFF & (~( static_cast<unsigned int> (tMask) << m_partitionNumber ));
    }

    // fill the record
    pL1GtTriggerMask->setGtTriggerMask(trigMask);

    if (edm::isDebugEnabled()) {
        std::ostringstream myCoutStream;
        pL1GtTriggerMask->print(myCoutStream);
        LogTrace("L1GtTriggerMaskVetoTechTrigConfigOnlineProd")
                << "\nThe following L1GtTriggerMaskVetoTechTrigRcd record was read from OMDS: \n"
                << myCoutStream.str() << "\n" << std::endl;
    }

    return pL1GtTriggerMask;
}

Member Data Documentation

partition number

Definition at line 52 of file L1GtTriggerMaskVetoTechTrigConfigOnlineProd.h.

Referenced by newObject().