diff --git a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/CMakeLists.txt b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/CMakeLists.txt index e9f2ac5f984c550ddade2aee5420874700aed676..5b3e95266908469a9dbc158b06b95717764ce0e4 100644 --- a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/CMakeLists.txt +++ b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/CMakeLists.txt @@ -23,7 +23,8 @@ atlas_depends_on_subdirs( PUBLIC MuonSpectrometer/MuonDigitContainer MuonSpectrometer/MuonIdHelpers MuonSpectrometer/MuonRDO - MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData ) + MuonSpectrometer/MuonReconstruction/MuonRecEvent/MuonPrepRawData + MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization ) # External dependencies: find_package( tdaq-common COMPONENTS eformat_write DataWriter ) @@ -33,7 +34,7 @@ atlas_add_component( MuonMM_CnvTools src/*.cxx src/components/*.cxx INCLUDE_DIRS ${TDAQ-COMMON_INCLUDE_DIRS} - LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps SGTools StoreGateLib SGtests AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib MuonContainerManager MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData ) + LINK_LIBRARIES ${TDAQ-COMMON_LIBRARIES} ByteStreamData ByteStreamData_test GaudiKernel AthenaBaseComps SGTools StoreGateLib SGtests AtlasDetDescr Identifier ByteStreamCnvSvcBaseLib MuonContainerManager MuonReadoutGeometry MuonDigitContainer MuonIdHelpersLib MuonRDO MuonPrepRawData MMClusterization ) # Install files from the package: atlas_install_headers( MuonMM_CnvTools ) diff --git a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.cxx b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.cxx index 1342d58a4546f7ebd7d31faf580814cdad5ecf7f..ad05be45b54e9ff5510cbccbdd75791cb3a85c2e 100644 --- a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.cxx @@ -27,6 +27,8 @@ #include "ByteStreamCnvSvcBase/IROBDataProviderSvc.h" #include "MuonCnvToolInterfaces/IMuonRawDataProviderTool.h" +#include "MMClusterization/IMMClusterBuilderTool.h" + using namespace MuonGM; using namespace Trk; using namespace Muon; @@ -40,7 +42,8 @@ Muon::MmRdoToPrepDataTool::MmRdoToPrepDataTool(const std::string& t, m_mmIdHelper(0), m_idHelperTool("Muon::MuonIdHelperTool/MuonIdHelperTool"), m_fullEventDone(false), - m_mmPrepDataContainer(0) + m_mmPrepDataContainer(0), + m_clusterBuilderTool("Muon::SimpleMMClusterBuilderTool/SimpleMMClusterBuilderTool",this) { declareInterface<Muon::IMuonRdoToPrepDataTool>(this); @@ -51,6 +54,7 @@ Muon::MmRdoToPrepDataTool::MmRdoToPrepDataTool(const std::string& t, "Muon::MMPrepDataContainer to record"); declareProperty("MergePrds", m_merge = true); + declareProperty("ClusterBuilderTool",m_clusterBuilderTool); } @@ -141,7 +145,6 @@ StatusCode Muon::MmRdoToPrepDataTool::processCollection(const MM_RawDataCollecti } std::vector<MMPrepData> MMprds; - std::vector<int> MMflag; // convert the RDO collection to a PRD collection MM_RawDataCollection::const_iterator it = rdoColl->begin(); for ( ; it != rdoColl->end() ; ++it ) { @@ -218,114 +221,21 @@ StatusCode Muon::MmRdoToPrepDataTool::processCollection(const MM_RawDataCollecti prdColl->push_back(new MMPrepData(prdId,hash,localPos,rdoList,cov,detEl,time,charge)); } else { MMprds.push_back(MMPrepData(prdId,hash,localPos,rdoList,cov,detEl,time,charge)); - MMflag.push_back(0); } } if(merge) { - for (unsigned int i=0; i<MMprds.size(); ++i){ - // skip the merged prds - if(MMflag[i]==1) continue; - - bool merge = false; - unsigned int jmerge = -1; - Identifier id_prd = MMprds[i].identify(); - int strip = m_mmIdHelper->channel(id_prd); - int gasGap = m_mmIdHelper->gasGap(id_prd); - int layer = m_mmIdHelper->multilayer(id_prd); - ATH_MSG_VERBOSE(" MMprds " << MMprds.size() <<" index "<< i << " strip " << strip << " gasGap " << gasGap << " layer " << layer << " z " << MMprds[i].globalPosition().z() ); - for (unsigned int j=i+1; j<MMprds.size(); ++j){ - Identifier id_prdN = MMprds[j].identify(); - int stripN = m_mmIdHelper->channel(id_prdN); - int gasGapN = m_mmIdHelper->gasGap(id_prdN); - int layerN = m_mmIdHelper->multilayer(id_prdN); - if( gasGapN==gasGap && layerN==layer ) { - ATH_MSG_VERBOSE(" next MMprds strip same gasGap and layer index " << j << " strip " << stripN << " gasGap " << gasGapN << " layer " << layerN ); - if(abs(strip-stripN)<2) { - merge = true; - jmerge = j; - break; - } - } - } - - if(!merge) { - ATH_MSG_VERBOSE(" add isolated MMprds strip " << strip << " gasGap " << gasGap << " layer " << layer ); - std::vector<Identifier> rdoList; - rdoList.push_back(id_prd); - double covX = MMprds[i].localCovariance()(Trk::locX,Trk::locX); - Amg::MatrixX* covN = new Amg::MatrixX(1,1); - covN->setIdentity(); - (*covN)(0,0) = covX; - MMPrepData* prdN = new MMPrepData(id_prd, hash, MMprds[i].localPosition(), rdoList, covN, MMprds[i].detectorElement()); - prdN->setHashAndIndex(prdColl->identifyHash(), prdColl->size()); - prdColl->push_back(prdN); - } else { - unsigned int nmerge = 0; - std::vector<Identifier> rdoList; - std::vector<unsigned int> mergeIndices; - std::vector<int> mergeStrips; - rdoList.push_back(id_prd); - MMflag[i] = 1; - mergeIndices.push_back(i); - mergeStrips.push_back(strip); - unsigned int nmergeStrips = 1; - unsigned int nmergeStripsMax = 25; - for (unsigned int k=0; k < nmergeStripsMax; ++k) { - for (unsigned int j=jmerge; j<MMprds.size(); ++j){ - if(MMflag[j] == 1) continue; - Identifier id_prdN = MMprds[j].identify(); - int stripN = m_mmIdHelper->channel(id_prdN); - if( abs(mergeStrips[k]-stripN) <= 1 ) { - int gasGapN = m_mmIdHelper->gasGap(id_prdN); - int layerN = m_mmIdHelper->multilayer(id_prdN); - if( gasGapN==gasGap && layerN==layer ) { - if(mergeStrips[k]==stripN) { - MMflag[j] = 1; - continue; - } - nmerge++; - rdoList.push_back(id_prdN); - MMflag[j] = 1; - mergeIndices.push_back(j); - mergeStrips.push_back(stripN); - nmergeStrips++; - } - } - } - if(k>=nmergeStrips) break; - } - ATH_MSG_VERBOSE(" add merged MMprds nmerge " << nmerge << " strip " << strip << " gasGap " << gasGap << " layer " << layer ); - - // start off from strip in the middle - int stripSum = 0; - for (unsigned int k =0; k<mergeStrips.size(); ++k) { - stripSum += mergeStrips[k]; - } - stripSum = stripSum/mergeStrips.size(); - - unsigned int j = jmerge; - for (unsigned int k =0; k<mergeStrips.size(); ++k) { - if(mergeStrips[k]==stripSum) j = mergeIndices[k]; - ATH_MSG_VERBOSE(" merged strip nr " << k << " strip " << mergeStrips[k] << " index " << mergeIndices[k]); - } - ATH_MSG_VERBOSE(" Look for strip nr " << stripSum << " found at index " << j); - - double covX = MMprds[j].localCovariance()(Trk::locX, Trk::locX); - Amg::MatrixX* covN = new Amg::MatrixX(1,1); - covN->setIdentity(); - (*covN)(0,0) = 6.*(nmerge + 1.)*covX; - if(nmerge<=1) (*covN)(0,0) = covX; - ATH_MSG_VERBOSE(" make merged prepData at strip " << m_mmIdHelper->channel(MMprds[j].identify()) << " nmerge " << nmerge << " sqrt covX " << sqrt((*covN)(0,0))); - - MMPrepData* prdN = new MMPrepData(MMprds[j].identify(), hash, MMprds[j].localPosition(), rdoList, covN, MMprds[j].detectorElement()); - prdN->setHashAndIndex(prdColl->identifyHash(), prdColl->size()); - prdColl->push_back(prdN); - } - } // end loop MMprds[i] - // clear vector and delete elements - MMflag.clear(); - MMprds.clear(); + std::vector<MMPrepData*> clusters; + + /// reconstruct the clusters + ATH_CHECK(m_clusterBuilderTool->getClusters(MMprds,clusters)); + + for (unsigned int i = 0 ; i<clusters.size() ; ++i ) { + MMPrepData* prdN = clusters.at(i); + prdN->setHashAndIndex(prdColl->identifyHash(), prdColl->size()); + prdColl->push_back(prdN); + } + } diff --git a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.h b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.h index 90a3d5666dac2129734a88298154d9d5a98eafee..b0b1448ae2afa9948cbb3ae943235a2b13bdcb1f 100644 --- a/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.h +++ b/MuonSpectrometer/MuonCnv/MuonMM_CnvTools/src/MmRdoToPrepDataTool.h @@ -39,6 +39,7 @@ namespace Muon class IMuonRawDataProviderTool; class MuonIdHelperTool; + class IMMClusterBuilderTool; class MmRdoToPrepDataTool : virtual public IMuonRdoToPrepDataTool, virtual public AthAlgTool { @@ -94,6 +95,9 @@ namespace Muon std::string m_outputCollectionLocation; bool m_merge; + + ToolHandle<IMMClusterBuilderTool> m_clusterBuilderTool; + }; } // end of namespace diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/MMClusterization/IMMClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/MMClusterization/IMMClusterBuilderTool.h index c32d8dd9b93d30b527f2aca5caf40f03aea99cbf..cca0eb4e3960c30598cc14b7f5eb27dd2ea12bf9 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/MMClusterization/IMMClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/MMClusterization/IMMClusterBuilderTool.h @@ -27,7 +27,7 @@ namespace Muon { public: // interface methods virtual StatusCode getClusters(std::vector<Muon::MMPrepData>& stripsVect, - std::vector<Muon::MMPrepData>& clustersVect)=0; + std::vector<Muon::MMPrepData*>& clustersVect)=0; }; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx index 0f09c5ff3cd58df75e7bf4e10dc9a930fcfd9995..f221ea4d9f082e67b6233bf0a337da4f9ab4980d 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx @@ -3,6 +3,8 @@ */ #include "SimpleMMClusterBuilderTool.h" #include "MuonPrepRawData/MMPrepData.h" +#include "MuonReadoutGeometry/MuonDetectorManager.h" +#include "MuonIdHelpers/MmIdHelper.h" using namespace Muon; @@ -10,9 +12,11 @@ Muon::SimpleMMClusterBuilderTool::SimpleMMClusterBuilderTool(const std::string& const std::string& n, const IInterface* p ) : - AthAlgTool(t,n,p) + AthAlgTool(t,n,p), + m_muonMgr(nullptr), + m_mmIdHelper(nullptr) { - + declareInterface<IMMClusterBuilderTool>(this); } @@ -25,6 +29,22 @@ Muon::SimpleMMClusterBuilderTool::~SimpleMMClusterBuilderTool() StatusCode Muon::SimpleMMClusterBuilderTool::initialize() { + /// get the detector descriptor manager + StoreGateSvc* detStore=0; + StatusCode sc = serviceLocator()->service("DetectorStore", detStore); + if (sc.isSuccess()) { + sc = detStore->retrieve( m_muonMgr ); + if (sc.isFailure()) { + ATH_MSG_FATAL(" Cannot retrieve MuonReadoutGeometry "); + return sc; + } + } else { + ATH_MSG_ERROR("DetectorStore not found "); + return sc; + } + + m_mmIdHelper = m_muonMgr->mmIdHelper(); + return StatusCode::SUCCESS; } @@ -35,14 +55,123 @@ StatusCode Muon::SimpleMMClusterBuilderTool::finalize() return StatusCode::SUCCESS; } -StatusCode Muon::SimpleMMClusterBuilderTool::getClusters(std::vector<Muon::MMPrepData>& stripsVect, - std::vector<Muon::MMPrepData>& clustersVect) +StatusCode Muon::SimpleMMClusterBuilderTool::getClusters(std::vector<Muon::MMPrepData>& MMprds, + std::vector<Muon::MMPrepData*>& clustersVect) { - ATH_MSG_DEBUG("Size of the input vector: " << stripsVect.size()); + ATH_MSG_DEBUG("Size of the input vector: " << MMprds.size()); ATH_MSG_DEBUG("Size of the output vector: " << clustersVect.size()); - + std::vector<int> MMflag; + IdentifierHash hash; + + if ( MMprds.size() > 0 ) { + hash = MMprds.at(0).collectionHash(); + } + else { + ATH_MSG_DEBUG("Empty PRD collection: no clusterization" ); + return StatusCode::SUCCESS; + } + + for (unsigned int i=0; i<MMprds.size(); ++i){ + MMflag.push_back(0); + } + + for (unsigned int i=0; i<MMprds.size(); ++i){ + // skip the merged prds + if(MMflag[i]==1) continue; + + unsigned int jmerge = -1; + Identifier id_prd = MMprds[i].identify(); + int strip = m_mmIdHelper->channel(id_prd); + int gasGap = m_mmIdHelper->gasGap(id_prd); + int layer = m_mmIdHelper->multilayer(id_prd); + ATH_MSG_VERBOSE(" MMprds " << MMprds.size() <<" index "<< i << " strip " << strip << " gasGap " << gasGap << " layer " << layer << " z " << MMprds[i].globalPosition().z() ); + for (unsigned int j=i+1; j<MMprds.size(); ++j){ + Identifier id_prdN = MMprds[j].identify(); + int stripN = m_mmIdHelper->channel(id_prdN); + int gasGapN = m_mmIdHelper->gasGap(id_prdN); + int layerN = m_mmIdHelper->multilayer(id_prdN); + if( gasGapN==gasGap && layerN==layer ) { + ATH_MSG_VERBOSE(" next MMprds strip same gasGap and layer index " << j << " strip " << stripN << " gasGap " << gasGapN << " layer " << layerN ); + if(abs(strip-stripN)<2) { + jmerge = j; + break; + } + } + } + + unsigned int nmerge = 0; + std::vector<Identifier> rdoList; + std::vector<unsigned int> mergeIndices; + std::vector<int> mergeStrips; + rdoList.push_back(id_prd); + MMflag[i] = 1; + mergeIndices.push_back(i); + mergeStrips.push_back(strip); + unsigned int nmergeStrips = 1; + unsigned int nmergeStripsMax = 25; + for (unsigned int k=0; k < nmergeStripsMax; ++k) { + for (unsigned int j=jmerge; j<MMprds.size(); ++j){ + if(MMflag[j] == 1) continue; + Identifier id_prdN = MMprds[j].identify(); + int stripN = m_mmIdHelper->channel(id_prdN); + if( abs(mergeStrips[k]-stripN) <= 1 ) { + int gasGapN = m_mmIdHelper->gasGap(id_prdN); + int layerN = m_mmIdHelper->multilayer(id_prdN); + if( gasGapN==gasGap && layerN==layer ) { + if(mergeStrips[k]==stripN) { + MMflag[j] = 1; + continue; + } + nmerge++; + rdoList.push_back(id_prdN); + MMflag[j] = 1; + mergeIndices.push_back(j); + mergeStrips.push_back(stripN); + nmergeStrips++; + } + } + } + if(k>=nmergeStrips) break; + } + ATH_MSG_VERBOSE(" add merged MMprds nmerge " << nmerge << " strip " << strip << " gasGap " << gasGap << " layer " << layer ); + + // start off from strip in the middle + int stripSum = 0; + for (unsigned int k =0; k<mergeStrips.size(); ++k) { + stripSum += mergeStrips[k]; + } + stripSum = stripSum/mergeStrips.size(); + + unsigned int j = jmerge; + for (unsigned int k =0; k<mergeStrips.size(); ++k) { + if(mergeStrips[k]==stripSum) j = mergeIndices[k]; + ATH_MSG_VERBOSE(" merged strip nr " << k << " strip " << mergeStrips[k] << " index " << mergeIndices[k]); + } + ATH_MSG_VERBOSE(" Look for strip nr " << stripSum << " found at index " << j); + + double covX = MMprds[j].localCovariance()(Trk::locX, Trk::locX); + + /// + /// memory allocated dynamically for the PrepRawData is managed by Event Store + /// + Amg::MatrixX* covN = new Amg::MatrixX(1,1); + covN->setIdentity(); + (*covN)(0,0) = 6.*(nmerge + 1.)*covX; + if(nmerge<=1) (*covN)(0,0) = covX; + ATH_MSG_VERBOSE(" make merged prepData at strip " << m_mmIdHelper->channel(MMprds[j].identify()) << " nmerge " << nmerge << " sqrt covX " << sqrt((*covN)(0,0))); + + /// + /// memory allocated dynamically for the PrepRawData is managed by Event Store + /// + MMPrepData* prdN = new MMPrepData(MMprds[j].identify(), hash, MMprds[j].localPosition(), rdoList, covN, MMprds[j].detectorElement()); + clustersVect.push_back(prdN); + } // end loop MMprds[i] + //clear vector and delete elements + MMflag.clear(); + MMprds.clear(); + return StatusCode::SUCCESS; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h index 38176c7e78ca48998a7b14f3afdce0cf7ff12ba8..b74a111ba8af7255330e87aa641c3c6252cb1850 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h @@ -8,20 +8,25 @@ #include "MMClusterization/IMMClusterBuilderTool.h" #include "MuonPrepRawData/MMPrepData.h" #include "AthenaBaseComps/AthAlgTool.h" + +class MmIdHelper; +namespace MuonGM +{ + class MuonDetectorManager; +} + // // Simple clusterization tool for MicroMegas // namespace Muon { - class IMMClusterBuilderTool; - class SimpleMMClusterBuilderTool : virtual public IMMClusterBuilderTool, public AthAlgTool { public: /** Default constructor */ SimpleMMClusterBuilderTool(const std::string&, const std::string&, const IInterface*); - + /** Default destructor */ virtual ~SimpleMMClusterBuilderTool(); @@ -32,12 +37,14 @@ namespace Muon virtual StatusCode finalize(); StatusCode getClusters(std::vector<Muon::MMPrepData>& stripsVect, - std::vector<Muon::MMPrepData>& clustersVect); + std::vector<Muon::MMPrepData*>& clustersVect); private: - - + /// Muon Detector Descriptor + const MuonGM::MuonDetectorManager* m_muonMgr; + const MmIdHelper* m_mmIdHelper; + }; diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/STgcClusterization/ISTgcClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/STgcClusterization/ISTgcClusterBuilderTool.h index 4b58507660c0753148663808efbbb119175d3c5e..707341ab4e531868ff8dc0d7004c218d6f746ae8 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/STgcClusterization/ISTgcClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/STgcClusterization/ISTgcClusterBuilderTool.h @@ -26,7 +26,7 @@ namespace Muon { public: // interface methods virtual StatusCode getClusters(std::vector<Muon::sTgcPrepData>& stripsVect, - std::vector<Muon::sTgcPrepData>& clustersVect)=0; + std::vector<Muon::sTgcPrepData*>& clustersVect)=0; }; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx index 18182fcf4fde401fb56f0b4e8d89e41976b3da28..a8929d163be3badf9adb87ba59534c42de7c65f1 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx @@ -36,7 +36,7 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::finalize() } StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTgcPrepData>& stripsVect, - std::vector<Muon::sTgcPrepData>& clustersVect) + std::vector<Muon::sTgcPrepData*>& clustersVect) { diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h index 79fb02528ea05c50e9f9ed225e1b7305e61433a6..d0fd160c92e9c53fda0adb9f2d683c7cd51813e4 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h @@ -31,7 +31,7 @@ namespace Muon virtual StatusCode finalize(); StatusCode getClusters(std::vector<Muon::sTgcPrepData>& stripsVect, - std::vector<Muon::sTgcPrepData>& clustersVect); + std::vector<Muon::sTgcPrepData*>& clustersVect); private: diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MMTools.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MMTools.py new file mode 100644 index 0000000000000000000000000000000000000000..f06205f0635234f12b38fa81899ccb87620c5640 --- /dev/null +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MMTools.py @@ -0,0 +1,12 @@ +# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + +__doc__ = """Configuration of tools for MicroMegas reconstruction""" + +from AthenaCommon.Logging import logging +logging.getLogger().info("Importing %s", __name__) + +from AthenaCommon import CfgMgr + +def SimpleMMClusterBuilderTool(name="SimpleMMClusterBuilderTool",extraFlags=None,**kwargs): + return CfgMgr.Muon__SimpleMMClusterBuilderTool(name,**kwargs) + diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py index 25ede1a4f8e627398361cccd6952834db6c8a0f9..9f816c07d274bd7738c605e347ee27b8bcd1fea7 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonPrdProviderToolsConfig.py @@ -106,6 +106,12 @@ def CscRdoToCscPrepData(name="CscRdoToCscPrepData", **kwargs): from MuonRdoToPrepData.MuonRdoToPrepDataConf import CscRdoToCscPrepData as Muon__CscRdoToCscPrepData return Muon__CscRdoToCscPrepData(name, **kwargs) +############################################################################# + +def MM_PrepDataProviderTool(name="MM_PrepDataProviderTool", **kwargs): + kwargs.setdefault("ClusterBuilderTool","SimpleMMClusterBuilderTool") + return Muon__MmRdoToPrepDataTool(name,**kwargs) + ### algorithms for other technologies can use C++ defaults diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py index 42723dac06ece8f99e0dc69dc74b000ab7cb0a89..90b5a86ab99e81016a815b2f4c0209c53e732e60 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/python/MuonRecExampleConfigDb.py @@ -222,6 +222,10 @@ addTool("MuonRecExample.CscTools.CscSegmentUtilTool","CscSegmentUtilTool") addAlgorithm("MuonRecExample.CscTools.CscThresholdClusterBuilder","CscThresholdClusterBuilder") +################################################################################ +# Tools from MuonRecExample.MMTools (MicroMegas reconstruction tools ) +################################################################################ +addTool("MuonRecExample.MMTools.SimpleMMClusterBuilderTool","SimpleMMClusterBuilderTool") ################################################################################ diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py index 322a86fc53bf81c63655b6491691c91d0345dde5..ad2afcce5d125d47bfe3b0cd4cd42ea524ad0f41 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py +++ b/MuonSpectrometer/MuonReconstruction/MuonRecExample/share/MuonRDO_to_PRD_jobOptions.py @@ -30,6 +30,8 @@ if muonRecFlags.doRPCs() and DetFlags.makeRIO.RPC_on() and (DetFlags.haveRDO.RPC if muonRecFlags.doTGCs() and DetFlags.makeRIO.TGC_on() and (DetFlags.haveRDO.TGC_on() or DetFlags.digitize.TGC_on()): topSequence += getAlgorithm("TgcRdoToTgcPrepData", tryDefaultConfigurable=True) +from MuonRecExample.MMTools import SimpleMMClusterBuilderTool + if not muonRecFlags.doFastDigitization(): if muonRecFlags.dosTGCs() and DetFlags.makeRIO.sTGC_on() and (DetFlags.haveRDO.sTGC_on() or DetFlags.digitize.sTGC_on()): topSequence += getAlgorithm("StgcRdoToStgcPrepData", tryDefaultConfigurable=True)