diff --git a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/sTgcRdoToPrepDataTool.cxx b/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/sTgcRdoToPrepDataTool.cxx index d8db919ea8abfb4a7c867a3e7ece32d7b9792355..3903ed993d58854bbd21c5b8a5d5718aaca71226 100644 --- a/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/sTgcRdoToPrepDataTool.cxx +++ b/MuonSpectrometer/MuonCnv/MuonSTGC_CnvTools/src/sTgcRdoToPrepDataTool.cxx @@ -280,6 +280,7 @@ StatusCode Muon::sTgcRdoToPrepDataTool::processCollection(const STGC_RawDataColl // merge the eta and phi prds that fire closeby strips or wires vector<Muon::sTgcPrepData*> sTgcStripClusters; vector<Muon::sTgcPrepData*> sTgcWireClusters; + vector<Muon::sTgcPrepData*> sTgcPadClusters; // // Clusterize strips // @@ -289,6 +290,9 @@ StatusCode Muon::sTgcRdoToPrepDataTool::processCollection(const STGC_RawDataColl // ATH_CHECK(m_clusterBuilderTool->getClusters(sTgcWirePrds,sTgcWireClusters)); // + // Clusterize pads + // + ATH_CHECK(m_clusterBuilderTool->getClusters(sTgcPadPrds,sTgcPadClusters)); // Add the clusters to the event store ( do not clusterize wires for now ) // for ( auto it : sTgcStripClusters ) { @@ -299,6 +303,10 @@ StatusCode Muon::sTgcRdoToPrepDataTool::processCollection(const STGC_RawDataColl it->setHashAndIndex(prdColl->identifyHash(), prdColl->size()); prdColl->push_back(it); } + for ( auto it : sTgcPadClusters ) { + it->setHashAndIndex(prdColl->identifyHash(), prdColl->size()); + prdColl->push_back(it); + } } diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx index 21dcf4381551add9a0104125a2a4ed57046359da..3463e4275dfdaca7026046b45a64370a4eee4bb4 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.cxx @@ -20,6 +20,7 @@ Muon::SimpleSTgcClusterBuilderTool::SimpleSTgcClusterBuilderTool(const std::stri { declareProperty("ChargeCut", m_chargeCut=0.0); declareProperty("maxHoleSize",m_maxHoleSize=1); + declareProperty("addError",m_addError=0); } Muon::SimpleSTgcClusterBuilderTool::~SimpleSTgcClusterBuilderTool() @@ -57,12 +58,13 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTg IdentifierHash hash; double resolution=0.; - bool isWire = false; + bool isStrip = false; if ( stripsVect.size()>0 ) { resolution = stripsVect.at(0).localCovariance()(0,0); Identifier chanId = stripsVect.at(0).identify(); - if ( m_stgcIdHelper->channelType(chanId)==2 ) isWire = true; - ATH_MSG_DEBUG("isWire: " << isWire << "Single channel resolution: " << resolution); + if ( m_stgcIdHelper->channelType(chanId)==1 ) isStrip = true; + ATH_MSG_DEBUG(" channelType " << m_stgcIdHelper->channelType(chanId)); + ATH_MSG_DEBUG("isStrip: " << isStrip << "Single channel resolution: " << resolution); } else { ATH_MSG_DEBUG("Size of the channel vectors is zero"); @@ -111,8 +113,8 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTg elementsTime.push_back(it.time()); elementsChannel.push_back(m_stgcIdHelper->channel(it.identify())); double weight = 0.0; - isWire ? weight = 1.0 : weight = it.charge(); - ATH_MSG_DEBUG("isWire: " << isWire << " weight: " << weight); + isStrip ? weight = it.charge() : weight = 1.0; + ATH_MSG_DEBUG("isStrip: " << isStrip << " weight: " << weight); weightedPosX += it.localPosition().x()*weight; totalCharge += weight; ATH_MSG_DEBUG("Channel local position and charge: " << it.localPosition().x() << " " @@ -120,11 +122,11 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTg // // Set the cluster identifier to the max charge strip // - if ( isWire ) { + if ( isStrip && it.charge()>maxCharge ) { + maxCharge = it.charge(); clusterId = it.identify(); } - if ( !isWire && it.charge()>maxCharge ) { - maxCharge = it.charge(); + if ( !isStrip) { clusterId = it.identify(); } } @@ -138,8 +140,8 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTg if ( cluster.size() > 1 ) { double weight = 0.0; for ( auto it : cluster ) { - isWire ? weight = 1.0 : weight = it.charge(); - ATH_MSG_DEBUG("isWire: " << isWire << " weight: " << weight); + isStrip ? weight = it.charge() : weight = 1.0; + ATH_MSG_DEBUG("isStrip: " << isStrip << " weight: " << weight); //sigmaSq += weight*(it.localPosition().x()-weightedPosX)*(it.localPosition().x()-weightedPosX); sigmaSq += weight*weight*resolution; ATH_MSG_DEBUG(">>>> posX: " << it.localPosition().x() << " weightedPosX: " << weightedPosX); @@ -151,11 +153,13 @@ StatusCode Muon::SimpleSTgcClusterBuilderTool::getClusters(std::vector<Muon::sTg sigmaSq = sigmaSq/(totalCharge*totalCharge*12); ATH_MSG_DEBUG("Uncertainty on cluster position is: " << sqrt(sigmaSq)); Amg::MatrixX* covN = new Amg::MatrixX(1,1); - (*covN)(0,0) = sigmaSq; + (*covN)(0,0) = sigmaSq + m_addError*m_addError; // // memory allocated dynamically for the PrepRawData is managed by Event Store in the converters // + ATH_MSG_INFO("error on cluster " << sqrt((*covN)(0,0)) << " added error " << m_addError); + sTgcPrepData* prdN = new sTgcPrepData(clusterId,hash,localPosition, rdoList, covN, cluster.at(0).detectorElement(), std::accumulate(elementsCharge.begin(),elementsCharge.end(),0),(short int)0,(uint16_t) 0,elementsChannel,elementsTime,elementsCharge); diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h index 1f1e266eb915d3600061d6301c0a93444d0651a2..f9241c3c8cebfda5a1c809737e35e5d748c6914a 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/STgcClusterization/src/SimpleSTgcClusterBuilderTool.h @@ -50,6 +50,7 @@ namespace Muon double m_chargeCut; unsigned int m_maxHoleSize; + double m_addError; /// Muon detector manager and helper const MuonGM::MuonDetectorManager* m_muonMgr;