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 
40  seedingLayerSetsBuilder_(iConfig, consumesCollector()),
41  origins_(iConfig.getParameter<edm::ParameterSet>("RegionPSet"), consumesCollector()),
42  inactiveAreaFinder_(iConfig, seedingLayerSetsBuilder_.layers(), seedingLayerSetsBuilder_.seedingLayerSetsLooper(), 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  if(!region) continue;
79 #ifdef EDM_ML_DEBUG
80  auto etaPhiRegion = dynamic_cast<const RectangularEtaPhiTrackingRegion *>(region.get());
81  std::stringstream ss;
82  for(const auto& ind: areasLayerSet.second) {
83  ss << ind << ",";
84  }
85  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();
86 #endif
87 
88  regions->emplace_back(std::move(region), std::move(areasLayerSet.second));
89  }
90  }
91 
92  iEvent.put(std::move(regions));
93 }
94 
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:137
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
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