CMS 3D CMS Logo

AreaSeededTrackingRegionsProducer.h
Go to the documentation of this file.
1 #ifndef RecoTracker_TkTrackingRegions_AreaSeededTrackingRegionsProducer_h
2 #define RecoTracker_TkTrackingRegions_AreaSeededTrackingRegionsProducer_h
3 
4 
6 
18 
19 #include "VertexBeamspotOrigins.h"
21 
22 #include <array>
23 #include <limits>
24 
50 public:
51 
53 
55  m_origins(conf.getParameter<edm::ParameterSet>("RegionPSet"), iC),
56  m_builder(conf.getParameter<edm::ParameterSet>("RegionPSet"), iC)
57  {
58  edm::ParameterSet regPSet = conf.getParameter<edm::ParameterSet>("RegionPSet");
59  for(const auto& area: regPSet.getParameter<std::vector<edm::ParameterSet> >("areas")) {
60  m_areas.emplace_back(area.getParameter<double>("rmin"),
61  area.getParameter<double>("rmax"),
62  area.getParameter<double>("phimin"),
63  area.getParameter<double>("phimax"),
64  area.getParameter<double>("zmin"),
65  area.getParameter<double>("zmax"));
66  }
67  if(m_areas.empty())
68  throw cms::Exception("Configuration") << "Empty 'areas' parameter.";
69  }
70 
72 
73  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
75 
77  descAreas.add<double>("rmin", 0.0);
78  descAreas.add<double>("rmax", 0.0);
79  descAreas.add<double>("zmin", 0.0);
80  descAreas.add<double>("zmax", 0.0);
81  descAreas.add<double>("phimin", 0.0);
82  descAreas.add<double>("phimax", 0.0);
83  std::vector<edm::ParameterSet> vDefaults;
84  desc.addVPSet("areas", descAreas, vDefaults);
85 
88 
89  // Only for backwards-compatibility
91  descRegion.add<edm::ParameterSetDescription>("RegionPSet", desc);
92 
93  descriptions.add("areaSeededTrackingRegion", descRegion);
94  }
95 
96  std::vector<std::unique_ptr<TrackingRegion> > regions(const edm::Event& e, const edm::EventSetup& es) const
97  {
98  auto origins = m_origins.origins(e);
99  auto builder = m_builder.beginEvent(e);
100  return builder.regions(origins, m_areas);
101  }
102 
103 private:
106  std::vector<AreaSeededTrackingRegionsBuilder::Area> m_areas;
107 };
108 
109 #endif
Origins origins(const edm::Event &iEvent) const
static void fillDescriptions(edm::ParameterSetDescription &desc)
T getParameter(std::string const &) const
ParameterDescriptionBase * addVPSet(U const &iLabel, ParameterSetDescription const &validator, std::vector< ParameterSet > const &defaults)
static void fillDescriptions(edm::ParameterSetDescription &desc, const std::string &defaultBeamSpot="offlineBeamSpot", const std::string &defaultVertex="firstStepPrimaryVertices", int defaultMaxVertices=-1)
std::vector< std::unique_ptr< TrackingRegion > > regions(const edm::Event &e, const edm::EventSetup &es) const
std::vector< std::unique_ptr< TrackingRegion > > regions(const Origins &origins, const std::vector< Area > &areas) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
std::vector< AreaSeededTrackingRegionsBuilder::Area > m_areas
HLT enums.
AreaSeededTrackingRegionsProducer(const edm::ParameterSet &conf, edm::ConsumesCollector &&iC)
Builder beginEvent(const edm::Event &e) const