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<edmNew::DetSetVector<SiStripApproximateCluster>>(
34  conf.getParameter<edm::InputTag>("inputApproxClusters"));
36  produces<edmNew::DetSetVector<SiStripCluster>>();
37 }
38 
40  auto result = std::make_unique<edmNew::DetSetVector<SiStripCluster>>();
41  const auto& clusterCollection = event.get(clusterToken_);
42 
43  const auto& tkGeom = &iSetup.getData(tkGeomToken_);
44  const auto& tkDets = tkGeom->dets();
45 
46  for (const auto& detClusters : clusterCollection) {
48  unsigned int detId = detClusters.id();
49 
50  uint16_t nStrips{0};
51  auto det = std::find_if(tkDets.begin(), tkDets.end(), [detId](auto& elem) -> bool {
52  return (elem->geographicalId().rawId() == detId);
53  });
54  const StripTopology& p = dynamic_cast<const StripGeomDetUnit*>(*det)->specificTopology();
55  nStrips = p.nstrips() - 1;
56 
57  for (const auto& cluster : detClusters) {
58  ff.push_back(SiStripCluster(cluster, nStrips));
59  }
60  }
61 
62  event.put(std::move(result));
63 }
64 
67  desc.add<edm::InputTag>("inputApproxClusters", edm::InputTag("siStripClusters"));
68  descriptions.add("SiStripApprox2Clusters", desc);
69 }
70 
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...
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< edmNew::DetSetVector< SiStripApproximateCluster > > clusterToken_
def move(src, dest)
Definition: eostools.py:511
Definition: event.py:1