CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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& geomDet = record.getRecord<TrackerDigiGeometryRecord>().get(geomDetToken_);
35 
36  const std::vector<uint32_t> dets = TrackerGeometryUtils::getSiStripDetIds(geomDet);
37  edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
38  << " Retrieved " << dets.size() << " DetIds from IdealGeometry!";
39 
40  auto hash = std::make_unique<SiStripHashedDetId>(dets);
41  LogTrace("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
42  << " DetId hash map: " << std::endl
43  << *hash;
44 
45  return hash;
46 }
47 
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 &)