CMS 3D CMS Logo

SiStripHashedDetIdFakeESSource.cc
Go to the documentation of this file.
4 
8 
11 
13 public:
16 
17  virtual std::unique_ptr<SiStripHashedDetId> produce(const SiStripHashedDetIdRcd&);
18 
19 private:
21 };
22 
23 using namespace sistrip;
24 
26  : geomDetToken_(setWhatProduced(this).consumes()) {}
27 
29 
30 std::unique_ptr<SiStripHashedDetId> SiStripHashedDetIdFakeESSource::produce(const SiStripHashedDetIdRcd& record) {
31  edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
32  << " Building \"fake\" hashed DetId map from IdealGeometry";
33 
34  const auto& geomDetRcd = record.getRecord<TrackerDigiGeometryRecord>();
35  const auto& geomDet = geomDetRcd.get(geomDetToken_);
36 
37  const std::vector<uint32_t> dets = TrackerGeometryUtils::getSiStripDetIds(geomDet);
38  edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
39  << " Retrieved " << dets.size() << " DetIds from IdealGeometry!";
40 
41  auto hash = std::make_unique<SiStripHashedDetId>(dets);
42  LogTrace("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
43  << " DetId hash map: " << std::endl
44  << *hash;
45 
46  return hash;
47 }
48 
Log< level::Info, true > LogVerbatim
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
sistrip classes
#define LogTrace(id)
std::vector< uint32_t > getSiStripDetIds(const GeometricDet &geomDet)
Definition: utils.cc:5
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:61
virtual std::unique_ptr< SiStripHashedDetId > produce(const SiStripHashedDetIdRcd &)
SiStripHashedDetIdFakeESSource(const edm::ParameterSet &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const