Public Member Functions | |
L1MuGMTChannelMaskOnlineProducer (const edm::ParameterSet &iConfig) | |
virtual boost::shared_ptr < L1MuGMTChannelMask > | newObject (const std::string &objectKey) |
~L1MuGMTChannelMaskOnlineProducer () |
Definition at line 5 of file L1MuGMTChannelMaskOnlineProducer.cc.
L1MuGMTChannelMaskOnlineProducer::L1MuGMTChannelMaskOnlineProducer | ( | const edm::ParameterSet & | iConfig | ) | [inline] |
Definition at line 7 of file L1MuGMTChannelMaskOnlineProducer.cc.
L1MuGMTChannelMaskOnlineProducer::~L1MuGMTChannelMaskOnlineProducer | ( | ) | [inline] |
Definition at line 9 of file L1MuGMTChannelMaskOnlineProducer.cc.
{}
boost::shared_ptr< L1MuGMTChannelMask > L1MuGMTChannelMaskOnlineProducer::newObject | ( | const std::string & | objectKey | ) | [virtual] |
Implements L1ConfigOnlineProdBase< L1MuGMTChannelMaskRcd, L1MuGMTChannelMask >.
Definition at line 16 of file L1MuGMTChannelMaskOnlineProducer.cc.
References l1t::OMDSReader::basicQuery(), l1t::OMDSReader::QueryResults::fillVariable(), L1ConfigOnlineProdBase< L1MuGMTChannelMaskRcd, L1MuGMTChannelMask >::m_omdsReader, l1t::OMDSReader::QueryResults::queryFailed(), python::entryComment::results, and l1t::OMDSReader::singleAttribute().
{ std::vector<std::string> columns; columns.push_back("ENABLE_RPCB"); columns.push_back("ENABLE_CSC"); columns.push_back("ENABLE_DT"); columns.push_back("ENABLE_RPCF"); // Execute SQL queries to get data from OMDS (using key) and make C++ object // Example: SELECT A_PARAMETER FROM CMS_XXX.XXX_CONF WHERE XXX_CONF.XXX_KEY = objectKey l1t::OMDSReader::QueryResults results = m_omdsReader.basicQuery( columns, "CMS_GMT", "GMT_RUN_SETTINGS", "GMT_RUN_SETTINGS.ID", m_omdsReader.singleAttribute( objectKey ) ) ; if( results.queryFailed() ) // check if query was successful { edm::LogError( "L1-O2O" ) << "L1MuGMTChannelMaskOnlineProducer: Problem getting " << objectKey << " key from GMT_RUN_SETTING." ; return boost::shared_ptr< L1MuGMTChannelMask >() ; } unsigned mask = 0; bool maskaux; results.fillVariable( "ENABLE_RPCB", maskaux ) ; if(!maskaux) mask|=2; results.fillVariable( "ENABLE_CSC", maskaux ) ; if(!maskaux) mask|=4; results.fillVariable( "ENABLE_DT", maskaux ) ; if(!maskaux) mask|=1; results.fillVariable( "ENABLE_RPCF", maskaux ) ; if(!maskaux) mask|=8; boost::shared_ptr< L1MuGMTChannelMask > gmtchanmask = boost::shared_ptr< L1MuGMTChannelMask >( new L1MuGMTChannelMask() ); gmtchanmask->setSubsystemMask(mask); return gmtchanmask; }