Skip to content
Snippets Groups Projects
Commit c3328b8b authored by Chikuma Kato's avatar Chikuma Kato
Browse files

migrated MuonMDT_CablingSvc to readCdo in MDT_Hid2RESrcID,...

migrated MuonMDT_CablingSvc to readCdo in MDT_Hid2RESrcID, MdtCsmContByteStreamTool, and MdtROD_Decoder


Former-commit-id: 28d702e6
parent 86c6c5ce
No related branches found
No related tags found
No related merge requests found
......@@ -23,15 +23,17 @@ using eformat::helper::SourceIdentifier;
MDT_Hid2RESrcID::MDT_Hid2RESrcID() :
m_cabling(0), m_mdtIdHelper(0), m_specialROBNumber(0)
m_mdtIdHelper(0), m_specialROBNumber(0), m_readKey("MuonMDT_CablingMap")
{
}
void MDT_Hid2RESrcID::set(MuonMDT_CablingSvc* p_cabling, const MdtIdHelper* mdtIdHelper) {
void MDT_Hid2RESrcID::set(const MdtIdHelper* mdtIdHelper) {
// Initialize the cabling Service
m_mdtIdHelper = mdtIdHelper;
m_cabling = p_cabling;
m_readKey.initialize();
//ATH_CHECK( m_readKey.initialize() );
//return StatusCode::SUCCESS;
}
uint32_t MDT_Hid2RESrcID::getRodID(const Identifier& offlineId) {
......@@ -63,15 +65,22 @@ uint32_t MDT_Hid2RESrcID::getRodID(const Identifier& offlineId) {
int multilayer = m_mdtIdHelper->multilayer(offlineId);
int tubelayer = m_mdtIdHelper->tubeLayer(offlineId);
int tube = m_mdtIdHelper->tube(offlineId);
online = m_cabling->getOnlineId(station_name, station_eta,
station_phi, multilayer,tubelayer,
tube,
SubsystemId,
MrodId,
LinkId,
TdcId,
ChannelId);
SG::ReadCondHandle<MuonMDT_CablingMap> readHandle{m_readKey};
const MuonMDT_CablingMap* readCdo{*readHandle};
if(readCdo==nullptr){
//ATH_MSG_ERROR("Null pointer to the read conditions object");
log << MSG::ERROR << "Null pointer to the read conditions object" << endmsg;
return 0;
}
online = readCdo->getOnlineId(station_name, station_eta,
station_phi, multilayer,tubelayer,
tube,
SubsystemId,
MrodId,
LinkId,
TdcId,
ChannelId);
if (!online) {
log << MSG::DEBUG << "ROD Id of the Station " << MSG::hex << "0x" << offlineId
......
......@@ -8,12 +8,13 @@
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/StatusCode.h"
#include "MuonMDT_Cabling/MuonMDT_CablingSvc.h"
#include "StoreGate/ReadCondHandle.h"
#include "MuonCablingData/MuonMDT_CablingMap.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "MuonIdHelpers/MdtIdHelper.h"
#include "Identifier/Identifier.h"
#include <stdint.h>
#include <map>
......@@ -36,7 +37,7 @@ public:
/** intialize the cabling service
*/
void set(MuonMDT_CablingSvc* p_cabling, const MdtIdHelper* m_mdtIdHelper);
void set(const MdtIdHelper* m_mdtIdHelper);
/** TMP method for sector 13 data */
void setSpecialROBNumber(int specialROBNumber) {m_specialROBNumber=specialROBNumber;}
......@@ -58,11 +59,13 @@ public:
private:
MuonMDT_CablingSvc* m_cabling;
const MdtIdHelper* m_mdtIdHelper;
int m_specialROBNumber;
//SG::ReadCondHandleKey<MuonMDT_CablingMap> m_readKey{this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"};
SG::ReadCondHandleKey<MuonMDT_CablingMap> m_readKey;
};
#endif
......
......@@ -5,8 +5,6 @@
#include "MdtCsmContByteStreamTool.h"
#include "MdtROD_Encoder.h"
#include "MuonMDT_Cabling/MuonMDT_CablingSvc.h"
#include "MuonRDO/MdtCsm.h"
#include "MuonRDO/MdtCsmContainer.h"
......@@ -24,7 +22,6 @@ Muon::MdtCsmContByteStreamTool::MdtCsmContByteStreamTool
( const std::string& type, const std::string& name,const IInterface* parent )
:
AthAlgTool(type,name,parent),
m_cabling(0),
m_hid2re(0),
m_mdtIdHelper(0)
{
......@@ -39,11 +36,6 @@ Muon::MdtCsmContByteStreamTool::MdtCsmContByteStreamTool
StatusCode Muon::MdtCsmContByteStreamTool::initialize() {
if (StatusCode::SUCCESS != service("MuonMDT_CablingSvc", m_cabling)) {
ATH_MSG_ERROR(" Can't get MuonMDT_CablingSvc ");
return StatusCode::FAILURE;
}
StoreGateSvc * detStore;
StatusCode status = service("DetectorStore", detStore);
if (status.isFailure()) {
......@@ -63,7 +55,7 @@ StatusCode Muon::MdtCsmContByteStreamTool::initialize() {
}
m_hid2re = new MDT_Hid2RESrcID ();
m_hid2re->set(m_cabling, mdt_id);
m_hid2re->set(mdt_id);
m_mdtIdHelper = mdt_id;
......@@ -81,7 +73,7 @@ StatusCode Muon::MdtCsmContByteStreamTool::convert(CONTAINER* cont, RawEventWrit
MsgStream& log ) {
m_fea.clear();
m_fea.idMap().set(m_cabling, m_mdtIdHelper);
m_fea.idMap().set(m_mdtIdHelper);
FullEventAssembler<MDT_Hid2RESrcID>::RODDATA* theROD ;
......
......@@ -18,7 +18,6 @@
class MdtCsmContainer;
class MsgStream;
class MuonMDT_CablingSvc;
#include <string>
......@@ -65,7 +64,6 @@ public:
private:
MuonMDT_CablingSvc* m_cabling;
MDT_Hid2RESrcID* m_hid2re;
const MdtIdHelper* m_mdtIdHelper;
......
......@@ -25,7 +25,7 @@ static const InterfaceID IID_IMdtROD_Decoder
MdtROD_Decoder::MdtROD_Decoder
( const std::string& type, const std::string& name,const IInterface* parent )
: AthAlgTool(type,name,parent),
m_EvtStore(0), m_hid2re(0), m_cabling(0), m_mdtIdHelper(0), m_rodReadOut(0), m_csmReadOut(0),
m_EvtStore(0), m_hid2re(0), m_mdtIdHelper(0), m_rodReadOut(0), m_csmReadOut(0),
m_amtReadOut(0), m_hptdcReadOut(0), m_BMEpresent(false), m_BMGpresent(false), m_BMEid(-1), m_BMGid(-1)
// m_debug(false),
// m_log (msgSvc(), name)
......@@ -72,12 +72,7 @@ StatusCode MdtROD_Decoder::initialize() {
// Here the mapping service has to be initialized
if (StatusCode::SUCCESS != service("MuonMDT_CablingSvc", m_cabling)) {
ATH_MSG_ERROR(" Can't get MuonMDT_CablingSvc ");
return StatusCode::FAILURE;
}
m_hid2re->set(m_cabling,m_mdtIdHelper);
m_hid2re->set(m_mdtIdHelper);
// Initialize decoding classes
m_rodReadOut = new MdtRODReadOut();
......@@ -96,6 +91,8 @@ StatusCode MdtROD_Decoder::initialize() {
ATH_MSG_INFO("Processing configuration for layouts with BMG chambers.");
m_BMGid = m_mdtIdHelper->stationNameIndex("BMG");
}
ATH_CHECK( m_readKey.initialize() );
return StatusCode::SUCCESS;
}
......@@ -287,7 +284,13 @@ StatusCode MdtROD_Decoder::fillCollections(const OFFLINE_FRAGMENTS_NAMESPACE::RO
bool cab;
cab = m_cabling->getOfflineId(subdetId, mrodId, csmId, tdc, cha,
SG::ReadCondHandle<MuonMDT_CablingMap> readHandle{m_readKey};
const MuonMDT_CablingMap* readCdo{*readHandle};
if(readCdo==nullptr){
ATH_MSG_ERROR("Null pointer to the read conditions object");
return StatusCode::FAILURE;
}
cab = readCdo->getOfflineId(subdetId, mrodId, csmId, tdc, cha,
StationName, StationEta, StationPhi,
MultiLayer, TubeLayer, Tube);
......
......@@ -16,7 +16,8 @@
#include "MuonIdHelpers/MdtIdHelper.h"
#include "MDT_Hid2RESrcID.h"
#include "MuonMDT_Cabling/MuonMDT_CablingSvc.h"
#include "MuonCablingData/MuonMDT_CablingMap.h"
#include "StoreGate/ReadCondHandleKey.h"
#include <stdint.h>
#include <map>
......@@ -81,7 +82,7 @@ private:
StoreGateSvc *m_EvtStore;
MDT_Hid2RESrcID* m_hid2re;
MuonMDT_CablingSvc* m_cabling;
SG::ReadCondHandleKey<MuonMDT_CablingMap> m_readKey{this, "ReadKey", "MuonMDT_CablingMap", "Key of MuonMDT_CablingMap"};
const MdtIdHelper* m_mdtIdHelper;
......@@ -101,6 +102,7 @@ private:
// bool m_debug; //!< If true, output debugging information
//MsgStream m_log;
};
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment