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):
29  m_zmin(zmin), m_zmax(zmax)
30  {
31  auto cosphimin = std::cos(phimin);
32  auto sinphimin = std::sin(phimin);
33  auto cosphimax = std::cos(phimax);
34  auto sinphimax = std::sin(phimax);
35 
36  m_x_rmin_phimin = rmin*cosphimin;
37  m_x_rmin_phimax = rmin*cosphimax;
38  m_x_rmax_phimin = rmax*cosphimin;
39  m_x_rmax_phimax = rmax*cosphimax;
40 
41  m_y_rmin_phimin = rmin*sinphimin;
42  m_y_rmin_phimax = rmin*sinphimax;
43  m_y_rmax_phimin = rmax*sinphimin;
44  m_y_rmax_phimax = rmax*sinphimax;
45  }
46 
47  float x_rmin_phimin() const { return m_x_rmin_phimin; }
48  float x_rmin_phimax() const { return m_x_rmin_phimax; }
49  float x_rmax_phimin() const { return m_x_rmax_phimin; }
50  float x_rmax_phimax() const { return m_x_rmax_phimax; }
51  float y_rmin_phimin() const { return m_y_rmin_phimin; }
52  float y_rmin_phimax() const { return m_y_rmin_phimax; }
53  float y_rmax_phimin() const { return m_y_rmax_phimin; }
54  float y_rmax_phimax() const { return m_y_rmax_phimax; }
55 
56  float zmin() const { return m_zmin; }
57  float zmax() const { return m_zmax; }
58 
59  private:
60  // all of these are in global coordinates
61  float m_x_rmin_phimin = 0;
62  float m_x_rmin_phimax = 0;
63  float m_x_rmax_phimin = 0;
64  float m_x_rmax_phimax = 0;
65 
66  float m_y_rmin_phimin = 0;
67  float m_y_rmin_phimax = 0;
68  float m_y_rmax_phimin = 0;
69  float m_y_rmax_phimax = 0;
70 
71  float m_zmin = 0;
72  float m_zmax = 0;
73  };
74 
75 
76  class Builder {
77  public:
78  explicit Builder(const AreaSeededTrackingRegionsBuilder *conf): m_conf(conf) {}
79  ~Builder() = default;
80 
81  void setMeasurementTracker(const MeasurementTrackerEvent *mte) { m_measurementTracker = mte; }
83 
84  std::vector<std::unique_ptr<TrackingRegion> > regions(const Origins& origins, const std::vector<Area>& areas) const;
85  std::unique_ptr<TrackingRegion> region(const Origin& origin, const std::vector<Area>& areas) const;
86  std::unique_ptr<TrackingRegion> region(const Origin& origin, const edm::VecArray<Area, 2>& areas) const;
87 
88  private:
89  template <typename T>
90  std::unique_ptr<TrackingRegion> regionImpl(const Origin& origin, const T& areas) const;
91 
92  const AreaSeededTrackingRegionsBuilder *m_conf = nullptr;
93  const MeasurementTrackerEvent *m_measurementTracker = nullptr;
95  };
96 
100 
102 
103  Builder beginEvent(const edm::Event& e) const;
104 
105 private:
106  std::vector<Area> m_areas;
108  float m_extraPhi;
109  float m_extraEta;
110  float m_ptMin;
112  bool m_precise;
116 };
117 
118 #endif
Builder(const AreaSeededTrackingRegionsBuilder *conf)
static void fillDescriptions(edm::ParameterSetDescription &desc)
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)
std::pair< const reco::CandidateView *, std::pair< float, float > > Objects