File indexing completed on 2024-04-06 12:28:43
0001 #ifndef CosmicTrackingRegion_H
0002 #define CosmicTrackingRegion_H
0003
0004
0005
0006
0007
0008
0009
0010
0011 #include "RecoTracker/TkTrackingRegions/interface/TrackingRegionBase.h"
0012 #include "RecoTracker/TkTrackingRegions/interface/HitRZConstraint.h"
0013 #include "RecoTracker/MeasurementDet/interface/MeasurementTrackerEvent.h"
0014 #include "MagneticField/Engine/interface/MagneticField.h"
0015
0016 #include "DataFormats/TrackerRecHit2D/interface/BaseTrackerRecHit.h"
0017 #include "DataFormats/TrackingRecHit/interface/mayown_ptr.h"
0018
0019 #include <vector>
0020
0021 using SeedingHit = BaseTrackerRecHit const*;
0022
0023 class CosmicTrackingRegion : public TrackingRegionBase {
0024 public:
0025 ~CosmicTrackingRegion() override {}
0026
0027
0028
0029
0030
0031
0032
0033
0034
0035
0036
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051 CosmicTrackingRegion(const GlobalVector& dir,
0052 const GlobalPoint& vertexPos,
0053 float ptMin,
0054 float rVertex,
0055 float zVertex,
0056 float deltaEta,
0057 float deltaPhi,
0058 const MagneticField& magField,
0059 float dummy = 0.,
0060 const MeasurementTrackerEvent* measurementTracker = nullptr)
0061 : TrackingRegionBase(dir, vertexPos, Range(-1 / ptMin, 1 / ptMin), rVertex, zVertex),
0062 theMeasurementTracker_(measurementTracker),
0063 theMagneticField_(&magField) {}
0064
0065 CosmicTrackingRegion(const GlobalVector& dir,
0066 const GlobalPoint& vertexPos,
0067 float ptMin,
0068 float rVertex,
0069 float zVertex,
0070 float deltaEta,
0071 float deltaPhi,
0072 const MagneticField& magField,
0073 const MeasurementTrackerEvent* measurementTracker = nullptr)
0074 : TrackingRegionBase(dir, vertexPos, Range(-1 / ptMin, 1 / ptMin), rVertex, zVertex),
0075 theMeasurementTracker_(measurementTracker),
0076 theMagneticField_(&magField) {}
0077
0078 CosmicTrackingRegion(CosmicTrackingRegion const& rh)
0079 : TrackingRegionBase(rh),
0080 theMeasurementTracker_(rh.theMeasurementTracker_),
0081 theMagneticField_(rh.theMagneticField_) {}
0082
0083 TrackingRegion::Hits hits(const SeedingLayerSetsHits::SeedingLayer& layer) const override;
0084
0085 std::unique_ptr<HitRZCompatibility> checkRZ(const DetLayer* layer,
0086 const Hit& outerHit,
0087 const DetLayer* outerlayer = nullptr,
0088 float lr = 0,
0089 float gz = 0,
0090 float dr = 0,
0091 float dz = 0) const override {
0092 return nullptr;
0093 }
0094
0095
0096
0097 void checkTracks(reco::TrackCollection const& tracks, std::vector<bool>& mask) const override;
0098
0099 std::unique_ptr<TrackingRegion> clone() const override { return std::make_unique<CosmicTrackingRegion>(*this); }
0100
0101 std::string name() const override { return "CosmicTrackingRegion"; }
0102
0103 private:
0104 template <typename T>
0105 void hits_(const T& layer, TrackingRegion::Hits& result) const;
0106
0107 const MeasurementTrackerEvent* theMeasurementTracker_;
0108 const MagneticField* theMagneticField_;
0109
0110 using cacheHitPointer = mayown_ptr<BaseTrackerRecHit>;
0111 using cacheHits = std::vector<cacheHitPointer>;
0112
0113
0114
0115
0116 mutable cacheHits cache;
0117 };
0118
0119 #endif