CMS 3D CMS Logo

AreaSeededTrackingRegionsBuilder.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkTrackingRegions_AreaSeededTrackingRegionsBuilder_h
2 #define RecoTracker_TkTrackingRegions_AreaSeededTrackingRegionsBuilder_h
3 
5 
14 
15 #include "TrackingSeedCandidates.h"
17 public:
18  using Origin = std::pair<GlobalPoint, float>; // (origin, half-length in z)
19  using Origins = std::vector<Origin>;
20 
21  class Area {
22  public:
23  Area() {}
24 
25  // phimin and phimax, and hence xmin+xmax and ymin+ymax are
26  // ordered by which way one goes around the unit circle, so it may
27  // happen that actually phimax < phimin
28  Area(float rmin, float rmax, float phimin, float phimax, float zmin, float zmax) : m_zmin(zmin), m_zmax(zmax) {
29  auto cosphimin = std::cos(phimin);
30  auto sinphimin = std::sin(phimin);
31  auto cosphimax = std::cos(phimax);
32  auto sinphimax = std::sin(phimax);
33 
34  m_x_rmin_phimin = rmin * cosphimin;
35  m_x_rmin_phimax = rmin * cosphimax;
36  m_x_rmax_phimin = rmax * cosphimin;
37  m_x_rmax_phimax = rmax * cosphimax;
38 
39  m_y_rmin_phimin = rmin * sinphimin;
40  m_y_rmin_phimax = rmin * sinphimax;
41  m_y_rmax_phimin = rmax * sinphimin;
42  m_y_rmax_phimax = rmax * sinphimax;
43  }
44 
45  float x_rmin_phimin() const { return m_x_rmin_phimin; }
46  float x_rmin_phimax() const { return m_x_rmin_phimax; }
47  float x_rmax_phimin() const { return m_x_rmax_phimin; }
48  float x_rmax_phimax() const { return m_x_rmax_phimax; }
49  float y_rmin_phimin() const { return m_y_rmin_phimin; }
50  float y_rmin_phimax() const { return m_y_rmin_phimax; }
51  float y_rmax_phimin() const { return m_y_rmax_phimin; }
52  float y_rmax_phimax() const { return m_y_rmax_phimax; }
53 
54  float zmin() const { return m_zmin; }
55  float zmax() const { return m_zmax; }
56 
57  private:
58  // all of these are in global coordinates
59  float m_x_rmin_phimin = 0;
60  float m_x_rmin_phimax = 0;
61  float m_x_rmax_phimin = 0;
62  float m_x_rmax_phimax = 0;
63 
64  float m_y_rmin_phimin = 0;
65  float m_y_rmin_phimax = 0;
66  float m_y_rmax_phimin = 0;
67  float m_y_rmax_phimax = 0;
68 
69  float m_zmin = 0;
70  float m_zmax = 0;
71  };
72 
73  class Builder {
74  public:
75  explicit Builder(const AreaSeededTrackingRegionsBuilder* conf) : m_conf(conf) {}
76  ~Builder() = default;
77 
78  void setMeasurementTracker(const MeasurementTrackerEvent* mte) { m_measurementTracker = mte; }
80 
81  std::vector<std::unique_ptr<TrackingRegion> > regions(const Origins& origins, const std::vector<Area>& areas) const;
82  std::unique_ptr<TrackingRegion> region(const Origin& origin, const std::vector<Area>& areas) const;
83  std::unique_ptr<TrackingRegion> region(const Origin& origin, const edm::VecArray<Area, 2>& areas) const;
84 
85  private:
86  template <typename T>
87  std::unique_ptr<TrackingRegion> regionImpl(const Origin& origin, const T& areas) const;
88 
89  const AreaSeededTrackingRegionsBuilder* m_conf = nullptr;
90  const MeasurementTrackerEvent* m_measurementTracker = nullptr;
92  };
93 
95  : AreaSeededTrackingRegionsBuilder(regPSet, iC) {}
98 
100 
101  Builder beginEvent(const edm::Event& e) const;
102 
103 private:
104  std::vector<Area> m_areas;
106  float m_extraPhi;
107  float m_extraEta;
108  float m_ptMin;
110  bool m_precise;
114 };
115 
116 #endif
Builder(const AreaSeededTrackingRegionsBuilder *conf)
static void fillDescriptions(edm::ParameterSetDescription &desc)
std::pair< const reco::CandidateView *, std::pair< float, float > > Objects
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void setCandidates(const TrackingSeedCandidates::Objects cands)
RectangularEtaPhiTrackingRegion::UseMeasurementTracker m_whereToUseMeasurementTracker
Area(float rmin, float rmax, float phimin, float phimax, float zmin, float zmax)
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
void setMeasurementTracker(const MeasurementTrackerEvent *mte)
Builder beginEvent(const edm::Event &e) const
edm::EDGetTokenT< MeasurementTrackerEvent > token_measurementTracker
long double T
AreaSeededTrackingRegionsBuilder(const edm::ParameterSet &regPSet, edm::ConsumesCollector &&iC)