diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RPCCablingDbTool.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RPCCablingDbTool.h new file mode 100644 index 0000000000000000000000000000000000000000..e07ea7b049a0d815ea1fe7b412e6371bcbbb594d --- /dev/null +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RPCCablingDbTool.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONCONDTOOL_RPCCABLINGDBTOOL_H +#define MUONCONDTOOL_RPCCABLINGDBTOOL_H + +#include "GaudiKernel/AlgTool.h" +#include "MuonCondInterface/IRPCCablingDbTool.h" +#include "GaudiKernel/IChronoStatSvc.h" + + + +class Identifier; +class StoreGateSvc; + +class RpcIdHelper; +class IIOVSvc; +class StatusCode; + + +class RPCCablingDbTool: public AlgTool, public IRPCCablingDbTool +{ + +public: + + RPCCablingDbTool(const std::string& type, + const std::string& name, + const IInterface* parent); + + /** required by the IAddressProvider interface */ + // virtual StatusCode updateAddress(SG::TransientAddress* tad); + virtual StatusCode updateAddress(StoreID::type storeID, SG::TransientAddress* tad); + + virtual StatusCode initialize(); + + virtual std::string mapConfFolderName() const {return m_mapFolder;} + virtual std::string mapCorrFolderName() const {return m_corrFolder;} + virtual const std::string* GetStringRPCConfMap() const {return &m_map;} + virtual const std::string* GetStringRPCCorrMap() const {return &m_corr;} + + virtual StatusCode loadParameters(IOVSVC_CALLBACK_ARGS); + virtual StatusCode loadRPCMap(IOVSVC_CALLBACK_ARGS); + virtual StatusCode loadRPCCorr(IOVSVC_CALLBACK_ARGS); + + + private: + + + + + StoreGateSvc* m_detStore; + IIOVSvc* m_IOVSvc; + + + const RpcIdHelper* m_rpcIdHelper; + + + std::string m_DataLocation; + + std::string m_mapFolder; + std::string m_corrFolder; + + std::string m_map; + std::string m_corr; + + IChronoStatSvc* m_chronoSvc; + + std::string m_chrono1; + std::string m_chrono2; + std::string m_chrono3; + std::string m_chrono4; + + +}; + + + +#endif diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RPCTriggerDbTool.h b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RPCTriggerDbTool.h new file mode 100644 index 0000000000000000000000000000000000000000..035795f7d6300e5d94f7243ec0a2ce0847deab9e --- /dev/null +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/RPC_CondCabling/RPCTriggerDbTool.h @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MUONCONDTOOL_RPCTRIGGERDBTOOL_H +#define MUONCONDTOOL_RPCTRIGGERDBTOOL_H + +#include "GaudiKernel/AlgTool.h" +#include "MuonCondInterface/IRPCTriggerDbTool.h" +#include "GaudiKernel/IChronoStatSvc.h" +#include "GaudiKernel/MsgStream.h" + + +class Identifier; +class StoreGateSvc; + +class RpcIdHelper; +class IIOVSvc; +class StatusCode; + + +class RPCTriggerDbTool: public AlgTool, public IRPCTriggerDbTool +{ + +public: + + RPCTriggerDbTool(const std::string& type, + const std::string& name, + const IInterface* parent); + + /** required by the IAddressProvider interface */ + // virtual StatusCode updateAddress(SG::TransientAddress* tad); + virtual StatusCode updateAddress(StoreID::type storeID, SG::TransientAddress* tad); + + virtual StatusCode initialize(); + + //getter methods + virtual std::string EtaTableFolderName() const {return m_etaTableFolder;} + virtual std::string PhiTableFolderName() const {return m_phiTableFolder;} + + virtual const std::vector<std::string> GetStringRPCEtaCM_File() const {return m_vecetaCM_File;} + virtual const std::vector<std::string> GetStringRPCEtaTh0() const {return m_vecetaTh0;} + // virtual const std::vector<std::string> GetStringRPCEtaTh1() const {return m_vecetaTh1;} + // virtual const std::vector<std::string> GetStringRPCEtaTh2() const {return m_vecetaTh2;} + virtual const std::vector<std::string> GetStringRPCEtaSequence_Th() const {return m_vecetaSequence_Th;} + virtual const std::vector<std::string> GetStringRPCEtaInfo() const {return m_vecetaInfo;} + + virtual const std::vector<std::string> GetStringRPCPhiCM_File() const {return m_vecphiCM_File;} + virtual const std::vector<std::string> GetStringRPCPhiTh0() const {return m_vecphiTh0;} + virtual const std::vector<std::string> GetStringRPCPhiInfo() const {return m_vecphiInfo;} + virtual const std::map<std::string, std::string>* GetRoads() const {return &m_trigroads;} + + //load methods + virtual StatusCode loadParameters(IOVSVC_CALLBACK_ARGS); + virtual StatusCode loadRPCEtaTable(IOVSVC_CALLBACK_ARGS); + virtual StatusCode loadRPCPhiTable(IOVSVC_CALLBACK_ARGS); + + + private: + + + + + StoreGateSvc* m_detStore; + IIOVSvc* m_IOVSvc; + + + const RpcIdHelper* m_rpcIdHelper; + + + std::string m_DataLocation; + + std::string m_etaTableFolder; + std::string m_phiTableFolder; + + std::string m_etaCM_File; + std::vector<std::string> m_vecetaCM_File; + std::string m_etaTh0; + std::vector<std::string> m_vecetaTh0; + //std::string m_etaTh1; + //std::string m_etaTh2; + std::string m_etaSequence_Th; + std::vector<std::string> m_vecetaSequence_Th; + std::string m_etaInfo; + std::vector<std::string> m_vecetaInfo; + + std::string m_phiCM_File; + std::vector<std::string> m_vecphiCM_File; + std::string m_phiTh0; + std::vector<std::string> m_vecphiTh0; + std::string m_phiInfo; + std::vector<std::string> m_vecphiInfo; + + std::map<std::string, std::string> m_trigroads; + + IChronoStatSvc* m_chronoSvc; + + std::string m_chrono1; + std::string m_chrono2; + std::string m_chrono3; + std::string m_chrono4; + MsgStream m_log; + bool m_debug; + bool m_verbose; + +}; + + + +#endif diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/cmt/requirements b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/cmt/requirements new file mode 100755 index 0000000000000000000000000000000000000000..86d3aae3befd9ba32a372c4044c67e6cd472b338 --- /dev/null +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/cmt/requirements @@ -0,0 +1,32 @@ +package RPC_CondCabling +######## +######## + +private + +use AthenaPoolUtilities AthenaPoolUtilities-* Database/AthenaPOOL +use AtlasCORAL AtlasCORAL-* External +use PathResolver PathResolver-* Tools +use SGTools SGTools-* Control +use StoreGate StoreGate-* Control +use Identifier Identifier-* DetectorDescription +use MuonIdHelpers MuonIdHelpers-* MuonSpectrometer + +public + +use AtlasPolicy AtlasPolicy-* +use GaudiInterface GaudiInterface-* External +use MuonCondInterface MuonCondInterface-* MuonSpectrometer/MuonConditions/MuonCondGeneral + +library RPC_CondCabling *.cxx components/*.cxx + +apply_pattern component_library + +#apply_pattern declare_joboptions files="*.py" + +#apply_pattern declare_python_modules files="*.py" + +# to build in dbg mode this package while using an opt build +#private +#macro cppdebugflags '$(cppdebugflags_s)' +#macro_remove componentshr_linkopts "-Wl,-s" diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCCablingDbTool.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCCablingDbTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..620cfd1fa29aee8a48df34c68d670ead9cd2a1fb --- /dev/null +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCCablingDbTool.cxx @@ -0,0 +1,241 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "GaudiKernel/MsgStream.h" + +#include "StoreGate/StoreGateSvc.h" +#include "SGTools/TransientAddress.h" +#include "CoralBase/Attribute.h" +#include "CoralBase/AttributeListSpecification.h" +#include "AthenaPoolUtilities/AthenaAttributeList.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" + +#include "Identifier/IdentifierHash.h" + +#include "MuonIdHelpers/RpcIdHelper.h" +#include "PathResolver/PathResolver.h" + +#include <fstream> +#include <string> +#include <stdlib.h> + + + +#include "RPC_CondCabling/RPCCablingDbTool.h" +#include "MuonCondInterface/IRPCCablingDbTool.h" + + +#include <map> +#include "Identifier/Identifier.h" + +//********************************************************** +//* Author Monica Verducci monica.verducci@cern.ch +//* +//* Tool to retrieve the RPC Cabling Map from COOL DB +//* one callback aganist the class +//* retrieving of tables from DB +//********************************************************* + + +RPCCablingDbTool::RPCCablingDbTool (const std::string& type, + const std::string& name, + const IInterface* parent) + : AlgTool(type, name, parent) +{ + + declareInterface<IRPCCablingDbTool>(this); + + + m_DataLocation="keyRPC"; + + declareProperty("MapConfigurationFolder", m_mapFolder="/RPC/CABLING/MAP_SCHEMA_NEW"); + declareProperty("MapCorrectionFolder", m_corrFolder="/RPC/CABLING/MAP_SCHEMA_CORR_2"); + m_map =""; + m_corr=""; + +} + +//StatusCode RPCCablingDbTool::updateAddress(SG::TransientAddress* /*tad*/) +StatusCode RPCCablingDbTool::updateAddress(StoreID::type /*storeID*/, SG::TransientAddress* /*tad*/) +{ + MsgStream log(msgSvc(), name()); + //CLID clid = tad->clID(); + //std::string key = tad->name(); + // if ( == clid && m_DataLocation == key) + //{ + // log << MSG::DEBUG << "OK " << endreq; + // return StatusCode::SUCCESS; + //} + return StatusCode::FAILURE; +} + + + + +StatusCode RPCCablingDbTool::initialize() +{ + MsgStream log(msgSvc(), name()); + log << MSG::INFO << "Initializing - folders names are: conf "<<m_mapFolder <<" / corr "<<m_corrFolder<< endreq; + + + StatusCode sc = serviceLocator()->service("DetectorStore", m_detStore); + if ( sc.isSuccess() ) { + log << MSG::DEBUG << "Retrieved DetectorStore" << endreq; + }else{ + log << MSG::ERROR << "Failed to retrieve DetectorStore" << endreq; + return sc; + } + + // retrieve the rpc id helper + sc = m_detStore->retrieve(m_rpcIdHelper, "RPCIDHELPER" ); + if (!sc.isSuccess()) { + log << MSG::ERROR << "Can't retrieve RpcIdHelper" << endreq; + return sc; + } + + // Get interface to IOVSvc + m_IOVSvc = 0; + bool CREATEIF(true); + sc = service( "IOVSvc", m_IOVSvc, CREATEIF ); + if ( sc.isFailure() ) + { + log << MSG::ERROR << "Unable to get the IOVSvc" << endreq; + return StatusCode::FAILURE; + } + + if(sc.isFailure()) return StatusCode::FAILURE; + + + + // initialize the chrono service + sc = service("ChronoStatSvc",m_chronoSvc); + if (sc != StatusCode::SUCCESS) { + log << MSG::ERROR << "Could not find the ChronoSvc" << endreq; + return sc; + } + + +// const DataHandle<CondAttrListCollection> MapData; +// sc=m_detStore->regFcn(&IRPCCablingDbTool::loadRPCMap, +// dynamic_cast<IRPCCablingDbTool*>(this), +// MapData, m_mapFolder); + + if(sc.isFailure()) return StatusCode::FAILURE; + + + + + return StatusCode::SUCCESS; + +} + + +StatusCode RPCCablingDbTool::loadParameters(IOVSVC_CALLBACK_ARGS_P(I,keys)) +{ + MsgStream log(msgSvc(), name()); + + std::list<std::string>::const_iterator itr; + for (itr=keys.begin(); itr!=keys.end(); ++itr) { + log << MSG::INFO <<"LoadParameters "<< *itr << " I="<<I<<" "<<endreq; + if(*itr==m_mapFolder) { + StatusCode sc = loadRPCMap(I,keys); + if (sc.isFailure()) + { + return sc; + } + } + else if (*itr==m_corrFolder) { + StatusCode sc = loadRPCCorr(I,keys); + if (sc.isFailure()) + { + return sc; + } + } + } + + return StatusCode::SUCCESS; +} + + + +StatusCode RPCCablingDbTool::loadRPCMap(IOVSVC_CALLBACK_ARGS_P(/*I*/,/*keys*/)) +{ + MsgStream log(msgSvc(), name()); + StatusCode sc=StatusCode::SUCCESS; + log << MSG::INFO << "loadRPCMap --- Load Map from DB" << endreq; + + const CondAttrListCollection * atrc; + log << MSG::INFO << "Try to read from folder <"<<m_mapFolder<<">"<<endreq; + + sc=m_detStore->retrieve(atrc,m_mapFolder); + if(sc.isFailure()) { + log << MSG::ERROR + << "could not retreive the CondAttrListCollection from DB folder " + << m_mapFolder << endreq; + return sc; + } + + else + log<<MSG::INFO<<" CondAttrListCollection from DB folder have been obtained with size "<< atrc->size() <<endreq; + + + CondAttrListCollection::const_iterator itr; + int ic=0; + for (itr = atrc->begin(); itr != atrc->end(); ++itr) { + ic++; + log << MSG::INFO << "Loop over CondAttrListCollection ic = "<<ic<<endreq; + const coral::AttributeList& atr=itr->second; + + // store configuration map in private member RPCConfMap + m_map = *(static_cast<const std::string*>((atr["Map"]).addressOfData())); + + log << MSG::VERBOSE << "Sequence load is \n" << m_map <<endreq; + log <<"End of Sequence load"<<endreq; + + } + log<< MSG::INFO<<"After Reading folder, Configuration string size is "<<m_map.size()<<endreq; + + return StatusCode::SUCCESS; + +} + + +StatusCode RPCCablingDbTool::loadRPCCorr(IOVSVC_CALLBACK_ARGS_P(/*I*/,/*keys*/)) +{ + MsgStream log(msgSvc(), name()); + StatusCode sc=StatusCode::SUCCESS; + log << MSG::INFO << "loadRPCCorr --- Load Corrections from DB" << endreq; + + const CondAttrListCollection * atrc; + log << MSG::INFO << "Try to read from folder <"<<m_corrFolder<<">"<<endreq; + + sc=m_detStore->retrieve(atrc,m_corrFolder); + if(sc.isFailure()) { + log << MSG::ERROR + << "could not retreive the CondAttrListCollection from DB folder " + << m_corrFolder << endreq; + return sc; + } + + else + log<<MSG::INFO<<" CondAttrListCollection from DB folder have been obtained with size "<< atrc->size() <<endreq; + + + CondAttrListCollection::const_iterator itr; + for (itr = atrc->begin(); itr != atrc->end(); ++itr) { + const coral::AttributeList& atr=itr->second; + + // store correction map in private member RPCCorrMap + m_corr = *(static_cast<const std::string*>((atr["Map"]).addressOfData())); + + log << MSG::VERBOSE << "Sequence load is \n" << m_corr <<endreq; + log <<"End of Sequence load"<<endreq; + + } + log<< MSG::INFO<<"After Reading folder, Correction string size is "<<m_corr.size()<<endreq; + + return StatusCode::SUCCESS; + +} + diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCTriggerDbTool.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCTriggerDbTool.cxx new file mode 100644 index 0000000000000000000000000000000000000000..5841779b4ccdaff059060cc82a4f17ad95cc8ef4 --- /dev/null +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/RPCTriggerDbTool.cxx @@ -0,0 +1,294 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "GaudiKernel/MsgStream.h" + +#include "StoreGate/StoreGateSvc.h" +#include "SGTools/TransientAddress.h" +#include "CoralBase/Attribute.h" +#include "CoralBase/AttributeListSpecification.h" +#include "AthenaPoolUtilities/AthenaAttributeList.h" +#include "AthenaPoolUtilities/CondAttrListCollection.h" + +#include "Identifier/IdentifierHash.h" + +#include "MuonIdHelpers/RpcIdHelper.h" +#include "PathResolver/PathResolver.h" + +#include <fstream> +#include <string> +#include <stdlib.h> + + + +#include "RPC_CondCabling/RPCTriggerDbTool.h" +///#include "MuonCondInterface/IRPCTriggerDbTool.h" +///#include "MuonCondSvc/MdtStringUtils.h" + + +#include <map> +#include "Identifier/Identifier.h" + +//********************************************************** +//* Author Monica Verducci monica.verducci@cern.ch +//* +//* Tool to retrieve the RPC trigger roads from COOL DB +//* one callback aganist the class +//* retrieving of tables from DB +//********************************************************* + + +RPCTriggerDbTool::RPCTriggerDbTool (const std::string& type, + const std::string& name, + const IInterface* parent) + : AlgTool(type, name, parent), + m_log( msgSvc(), name ), + m_debug(false), + m_verbose(false) +{ + + declareInterface<IRPCTriggerDbTool>(this); + + + m_DataLocation="keyRPC"; + + declareProperty("EtaTableFolder", m_etaTableFolder="/RPC/TRIGGER/CM_THR_ETA"); + declareProperty("PhiTableFolder", m_phiTableFolder="/RPC/TRIGGER/CM_THR_PHI"); + + m_etaCM_File= ""; + m_etaTh0= ""; + // m_etaTh1= ""; + // m_etaTh2= ""; + m_etaSequence_Th= ""; + m_etaInfo= ""; + + m_phiCM_File= ""; + m_phiTh0= ""; + m_etaInfo= ""; + m_trigroads.clear(); +} + + +//StatusCode RPCTriggerDbTool::updateAddress(SG::TransientAddress* /*tad*/) +StatusCode RPCTriggerDbTool::updateAddress(StoreID::type /*storeID*/, SG::TransientAddress* /*tad*/) +{ + MsgStream log(msgSvc(), name()); + + return StatusCode::FAILURE; +} + + + + +StatusCode RPCTriggerDbTool::initialize() +{ + + m_log.setLevel(outputLevel()); + m_debug = m_log.level() <= MSG::DEBUG; + m_verbose = m_log.level() <= MSG::VERBOSE; + + if( m_debug ) m_log << MSG::INFO << "Initializing - folders names are: eta " << m_etaTableFolder + << " / phi "<< m_phiTableFolder << endreq; + + + StatusCode sc = serviceLocator()->service("DetectorStore", m_detStore); + if ( sc.isSuccess() ) { + if( m_debug ) m_log << MSG::DEBUG << "Retrieved DetectorStore" << endreq; + }else{ + m_log << MSG::ERROR << "Failed to retrieve DetectorStore" << endreq; + return sc; + } + + + // Get interface to IOVSvc + m_IOVSvc = 0; + bool CREATEIF(true); + sc = service( "IOVSvc", m_IOVSvc, CREATEIF ); + if ( sc.isFailure() ) + { + m_log << MSG::ERROR << "Unable to get the IOVSvc" << endreq; + return StatusCode::FAILURE; + } + + if(sc.isFailure()) return StatusCode::FAILURE; + + + + // initialize the chrono service + sc = service("ChronoStatSvc",m_chronoSvc); + if (sc != StatusCode::SUCCESS) { + m_log << MSG::ERROR << "Could not find the ChronoSvc" << endreq; + return sc; + } + + + + if(sc.isFailure()) return StatusCode::FAILURE; + + return StatusCode::SUCCESS; + +} + + +StatusCode RPCTriggerDbTool::loadParameters(IOVSVC_CALLBACK_ARGS_P(I,keys)) +{ + + m_log.setLevel(outputLevel()); + m_debug = m_log.level() <= MSG::DEBUG; + m_verbose = m_log.level() <= MSG::VERBOSE; + + + if( m_verbose ) m_log << MSG::VERBOSE <<"LoadParameters "<<endreq; + + std::list<std::string>::const_iterator itr; + for (itr=keys.begin(); itr!=keys.end(); ++itr) { + m_log << MSG::INFO <<"LoadParameters "<< *itr << " I="<<I<<" "<<endreq; + if(*itr== m_etaTableFolder) { + StatusCode sc = loadRPCEtaTable(I,keys); + if (sc.isFailure()) + { + return sc; + } + } + else if (*itr==m_phiTableFolder) { + StatusCode sc = loadRPCPhiTable(I,keys); + if (sc.isFailure()) + { + return sc; + } + } + } + + return StatusCode::SUCCESS; +} + + + +StatusCode RPCTriggerDbTool::loadRPCEtaTable(IOVSVC_CALLBACK_ARGS_P(/*I*/,/*keys*/)) +{ + + + m_log.setLevel(outputLevel()); + m_debug = m_log.level() <= MSG::DEBUG; + m_verbose = m_log.level() <= MSG::VERBOSE; + + StatusCode sc=StatusCode::SUCCESS; + if( m_debug ) m_log << MSG::INFO << "loadRPCEtaTable --- Load Map from DB" << endreq; + + const CondAttrListCollection * atrc; + if( m_debug ) m_log << MSG::INFO << "Try to read from folder <" << m_etaTableFolder << ">" << endreq; + + sc=m_detStore->retrieve(atrc,m_etaTableFolder); + if(sc.isFailure()) { + m_log << MSG::ERROR + << "could not retreive the CondAttrListCollection from DB folder " + << m_etaTableFolder << endreq; + return sc; + } + + else + if( m_debug ) m_log<<MSG::INFO<<" CondAttrListCollection from DB folder have been obtained with size "<< atrc->size() <<endreq; + + + CondAttrListCollection::const_iterator itr; + int ic=0; + for (itr = atrc->begin(); itr != atrc->end(); ++itr) { + ic++; + if( m_verbose ) m_log << MSG::VERBOSE << "Loop over CondAttrListCollection ic = "<<ic<<endreq; + const coral::AttributeList& atr=itr->second; + + // store the table columns in private members + m_etaCM_File = *(static_cast<const std::string*>((atr["CM_File"]).addressOfData())); + m_vecetaCM_File.push_back(m_etaCM_File); + m_etaTh0 = *(static_cast<const std::string*>((atr["Th0"]).addressOfData())); + m_trigroads[m_etaCM_File]=m_etaTh0; + m_vecetaTh0.push_back(m_etaTh0); + //m_etaTh1 = *(static_cast<const std::string*>((atr["Th1"]).addressOfData())); + //m_etaTh2 = *(static_cast<const std::string*>((atr["Th2"]).addressOfData())); + m_etaSequence_Th = *(static_cast<const std::string*>((atr["Sequence_Th"]).addressOfData())); + m_vecetaSequence_Th.push_back(m_etaSequence_Th); + m_etaInfo = *(static_cast<const std::string*>((atr["Additional_Info"]).addressOfData())); + m_vecetaInfo.push_back(m_etaInfo); + } + std::vector<std::string>::const_iterator itrdb; + itrdb=m_vecetaCM_File.begin(); + while(itrdb<m_vecetaCM_File.end()){ + if( m_verbose ) m_log << MSG::VERBOSE << "column eta CM_File is \n" << (*itrdb) << endreq; + itrdb++; + /* + log << MSG::VERBOSE << "column eta CM_File is \n" << m_etaCM_File << endreq; + log << MSG::VERBOSE << "column eta Th0 is \n" << m_etaTh0 << endreq; + log << MSG::VERBOSE << "column eta Th1 is \n" << m_etaTh1 << endreq; + log << MSG::VERBOSE << "column eta Th2 is \n" << m_etaTh2 << endreq; + log << MSG::VERBOSE << "column eta Sequence_Th is \n" << m_etaSequence_Th << endreq; + log << MSG::VERBOSE << "column eta Additional_Info is \n" << m_etaInfo << endreq; + + log <<"End of Sequence load"<<endreq; + */ + } + if( m_debug ) m_log << MSG::INFO<<"After Reading folder, Configuration string size is " + <<m_etaCM_File.size()<<endreq; + + return StatusCode::SUCCESS; + +} + + +StatusCode RPCTriggerDbTool::loadRPCPhiTable(IOVSVC_CALLBACK_ARGS_P(/*I*/,/*keys*/)) +{ + + + m_log.setLevel(outputLevel()); + m_debug = m_log.level() <= MSG::DEBUG; + m_verbose = m_log.level() <= MSG::VERBOSE; + + + StatusCode sc=StatusCode::SUCCESS; + if( m_debug ) m_log << MSG::INFO << "loadRPCPhiTable --- Load info from DB" << endreq; + + const CondAttrListCollection * atrc; + if( m_debug ) m_log << MSG::INFO << "Try to read from folder <"<<m_phiTableFolder<<">"<<endreq; + + sc=m_detStore->retrieve(atrc,m_phiTableFolder); + if(sc.isFailure()) { + m_log << MSG::ERROR + << "could not retreive the CondAttrListCollection from DB folder " + << m_phiTableFolder << endreq; + return sc; + } + + else + if( m_debug ) m_log<<MSG::INFO + <<" CondAttrListCollection from DB folder have been obtained with size " + << atrc->size() <<endreq; + + + CondAttrListCollection::const_iterator itr; + for (itr = atrc->begin(); itr != atrc->end(); ++itr) { + const coral::AttributeList& atr=itr->second; + + // store table coloumns in private members + + m_phiCM_File = *(static_cast<const std::string*>((atr["CM_File"]).addressOfData())); + m_vecphiCM_File.push_back(m_phiCM_File); + m_phiTh0 = *(static_cast<const std::string*>((atr["Th0"]).addressOfData())); + m_vecphiTh0.push_back(m_phiTh0); + m_trigroads[m_phiCM_File]=m_phiTh0; + m_phiInfo = *(static_cast<const std::string*>((atr["Additional_Info"]).addressOfData())); + m_vecphiInfo.push_back(m_phiInfo); + if( m_verbose ) { + m_log << MSG::VERBOSE << "column phi CM_File is \n" << m_phiCM_File << endreq; + m_log << MSG::VERBOSE << "column phi Th0 is \n" << m_phiTh0 << endreq; + m_log << MSG::VERBOSE << "column phi Additional_Info is \n" << m_phiInfo << endreq; + + m_log <<MSG::VERBOSE << "End of Sequence load"<<endreq; + } + } + if( m_debug ) m_log<< MSG::INFO<<"After Reading folder, Correction string size is " + << m_phiCM_File.size()<<endreq; + + return StatusCode::SUCCESS; + +} + diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/components/RPC_CondCabling_entries.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/components/RPC_CondCabling_entries.cxx new file mode 100755 index 0000000000000000000000000000000000000000..43d381b2e0509e8f6e4455fa209406895e3887a0 --- /dev/null +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/components/RPC_CondCabling_entries.cxx @@ -0,0 +1,13 @@ +#include "GaudiKernel/DeclareFactoryEntries.h" +#include "RPC_CondCabling/RPCTriggerDbTool.h" +#include "RPC_CondCabling/RPCCablingDbTool.h" + +DECLARE_TOOL_FACTORY( RPCCablingDbTool ) +DECLARE_TOOL_FACTORY( RPCTriggerDbTool ) + + +DECLARE_FACTORY_ENTRIES( RPC_CondCabling ){ + DECLARE_TOOL( RPCCablingDbTool ) + DECLARE_TOOL( RPCTriggerDbTool ) +} + diff --git a/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/components/RPC_CondCabling_load.cxx b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/components/RPC_CondCabling_load.cxx new file mode 100755 index 0000000000000000000000000000000000000000..f14bcbfbc7b3042b826ca74750d9fcb4a88a310c --- /dev/null +++ b/MuonSpectrometer/MuonConditions/MuonCondCabling/RPC_CondCabling/src/components/RPC_CondCabling_load.cxx @@ -0,0 +1,3 @@ +#include "GaudiKernel/LoadFactoryEntries.h" + +LOAD_FACTORY_ENTRIES( RPC_CondCabling )