CMS 3D CMS Logo

PixelInactiveAreaTrackingRegionsSeedingLayersProducer.cc
Go to the documentation of this file.
6 
9 
12 
14 
15 #include "VertexBeamspotOrigins.h"
18 
19 #include <vector>
20 #include <utility>
21 #include <memory>
22 
24 public:
27 
28  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
29 
30  void produce(edm::Event& iEvent, const edm::EventSetup& iSetup) override;
31 
32 private:
37 };
38 
41  origins_(iConfig.getParameter<edm::ParameterSet>("RegionPSet"), consumesCollector()),
43  trackingRegionsBuilder_(iConfig.getParameter<edm::ParameterSet>("RegionPSet"), consumesCollector())
44 {
45  produces<SeedingLayerSetsHits>();
46  produces<TrackingRegionsSeedingLayerSets>();
47 }
48 
51 
55  desc.add<edm::ParameterSetDescription>("RegionPSet", descRegion);
56 
59 
60  descriptions.add("pixelInactiveAreaTrackingRegionsAndSeedingLayers", desc);
61 }
62 
64  auto orphanHandle = iEvent.put(seedingLayerSetsBuilder_.hits(iEvent, iSetup));
65  const SeedingLayerSetsHits *seedingLayers = orphanHandle.product();
66 
67  auto regions = std::make_unique<TrackingRegionsSeedingLayerSets>(seedingLayers);
68 
69  const auto origins = origins_.origins(iEvent);
70  const auto builder = trackingRegionsBuilder_.beginEvent(iEvent);
71 
72  const auto allAreas = inactiveAreaFinder_.inactiveAreas(iEvent, iSetup);
73  for(const auto& origin: origins) {
74  auto areasLayerSets = allAreas.areasAndLayerSets(origin.first, origin.second); // point, half length in z
75  LogTrace("PixelInactiveAreaTrackingRegionsSeedingLayersProducer") << "Origin " << origin.first.x() << "," << origin.first.y() << "," << origin.first.z() << " z half lengh " << origin.second;
76  for(auto& areasLayerSet: areasLayerSets) {
77  auto region = builder.region(origin, areasLayerSet.first);
78 #ifdef EDM_ML_DEBUG
79  auto etaPhiRegion = dynamic_cast<const RectangularEtaPhiTrackingRegion *>(region.get());
80  std::stringstream ss;
81  for(const auto& ind: areasLayerSet.second) {
82  ss << ind << ",";
83  }
84  LogTrace("PixelInactiveAreaTrackingRegionsSeedingLayersProducer") << " region eta,phi " << region->direction().eta() << "," << region->direction().phi() << " eta range " << etaPhiRegion->etaRange().min() << "," << etaPhiRegion->etaRange().max() << " phi range " << (region->direction().phi()-etaPhiRegion->phiMargin().left()) << "," << (region->direction().phi()+etaPhiRegion->phiMargin().right()) << " layer sets " << ss.str();
85 #endif
86 
87  regions->emplace_back(std::move(region), std::move(areasLayerSet.second));
88  }
89  }
90 
91  iEvent.put(std::move(regions));
92 }
93 
Origins origins(const edm::Event &iEvent) const
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
static void fillDescriptions(edm::ParameterSetDescription &desc)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
std::vector< std::pair< VecArray2< Area >, std::vector< LayerSetIndex > > > areasAndLayerSets(const GlobalPoint &point, float zwidth) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
static void fillDescriptions(edm::ParameterSetDescription &desc, const std::string &defaultBeamSpot="offlineBeamSpot", const std::string &defaultVertex="firstStepPrimaryVertices", int defaultMaxVertices=-1)
static void fillDescriptions(edm::ParameterSetDescription &desc)
~PixelInactiveAreaTrackingRegionsSeedingLayersProducer() override=default
int iEvent
Definition: GenABIO.cc:230
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
std::unique_ptr< SeedingLayerSetsHits > hits(const edm::Event &ev, const edm::EventSetup &es)
InactiveAreas inactiveAreas(const edm::Event &iEvent, const edm::EventSetup &iSetup)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define LogTrace(id)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.
static void fillDescriptions(edm::ParameterSetDescription &desc)
Builder beginEvent(const edm::Event &e) const
def move(src, dest)
Definition: eostools.py:510