Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include "L1TriggerConfig/L1ScalesProducers/interface/L1MuTriggerPtScaleOnlineProducer.h"
00015
00016
00017 #ifdef DEBUG_PT_SCALE
00018 #include <iostream>
00019 #endif
00020
00021 #include <sstream>
00022
00023 using namespace std;
00024
00025 L1MuTriggerPtScaleOnlineProducer::L1MuTriggerPtScaleOnlineProducer(const edm::ParameterSet& ps)
00026 : L1ConfigOnlineProdBase<L1MuTriggerPtScaleRcd, L1MuTriggerPtScale>(ps),
00027 m_signedPacking(ps.getParameter<bool>("signedPackingPt")),
00028 m_nbitsPacking(ps.getParameter<int>("nbitPackingPt")),
00029 m_nBins(ps.getParameter<int>("nbinsPt"))
00030 {
00031 }
00032
00033 L1MuTriggerPtScaleOnlineProducer::~L1MuTriggerPtScaleOnlineProducer() {}
00034
00035
00036
00037
00038
00039
00040
00041 boost::shared_ptr<L1MuTriggerPtScale>
00042 L1MuTriggerPtScaleOnlineProducer::newObject(const std::string& objectKey )
00043 {
00044 using namespace edm::es;
00045
00046
00047 l1t::OMDSReader::QueryResults keysRecord =
00048 m_omdsReader.basicQuery(
00049
00050 "SC_MUON_PT_FK",
00051
00052 "CMS_GT",
00053
00054 "L1T_SCALES",
00055
00056 "L1T_SCALES.ID",
00057
00058 m_omdsReader.singleAttribute( objectKey ) );
00059
00060 if( keysRecord.numberRows() != 1 )
00061 {
00062 throw cond::Exception("Problem finding L1MuTriggerScales associated "
00063 "with scales key " + objectKey);
00064 }
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077 ScaleRecordHelper h("PT_GEV_BIN_LOW", m_nBins );
00078
00079 vector<string> columns;
00080 h.pushColumnNames(columns);
00081
00082 l1t::OMDSReader::QueryResults resultRecord =
00083 m_omdsReader.basicQuery(
00084
00085 columns,
00086
00087 "CMS_GT",
00088
00089 "L1T_SCALE_MUON_PT",
00090
00091 "L1T_SCALE_MUON_PT.ID",
00092
00093 keysRecord);
00094
00095 if(resultRecord.numberRows() != 1) {
00096 throw cond::Exception("Couldn't find Pt scale record for scales key `"
00097 + objectKey + "'") ;
00098 }
00099
00100 vector<double> scales;
00101 h.extractScales(resultRecord, scales);
00102
00103 boost::shared_ptr<L1MuTriggerPtScale> result( new L1MuTriggerPtScale(m_nbitsPacking, m_signedPacking, m_nBins, scales) );
00104
00105 #ifdef DEBUG_PT_SCALE
00106 cout << "PT scale:" << endl << result->getPtScale()->print() << endl;
00107 #endif
00108
00109
00110 return result ;
00111 }