diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx index ab0b49b28e1c669e245bddc79ce68dab9e280a83..b7f40a557e1d036e5856a49356e72ddfe60747c9 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.cxx @@ -11,7 +11,6 @@ Muon::SimpleMMClusterBuilderTool::SimpleMMClusterBuilderTool(const std::string& AthAlgTool(t,n,p) { declareInterface<IMMClusterBuilderTool>(this); declareProperty("writeStripProperties", m_writeStripProperties = true ); // true for debugging; needs to become false for large productions - declareProperty("useErrorParametrization", m_useErrorParametrization = true); declareProperty("maxHoleSize", m_maxHoleSize = 1); } @@ -164,23 +163,15 @@ StatusCode Muon::SimpleMMClusterBuilderTool::getClusters(std::vector<Muon::MMPre Amg::Vector2D clusterLocalPosition(weightedPosX,posY); - 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(); - if(!m_useErrorParametrization) { - (*covN)(0,0) = 6.*(nmerge + 1.)*covX; - if(nmerge<=1) (*covN)(0,0) = covX; - } else { - double localUncertainty = 0.074+0.66*theta-0.15*theta*theta; - if ( m_idHelperSvc->mmIdHelper().isStereo(MMprds[i].identify()) ) { - localUncertainty = 10.; - } - (*covN)(0,0) = localUncertainty * localUncertainty; - } + /// keeping 50% looser uncertainties until the final calibrations will be in place + double localUncertainty = 1.5*(0.074+0.66*theta-0.15*theta*theta); + (*covN)(0,0) = localUncertainty * localUncertainty; + ATH_MSG_VERBOSE(" make merged prepData at strip " << m_idHelperSvc->mmIdHelper().channel(MMprds[j].identify()) << " nmerge " << nmerge << " sqrt covX " << sqrt((*covN)(0,0))); /// diff --git a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h index 1caf41f050a78da6e10ede0f63acc1017c8dabe8..370c758273e9f30a8514560b9e85a858d070a050 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonDataPrep/MMClusterization/src/SimpleMMClusterBuilderTool.h @@ -35,7 +35,6 @@ namespace Muon ServiceHandle<Muon::IMuonIdHelperSvc> m_idHelperSvc {this, "MuonIdHelperSvc", "Muon::MuonIdHelperSvc/MuonIdHelperSvc"}; bool m_writeStripProperties; - bool m_useErrorParametrization; uint m_maxHoleSize; }; diff --git a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx index 63f0e8b7e9531a9a2a37d246092bc7d01f4c2586..11aa0404110f41f9c27087bdc5011eb75270ab14 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonPatternFinders/MuonPatternFinderTools/MuonHoughPatternTools/src/MuonLayerHoughTool.cxx @@ -1534,12 +1534,24 @@ namespace Muon { updateHits(hits,hough); } + Identifier id_hit = hits.front()->tgc ? hits.front()->tgc->etaCluster.hitList.front()->identify() : hits.front()->prd->identify(); + MuonHough::MuonLayerHoughSelector selectorLoose; + MuonHough::MuonLayerHoughSelector selector; + + if ( m_idHelperSvc->issTgc(id_hit) || m_idHelperSvc->isMM(id_hit) ) { + selectorLoose = MuonHough::MuonLayerHoughSelector({std::make_pair(0,9.9)}); + selector = MuonHough::MuonLayerHoughSelector({std::make_pair(0,13.9)}); + } + else { + selectorLoose = m_selectorsLoose[hough.m_descriptor.chIndex]; + selector = m_selectors[hough.m_descriptor.chIndex]; + } // Muon::MuonStationIndex::StIndex stIndex = Muon::MuonStationIndex::toStationIndex(hough.m_descriptor.chIndex); unsigned int nmaxima = 0; while( nmaxima < 5 ){ MuonHough::MuonLayerHough::Maximum maximum; - if( hough.findMaximum( maximum, m_selectorsLoose[hough.m_descriptor.chIndex] ) ) { + if( hough.findMaximum( maximum, selectorLoose ) ) { hough.associateHitsToMaximum(maximum,hits); ATH_MSG_DEBUG("findMaxima: Found Eta Maximum " << nmaxima << " " << maximum.max @@ -1579,7 +1591,7 @@ namespace Muon { if( nmdt > 0 || (nmm + nstgc) > 0) { maxima.push_back( new MuonHough::MuonLayerHough::Maximum(maximum) ); // add to seed list if - if( maximum.max > m_selectors[hough.m_descriptor.chIndex].getCutValue(maximum.pos) ) seedMaxima.push_back(maxima.back()); + if( maximum.max > selector.getCutValue(maximum.pos) ) seedMaxima.push_back(maxima.back()); ++nmaxima; } hough.fillLayer2(maximum.hits,true); diff --git a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.cxx b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.cxx index d812bd04ffa44efd66b2d3905079b52e03bbaff7..6c3a634589fc8a7279dbd13b3fad9fd654bbd6e5 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRIO_OnTrackCreators/MuonClusterOnTrackCreator/src/MMClusterOnTrackCreator.cxx @@ -27,64 +27,67 @@ StatusCode Muon::MMClusterOnTrackCreator::initialize() { const Muon::MuonClusterOnTrack* Muon::MMClusterOnTrackCreator::createRIO_OnTrack(const Trk::PrepRawData& RIO, - const Amg::Vector3D& GP) const { - MuonClusterOnTrack* MClT = nullptr; - - // check whether PrepRawData has detector element, if not there print warning - const Trk::TrkDetElementBase* EL = RIO.detectorElement(); - if ( !EL ) { - ATH_MSG_WARNING("RIO does not have associated detectorElement!, cannot produce ROT"); - return nullptr; - } - - // MuClusterOnTrack production - // - // in RIO_OnTrack the local param and cov should have the same dimension - Trk::LocalParameters locpar(RIO.localPosition()); - - if (RIO.localCovariance().cols() != RIO.localCovariance().rows()) { - ATH_MSG_FATAL("Rows and colums not equal!"); - } - - if (RIO.localCovariance().cols() > 1) { - ATH_MSG_VERBOSE("Making 2-dim local parameters: " << m_idHelperSvc->toString(RIO.identify())); - } else { - Trk::DefinedParameter radiusPar(RIO.localPosition().x(), Trk::locX); - locpar = Trk::LocalParameters(radiusPar); - ATH_MSG_VERBOSE("Making 1-dim local parameters: " << m_idHelperSvc->toString(RIO.identify())); - } - - Amg::Vector2D lp; - double positionAlongStrip = 0; - - if ( !EL->surface(RIO.identify()).globalToLocal(GP, GP, lp) ) { - Amg::Vector3D lpos = RIO.detectorElement()->surface(RIO.identify()).transform().inverse()*GP; - ATH_MSG_WARNING("Extrapolated GlobalPosition not on detector surface! Distance " << lpos.z()); - lp[Trk::locX] = lpos.x(); - lp[Trk::locY] = lpos.y(); - } - positionAlongStrip = lp[Trk::locY]; - - Amg::MatrixX loce = RIO.localCovariance(); - ATH_MSG_DEBUG("All: new err matrix is " << loce); - - - - - if ( m_idHelperSvc->isMM(RIO.identify()) ) { - // cast to MMPrepData - const MMPrepData* MClus = dynamic_cast<const MMPrepData*> (&RIO); - if (!MClus) { - ATH_MSG_WARNING("RIO not of type MMPrepData, cannot create ROT"); - return nullptr; - } - ATH_MSG_VERBOSE("generating MMClusterOnTrack in MMClusterBuilder"); - MClT = new MMClusterOnTrack(MClus, locpar, loce, positionAlongStrip); - } else { - ATH_MSG_WARNING("MMClusterOnTrackCreator called with an non MM identifier"); - } - + const Amg::Vector3D& GP) const { + + MuonClusterOnTrack* MClT = nullptr; + + if ( !m_idHelperSvc->isMM(RIO.identify()) ) { + ATH_MSG_ERROR("MMClusterOnTrackCreator called with an non MM identifier"); return MClT; + } + + + // check whether PrepRawData has detector element, if not there print warning + const Trk::TrkDetElementBase* EL = RIO.detectorElement(); + if ( !EL ) { + ATH_MSG_WARNING("RIO does not have associated detectorElement!, cannot produce ROT"); + return nullptr; + } + + // MuClusterOnTrack production + // + // in RIO_OnTrack the local param and cov should have the same dimension + Trk::LocalParameters locpar(RIO.localPosition()); + + if (RIO.localCovariance().cols() != RIO.localCovariance().rows()) { + ATH_MSG_FATAL("Rows and colums not equal!"); + } + + if (RIO.localCovariance().cols() > 1) { + ATH_MSG_VERBOSE("Making 2-dim local parameters: " << m_idHelperSvc->toString(RIO.identify())); + } else { + Trk::DefinedParameter radiusPar(RIO.localPosition().x(), Trk::locX); + locpar = Trk::LocalParameters(radiusPar); + ATH_MSG_VERBOSE("Making 1-dim local parameters: " << m_idHelperSvc->toString(RIO.identify())); + } + + Amg::Vector2D lp; + double positionAlongStrip = 0; + + if ( !EL->surface(RIO.identify()).globalToLocal(GP, GP, lp) ) { + Amg::Vector3D lpos = RIO.detectorElement()->surface(RIO.identify()).transform().inverse()*GP; + ATH_MSG_WARNING("Extrapolated GlobalPosition not on detector surface! Distance " << lpos.z()); + lp[Trk::locX] = lpos.x(); + lp[Trk::locY] = lpos.y(); + } + positionAlongStrip = lp[Trk::locY]; + + /// correct the local position based on the stereo angle + if ( m_idHelperSvc->mmIdHelper().isStereo(RIO.identify())) { + const MuonGM::MMReadoutElement* mmEL = dynamic_cast<const MuonGM::MMReadoutElement*>(EL); + double sAngle = mmEL->getDesign(RIO.identify())->sAngle; + locpar[Trk::locX] = locpar[Trk::locX]+positionAlongStrip*tan(sAngle); + } + + Amg::MatrixX loce = RIO.localCovariance(); + ATH_MSG_DEBUG("All: new err matrix is " << loce); + + // cast to MMPrepData + const MMPrepData* MClus = dynamic_cast<const MMPrepData*> (&RIO); + ATH_MSG_VERBOSE("generating MMClusterOnTrack in MMClusterBuilder"); + MClT = new MMClusterOnTrack(MClus, locpar, loce, positionAlongStrip); + + return MClT; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/MuonClusterSegmentFinderTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/MuonClusterSegmentFinderTool.cxx index 669d7d56507475ef2744081ff2291f3debc73e5b..7a01d416776c4c88df5e9249cd55f64d7f3d3284 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/MuonClusterSegmentFinderTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/MuonClusterSegmentFinderTool.cxx @@ -27,6 +27,7 @@ MuonClusterSegmentFinderTool::MuonClusterSegmentFinderTool(const std::string& ty // declareProperty("IPConstraint", m_ipConstraint = true); declareProperty("ClusterDistance", m_maxClustDist = 5); + declareProperty("NOfSeedLayers", m_nOfSeedLayers=1); } StatusCode @@ -92,7 +93,7 @@ MuonClusterSegmentFinderTool::findPrecisionSegments(std::vector<const Muon::Muon std::vector<const Muon::MuonClusterOnTrack*> rioVecPrevious; // find all clusters near the seed and try to fit for (unsigned int i = 0; i < seeds.size(); ++i) { - std::vector<const Muon::MuonClusterOnTrack*> rioVec = getClustersOnSegment(orderedClusters, seeds[i], false); + std::vector<const Muon::MuonClusterOnTrack*> rioVec = getClustersOnSegment(orderedClusters, seeds[i]); // make consistent cut if (belowThreshold(rioVec, 4)) continue; // logic to reduce combinatorics @@ -337,9 +338,8 @@ MuonClusterSegmentFinderTool::find3DSegments(std::vector<const Muon::MuonCluster seed3D = seeds[i]; } - std::vector<const Muon::MuonClusterOnTrack*> phiHits = getClustersOnSegment(orderedClusters, seed3D, true); - std::vector<const Muon::MuonClusterOnTrack*> etaHitsRedone = - getClustersOnSegment(orderedEtaClusters, seed3D, true); + std::vector<const Muon::MuonClusterOnTrack*> phiHits = getClustersOnSegment(orderedClusters, seed3D); + std::vector<const Muon::MuonClusterOnTrack*> etaHits = getClustersOnSegment(orderedEtaClusters, seed3D); if (phiHits.size() < 2) { delete startpar; continue; @@ -364,19 +364,13 @@ MuonClusterSegmentFinderTool::find3DSegments(std::vector<const Muon::MuonCluster // interleave the phi hits std::vector<const Trk::MeasurementBase*> vec2; - std::vector<const Trk::RIO_OnTrack*> etaHits; - for (unsigned int irot = 0; irot < (*sit)->numberOfContainedROTs(); irot++) { - const Trk::RIO_OnTrack* rot = dynamic_cast<const Trk::RIO_OnTrack*>((*sit)->rioOnTrack(irot)); - if (rot) etaHits.push_back(rot); - } - unsigned int netas = etaHits.size(); - ATH_MSG_DEBUG("got " << netas << " eta hits and " << etaHitsRedone.size() << " redone eta hits"); - bool useEtaHitsRedone = false; - if (etaHitsRedone.size() > netas) { - ATH_MSG_VERBOSE(" Found additional eta hits " << etaHitsRedone.size() - netas); - useEtaHitsRedone = true; - } - if (useEtaHitsRedone) netas = etaHitsRedone.size(); + /// here get the new corrected set of eta hits + std::vector< const Muon::MuonClusterOnTrack* > etaHitsCalibrated; + etaHitsCalibrated = getCalibratedClusters(etaHits,seed3D); + + unsigned int netas = etaHitsCalibrated.size(); + ATH_MSG_DEBUG("got " << netas << " eta hits " ); + if (m_ipConstraint) vec2.reserve(phiHits.size() + netas + 1); else @@ -396,22 +390,18 @@ MuonClusterSegmentFinderTool::find3DSegments(std::vector<const Muon::MuonCluster vec2.push_back(pseudoVtx); } unsigned int iEta(0), iPhi(0); - ATH_MSG_VERBOSE("There are " << (*sit)->numberOfContainedROTs() << " & " << phiHits.size() + ATH_MSG_VERBOSE("There are " << etaHitsCalibrated.size() << " & " << phiHits.size() << " eta and phi hits"); while (true) { float phiZ(999999.), etaZ(999999.); if (iPhi < phiHits.size()) phiZ = std::abs(phiHits[iPhi]->globalPosition().z()); - if (iEta < etaHits.size()) etaZ = std::abs(etaHits[iEta]->globalPosition().z()); + if (iEta < etaHitsCalibrated.size()) etaZ = std::abs(etaHitsCalibrated[iEta]->globalPosition().z()); if (phiZ < etaZ) { - vec2.push_back(phiHits[iPhi]); - iPhi++; + vec2.push_back(phiHits[iPhi]); + iPhi++; } else { - if (!useEtaHitsRedone) { - vec2.push_back(etaHits[iEta]); - } else { - vec2.push_back(etaHitsRedone[iEta]); - } - iEta++; + vec2.push_back(etaHitsCalibrated[iEta]); + iEta++; } if (iEta >= netas && iPhi >= phiHits.size()) break; } @@ -558,11 +548,11 @@ MuonClusterSegmentFinderTool::segmentSeed(std::vector<std::vector<const Muon::Mu { std::vector<std::pair<Amg::Vector3D, Amg::Vector3D> > seeds; - if (orderedClusters.size() < 2) return seeds; + if (orderedClusters.size() < 4) return seeds; // calculate the straight line between the two furthest points int seedlayers1 = 0; - for (unsigned int i = 0; (i < orderedClusters.size() && seedlayers1 < 2); ++i) { + for (unsigned int i = 0; (i < orderedClusters.size() && seedlayers1 < m_nOfSeedLayers); ++i) { bool usedLayer1 = false; for (std::vector<const Muon::MuonClusterOnTrack*>::const_iterator cit = orderedClusters[i].begin(); @@ -574,7 +564,7 @@ MuonClusterSegmentFinderTool::segmentSeed(std::vector<std::vector<const Muon::Mu const Amg::Vector3D& gp1 = (*cit)->prepRawData()->globalPosition(); int seedlayers2 = 0; - for (unsigned int k = orderedClusters.size() - 1; (k > i && seedlayers2 < 2); --k) { + for (unsigned int k = orderedClusters.size() - 1; (k > i && seedlayers2 < m_nOfSeedLayers); --k) { bool usedLayer2 = false; for (std::vector<const Muon::MuonClusterOnTrack*>::const_iterator cit2 = orderedClusters[k].begin(); @@ -645,7 +635,7 @@ MuonClusterSegmentFinderTool::segmentSeed(std::vector<std::vector<const Muon::Mu std::vector<const Muon::MuonClusterOnTrack*> MuonClusterSegmentFinderTool::getClustersOnSegment(std::vector<std::vector<const Muon::MuonClusterOnTrack*> >& clusters, - std::pair<Amg::Vector3D, Amg::Vector3D>& seed, bool tight) const + std::pair<Amg::Vector3D, Amg::Vector3D>& seed) const { ATH_MSG_VERBOSE(" getClustersOnSegment: layers " << clusters.size()); std::vector<const Muon::MuonClusterOnTrack*> rios; @@ -661,7 +651,7 @@ MuonClusterSegmentFinderTool::getClustersOnSegment(std::vector<std::vector<const { double dist = clusterDistanceToSeed(*cit, seed); double error = Amg::error((*cit)->localCovariance(), Trk::locX); - if (!tight && m_idHelperSvc->isMM((*cit)->identify())) error += 15.; + if (m_idHelperSvc->isMM((*cit)->identify()) && m_idHelperSvc->mmIdHelper().isStereo((*cit)->identify()) ) error = 15; ATH_MSG_VERBOSE(" lay " << layer << " dist " << dist << " pull " << dist / error << " cut " << m_maxClustDist << " " << m_idHelperSvc->toString((*cit)->identify())); @@ -1053,4 +1043,49 @@ MuonClusterSegmentFinderTool::belowThreshold(std::vector<const Muon::MuonCluster return false; } + std::vector<const Muon::MuonClusterOnTrack*> + MuonClusterSegmentFinderTool::getCalibratedClusters(std::vector<const Muon::MuonClusterOnTrack*>& clusters, + std::pair<Amg::Vector3D,Amg::Vector3D>& seed) const + { + std::vector<const Muon::MuonClusterOnTrack*> calibratedClusters; + + /// loop on the segment clusters and use the phi of the seed to correct them + std::vector<const Muon::MuonClusterOnTrack*>::const_iterator cit = clusters.begin(); + + for ( ; cit != clusters.end() ; ++cit ) { + const Muon::MuonClusterOnTrack* clus = *cit; + const Muon::MuonClusterOnTrack* newClus; + /// get the intercept of the seed direction with the cluster surface + const Trk::PlaneSurface* surf = dynamic_cast<const Trk::PlaneSurface*> (&clus->associatedSurface()); + if(surf) { + Amg::Vector3D posOnSurf = intersectPlane( *surf, seed.first, seed.second ); + Amg::Vector2D lpos; + surf->globalToLocal(posOnSurf,posOnSurf,lpos); + /// correct the eta position of the MM stereo layers only, based on the + Identifier clus_id = clus->identify(); + if ( m_idHelperSvc->isMM(clus_id) ) { + if ( m_idHelperSvc->mmIdHelper().isStereo(clus_id) ) { + /// build a new MM cluster on track with correct position + newClus = m_mmClusterCreator->createRIO_OnTrack(*(clus->prepRawData()),posOnSurf); + ATH_MSG_VERBOSE("Position before correction: " << clus->globalPosition().x() << " " + << clus->globalPosition().y() << " " << clus->globalPosition().z()); + ATH_MSG_VERBOSE("Position after correction: " << newClus->globalPosition().x() << " " + << newClus->globalPosition().y() << " " << newClus->globalPosition().z()); + } + else { + /// here calibration of the MM eta strip ( all phi-dependent effects ) + newClus = clus; + } + } + else if ( m_idHelperSvc->issTgc(clus->identify()) ) { + /// if it's STGC just copy the cluster -> calibration to be added + newClus = clus; + } + } + calibratedClusters.push_back(newClus); + } + return calibratedClusters; + } + + } // namespace Muon diff --git a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/MuonClusterSegmentFinderTool.h b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/MuonClusterSegmentFinderTool.h index de2e5ab6e710f7adcb8a4c9f4d16117abfd359bc..e9527d0bc6c9dc858340038553e60f1d8f84bfbd 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/MuonClusterSegmentFinderTool.h +++ b/MuonSpectrometer/MuonReconstruction/MuonSegmentMakers/MuonSegmentMakerTools/DCMathSegmentMaker/src/MuonClusterSegmentFinderTool.h @@ -23,6 +23,7 @@ #include "TrkPseudoMeasurementOnTrack/PseudoMeasurementOnTrack.h" #include "TrkToolInterfaces/ITrackAmbiguityProcessorTool.h" #include "TrkToolInterfaces/ITrackSummaryTool.h" +#include "MuonRecToolInterfaces/IMuonClusterOnTrackCreator.h" namespace Muon { @@ -84,9 +85,15 @@ class MuonClusterSegmentFinderTool : virtual public IMuonClusterSegmentFinderToo "TrackSummaryTool", "Trk::TrackSummaryTool/MuidTrackSummaryTool", }; + ToolHandle<IMuonClusterOnTrackCreator> m_mmClusterCreator{ + this, + "MMClusterCreator", + "Muon::MMClusterOnTrackCreator/MMClusterOnTrackCreator" + }; bool m_ipConstraint; // use a ip perigee(0,0) constraint in the segment fit double m_maxClustDist; + int m_nOfSeedLayers; public: // find segments given a list of MuonCluster @@ -120,7 +127,10 @@ class MuonClusterSegmentFinderTool : virtual public IMuonClusterSegmentFinderToo // associate clusters to the segment seeds std::vector<const Muon::MuonClusterOnTrack*> getClustersOnSegment( std::vector<std::vector<const Muon::MuonClusterOnTrack*> >& clusters, - std::pair<Amg::Vector3D, Amg::Vector3D>& seed, bool tight) const; + std::pair<Amg::Vector3D, Amg::Vector3D>& seed) const; + //get the clusters after calibration + std::vector< const Muon::MuonClusterOnTrack* > getCalibratedClusters(std::vector<const Muon::MuonClusterOnTrack*>& clusters, + std::pair<Amg::Vector3D,Amg::Vector3D>& seed) const; // distance of cluster to segment seed double clusterDistanceToSeed(const Muon::MuonClusterOnTrack* clust, std::pair<Amg::Vector3D, Amg::Vector3D>& seed) const; diff --git a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx index c4638708fa1aadeea65566189d52554b8bd9117b..c032482330484909aa8c577b78f67b917b680c53 100644 --- a/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx +++ b/Tracking/TrkFitter/TrkGlobalChi2Fitter/src/GlobalChi2Fitter.cxx @@ -2473,7 +2473,7 @@ namespace Trk { std::unique_ptr<Track> GlobalChi2Fitter::fit( const EventContext& ctx, - const MeasurementSet & rots_in, + const MeasurementSet & rots, const TrackParameters & param, const RunOutlierRemoval runOutlier, const ParticleHypothesis matEffects @@ -2491,60 +2491,6 @@ namespace Trk { trajectory.m_fieldprop = trajectory.m_straightline ? Trk::NoField : Trk::FullField; - MeasurementSet rots; - - bool need_to_correct = false; - - for (const auto *itSet : rots_in) { - if ( - (itSet != nullptr) && - itSet->associatedSurface().associatedDetectorElementIdentifier().is_valid() && - m_DetID->is_mm(itSet->associatedSurface().associatedDetectorElementIdentifier()) - ) { - need_to_correct = true; - break; - } - } - - if (need_to_correct) { - MeasurementSet rots_new; - - for (const auto *itSet : rots_in) { - if (itSet == nullptr) { - ATH_MSG_WARNING( "There is an empty MeasurementBase object in the track! Skip this object.." ); - continue; - } - - const RIO_OnTrack *rot = dynamic_cast<const RIO_OnTrack *>(itSet); - - if ( - (rot != nullptr) && - m_DetID->is_mm(rot->identify()) && - rot->associatedSurface().type() == Trk::Surface::Plane - ) { - const PlaneSurface* surf = static_cast<const PlaneSurface *>(&rot->associatedSurface()); - - AtaPlane atapl( - surf->center(), - param.parameters()[Trk::phi], - param.parameters()[Trk::theta], - param.parameters()[Trk::qOverP], - *surf - ); - - const RIO_OnTrack *new_rot = m_ROTcreator->correct(*(rot->prepRawData()), atapl); - - rots_new.push_back(new_rot); - } else { - rots_new.push_back(itSet); - } - } - - rots = rots_new; - } else { - rots = rots_in; - } - for (const auto *itSet : rots) { if (itSet == nullptr) { ATH_MSG_WARNING("There is an empty MeasurementBase object in the track! Skip this object..");