diff --git a/RecoTracker/DeDx/plugins/DeDxHitInfoProducer.cc b/RecoTracker/DeDx/plugins/DeDxHitInfoProducer.cc index 593ba2242b1b8..e01987db07ad5 100644 --- a/RecoTracker/DeDx/plugins/DeDxHitInfoProducer.cc +++ b/RecoTracker/DeDx/plugins/DeDxHitInfoProducer.cc @@ -75,6 +75,7 @@ class DeDxHitInfoProducer : public edm::stream::EDProducer<> { const std::string calibrationPath_; const bool useCalibration_; const bool doShapeTest_; + const bool usePixelShape_; const unsigned int lowPtTracksPrescalePass_, lowPtTracksPrescaleFail_; GenericTruncatedAverageDeDxEstimator lowPtTracksEstimator_; @@ -114,6 +115,7 @@ DeDxHitInfoProducer::DeDxHitInfoProducer(const edm::ParameterSet& iConfig) calibrationPath_(iConfig.getParameter("calibrationPath")), useCalibration_(iConfig.getParameter("useCalibration")), doShapeTest_(iConfig.getParameter("shapeTest")), + usePixelShape_(not iConfig.getParameter("clusterShapeCache").label().empty()), lowPtTracksPrescalePass_(iConfig.getParameter("lowPtTracksPrescalePass")), lowPtTracksPrescaleFail_(iConfig.getParameter("lowPtTracksPrescaleFail")), lowPtTracksEstimator_(iConfig.getParameter("lowPtTracksEstimatorParameters")), @@ -150,7 +152,8 @@ void DeDxHitInfoProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe const TrackCollection& trackCollection(*trackCollectionHandle.product()); clShape_ = iSetup.getHandle(clShapeToken_); - pixShapeCache_ = iEvent.getHandle(pixShapeCacheToken_); + if (usePixelShape_) + pixShapeCache_ = iEvent.getHandle(pixShapeCacheToken_); // creates the output collection auto resultdedxHitColl = std::make_unique(); @@ -306,7 +309,7 @@ void DeDxHitInfoProducer::processHit(const TrackingRecHit* recHit, ClusterShape().determineShape(pixelDet, clus.pixelCluster(), data); if (data.isComplete) type |= (1 << reco::DeDxHitInfo::Complete); - if (clShape_->isCompatible(pixelRecHit, trackDirection, *pixShapeCache_)) + if (usePixelShape_ && clShape_->isCompatible(pixelRecHit, trackDirection, *pixShapeCache_)) type |= (1 << reco::DeDxHitInfo::Compatible); if (data.isComplete && data.isStraight && data.hasBigPixelsOnlyInside) type |= (1 << reco::DeDxHitInfo::Calibration); diff --git a/TauAnalysis/MCEmbeddingTools/python/customisers.py b/TauAnalysis/MCEmbeddingTools/python/customisers.py index 3cce2db3c0f5e..47f5d5d23fe05 100644 --- a/TauAnalysis/MCEmbeddingTools/python/customisers.py +++ b/TauAnalysis/MCEmbeddingTools/python/customisers.py @@ -891,6 +891,7 @@ def performMCMatching(process, names, postfix, outputModules): process.ak4CaloJetsForTrk.srcPVs = cms.InputTag( "firstStepPrimaryVertices", "", dataTier ) + process.dedxHitInfo.clusterShapeCache = cms.InputTag("") # process.muons.FillDetectorBasedIsolation = cms.bool(False) # process.muons.FillSelectorMaps = cms.bool(False)