diff --git a/EventFilter/SiPixelRawToDigi/plugins/BuildFile.xml b/EventFilter/SiPixelRawToDigi/plugins/BuildFile.xml index 90fea254b67c4..f92aa68373927 100644 --- a/EventFilter/SiPixelRawToDigi/plugins/BuildFile.xml +++ b/EventFilter/SiPixelRawToDigi/plugins/BuildFile.xml @@ -1,4 +1,4 @@ - - - + + + diff --git a/EventFilter/SiPixelRawToDigi/plugins/SealModule.cc b/EventFilter/SiPixelRawToDigi/plugins/SealModule.cc deleted file mode 100644 index 30ed2eb6e8850..0000000000000 --- a/EventFilter/SiPixelRawToDigi/plugins/SealModule.cc +++ /dev/null @@ -1,8 +0,0 @@ -#include "FWCore/PluginManager/interface/ModuleDef.h" -#include "FWCore/Framework/interface/MakerMacros.h" - -#include "SiPixelRawToDigi.h" -#include "SiPixelDigiToRaw.h" - -DEFINE_FWK_MODULE(SiPixelDigiToRaw); -DEFINE_FWK_MODULE(SiPixelRawToDigi); diff --git a/EventFilter/SiPixelRawToDigi/plugins/SiPixelDigiToRaw.cc b/EventFilter/SiPixelRawToDigi/plugins/SiPixelDigiToRaw.cc index cb0999d51c4db..cd6199e05ae9c 100644 --- a/EventFilter/SiPixelRawToDigi/plugins/SiPixelDigiToRaw.cc +++ b/EventFilter/SiPixelRawToDigi/plugins/SiPixelDigiToRaw.cc @@ -147,5 +147,6 @@ void SiPixelDigiToRaw::produce( edm::Event& ev, } -// ----------------------------------------------------------------------------- - +// declare this as a framework plugin +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(SiPixelDigiToRaw); diff --git a/EventFilter/SiPixelRawToDigi/plugins/SiPixelRawToDigi.cc b/EventFilter/SiPixelRawToDigi/plugins/SiPixelRawToDigi.cc index 9b93f63741df4..dc3c9e4c68f68 100644 --- a/EventFilter/SiPixelRawToDigi/plugins/SiPixelRawToDigi.cc +++ b/EventFilter/SiPixelRawToDigi/plugins/SiPixelRawToDigi.cc @@ -324,3 +324,7 @@ void SiPixelRawToDigi::produce( edm::Event& ev, ev.put(std::move(disabled_channelcollection)); } } + +// declare this as a framework plugin +#include "FWCore/Framework/interface/MakerMacros.h" +DEFINE_FWK_MODULE(SiPixelRawToDigi); diff --git a/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py b/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py index 4697f508948a6..465aa0bb346ce 100644 --- a/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py +++ b/RecoLocalTracker/SiPixelRecHits/python/SiPixelRecHits_cfi.py @@ -3,8 +3,7 @@ siPixelRecHits = cms.EDProducer("SiPixelRecHitConverter", src = cms.InputTag("siPixelClusters"), CPE = cms.string('PixelCPEGeneric'), - VerboseLevel = cms.untracked.int32(0), - + VerboseLevel = cms.untracked.int32(0) ) siPixelRecHitsPreSplitting = siPixelRecHits.clone( diff --git a/RecoPixelVertexing/PixelLowPtUtilities/src/ClusterShapeTrackFilter.cc b/RecoPixelVertexing/PixelLowPtUtilities/src/ClusterShapeTrackFilter.cc index f5d3d0ad25bcd..6a30e54861d9e 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/src/ClusterShapeTrackFilter.cc +++ b/RecoPixelVertexing/PixelLowPtUtilities/src/ClusterShapeTrackFilter.cc @@ -1,25 +1,19 @@ -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ClusterShapeTrackFilter.h" - -#include "RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.h" -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/HitInfo.h" -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ClusterShapeHitFilter.h" - -#include "FWCore/Framework/interface/EventSetup.h" -#include "FWCore/Framework/interface/ESHandle.h" -#include "FWCore/MessageLogger/interface/MessageLogger.h" - +#include "DataFormats/SiPixelCluster/interface/SiPixelClusterShapeCache.h" +#include "DataFormats/TrackReco/interface/Track.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" #include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" -#include "DataFormats/TrackReco/interface/Track.h" - +#include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/EventSetup.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" -#include "Geometry/CommonDetUnit/interface/GeomDet.h" - +#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ClusterShapeHitFilter.h" +#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ClusterShapeTrackFilter.h" +#include "RecoPixelVertexing/PixelLowPtUtilities/interface/HitInfo.h" +#include "RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h" #include "RecoTracker/Record/interface/CkfComponentsRecord.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" - -#include "DataFormats/SiPixelCluster/interface/SiPixelClusterShapeCache.h" inline float sqr(float x) { return x*x; } diff --git a/RecoPixelVertexing/PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc b/RecoPixelVertexing/PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc index b3d97c8c49fdb..bf7c9795f5e74 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc +++ b/RecoPixelVertexing/PixelLowPtUtilities/src/LowPtClusterShapeSeedComparitor.cc @@ -1,32 +1,24 @@ -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/LowPtClusterShapeSeedComparitor.h" +#include -#include "RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.h" -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/HitInfo.h" -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ClusterShapeHitFilter.h" - -#include "FWCore/Framework/interface/EventSetup.h" +#include "DataFormats/GeometryVector/interface/Basic2DVector.h" +#include "DataFormats/GeometryVector/interface/GlobalPoint.h" +#include "DataFormats/GeometryVector/interface/GlobalVector.h" +#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" +#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" +#include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/Event.h" -#include "FWCore/Framework/interface/ConsumesCollector.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "FWCore/Framework/interface/EventSetup.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h" -#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" -#include "DataFormats/TrackerCommon/interface/TrackerTopology.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "Geometry/Records/interface/TrackerTopologyRcd.h" - -#include "RecoTracker/TkSeedingLayers/interface/SeedingHitSet.h" - +#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ClusterShapeHitFilter.h" +#include "RecoPixelVertexing/PixelLowPtUtilities/interface/HitInfo.h" +#include "RecoPixelVertexing/PixelLowPtUtilities/interface/LowPtClusterShapeSeedComparitor.h" +#include "RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h" #include "RecoTracker/Record/interface/CkfComponentsRecord.h" - -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" -#include "DataFormats/GeometryVector/interface/GlobalVector.h" -#include "DataFormats/GeometryVector/interface/Basic2DVector.h" - -#include - - +#include "RecoTracker/TkSeedingLayers/interface/SeedingHitSet.h" namespace { typedef Basic2DVector Vector2D; diff --git a/RecoPixelVertexing/PixelLowPtUtilities/src/ThirdHitPrediction.cc b/RecoPixelVertexing/PixelLowPtUtilities/src/ThirdHitPrediction.cc index 7b407570162b4..bc635f36fce06 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/src/ThirdHitPrediction.cc +++ b/RecoPixelVertexing/PixelLowPtUtilities/src/ThirdHitPrediction.cc @@ -1,19 +1,14 @@ -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ThirdHitPrediction.h" - #include "DataFormats/GeometryVector/interface/GlobalPoint.h" - -#include "TrackingTools/DetLayers/interface/BarrelDetLayer.h" -#include "TrackingTools/DetLayers/interface/ForwardDetLayer.h" -#include "TrackingTools/DetLayers/interface/DetLayer.h" - -#include "RecoTracker/TkMSParametrization/interface/MultipleScatteringParametrisation.h" -#include "RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.h" - #include "MagneticField/Engine/interface/MagneticField.h" #include "MagneticField/Records/interface/IdealMagneticFieldRecord.h" - -#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" +#include "RecoPixelVertexing/PixelLowPtUtilities/interface/ThirdHitPrediction.h" +#include "RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h" +#include "RecoTracker/TkMSParametrization/interface/MultipleScatteringParametrisation.h" +#include "TrackingTools/DetLayers/interface/BarrelDetLayer.h" +#include "TrackingTools/DetLayers/interface/DetLayer.h" +#include "TrackingTools/DetLayers/interface/ForwardDetLayer.h" #include "TrackingTools/Records/interface/TransientRecHitRecord.h" +#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" inline float sqr(float x) { return x*x; } diff --git a/RecoPixelVertexing/PixelLowPtUtilities/src/TrackFitter.cc b/RecoPixelVertexing/PixelLowPtUtilities/src/TrackFitter.cc index 18ed92c18574c..a73464d90367a 100644 --- a/RecoPixelVertexing/PixelLowPtUtilities/src/TrackFitter.cc +++ b/RecoPixelVertexing/PixelLowPtUtilities/src/TrackFitter.cc @@ -1,37 +1,29 @@ -#include "RecoPixelVertexing/PixelLowPtUtilities/interface/TrackFitter.h" -#include "FWCore/ParameterSet/interface/ParameterSet.h" - -#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" - -#include "DataFormats/GeometryVector/interface/LocalPoint.h" -#include "DataFormats/GeometryVector/interface/GlobalPoint.h" -#include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h" - -#include "TrackingTools/DetLayers/interface/DetLayer.h" -#include "Geometry/CommonDetUnit/interface/GeomDet.h" -#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" -#include "RecoTracker/TkMSParametrization/interface/PixelRecoUtilities.h" - -#include "MagneticField/Engine/interface/MagneticField.h" -#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" - #include "CommonTools/Statistics/interface/LinearFit.h" +#include "CommonTools/Utils/interface/DynArray.h" +#include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h" #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h" - +#include "DataFormats/GeometryVector/interface/GlobalPoint.h" +#include "DataFormats/GeometryVector/interface/LocalPoint.h" +#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" +#include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "FWCore/ParameterSet/interface/ParameterSet.h" +#include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/GeomDet.h" #include "Geometry/CommonDetUnit/interface/GeomDetType.h" - -#include "FWCore/MessageLogger/interface/MessageLogger.h" - -#include "RecoPixelVertexing/PixelTrackFitting/interface/RZLine.h" -#include "RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.h" +#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" +#include "MagneticField/Engine/interface/MagneticField.h" +#include "RecoPixelVertexing/PixelLowPtUtilities/interface/TrackFitter.h" +#include "RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h" #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackBuilder.h" +#include "RecoPixelVertexing/PixelTrackFitting/interface/RZLine.h" +#include "RecoTracker/TkMSParametrization/interface/PixelRecoUtilities.h" +#include "TrackingTools/DetLayers/interface/DetLayer.h" +#include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHitBuilder.h" using namespace std; -#include "CommonTools/Utils/interface/DynArray.h" - namespace { + int getCharge (const DynArray & points) { @@ -43,8 +35,6 @@ int getCharge return (dphi > 0) ? -1 : 1; } - - } diff --git a/RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.h b/RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h similarity index 76% rename from RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.h rename to RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h index b695caec914c0..5397eaf1dea59 100644 --- a/RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.h +++ b/RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h @@ -1,5 +1,5 @@ -#ifndef CircleFromThreePoints_H -#define CircleFromThreePoints_H +#ifndef RecoPixelVertexing_PixelTrackFitting_interface_CircleFromThreePoints_h +#define RecoPixelVertexing_PixelTrackFitting_interface_CircleFromThreePoints_h #include "DataFormats/GeometryVector/interface/GlobalPoint.h" #include "DataFormats/GeometryVector/interface/Basic2DVector.h" @@ -7,13 +7,13 @@ /** Computes the curvature (1/radius) and, if possible, the center * of the circle passing through three points. * The input points are three dimensional for convenience, but the - * calculation is done in the transverse (x,y) plane. + * calculation is done in the transverse (x,y) plane. * No verification of the reasonableness of the z coordinate is done. * If the three points lie on a line the curvature is zero and the center * position is undefined. The 3 points are assumed to make sense: - * if the distance between two of them is very small compared to + * if the distance between two of them is very small compared to * the ditance to the third the result will be numerically unstable. - */ + */ class CircleFromThreePoints { public: @@ -26,11 +26,11 @@ class CircleFromThreePoints { /** Construct from three points (see class description). * The order of points is not essential, but accuracy should be better if * the second point lies between the other two on the circle. - * The optional argument "precision" specifies how accurately the + * The optional argument "precision" specifies how accurately the * straight line check has to be satisfied for setting the curvature - * to zero and the center position to "undefined". + * to zero and the center position to "undefined". */ - CircleFromThreePoints( const GlobalPoint& inner, + CircleFromThreePoints( const GlobalPoint& inner, const GlobalPoint& mid, const GlobalPoint& outer, double precision = 1.e-7); @@ -38,7 +38,7 @@ class CircleFromThreePoints { /** Returns the curvature (1/radius), in cm^(-1). * The curvature is precomputed, this is just access method (takes no time). - * If curvature is zero the center is undefined + * If curvature is zero the center is undefined * (see description of presicion above). */ float curvature() const { return theCurvature;} @@ -49,15 +49,15 @@ class CircleFromThreePoints { * If the curvature is very small the position of the center will * be very inaccurate. */ - Vector2D center() const { return theCenter; } + Vector2D center() const { return theCenter; } private: float theCurvature; Vector2D theCenter; - void init( const Vector2D& b, const Vector2D& c, + void init( const Vector2D& b, const Vector2D& c, const Vector2D& offset, double precision); }; -#endif +#endif // RecoPixelVertexing_PixelTrackFitting_interface_CircleFromThreePoints_h diff --git a/RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.cc b/RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.cc index 866fed1c1562a..6a75dd6128fe1 100644 --- a/RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.cc +++ b/RecoPixelVertexing/PixelTrackFitting/src/CircleFromThreePoints.cc @@ -1,4 +1,4 @@ -#include "CircleFromThreePoints.h" +#include "RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h" CircleFromThreePoints::CircleFromThreePoints( const GlobalPoint& inner, const GlobalPoint& mid, diff --git a/RecoPixelVertexing/PixelTrackFitting/src/KFBasedPixelFitter.cc b/RecoPixelVertexing/PixelTrackFitting/src/KFBasedPixelFitter.cc index 41f55d2a3f6af..f23f4475a6cb1 100644 --- a/RecoPixelVertexing/PixelTrackFitting/src/KFBasedPixelFitter.cc +++ b/RecoPixelVertexing/PixelTrackFitting/src/KFBasedPixelFitter.cc @@ -24,7 +24,7 @@ #include "RecoTracker/TkMSParametrization/interface/PixelRecoUtilities.h" #include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h" -#include "CircleFromThreePoints.h" +#include "RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h" #include "DataFormats/BeamSpot/interface/BeamSpot.h" #include "FWCore/Utilities/interface/InputTag.h" diff --git a/RecoPixelVertexing/PixelTrackFitting/src/PixelFitterByHelixProjections.cc b/RecoPixelVertexing/PixelTrackFitting/src/PixelFitterByHelixProjections.cc index 65d2d38d65491..7a85f3d120510 100644 --- a/RecoPixelVertexing/PixelTrackFitting/src/PixelFitterByHelixProjections.cc +++ b/RecoPixelVertexing/PixelTrackFitting/src/PixelFitterByHelixProjections.cc @@ -25,7 +25,7 @@ #include "FWCore/MessageLogger/interface/MessageLogger.h" #include "RecoPixelVertexing/PixelTrackFitting/interface/RZLine.h" -#include "CircleFromThreePoints.h" +#include "RecoPixelVertexing/PixelTrackFitting/interface/CircleFromThreePoints.h" #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackBuilder.h" #include "RecoPixelVertexing/PixelTrackFitting/interface/PixelTrackErrorParam.h" #include "DataFormats/GeometryVector/interface/Pi.h" diff --git a/RecoPixelVertexing/PixelTrackFitting/src/PixelTrackReconstruction.cc b/RecoPixelVertexing/PixelTrackFitting/src/PixelTrackReconstruction.cc index 81d5a522afe2c..df0a396b4f25e 100644 --- a/RecoPixelVertexing/PixelTrackFitting/src/PixelTrackReconstruction.cc +++ b/RecoPixelVertexing/PixelTrackFitting/src/PixelTrackReconstruction.cc @@ -38,8 +38,8 @@ PixelTrackReconstruction::PixelTrackReconstruction(const ParameterSet& cfg, theFilterToken = iC.consumes(filterTag); } } - -PixelTrackReconstruction::~PixelTrackReconstruction() + +PixelTrackReconstruction::~PixelTrackReconstruction() { } @@ -66,8 +66,8 @@ void PixelTrackReconstruction::run(TracksWithTTRHs& tracks, edm::Event& ev, cons ev.getByToken(theFilterToken, hfilter); filter = hfilter.product(); } - - std::vector hits;hits.reserve(4); + + std::vector hits;hits.reserve(4); for(const auto& regionHitSets: hitSets) { const TrackingRegion& region = regionHitSets.region(); @@ -75,7 +75,7 @@ void PixelTrackReconstruction::run(TracksWithTTRHs& tracks, edm::Event& ev, cons /// FIXME at some point we need to migrate the fitter... auto nHits = tuplet.size(); hits.resize(nHits); for (unsigned int iHit = 0; iHit < nHits; ++iHit) hits[iHit] = tuplet[iHit]; - + // fitting std::unique_ptr track = fitter.run(hits, region); if (!track) continue; diff --git a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletEDProducerT.cc b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletEDProducerT.cc index d5849250e698c..4acbd3050bddf 100644 --- a/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletEDProducerT.cc +++ b/RecoPixelVertexing/PixelTriplets/plugins/CAHitNtupletEDProducerT.cc @@ -80,8 +80,8 @@ void CAHitNtupletEDProducerT::produce(edm::Event& iEvent, const edm LogDebug("CAHitNtupletEDProducer") << "Creating ntuplets for " << regionDoublets.regionSize() << " regions, and " << regionDoublets.layerPairsSize() << " layer pairs"; std::vector ntuplets; ntuplets.resize(regionDoublets.regionSize()); - for(auto& ntuplet : ntuplets) ntuplet.reserve(localRA_.upper()); - + for(auto& ntuplet : ntuplets) ntuplet.reserve(localRA_.upper()); + generator_.hitNtuplets(regionDoublets, ntuplets, iSetup, seedingLayerHits); int index = 0; for(const auto& regionLayerPairs: regionDoublets) { diff --git a/RecoPixelVertexing/PixelTriplets/src/CACell.h b/RecoPixelVertexing/PixelTriplets/src/CACell.h index 7a5667eded54c..bbe12ce093176 100644 --- a/RecoPixelVertexing/PixelTriplets/src/CACell.h +++ b/RecoPixelVertexing/PixelTriplets/src/CACell.h @@ -1,14 +1,13 @@ -#ifndef RECOPIXELVERTEXING_PIXELTRIPLETS_CACELL_h -#define RECOPIXELVERTEXING_PIXELTRIPLETS_CACELL_h +#ifndef RecoPixelVertexing_PixelTriplets_src_CACell_h +#define RecoPixelVertexing_PixelTriplets_src_CACell_h -#include "RecoTracker/TkHitPairs/interface/RecHitsSortedInPhi.h" -#include "TrackingTools/TransientTrackingRecHit/interface/SeedingLayerSetsHits.h" -#include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h" +#include +#include #include "DataFormats/Math/interface/deltaPhi.h" - -#include -#include +#include "RecoTracker/TkHitPairs/interface/RecHitsSortedInPhi.h" +#include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h" +#include "TrackingTools/TransientTrackingRecHit/interface/SeedingLayerSetsHits.h" class CACellStatus { @@ -298,4 +297,4 @@ class CACell { }; -#endif /*CACELL_H_ */ +#endif // RecoPixelVertexing_PixelTriplets_src_CACell_h diff --git a/RecoPixelVertexing/PixelTriplets/src/CAGraph.h b/RecoPixelVertexing/PixelTriplets/src/CAGraph.h index 09658241d0f60..dc679abce5492 100644 --- a/RecoPixelVertexing/PixelTriplets/src/CAGraph.h +++ b/RecoPixelVertexing/PixelTriplets/src/CAGraph.h @@ -1,68 +1,58 @@ -#ifndef RECOPIXELVERTEXING_PIXELTRIPLETS_CAGRAPH_H_ -#define RECOPIXELVERTEXING_PIXELTRIPLETS_CAGRAPH_H_ +#ifndef RecoPixelVertexing_PixelTriplets_src_CAGraph_h +#define RecoPixelVertexing_PixelTriplets_src_CAGraph_h -#include #include #include +#include struct CALayer { - CALayer(const std::string& layerName, std::size_t numberOfHits ) - : theName(layerName) - { - isOuterHitOfCell.resize(numberOfHits); - } + CALayer(const std::string &layerName, std::size_t numberOfHits) + : theName(layerName) + { + isOuterHitOfCell.resize(numberOfHits); + } - bool operator==(const std::string& otherString) - { - return otherString == theName; - } + bool operator==(const std::string &otherString) { + return otherString == theName; + } - std::string name() const - { - return theName; - } + const std::string& name() const { return theName; } - std::vector theOuterLayerPairs; - std::vector theInnerLayerPairs; - - std::vector theOuterLayers; - std::vector theInnerLayers; - std::vector< std::vector > isOuterHitOfCell; + std::vector theOuterLayerPairs; + std::vector theInnerLayerPairs; + std::vector theOuterLayers; + std::vector theInnerLayers; + std::vector> isOuterHitOfCell; private: - - std::string theName; + std::string theName; }; struct CALayerPair { + CALayerPair(int a, int b) - CALayerPair(int a, int b) - - { - theLayers[0] = a; - theLayers[1] = b; - } - - + { + theLayers[0] = a; + theLayers[1] = b; + } - bool operator==(const CALayerPair& otherLayerPair) - { - return (theLayers[0] == otherLayerPair.theLayers[0]) - && (theLayers[1] == otherLayerPair.theLayers[1]); - } + bool operator==(const CALayerPair &otherLayerPair) { + return (theLayers[0] == otherLayerPair.theLayers[0]) && + (theLayers[1] == otherLayerPair.theLayers[1]); + } - std::array theLayers; - std::array theFoundCells= {{0,0}}; + std::array theLayers; + std::array theFoundCells = {{0, 0}}; }; struct CAGraph { - std::vector theLayers; - std::vector theLayerPairs; - std::vector theRootLayers; + std::vector theLayers; + std::vector theLayerPairs; + std::vector theRootLayers; }; -#endif /* CAGRAPH_H_ */ +#endif // RecoPixelVertexing_PixelTriplets_src_CAGraph_h diff --git a/RecoPixelVertexing/PixelTriplets/src/CAHitQuadrupletGenerator.cc b/RecoPixelVertexing/PixelTriplets/src/CAHitQuadrupletGenerator.cc index 1f8da814c3117..e82d790fff250 100644 --- a/RecoPixelVertexing/PixelTriplets/src/CAHitQuadrupletGenerator.cc +++ b/RecoPixelVertexing/PixelTriplets/src/CAHitQuadrupletGenerator.cc @@ -1,36 +1,27 @@ -#include "RecoPixelVertexing/PixelTriplets/interface/CAHitQuadrupletGenerator.h" - -#include "RecoPixelVertexing/PixelTriplets/interface/ThirdHitPredictionFromCircle.h" +#include -#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "CommonTools/Utils/interface/DynArray.h" +#include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Event.h" -#include "DataFormats/Common/interface/Handle.h" - +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/isFinite.h" +#include "RecoPixelVertexing/PixelTriplets/interface/CAHitQuadrupletGenerator.h" +#include "RecoPixelVertexing/PixelTriplets/interface/ThirdHitPredictionFromCircle.h" #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h" - #include "CAGraph.h" #include "CellularAutomaton.h" -#include "CommonTools/Utils/interface/DynArray.h" - -#include "FWCore/Utilities/interface/isFinite.h" - -#include - namespace { - template T sqr(T x) { - return x*x; + return x * x; } } - - using namespace std; constexpr unsigned int CAHitQuadrupletGenerator::minLayers; diff --git a/RecoPixelVertexing/PixelTriplets/src/CAHitTripletGenerator.cc b/RecoPixelVertexing/PixelTriplets/src/CAHitTripletGenerator.cc index b8a43a8ecc794..e824825d8553f 100644 --- a/RecoPixelVertexing/PixelTriplets/src/CAHitTripletGenerator.cc +++ b/RecoPixelVertexing/PixelTriplets/src/CAHitTripletGenerator.cc @@ -1,31 +1,26 @@ #include -#include "RecoPixelVertexing/PixelTriplets/interface/CAHitTripletGenerator.h" - -#include "RecoPixelVertexing/PixelTriplets/interface/ThirdHitPredictionFromCircle.h" - -#include "RecoPixelVertexing/PixelTriplets/interface/HitTripletGenerator.h" -#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "CommonTools/Utils/interface/DynArray.h" +#include "DataFormats/Common/interface/Handle.h" #include "FWCore/Framework/interface/ConsumesCollector.h" #include "FWCore/Framework/interface/Event.h" -#include "DataFormats/Common/interface/Handle.h" - +#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" +#include "FWCore/Utilities/interface/isFinite.h" +#include "RecoPixelVertexing/PixelTriplets/interface/CAHitTripletGenerator.h" +#include "RecoPixelVertexing/PixelTriplets/interface/HitTripletGenerator.h" +#include "RecoPixelVertexing/PixelTriplets/interface/ThirdHitPredictionFromCircle.h" #include "TrackingTools/DetLayers/interface/BarrelDetLayer.h" + #include "CAGraph.h" #include "CellularAutomaton.h" -#include "CommonTools/Utils/interface/DynArray.h" - -#include "FWCore/Utilities/interface/isFinite.h" - namespace { - -template -T sqr(T x) -{ - return x * x; -} + template + T sqr(T x) + { + return x * x; + } } using namespace std; diff --git a/RecoPixelVertexing/PixelTriplets/src/CellularAutomaton.cc b/RecoPixelVertexing/PixelTriplets/src/CellularAutomaton.cc index d76a6793b36ae..6e5e6cbc2ff37 100644 --- a/RecoPixelVertexing/PixelTriplets/src/CellularAutomaton.cc +++ b/RecoPixelVertexing/PixelTriplets/src/CellularAutomaton.cc @@ -1,265 +1,210 @@ -#include "CellularAutomaton.h" - -#include +#include +#include "CellularAutomaton.h" -void CellularAutomaton::createAndConnectCells(const std::vector& hitDoublets, const TrackingRegion& region, - const float thetaCut, const float phiCut, const float hardPtCut) +void CellularAutomaton::createAndConnectCells( + const std::vector & hitDoublets, + const TrackingRegion & region, + const float thetaCut, + const float phiCut, + const float hardPtCut) { - int tsize=0; - for ( auto hd : hitDoublets) tsize+=hd->size(); - allCells.reserve(tsize); - unsigned int cellId = 0; - float ptmin = region.ptMin(); - float region_origin_x = region.origin().x(); - float region_origin_y = region.origin().y(); - float region_origin_radius = region.originRBound(); - - std::vector alreadyVisitedLayerPairs; - alreadyVisitedLayerPairs.resize(theLayerGraph.theLayerPairs.size()); - for (auto visited : alreadyVisitedLayerPairs) - { - visited = false; - } - for (int rootVertex : theLayerGraph.theRootLayers) - { - - std::queue LayerPairsToVisit; - - for (int LayerPair : theLayerGraph.theLayers[rootVertex].theOuterLayerPairs) - { - LayerPairsToVisit.push(LayerPair); - - } - - unsigned int numberOfLayerPairsToVisitAtThisDepth = - LayerPairsToVisit.size(); - - while (!LayerPairsToVisit.empty()) - { - auto currentLayerPair = LayerPairsToVisit.front(); - auto & currentLayerPairRef = theLayerGraph.theLayerPairs[currentLayerPair]; - auto & currentInnerLayerRef = theLayerGraph.theLayers[currentLayerPairRef.theLayers[0]]; - auto & currentOuterLayerRef = theLayerGraph.theLayers[currentLayerPairRef.theLayers[1]]; - bool allInnerLayerPairsAlreadyVisited { true }; - - for (auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) - { - allInnerLayerPairsAlreadyVisited &= - alreadyVisitedLayerPairs[innerLayerPair]; - } - - if (alreadyVisitedLayerPairs[currentLayerPair] == false - && allInnerLayerPairsAlreadyVisited) - { - - const HitDoublets* doubletLayerPairId = - hitDoublets[currentLayerPair]; - auto numberOfDoublets = doubletLayerPairId->size(); - currentLayerPairRef.theFoundCells[0] = cellId; - currentLayerPairRef.theFoundCells[1] = cellId+numberOfDoublets; - for (unsigned int i = 0; i < numberOfDoublets; ++i) - { - allCells.emplace_back(doubletLayerPairId, i, - doubletLayerPairId->innerHitId(i), - doubletLayerPairId->outerHitId(i)); - - - currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->outerHitId(i)].push_back(cellId); - - cellId++; - - auto & neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->innerHitId(i)]; - allCells.back().checkAlignmentAndTag(allCells, - neigCells, ptmin, region_origin_x, - region_origin_y, region_origin_radius, thetaCut, - phiCut, hardPtCut - ); - - - } - assert(cellId==currentLayerPairRef.theFoundCells[1]); - for (auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) - { - LayerPairsToVisit.push(outerLayerPair); - } - - alreadyVisitedLayerPairs[currentLayerPair] = true; - } - LayerPairsToVisit.pop(); - numberOfLayerPairsToVisitAtThisDepth--; - if (numberOfLayerPairsToVisitAtThisDepth == 0) - { - numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size(); - } - - } - - } + int tsize = 0; + for (auto hd : hitDoublets) { + tsize += hd->size(); + } + allCells.reserve(tsize); + unsigned int cellId = 0; + float ptmin = region.ptMin(); + float region_origin_x = region.origin().x(); + float region_origin_y = region.origin().y(); + float region_origin_radius = region.originRBound(); + + std::vector alreadyVisitedLayerPairs; + alreadyVisitedLayerPairs.resize(theLayerGraph.theLayerPairs.size()); + for (auto visited : alreadyVisitedLayerPairs) { + visited = false; + } + for (int rootVertex : theLayerGraph.theRootLayers) { + std::queue LayerPairsToVisit; + + for (int LayerPair : theLayerGraph.theLayers[rootVertex].theOuterLayerPairs) { + LayerPairsToVisit.push(LayerPair); + } + unsigned int numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size(); + + while (not LayerPairsToVisit.empty()) { + auto currentLayerPair = LayerPairsToVisit.front(); + auto & currentLayerPairRef = theLayerGraph.theLayerPairs[currentLayerPair]; + auto & currentInnerLayerRef = theLayerGraph.theLayers[currentLayerPairRef.theLayers[0]]; + auto & currentOuterLayerRef = theLayerGraph.theLayers[currentLayerPairRef.theLayers[1]]; + bool allInnerLayerPairsAlreadyVisited{true}; + + for (auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) { + allInnerLayerPairsAlreadyVisited &= alreadyVisitedLayerPairs[innerLayerPair]; + } + + if (alreadyVisitedLayerPairs[currentLayerPair] == false and allInnerLayerPairsAlreadyVisited) { + const HitDoublets *doubletLayerPairId = hitDoublets[currentLayerPair]; + auto numberOfDoublets = doubletLayerPairId->size(); + currentLayerPairRef.theFoundCells[0] = cellId; + currentLayerPairRef.theFoundCells[1] = cellId + numberOfDoublets; + for (unsigned int i = 0; i < numberOfDoublets; ++i) { + allCells.emplace_back(doubletLayerPairId, i, + doubletLayerPairId->innerHitId(i), + doubletLayerPairId->outerHitId(i)); + + currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->outerHitId(i)].push_back(cellId); + + cellId++; + + auto & neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->innerHitId(i)]; + allCells.back().checkAlignmentAndTag( + allCells, neigCells, ptmin, region_origin_x, region_origin_y, + region_origin_radius, thetaCut, phiCut, hardPtCut); + } + assert(cellId == currentLayerPairRef.theFoundCells[1]); + for (auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) { + LayerPairsToVisit.push(outerLayerPair); + } + + alreadyVisitedLayerPairs[currentLayerPair] = true; + } + LayerPairsToVisit.pop(); + numberOfLayerPairsToVisitAtThisDepth--; + if (numberOfLayerPairsToVisitAtThisDepth == 0) { + numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size(); + } + } + } } void CellularAutomaton::evolve(const unsigned int minHitsPerNtuplet) { allStatus.resize(allCells.size()); - - + unsigned int numberOfIterations = minHitsPerNtuplet - 2; // keeping the last iteration for later - for (unsigned int iteration = 0; iteration < numberOfIterations - 1; - ++iteration) - { - for (auto& layerPair : theLayerGraph.theLayerPairs) - { - for (auto i =layerPair.theFoundCells[0]; i& foundNtuplets, - const unsigned int minHitsPerNtuplet) +void CellularAutomaton::findNtuplets(std::vector & foundNtuplets, const unsigned int minHitsPerNtuplet) { - CACell::CAntuple tmpNtuplet; - tmpNtuplet.reserve(minHitsPerNtuplet); - - for (auto root_cell : theRootCells) - { - tmpNtuplet.clear(); - tmpNtuplet.push_back(root_cell); - allCells[root_cell].findNtuplets(allCells,foundNtuplets, tmpNtuplet, minHitsPerNtuplet); - } - + CACell::CAntuple tmpNtuplet; + tmpNtuplet.reserve(minHitsPerNtuplet); + + for (auto root_cell : theRootCells) + { + tmpNtuplet.clear(); + tmpNtuplet.push_back(root_cell); + allCells[root_cell].findNtuplets(allCells, foundNtuplets, tmpNtuplet, minHitsPerNtuplet); + } } - -void CellularAutomaton::findTriplets(const std::vector& hitDoublets,std::vector& foundTriplets, const TrackingRegion& region, - const float thetaCut, const float phiCut, const float hardPtCut) +void CellularAutomaton::findTriplets( + std::vector const& hitDoublets, + std::vector & foundTriplets, TrackingRegion const& region, + const float thetaCut, + const float phiCut, + const float hardPtCut) { - int tsize=0; - for ( auto hd : hitDoublets) tsize+=hd->size(); - allCells.reserve(tsize); - - unsigned int cellId = 0; - float ptmin = region.ptMin(); - float region_origin_x = region.origin().x(); - float region_origin_y = region.origin().y(); - float region_origin_radius = region.originRBound(); - - std::vector alreadyVisitedLayerPairs; - alreadyVisitedLayerPairs.resize(theLayerGraph.theLayerPairs.size()); - for (auto visited : alreadyVisitedLayerPairs) - { - visited = false; - } - for (int rootVertex : theLayerGraph.theRootLayers) - { - - std::queue LayerPairsToVisit; - - for (int LayerPair : theLayerGraph.theLayers[rootVertex].theOuterLayerPairs) - { - LayerPairsToVisit.push(LayerPair); - - } - - unsigned int numberOfLayerPairsToVisitAtThisDepth = - LayerPairsToVisit.size(); - - while (!LayerPairsToVisit.empty()) - { - auto currentLayerPair = LayerPairsToVisit.front(); - auto & currentLayerPairRef = theLayerGraph.theLayerPairs[currentLayerPair]; - auto & currentInnerLayerRef = theLayerGraph.theLayers[currentLayerPairRef.theLayers[0]]; - auto & currentOuterLayerRef = theLayerGraph.theLayers[currentLayerPairRef.theLayers[1]]; - bool allInnerLayerPairsAlreadyVisited { true }; - - for (auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) - { - allInnerLayerPairsAlreadyVisited &= - alreadyVisitedLayerPairs[innerLayerPair]; - } - - if (alreadyVisitedLayerPairs[currentLayerPair] == false - && allInnerLayerPairsAlreadyVisited) - { - - const HitDoublets* doubletLayerPairId = - hitDoublets[currentLayerPair]; - auto numberOfDoublets = doubletLayerPairId->size(); - currentLayerPairRef.theFoundCells[0] = cellId; - currentLayerPairRef.theFoundCells[1] = cellId+numberOfDoublets; - for (unsigned int i = 0; i < numberOfDoublets; ++i) - { - allCells.emplace_back(doubletLayerPairId, i, - doubletLayerPairId->innerHitId(i), - doubletLayerPairId->outerHitId(i)); - - - currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->outerHitId(i)].push_back(cellId); - - cellId++; - - auto & neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->innerHitId(i)]; - allCells.back().checkAlignmentAndPushTriplet(allCells, - neigCells, foundTriplets, ptmin, region_origin_x, - region_origin_y, region_origin_radius, thetaCut, - phiCut, hardPtCut - ); - } - assert(cellId==currentLayerPairRef.theFoundCells[1]); - - - for (auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) - { - LayerPairsToVisit.push(outerLayerPair); - } - - alreadyVisitedLayerPairs[currentLayerPair] = true; - } - LayerPairsToVisit.pop(); - numberOfLayerPairsToVisitAtThisDepth--; - if (numberOfLayerPairsToVisitAtThisDepth == 0) - { - numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size(); - } - - } - - } + int tsize = 0; + for (auto hd : hitDoublets) { + tsize += hd->size(); + } + allCells.reserve(tsize); + + unsigned int cellId = 0; + float ptmin = region.ptMin(); + float region_origin_x = region.origin().x(); + float region_origin_y = region.origin().y(); + float region_origin_radius = region.originRBound(); + + std::vector alreadyVisitedLayerPairs; + alreadyVisitedLayerPairs.resize(theLayerGraph.theLayerPairs.size()); + for (auto visited : alreadyVisitedLayerPairs) { + visited = false; + } + for (int rootVertex : theLayerGraph.theRootLayers) { + std::queue LayerPairsToVisit; + + for (int LayerPair : theLayerGraph.theLayers[rootVertex].theOuterLayerPairs) { + LayerPairsToVisit.push(LayerPair); + } + unsigned int numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size(); + + while (not LayerPairsToVisit.empty()) { + auto currentLayerPair = LayerPairsToVisit.front(); + auto & currentLayerPairRef = theLayerGraph.theLayerPairs[currentLayerPair]; + auto & currentInnerLayerRef = theLayerGraph.theLayers[currentLayerPairRef.theLayers[0]]; + auto & currentOuterLayerRef = theLayerGraph.theLayers[currentLayerPairRef.theLayers[1]]; + bool allInnerLayerPairsAlreadyVisited{true}; + + for (auto innerLayerPair : currentInnerLayerRef.theInnerLayerPairs) { + allInnerLayerPairsAlreadyVisited &= alreadyVisitedLayerPairs[innerLayerPair]; + } + + if (alreadyVisitedLayerPairs[currentLayerPair] == false and allInnerLayerPairsAlreadyVisited) { + const HitDoublets *doubletLayerPairId = hitDoublets[currentLayerPair]; + auto numberOfDoublets = doubletLayerPairId->size(); + currentLayerPairRef.theFoundCells[0] = cellId; + currentLayerPairRef.theFoundCells[1] = cellId + numberOfDoublets; + for (unsigned int i = 0; i < numberOfDoublets; ++i) { + allCells.emplace_back(doubletLayerPairId, i, + doubletLayerPairId->innerHitId(i), + doubletLayerPairId->outerHitId(i)); + + currentOuterLayerRef.isOuterHitOfCell[doubletLayerPairId->outerHitId(i)].push_back(cellId); + + cellId++; + + auto & neigCells = currentInnerLayerRef.isOuterHitOfCell[doubletLayerPairId->innerHitId(i)]; + allCells.back().checkAlignmentAndPushTriplet( + allCells, neigCells, foundTriplets, ptmin, region_origin_x, region_origin_y, + region_origin_radius, thetaCut, phiCut, hardPtCut); + } + assert(cellId == currentLayerPairRef.theFoundCells[1]); + for (auto outerLayerPair : currentOuterLayerRef.theOuterLayerPairs) { + LayerPairsToVisit.push(outerLayerPair); + } + + alreadyVisitedLayerPairs[currentLayerPair] = true; + } + LayerPairsToVisit.pop(); + numberOfLayerPairsToVisitAtThisDepth--; + if (numberOfLayerPairsToVisitAtThisDepth == 0) { + numberOfLayerPairsToVisitAtThisDepth = LayerPairsToVisit.size(); + } + } + } } diff --git a/RecoPixelVertexing/PixelTriplets/src/CellularAutomaton.h b/RecoPixelVertexing/PixelTriplets/src/CellularAutomaton.h index 2166e271cc66c..7fafc2d597a48 100644 --- a/RecoPixelVertexing/PixelTriplets/src/CellularAutomaton.h +++ b/RecoPixelVertexing/PixelTriplets/src/CellularAutomaton.h @@ -1,20 +1,22 @@ -#ifndef RECOPIXELVERTEXING_PIXELTRIPLETS_PLUGINS_CELLULARAUTOMATON_H_ -#define RECOPIXELVERTEXING_PIXELTRIPLETS_PLUGINS_CELLULARAUTOMATON_H_ +#ifndef RecoPixelVertexing_PixelTriplets_src_CellularAutomaton_h +#define RecoPixelVertexing_PixelTriplets_src_CellularAutomaton_h + #include -#include "CACell.h" -#include "TrackingTools/TransientTrackingRecHit/interface/SeedingLayerSetsHits.h" + #include "RecoTracker/TkTrackingRegions/interface/TrackingRegion.h" +#include "TrackingTools/TransientTrackingRecHit/interface/SeedingLayerSetsHits.h" + +#include "CACell.h" #include "CAGraph.h" + class CellularAutomaton { public: CellularAutomaton(CAGraph& graph) : theLayerGraph(graph) - { - - } + { } - std::vector & getAllCells() { return allCells;} + std::vector & getAllCells() { return allCells; } void createAndConnectCells(const std::vector&, const TrackingRegion&, const float, const float, const float); @@ -35,4 +37,4 @@ class CellularAutomaton }; -#endif +#endif // RecoPixelVertexing_PixelTriplets_src_CellularAutomaton_h