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