CMS 3D CMS Logo

SiStripApprox2Clusters.cc
Go to the documentation of this file.
16 
17 #include <vector>
18 #include <memory>
19 
21 public:
22  explicit SiStripApprox2Clusters(const edm::ParameterSet& conf);
23 
24  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
25  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
26 
27 private:
30 };
31 
33  clusterToken_ = consumes(conf.getParameter<edm::InputTag>("inputApproxClusters"));
35  produces<edmNew::DetSetVector<SiStripCluster>>();
36 }
37 
39  auto result = std::make_unique<edmNew::DetSetVector<SiStripCluster>>();
40  const auto& clusterCollection = event.get(clusterToken_);
41 
42  const auto& tkGeom = &iSetup.getData(tkGeomToken_);
43  const auto& tkDets = tkGeom->dets();
44 
45  for (const auto& detClusters : clusterCollection) {
47  unsigned int detId = detClusters.id();
48 
49  uint16_t nStrips{0};
50  auto det = std::find_if(tkDets.begin(), tkDets.end(), [detId](auto& elem) -> bool {
51  return (elem->geographicalId().rawId() == detId);
52  });
53  const StripTopology& p = dynamic_cast<const StripGeomDetUnit*>(*det)->specificTopology();
54  nStrips = p.nstrips() - 1;
55 
56  for (const auto& cluster : detClusters) {
57  ff.push_back(SiStripCluster(cluster, nStrips));
58  }
59  }
60 
61  event.put(std::move(result));
62 }
63 
66  desc.add<edm::InputTag>("inputApproxClusters", edm::InputTag("siStripClusters"));
67  descriptions.add("SiStripApprox2Clusters", desc);
68 }
69 
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
SiStripApprox2Clusters(const edm::ParameterSet &conf)
nStrips
1.2 is to make the matching window safely the two nearest strips 0.35 is the size of an ME0 chamber i...
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void add(std::string const &label, ParameterSetDescription const &psetDescription)
edm::EDGetTokenT< SiStripApproximateClusterCollection > clusterToken_
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1