Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-23 03:25:33

0001 #ifndef RecoTracker_TkSeedingLayers_HitExtractorSTRP_H
0002 #define RecoTracker_TkSeedingLayers_HitExtractorSTRP_H
0003 
0004 #include "DataFormats/TrackerCommon/interface/TrackerDetSide.h"
0005 #include "FWCore/Utilities/interface/InputTag.h"
0006 #include "HitExtractor.h"
0007 
0008 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2D.h"
0009 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2DCollection.h"
0010 #include "DataFormats/TrackerRecHit2D/interface/SiStripRecHit2DCollection.h"
0011 #include "DataFormats/TrackerRecHit2D/interface/VectorHit.h"
0012 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0013 #include "Geometry/Records/interface/TrackerTopologyRcd.h"
0014 
0015 #include <vector>
0016 #include <tuple>
0017 class DetLayer;
0018 
0019 namespace edm {
0020   template <typename T>
0021   class ContainerMask;
0022 }
0023 
0024 namespace ctfseeding {
0025 
0026   class HitExtractorSTRP final : public HitExtractor {
0027   public:
0028     typedef SiStripRecHit2D::ClusterRef SiStripClusterRef;
0029 
0030     HitExtractorSTRP(GeomDetEnumerators::SubDetector subdet,
0031                      TrackerDetSide side,
0032                      int idLayer,
0033                      float iminGoodCharge,
0034                      edm::ConsumesCollector& iC);
0035     ~HitExtractorSTRP() override {}
0036 
0037     HitExtractor::Hits hits(const TkTransientTrackingRecHitBuilder& ttrhBuilder,
0038                             const edm::Event&,
0039                             const edm::EventSetup&) const override;
0040     HitExtractorSTRP* clone() const override { return new HitExtractorSTRP(*this); }
0041 
0042     void useMatchedHits(const edm::InputTag& m, edm::ConsumesCollector& iC) {
0043       hasMatchedHits = true;
0044       theMatchedHits = iC.consumes<SiStripMatchedRecHit2DCollection>(m);
0045     }
0046     void useRPhiHits(const edm::InputTag& m, edm::ConsumesCollector& iC) {
0047       hasRPhiHits = true;
0048       theRPhiHits = iC.consumes<SiStripRecHit2DCollection>(m);
0049     }
0050     void useStereoHits(const edm::InputTag& m, edm::ConsumesCollector& iC) {
0051       hasStereoHits = true;
0052       theStereoHits = iC.consumes<SiStripRecHit2DCollection>(m);
0053     }
0054 
0055     void useVectorHits(const edm::InputTag& m, edm::ConsumesCollector& iC) {
0056       hasVectorHits = true;
0057       theVectorHits = iC.consumes<VectorHitCollection>(m);
0058     }
0059     void useRingSelector(int minRing, int maxRing);
0060     void useSimpleRphiHitsCleaner(bool use) { hasSimpleRphiHitsCleaner = use; }
0061 
0062     void cleanedOfClusters(const TkTransientTrackingRecHitBuilder& ttrhBuilder,
0063                            const edm::Event& ev,
0064                            HitExtractor::Hits& hits,
0065                            bool matched,
0066                            unsigned int cleanFrom = 0) const;
0067 
0068     std::pair<bool, ProjectedSiStripRecHit2D*> skipThis(
0069         const TkTransientTrackingRecHitBuilder& ttrhBuilder,
0070         TkHitRef matched,
0071         edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >& stripClusterMask) const;
0072 
0073     bool skipThis(DetId id,
0074                   OmniClusterRef const& clus,
0075                   edm::Handle<edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > >& stripClusterMask) const;
0076 
0077     void setNoProjection() { failProjection = true; }
0078     void setMinAbsZ(double minZToSet) { minAbsZ = minZToSet; }
0079 
0080     bool useRingSelector() const { return hasRingSelector; }
0081     std::tuple<int, int> getMinMaxRing() const { return std::make_tuple(theMinRing, theMaxRing); }
0082 
0083   private:
0084     bool ringRange(int ring) const;
0085 
0086     typedef edm::ContainerMask<edmNew::DetSetVector<SiStripCluster> > SkipClustersCollection;
0087     typedef edm::ContainerMask<Phase2TrackerCluster1DCollectionNew> SkipPhase2ClustersCollection;
0088     void useSkipClusters_(const edm::InputTag& m, edm::ConsumesCollector& iC) override;
0089 
0090   private:
0091     const GeomDetEnumerators::SubDetector theLayerSubDet;
0092     TrackerDetSide theSide;
0093     int theIdLayer;
0094     double minAbsZ;
0095     int theMinRing, theMaxRing;
0096     edm::EDGetTokenT<SkipClustersCollection> theSkipClusters;
0097     edm::EDGetTokenT<SkipPhase2ClustersCollection> theSkipPhase2Clusters;
0098     edm::EDGetTokenT<SiStripMatchedRecHit2DCollection> theMatchedHits;
0099     edm::EDGetTokenT<SiStripRecHit2DCollection> theRPhiHits;
0100     edm::EDGetTokenT<SiStripRecHit2DCollection> theStereoHits;
0101     edm::EDGetTokenT<VectorHitCollection> theVectorHits;
0102     edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> theTtopo;
0103     bool hasMatchedHits;
0104     bool hasRPhiHits;
0105     bool hasStereoHits;
0106     bool hasVectorHits;
0107     bool hasRingSelector;
0108     bool hasSimpleRphiHitsCleaner;
0109     bool failProjection;
0110   };
0111 
0112 }  // namespace ctfseeding
0113 #endif