Skip to content

Commit

Permalink
use fast cpe also for 1d hits
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn committed May 3, 2016
1 parent fefdadc commit e77be1a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
5 changes: 3 additions & 2 deletions RecoTracker/MeasurementDet/plugins/TkStripMeasurementDet.cc
Expand Up @@ -136,6 +136,7 @@ TkStripMeasurementDet::recHits( const TrajectoryStateOnSurface& stateOnThisDet,
if unlikely( (!isActive(data)) || isEmpty(data.stripData())) return false;

auto oldSize = result.size();
auto const & cpepar = cpe()->getAlgoParam(specificGeomDet(),stateOnThisDet.localParameters());

int utraj = specificGeomDet().specificTopology().measurementPosition( stateOnThisDet.localPosition()).x();

Expand All @@ -148,13 +149,13 @@ TkStripMeasurementDet::recHits( const TrajectoryStateOnSurface& stateOnThisDet,
auto leftCluster = rightCluster;
while ( --leftCluster >= detSet.begin()) {
SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), leftCluster);
bool isCompatible = filteredRecHits(clusterref, stateOnThisDet, est, data.stripClustersToSkip(), result, diffs);
bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result, diffs);
if(!isCompatible) break; // exit loop on first incompatible hit
}
}
for ( ; rightCluster != detSet.end(); rightCluster++) {
SiStripClusterRef clusterref = detSet.makeRefTo( data.stripData().handle(), rightCluster);
bool isCompatible = filteredRecHits(clusterref, stateOnThisDet, est, data.stripClustersToSkip(), result,diffs);
bool isCompatible = filteredRecHits(clusterref, cpepar, stateOnThisDet, est, data.stripClustersToSkip(), result,diffs);
if(!isCompatible) break; // exit loop on first incompatible hit
}

Expand Down
27 changes: 11 additions & 16 deletions RecoTracker/MeasurementDet/plugins/TkStripMeasurementDet.h
Expand Up @@ -172,25 +172,21 @@ class dso_hidden TkStripMeasurementDet final : public MeasurementDet {


template<class ClusterRefT>
bool filteredRecHits( const ClusterRefT& cluster, const TrajectoryStateOnSurface& ltp, const MeasurementEstimator& est, const std::vector<bool> & skipClusters,
bool filteredRecHits( const ClusterRefT& cluster, StripCPE::AlgoParam const& cpepar,
const TrajectoryStateOnSurface& ltp, const MeasurementEstimator& est, const std::vector<bool> & skipClusters,
RecHitContainer & result, std::vector<float> & diffs) const {
if (isMasked(*cluster)) return true;
const GeomDetUnit& gdu( specificGeomDet());
if (!accept(cluster, skipClusters)) return true;
if (!est.preFilter(ltp, ClusterFilterPayload(rawId(),&*cluster) )) return true; // avoids shadow; consistent with previous statement...
VLocalValues const & vlv = cpe()->localParametersV( *cluster, gdu, ltp);
bool isCompatible(false);
for(auto vl : vlv) {
SiStripRecHit2D recHit(vl.first, vl.second, fastGeomDet(), cluster); // FIXME add cluster count in OmniRef
std::pair<bool,double> diffEst = est.estimate(ltp, recHit);
LogDebug("TkStripMeasurementDet")<<" chi2=" << diffEst.second;
if ( diffEst.first ) {
result.push_back(std::move(std::make_shared<SiStripRecHit2D>(recHit)));
diffs.push_back(diffEst.second);
isCompatible = true;
}
auto const & vl = cpe()->localParameters( *cluster, cpepar);
SiStripRecHit2D recHit(vl.first, vl.second, fastGeomDet(), cluster); // FIXME add cluster count in OmniRef (and move again to multiple sub-clusters..)
std::pair<bool,double> diffEst = est.estimate(ltp, recHit);
LogDebug("TkStripMeasurementDet")<<" chi2=" << diffEst.second;
if ( diffEst.first ) {
result.push_back(std::move(std::make_shared<SiStripRecHit2D>(recHit)));
diffs.push_back(diffEst.second);
}
return isCompatible;
return diffEst.first;
}


Expand All @@ -199,11 +195,10 @@ class dso_hidden TkStripMeasurementDet final : public MeasurementDet {
const TrajectoryStateOnSurface& ltp, const MeasurementEstimator& est, const std::vector<bool> & skipClusters,
std::vector<SiStripRecHit2D> & result) const {
if (isMasked(*cluster)) return true;
const GeomDetUnit& gdu( specificGeomDet());
if (!accept(cluster, skipClusters)) return true;
if (!est.preFilter(ltp, ClusterFilterPayload(rawId(),&*cluster) )) return true; // avoids shadow; consistent with previous statement...
auto const & vl = cpe()->localParameters( *cluster, cpepar);
result.emplace_back( vl.first, vl.second, gdu, cluster); // FIXME add cluster count in OmniRef
result.emplace_back( vl.first, vl.second, fastGeomDet(), cluster); // FIXME add cluster count in OmniRef
std::pair<bool,double> diffEst = est.estimate(ltp, result.back());
LogDebug("TkStripMeasurementDet")<<" chi2=" << diffEst.second;
if ( !diffEst.first ) result.pop_back();
Expand Down

0 comments on commit e77be1a

Please sign in to comment.