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
const
edm::ESGetToken<GeometricDet, IdealGeometryRecord>
geomDetToken_
;
21
};
22
23
using namespace
sistrip
;
24
25
SiStripHashedDetIdFakeESSource::SiStripHashedDetIdFakeESSource
(
const
edm::ParameterSet
&
pset
)
26
: geomDetToken_(setWhatProduced(this).consumes()) {}
27
28
SiStripHashedDetIdFakeESSource::~SiStripHashedDetIdFakeESSource
() {}
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
48
#include "
FWCore/Framework/interface/MakerMacros.h
"
49
#include "
FWCore/Framework/interface/ModuleFactory.h
"
50
DEFINE_FWK_EVENTSETUP_MODULE
(
SiStripHashedDetIdFakeESSource
);
MessageLogger.h
cond::hash
Definition:
Time.h:19
SiStripHashedDetIdFakeESSource::~SiStripHashedDetIdFakeESSource
~SiStripHashedDetIdFakeESSource() override
Definition:
SiStripHashedDetIdFakeESSource.cc:28
SiStripHashedDetIdFakeESSource::produce
virtual std::unique_ptr< SiStripHashedDetId > produce(const SiStripHashedDetIdRcd &)
Definition:
SiStripHashedDetIdFakeESSource.cc:30
ESProducer.h
SiStripHashedDetIdRcd.h
TrackerGeometryUtils::getSiStripDetIds
std::vector< uint32_t > getSiStripDetIds(const GeometricDet &geomDet)
Definition:
utils.cc:5
MakerMacros.h
SiStripHashedDetId.h
TrackerDigiGeometryRecord
Definition:
TrackerDigiGeometryRecord.h:16
edm::ParameterSet
Definition:
ParameterSet.h:47
IdealGeometryRecord.h
utils.h
AlCaHarvesting_cff.record
record
Definition:
AlCaHarvesting_cff.py:42
SiStripHashedDetIdFakeESSource::SiStripHashedDetIdFakeESSource
SiStripHashedDetIdFakeESSource(const edm::ParameterSet &)
Definition:
SiStripHashedDetIdFakeESSource.cc:25
GeometricDet.h
get
#define get
edm::ESGetToken< GeometricDet, IdealGeometryRecord >
ModuleFactory.h
SiStripHashedDetIdFakeESSource::geomDetToken_
const edm::ESGetToken< GeometricDet, IdealGeometryRecord > geomDetToken_
Definition:
SiStripHashedDetIdFakeESSource.cc:20
DEFINE_FWK_EVENTSETUP_MODULE
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition:
ModuleFactory.h:60
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition:
MessageLogger.h:128
edm::ESProducer
Definition:
ESProducer.h:104
LogTrace
#define LogTrace(id)
Definition:
MessageLogger.h:234
ParameterSet.h
sistrip
sistrip classes
Definition:
EnsembleCalibrationLA.cc:10
SiStripHashedDetIdFakeESSource
Definition:
SiStripHashedDetIdFakeESSource.cc:12
muonDTDigis_cfi.pset
pset
Definition:
muonDTDigis_cfi.py:27
SiStripHashedDetIdRcd
Definition:
SiStripDependentRecords.h:47
Generated for CMSSW Reference Manual by
1.8.16