CalibTracker
SiStripESProducers
plugins
fake
SiStripHashedDetIdFakeESSource.cc
Go to the documentation of this file.
1
#include "
FWCore/Framework/interface/ESProducer.h
"
2
#include "
FWCore/ParameterSet/interface/ParameterSet.h
"
3
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
4
5
#include "
Geometry/Records/interface/IdealGeometryRecord.h
"
6
#include "
Geometry/TrackerNumberingBuilder/interface/GeometricDet.h
"
7
#include "
Geometry/TrackerNumberingBuilder/interface/utils.h
"
8
9
#include "
CalibFormats/SiStripObjects/interface/SiStripHashedDetId.h
"
10
#include "
CalibTracker/Records/interface/SiStripHashedDetIdRcd.h
"
11
12
class
SiStripHashedDetIdFakeESSource
:
public
edm::ESProducer
{
13
public
:
14
explicit
SiStripHashedDetIdFakeESSource
(
const
edm::ParameterSet
&);
15
~SiStripHashedDetIdFakeESSource
()
override
;
16
17
virtual
std::unique_ptr<SiStripHashedDetId>
produce
(
const
SiStripHashedDetIdRcd
&);
18
19
private
:
20
edm::ESGetToken<GeometricDet, IdealGeometryRecord>
geomDetToken_
;
21
};
22
23
using namespace
sistrip
;
24
25
SiStripHashedDetIdFakeESSource::SiStripHashedDetIdFakeESSource
(
const
edm::ParameterSet
&
pset
) {
26
setWhatProduced(
this
).setConsumes(geomDetToken_);
27
}
28
29
SiStripHashedDetIdFakeESSource::~SiStripHashedDetIdFakeESSource
() {}
30
31
std::unique_ptr<SiStripHashedDetId>
SiStripHashedDetIdFakeESSource::produce
(
const
SiStripHashedDetIdRcd
&
record
) {
32
edm::LogVerbatim
(
"HashedDetId"
) <<
"[SiStripHashedDetIdFakeESSource::"
<< __func__ <<
"]"
33
<<
" Building \"fake\" hashed DetId map from IdealGeometry"
;
34
35
const
auto
& geomDet =
record
.getRecord<
TrackerDigiGeometryRecord
>().
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
49
#include "
FWCore/Framework/interface/MakerMacros.h
"
50
#include "
FWCore/Framework/interface/ModuleFactory.h
"
51
DEFINE_FWK_EVENTSETUP_MODULE
(
SiStripHashedDetIdFakeESSource
);
MessageLogger.h
cond::hash
Definition:
Time.h:19
SiStripHashedDetIdFakeESSource::~SiStripHashedDetIdFakeESSource
~SiStripHashedDetIdFakeESSource() override
Definition:
SiStripHashedDetIdFakeESSource.cc:29
SiStripHashedDetIdFakeESSource::produce
virtual std::unique_ptr< SiStripHashedDetId > produce(const SiStripHashedDetIdRcd &)
Definition:
SiStripHashedDetIdFakeESSource.cc:31
ESProducer.h
GlobalPosition_Frontier_DevDB_cff.record
record
Definition:
GlobalPosition_Frontier_DevDB_cff.py:10
SiStripHashedDetIdRcd.h
TrackerGeometryUtils::getSiStripDetIds
std::vector< uint32_t > getSiStripDetIds(const GeometricDet &geomDet)
Definition:
utils.cc:4
SiStripHashedDetIdFakeESSource::geomDetToken_
edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
Definition:
SiStripHashedDetIdFakeESSource.cc:20
MakerMacros.h
SiStripHashedDetId.h
TrackerDigiGeometryRecord
Definition:
TrackerDigiGeometryRecord.h:15
edm::ParameterSet
Definition:
ParameterSet.h:36
edm::LogVerbatim
Definition:
MessageLogger.h:297
IdealGeometryRecord.h
utils.h
SiStripHashedDetIdFakeESSource::SiStripHashedDetIdFakeESSource
SiStripHashedDetIdFakeESSource(const edm::ParameterSet &)
Definition:
SiStripHashedDetIdFakeESSource.cc:25
GeometricDet.h
get
#define get
edm::ESGetToken< GeometricDet, IdealGeometryRecord >
ModuleFactory.h
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
SiStripHashedDetIdFakeESSource
Definition:
SiStripHashedDetIdFakeESSource.cc:12
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
SiStripHashedDetIdRcd
Definition:
SiStripDependentRecords.h:48
Generated for CMSSW Reference Manual by
1.8.16