Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance improvement in quadruplet seeding #126

Closed
30 changes: 4 additions & 26 deletions RecoPixelVertexing/PixelTriplets/interface/QuadrupletSeedMerger.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <memory>
#include <vector>
#include <functional>
#include <array>

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/Event.h"
Expand Down Expand Up @@ -82,7 +83,6 @@ class QuadrupletSeedMerger {
//const std::vector<SeedingHitSet> mergeTriplets( const OrderedSeedingHits&, const edm::EventSetup& );
const OrderedSeedingHits& mergeTriplets( const OrderedSeedingHits&, const edm::EventSetup& );
const TrajectorySeedCollection mergeTriplets( const TrajectorySeedCollection&, const TrackingRegion&, const edm::EventSetup&, const edm::ParameterSet& );
bool isEqual( const TrackingRecHit*, const TrackingRecHit* ) const;
std::pair<double,double> calculatePhiEta( SeedingHitSet const& ) const;
void printHit( const TrackingRecHit* ) const;
void printHit( const TransientTrackingRecHit::ConstRecHitPointer& ) const;
Expand All @@ -93,35 +93,13 @@ class QuadrupletSeedMerger {
void setTTRHBuilderLabel( std::string );

private:
typedef std::array<TransientTrackingRecHit::ConstRecHitPointer, 4> QuadrupletHits;
void mySort(QuadrupletHits& unsortedHits);

std::vector<TransientTrackingRecHit::ConstRecHitPointer> mySort(TransientTrackingRecHit::ConstRecHitPointer &h1,
TransientTrackingRecHit::ConstRecHitPointer &h2,
TransientTrackingRecHit::ConstRecHitPointer &h3,
TransientTrackingRecHit::ConstRecHitPointer &h4);


bool isValidQuadruplet( std::vector<TransientTrackingRecHit::ConstRecHitPointer> &quadruplet, const std::vector<SeedMergerPixelLayer>& layers ) const;
bool isValidQuadruplet(const QuadrupletHits& quadruplet, const std::vector<SeedMergerPixelLayer>& layers ) const;

// bool isValidQuadruplet( const SeedingHitSet&, const std::vector<SeedMergerPixelLayer>& ) const;

bool isTripletsShareHitsOnLayers( const SeedingHitSet& firstTriplet, const SeedingHitSet& secondTriplet,
const SeedMergerPixelLayer &share1, const SeedMergerPixelLayer &share2,
std::pair<TransientTrackingRecHit::ConstRecHitPointer,TransientTrackingRecHit::ConstRecHitPointer>& hits ) const;

//bool isTripletsShareHitsOnLayers( const SeedingHitSet&, const SeedingHitSet&,
// const std::pair<SeedMergerPixelLayer, SeedMergerPixelLayer>&,
// std::pair<TransientTrackingRecHit::ConstRecHitPointer,TransientTrackingRecHit::ConstRecHitPointer>& ) const;
//
// bool isMergeableHitsInTriplets( const SeedingHitSet&, const SeedingHitSet&,
// const std::pair<SeedMergerPixelLayer, SeedMergerPixelLayer>&,
// std::pair<TransientTrackingRecHit::ConstRecHitPointer,TransientTrackingRecHit::ConstRecHitPointer>& ) const;

bool isMergeableHitsInTriplets( const SeedingHitSet& firstTriplet, const SeedingHitSet& secondTriplet,
const SeedMergerPixelLayer &nonShared1, const SeedMergerPixelLayer &nonShared2,
std::pair<TransientTrackingRecHit::ConstRecHitPointer,TransientTrackingRecHit::ConstRecHitPointer>& hits ) const;



ctfseeding::SeedingLayerSets theLayerSets_;
edm::ESHandle<TrackerGeometry> theTrackerGeometry_;
edm::ESHandle<TransientTrackingRecHitBuilder> theTTRHBuilder_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include "DataFormats/GeometryVector/interface/Pi.h"
//#include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerAlgo.h"
//#include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerTools.h"
#include "RecoPixelVertexing/PixelTriplets/plugins/KDTreeLinkerAlgo.h" //amend to point at your copy...
#include "RecoPixelVertexing/PixelTriplets/plugins/KDTreeLinkerTools.h"
#include "RecoPixelVertexing/PixelTriplets/interface/KDTreeLinkerAlgo.h" //amend to point at your copy...
#include "RecoPixelVertexing/PixelTriplets/interface/KDTreeLinkerTools.h"

using pixelrecoutilities::LongitudinalBendingCorrection;
typedef PixelRecoRange<float> Range;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
#include "MatchedHitRZCorrectionFromBending.h"
//#include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerAlgo.h"
//#include "RecoParticleFlow/PFProducer/interface/KDTreeLinkerTools.h"
#include "RecoPixelVertexing/PixelTriplets/plugins/KDTreeLinkerAlgo.h" //amend to point at your copy...
#include "RecoPixelVertexing/PixelTriplets/plugins/KDTreeLinkerTools.h"
#include "RecoPixelVertexing/PixelTriplets/interface/KDTreeLinkerAlgo.h" //amend to point at your copy...
#include "RecoPixelVertexing/PixelTriplets/interface/KDTreeLinkerTools.h"

#include <algorithm>
#include <iostream>
Expand Down
Loading