CMS 3D CMS Logo

SiStripHashedDetIdESModule.cc
Go to the documentation of this file.
9 
10 using namespace sistrip;
11 
18 public:
20  ~SiStripHashedDetIdESModule() override;
21 
23  std::unique_ptr<SiStripHashedDetId> produce(const SiStripHashedDetIdRcd&);
24 
25 private:
27 };
28 
29 // -----------------------------------------------------------------------------
30 //
32  setWhatProduced(this, &SiStripHashedDetIdESModule::produce).setConsumes(geomToken_);
33  edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdESSourceFromGeom::" << __func__ << "]"
34  << " Constructing object...";
35 }
36 
37 // -----------------------------------------------------------------------------
38 //
40  edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdESSourceFromGeom::" << __func__ << "]"
41  << " Destructing object...";
42 }
43 
44 // -----------------------------------------------------------------------------
45 //
46 std::unique_ptr<SiStripHashedDetId> SiStripHashedDetIdESModule::produce(const SiStripHashedDetIdRcd& rcd) {
47  edm::LogVerbatim("HashedDetId") << "[SiStripHashedDetIdFakeESSource::" << __func__ << "]"
48  << " Building \"fake\" hashed DetId map from geometry";
49 
50  const auto& geom = rcd.get(geomToken_);
51 
52  std::vector<uint32_t> dets;
53  dets.reserve(16000);
54 
55  for (const auto& iter : geom.detUnits()) {
56  const auto strip = dynamic_cast<StripGeomDetUnit const*>(iter);
57  if (strip) {
58  dets.push_back((strip->geographicalId()).rawId());
59  }
60  }
61  edm::LogVerbatim(mlDqmCommon_) << "[SiStripHashedDetIdESModule::" << __func__ << "]"
62  << " Retrieved " << dets.size() << " sistrip DetIds from geometry!";
63 
64  // Create hash map object
65  auto hash = std::make_unique<SiStripHashedDetId>(dets);
66  LogTrace(mlDqmCommon_) << "[SiStripHashedDetIdESModule::" << __func__ << "]"
67  << " DetId hash map: " << std::endl
68  << *hash;
69 
70  return hash;
71 }
72 
SiStripHashedDetIdESModule::~SiStripHashedDetIdESModule
~SiStripHashedDetIdESModule() override
Definition: SiStripHashedDetIdESModule.cc:39
StripGeomDetUnit.h
MessageLogger.h
TrackerGeometry.h
cond::hash
Definition: Time.h:19
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
ESProducer.h
SiStripHashedDetIdRcd.h
SiStripHashedDetId.h
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
sistrip::mlDqmCommon_
static const char mlDqmCommon_[]
Definition: ConstantsForLogger.h:18
edm::eventsetup::DependentRecordImplementation::get
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition: DependentRecordImplementation.h:112
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogVerbatim
Definition: MessageLogger.h:297
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord >
SiStripHashedDetIdESModule::geomToken_
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
Definition: SiStripHashedDetIdESModule.cc:26
ModuleFactory.h
SiStripHashedDetIdESModule
Builds hashed DetId map based on DetIds read from geometry database.
Definition: SiStripHashedDetIdESModule.cc:17
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::ESProducer
Definition: ESProducer.h:101
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:671
ParameterSet.h
sistrip
sistrip classes
Definition: SiStripQualityHelpers.h:14
SiStripHashedDetIdESModule::produce
std::unique_ptr< SiStripHashedDetId > produce(const SiStripHashedDetIdRcd &)
Definition: SiStripHashedDetIdESModule.cc:46
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
SiStripHashedDetIdESModule::SiStripHashedDetIdESModule
SiStripHashedDetIdESModule(const edm::ParameterSet &)
Definition: SiStripHashedDetIdESModule.cc:31
SiStripHashedDetIdRcd
Definition: SiStripDependentRecords.h:48