From 026d01a2116d211c3e0a11b32570168df4eaa7f4 Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Mon, 28 Nov 2016 16:42:51 +0100 Subject: [PATCH 1/2] Remove RecoPixelVertexing/PixelTrackFitting/test/test_cfg.py as obsolete --- .../PixelTrackFitting/test/test_cfg.py | 73 ------------------- 1 file changed, 73 deletions(-) delete mode 100644 RecoPixelVertexing/PixelTrackFitting/test/test_cfg.py diff --git a/RecoPixelVertexing/PixelTrackFitting/test/test_cfg.py b/RecoPixelVertexing/PixelTrackFitting/test/test_cfg.py deleted file mode 100644 index 061b46c47f748..0000000000000 --- a/RecoPixelVertexing/PixelTrackFitting/test/test_cfg.py +++ /dev/null @@ -1,73 +0,0 @@ -import FWCore.ParameterSet.Config as cms -process = cms.Process("Analysis") - -process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(1000)) -process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( -'file:data/DoubleMu_3_00.root' -)) - -# import of standard configurations -process.load('Configuration.StandardSequences.Services_cff') -process.load('FWCore.MessageService.MessageLogger_cfi') -process.load('Configuration.StandardSequences.GeometryDB_cff') -process.load('Configuration.StandardSequences.MagneticField_38T_cff') -process.load('Configuration.StandardSequences.RawToDigi_cff') -process.load('Configuration.StandardSequences.Reconstruction_cff') -process.load('Configuration.StandardSequences.EndOfProcess_cff') -process.load('Configuration.StandardSequences.FrontierConditions_GlobalTag_cff') -process.GlobalTag.globaltag = 'DESIGN_36_V3::All' - -process.MessageLogger = cms.Service("MessageLogger", - #debugModules = cms.untracked.vstring('pixelVertices'), - #debugModules = cms.untracked.vstring('pixelTracks'), - #debugModules = cms.untracked.vstring('*'), - debugModules = cms.untracked.vstring(''), - destinations = cms.untracked.vstring('cout'), - cout = cms.untracked.PSet( threshold = cms.untracked.string('INFO')) -) - -process.load("RecoTracker.Configuration.RecoTracker_cff") -from RecoTracker.Configuration.RecoTracker_cff import * -process.load('RecoLocalTracker/Configuration/RecoLocalTracker_cff') -process.load("RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff") -from RecoPixelVertexing.PixelTrackFitting.PixelTracks_cff import * -from RecoPixelVertexing.PixelTrackFitting.PixelFitterByConformalMappingAndLine_cfi import * - - -BBlock = cms.PSet( - ComponentName = cms.string('GlobalRegionProducerFromBeamSpot'), - RegionPSet = cms.PSet( - precise = cms.bool(True), - nSigmaZ = cms.double(3.0), - originRadius = cms.double(0.2), - ptMin = cms.double(0.8), - beamSpot = cms.InputTag("offlineBeamSpot") - ) -) - -GBlock= cms.PSet( - ComponentName = cms.string('GlobalRegionProducer'), - RegionPSet = cms.PSet( - precise = cms.bool(True), - ptMin = cms.double(0.875), - originHalfLength = cms.double(15.9), - originRadius = cms.double(0.2), - originXPos = cms.double(0.), - originYPos = cms.double(0.), - originZPos = cms.double(0.) -# originXPos = cms.double(0.2), -# originYPos = cms.double(0.4), -# originZPos = cms.double(-2.4) - - ) -) - - -process.pixelTracks2 = pixelTracks.clone() -process.pixelTracks2.RegionFactoryPSet= cms.PSet( GBlock ) -process.pixelTracks2.FilterPSet.ComponentName = cms.string('none') - -process.test = cms.EDAnalyzer("PixelTrackTest", TrackCollection = cms.string("pixelTracks2")) - -process.p=cms.Path(process.siPixelDigis*process.pixeltrackerlocalreco*process.offlineBeamSpot*process.PixelLayerTriplets*process.pixelTracks2*process.test) - From 164031c59d474c05876a1be9b1693b5b51e7ba7c Mon Sep 17 00:00:00 2001 From: Matti Kortelainen Date: Tue, 29 Nov 2016 22:06:54 +0100 Subject: [PATCH 2/2] Remove PixelTripletLowPtGenerator and AllPixelTracks_cfi as obsolete --- .../interface/PixelTripletLowPtGenerator.h | 64 ----- .../PixelLowPtUtilities/plugins/modules.cc | 6 - .../python/AllPixelTracks_cfi.py | 64 ----- .../src/PixelTripletLowPtGenerator.cc | 223 ------------------ 4 files changed, 357 deletions(-) delete mode 100644 RecoPixelVertexing/PixelLowPtUtilities/interface/PixelTripletLowPtGenerator.h delete mode 100644 RecoPixelVertexing/PixelLowPtUtilities/python/AllPixelTracks_cfi.py delete mode 100644 RecoPixelVertexing/PixelLowPtUtilities/src/PixelTripletLowPtGenerator.cc diff --git a/RecoPixelVertexing/PixelLowPtUtilities/interface/PixelTripletLowPtGenerator.h b/RecoPixelVertexing/PixelLowPtUtilities/interface/PixelTripletLowPtGenerator.h deleted file mode 100644 index 5d7cd4573be4e..0000000000000 --- a/RecoPixelVertexing/PixelLowPtUtilities/interface/PixelTripletLowPtGenerator.h +++ /dev/null @@ -1,64 +0,0 @@ -#ifndef _PixelTripletLowPtGenerator_h_ -#define _PixelTripletLowPtGenerator_h_ - -/** A HitTripletGenerator from HitPairGenerator and vector of - Layers. The HitPairGenerator provides a set of hit pairs. - For each pair the search for compatible hit(s) is done among - provided Layers - */ - -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" -#include "FWCore/Utilities/interface/EDGetToken.h" -#include "RecoPixelVertexing/PixelTriplets/interface/HitTripletGeneratorFromPairAndLayers.h" - -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/TripletFilter.h" - -class TrackerGeometry; -class TripletFilter; -class SiPixelClusterShapeCache; - -#include - -class PixelTripletLowPtGenerator : - public HitTripletGeneratorFromPairAndLayers { - - - public: - PixelTripletLowPtGenerator( const edm::ParameterSet& cfg, edm::ConsumesCollector& iC); - - virtual ~PixelTripletLowPtGenerator(); - - virtual void hitTriplets( const TrackingRegion& region, OrderedHitTriplets & trs, - const edm::Event & ev, const edm::EventSetup& es, - const SeedingLayerSetsHits::SeedingLayerSet& pairLayers, - const std::vector& thirdLayers) override; - void hitTriplets( - const TrackingRegion& region, - OrderedHitTriplets & result, - const edm::EventSetup & es, - const HitDoublets & doublets, - const RecHitsSortedInPhi ** thirdHitMap, - const std::vector & thirdLayerDetLayer, - const int nThirdLayers)override; - - private: - void getTracker (const edm::EventSetup& es); - GlobalPoint getGlobalPosition(const TrackingRecHit* recHit); - - const TrackerGeometry * theTracker; - std::unique_ptr theFilter; - - - edm::EDGetTokenT theClusterShapeCacheToken; - double nSigMultipleScattering; - double rzTolerance; - double maxAngleRatio; - - std::string builderName; - bool checkMultipleScattering; - bool checkClusterShape; - -}; - -#endif diff --git a/RecoPixelVertexing/PixelLowPtUtilities/plugins/modules.cc b/RecoPixelVertexing/PixelLowPtUtilities/plugins/modules.cc index 9a5788c03455e..18cf5526d37e5 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/plugins/modules.cc +++ b/RecoPixelVertexing/PixelLowPtUtilities/plugins/modules.cc @@ -18,12 +18,6 @@ DEFINE_FWK_MODULE(PixelVertexProducerClusters); #include "TrackListCombiner.h" DEFINE_FWK_MODULE(TrackListCombiner); -// Generator -#include "RecoPixelVertexing/PixelTriplets/interface/HitTripletGeneratorFromPairAndLayers.h" -#include "RecoPixelVertexing/PixelTriplets/interface/HitTripletGeneratorFromPairAndLayersFactory.h" -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/PixelTripletLowPtGenerator.h" -DEFINE_EDM_PLUGIN(HitTripletGeneratorFromPairAndLayersFactory, PixelTripletLowPtGenerator,"PixelTripletLowPtGenerator"); - // Filters #include "RecoPixelVertexing/PixelLowPtUtilities/interface/ClusterShapeTrackFilter.h" #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackFilter.h" diff --git a/RecoPixelVertexing/PixelLowPtUtilities/python/AllPixelTracks_cfi.py b/RecoPixelVertexing/PixelLowPtUtilities/python/AllPixelTracks_cfi.py deleted file mode 100644 index 2baf657ae512a..0000000000000 --- a/RecoPixelVertexing/PixelLowPtUtilities/python/AllPixelTracks_cfi.py +++ /dev/null @@ -1,64 +0,0 @@ -import FWCore.ParameterSet.Config as cms - -########################## -# The base for all steps -allPixelTracks = cms.EDProducer("PixelTrackProducer", - - passLabel = cms.string(''), - - # Region - RegionFactoryPSet = cms.PSet( - ComponentName = cms.string('GlobalTrackingRegionWithVerticesProducer'), - RegionPSet = cms.PSet( - precise = cms.bool(True), - beamSpot = cms.InputTag("offlineBeamSpot"), - originRadius = cms.double(0.2), - sigmaZVertex = cms.double(3.0), - useFixedError = cms.bool(True), - fixedError = cms.double(0.2), - - useFoundVertices = cms.bool(False), - VertexCollection = cms.InputTag("pixel3Vertices"), - ptMin = cms.double(0.075), - nSigmaZ = cms.double(3.0) - ) - ), - - # Ordered hits - OrderedHitsFactoryPSet = cms.PSet( - ComponentName = cms.string('StandardHitTripletGenerator'), - SeedingLayers = cms.InputTag('PixelLayerTriplets'), - GeneratorPSet = cms.PSet( - ComponentName = cms.string('PixelTripletLowPtGenerator'), - checkClusterShape = cms.bool(False), - checkMultipleScattering = cms.bool(True), - nSigMultipleScattering = cms.double(5.0), - maxAngleRatio = cms.double(10.0), - rzTolerance = cms.double(0.2), - TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelTriplets'), - clusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache") - ) - ), - - # Filter - useFilterWithES = cms.bool(True), - FilterPSet = cms.PSet( - ComponentName = cms.string('ClusterShapeTrackFilter'), - clusterShapeCacheSrc = cms.InputTag("siPixelClusterShapeCache") -# ptMin = cms.double() -# ptMax = cms.double() - ), - - # Cleaner - CleanerPSet = cms.PSet( - ComponentName = cms.string('TrackCleaner') - ), - - # Fitter - FitterPSet = cms.PSet( - ComponentName = cms.string('TrackFitter'), - TTRHBuilder = cms.string('TTRHBuilderWithoutAngle4PixelTriplets') - ) -) - - diff --git a/RecoPixelVertexing/PixelLowPtUtilities/src/PixelTripletLowPtGenerator.cc b/RecoPixelVertexing/PixelLowPtUtilities/src/PixelTripletLowPtGenerator.cc deleted file mode 100644 index fd033abf05c37..0000000000000 --- a/RecoPixelVertexing/PixelLowPtUtilities/src/PixelTripletLowPtGenerator.cc +++ /dev/null @@ -1,223 +0,0 @@ -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/PixelTripletLowPtGenerator.h" -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ThirdHitPrediction.h" -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/TripletFilter.h" -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/HitInfo.h" - -#include "RecoTracker/TkMSParametrization/interface/PixelRecoPointRZ.h" -#include "RecoTracker/TkHitPairs/interface/HitPairGeneratorFromLayerPair.h" - -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" - -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" -#include "Geometry/Records/interface/TrackerTopologyRcd.h" - -#include "FWCore/Framework/interface/Event.h" -#include "DataFormats/SiPixelCluster/interface/SiPixelClusterShapeCache.h" - -#undef Debug - -using namespace std; -using namespace ctfseeding; - -/*****************************************************************************/ -PixelTripletLowPtGenerator::PixelTripletLowPtGenerator( const edm::ParameterSet& cfg, edm::ConsumesCollector& iC): - HitTripletGeneratorFromPairAndLayers(), // no theMaxElement used in this class - theTracker(nullptr), - theClusterShapeCacheToken(iC.consumes(cfg.getParameter("clusterShapeCacheSrc"))) -{ - checkMultipleScattering = cfg.getParameter("checkMultipleScattering"); - nSigMultipleScattering = cfg.getParameter("nSigMultipleScattering"); - checkClusterShape = cfg.getParameter("checkClusterShape"); - rzTolerance = cfg.getParameter("rzTolerance"); - maxAngleRatio = cfg.getParameter("maxAngleRatio"); - builderName = cfg.getParameter("TTRHBuilder"); -} - -/*****************************************************************************/ -PixelTripletLowPtGenerator::~PixelTripletLowPtGenerator() {} - -/*****************************************************************************/ - - -/*****************************************************************************/ -void PixelTripletLowPtGenerator::getTracker - (const edm::EventSetup& es) -{ - if(theTracker == 0) - { - // Get tracker geometry - edm::ESHandle tracker; - es.get().get(tracker); - - theTracker = tracker.product(); - } - - if(!theFilter) - { - theFilter = std::make_unique(es); - } -} - -/*****************************************************************************/ -GlobalPoint PixelTripletLowPtGenerator::getGlobalPosition - (const TrackingRecHit* recHit) -{ - DetId detId = recHit->geographicalId(); - - return - theTracker->idToDet(detId)->toGlobal(recHit->localPosition()); -} - -/*****************************************************************************/ -void PixelTripletLowPtGenerator::hitTriplets( - const TrackingRegion& region, - OrderedHitTriplets & result, - const edm::Event & ev, - const edm::EventSetup& es, - const SeedingLayerSetsHits::SeedingLayerSet& pairLayers, - const std::vector& thirdLayers) -{ - - //Retrieve tracker topology from geometry - edm::ESHandle tTopoHand; - es.get().get(tTopoHand); - const TrackerTopology *tTopo=tTopoHand.product(); - - edm::Handle clusterShapeCache; - ev.getByToken(theClusterShapeCacheToken, clusterShapeCache); - - // Generate pairs - OrderedHitPairs pairs; pairs.reserve(30000); - thePairGenerator->hitPairs(region,pairs,ev,es, pairLayers); - - if (pairs.size() == 0) return; - - int size = thirdLayers.size(); - - // Set aliases - const RecHitsSortedInPhi **thirdHitMap = new const RecHitsSortedInPhi*[size]; - for(int il=0; il recHits(3); - vector points(3); - - recHits[0] = (*ip).inner()->hit(); - recHits[1] = (*ip).outer()->hit(); - -#ifdef Debug - cerr << " RecHits " + HitInfo::getInfo(*recHits[0]) + - HitInfo::getInfo(*recHits[1]) << endl; -#endif - - for(int i=0; i<2; i++) - points[i] = getGlobalPosition(recHits[i]); - - // Initialize helix prediction - ThirdHitPrediction - thePrediction(region, - points[0],points[1], es, - nSigMultipleScattering,maxAngleRatio,builderName); - - // Look at all layers - for(int il=0; ilsubDetector() - << " " << layer->location() << endl; -#endif - - // Get ranges for the third hit - float phi[2],rz[2]; - thePrediction.getRanges(layer, phi,rz); - - PixelRecoRange phiRange(phi[0] , phi[1] ); - PixelRecoRange rzRange( rz[0] - rzTolerance, rz[1] + rzTolerance); - - // Get third hit candidates from cache - typedef RecHitsSortedInPhi::Hit Hit; - vector thirdHits = thirdHitMap[il]->hits(phiRange.min(),phiRange.max()); - typedef vector::const_iterator IH; - - for (IH th=thirdHits.begin(), eh=thirdHits.end(); th < eh; ++th) - { - // Fill rechit and point - recHits[2] = (*th)->hit(); - points[2] = getGlobalPosition(recHits[2]); - -#ifdef Debug - cerr << " third hit " + HitInfo::getInfo(*recHits[2]) << endl; -#endif - - // Check if third hit is compatible with multiple scattering - vector globalDirs; - if(thePrediction.isCompatibleWithMultipleScattering - (points[2], recHits, globalDirs, es) == false) - { -#ifdef Debug - cerr << " not compatible: multiple scattering" << endl; -#endif - if(checkMultipleScattering) continue; - } - - // Convert to localDirs -/* - vector localDirs; - vector::const_iterator globalDir = globalDirs.begin(); - for(vector::const_iterator - recHit = recHits.begin(); - recHit != recHits.end(); recHit++) - { - localDirs.push_back(theTracker->idToDet( - (*recHit)->geographicalId())->toLocal(*globalDir)); - globalDir++; - } -*/ - - // Check if the cluster shapes are compatible with thrusts - if(checkClusterShape) - { - if(! theFilter->checkTrack(recHits,globalDirs,tTopo, *clusterShapeCache)) - { -#ifdef Debug - cerr << " not compatible: cluster shape" << endl; -#endif - continue; - } - } - - // All checks passed, put triplet back - result.push_back(OrderedHitTriplet((*ip).inner(),(*ip).outer(),*th)); - } - } - } - delete [] thirdHitMap; - - return; -} -void PixelTripletLowPtGenerator::hitTriplets( - const TrackingRegion& region, - OrderedHitTriplets & result, - const edm::EventSetup & es, - const HitDoublets & doublets, - const RecHitsSortedInPhi ** thirdHitMap, - const std::vector & thirdLayerDetLayer, - const int nThirdLayers) -{ - throw cms::Exception("Error")<<"PixelTripletLowPtGenerator::hitTriplets is not implemented \n"; -} - -