Geometry
EcalTestBeam
plugins
EcalTBGeometryBuilder.cc
Go to the documentation of this file.
1
// -*- C++ -*-
2
//
3
// Package: EcalTBGeometryBuilder
4
// Class: EcalTBGeometryBuilder
5
//
13
//
14
// Original Author: Jeremiah Mans
15
// Created: Mon Oct 3 11:35:27 CDT 2005
16
//
17
//
18
19
// user include files
20
#include "
Geometry/EcalTestBeam/plugins/EcalTBGeometryBuilder.h
"
21
#include "
DataFormats/EcalDetId/interface/EcalSubdetector.h
"
22
#include "
FWCore/MessageLogger/interface/MessageLogger.h
"
23
24
//
25
// constructors and destructor
26
//
27
EcalTBGeometryBuilder::EcalTBGeometryBuilder
(
const
edm::ParameterSet
& iConfig) {
28
//the following line is needed to tell the framework what
29
// data is being produced
30
auto
cc
=
setWhatProduced
(
this
);
31
32
barrelToken_
=
cc
.consumes<
CaloSubdetectorGeometry
>(
edm::ESInputTag
{
""
,
"EcalBarrel"
});
33
hodoscopeToken_
=
cc
.consumes<
CaloSubdetectorGeometry
>(
edm::ESInputTag
{
""
,
"EcalLaserPnDiode"
});
34
35
//now do what ever other initialization is needed
36
}
37
38
EcalTBGeometryBuilder::~EcalTBGeometryBuilder
() {}
39
40
//
41
// member functions
42
//
43
44
// ------------ method called to produce the data ------------
45
EcalTBGeometryBuilder::ReturnType
EcalTBGeometryBuilder::produce
(
const
IdealGeometryRecord
& iRecord) {
46
edm::ESHandle<CaloSubdetectorGeometry>
pG;
47
48
auto
pCaloGeom = std::make_unique<CaloGeometry>();
49
50
// TODO: Look for ECAL parts
51
if
(
auto
pG = iRecord.
getHandle
(
barrelToken_
)) {
52
pCaloGeom->setSubdetGeometry(
DetId::Ecal
,
EcalBarrel
, pG.
product
());
53
}
else
{
54
edm::LogWarning
(
"MissingInput"
) <<
"No Ecal Barrel Geometry found"
;
55
}
56
if
(
auto
pG = iRecord.
getHandle
(
hodoscopeToken_
)) {
57
pCaloGeom->setSubdetGeometry(
DetId::Ecal
,
EcalLaserPnDiode
, pG.
product
());
58
}
else
{
59
edm::LogWarning
(
"MissingInput"
) <<
"No Ecal TB Hodoscope Geometry found"
;
60
}
61
62
return
pCaloGeom;
63
}
edm::ESHandle::product
T const * product() const
Definition:
ESHandle.h:86
EcalTBGeometryBuilder::ReturnType
std::unique_ptr< CaloGeometry > ReturnType
Definition:
EcalTBGeometryBuilder.h:41
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
edm::eventsetup::DependentRecordImplementation::getHandle
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:81
EcalLaserPnDiode
Definition:
EcalSubdetector.h:10
EcalTBGeometryBuilder::barrelToken_
edm::ESGetToken< CaloSubdetectorGeometry, IdealGeometryRecord > barrelToken_
Definition:
EcalTBGeometryBuilder.h:47
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition:
ESProducer.h:163
EcalTBGeometryBuilder::hodoscopeToken_
edm::ESGetToken< CaloSubdetectorGeometry, IdealGeometryRecord > hodoscopeToken_
Definition:
EcalTBGeometryBuilder.h:48
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition:
MessageLogger.h:122
EcalBarrel
Definition:
EcalSubdetector.h:10
EcalTBGeometryBuilder::produce
ReturnType produce(const IdealGeometryRecord &)
Definition:
EcalTBGeometryBuilder.cc:45
edm::ESHandle< CaloSubdetectorGeometry >
EcalTBGeometryBuilder::EcalTBGeometryBuilder
EcalTBGeometryBuilder(const edm::ParameterSet &)
Definition:
EcalTBGeometryBuilder.cc:27
EcalSubdetector.h
edm::ParameterSet
Definition:
ParameterSet.h:47
DetId::Ecal
Definition:
DetId.h:27
cc
CaloSubdetectorGeometry
Definition:
CaloSubdetectorGeometry.h:22
EcalTBGeometryBuilder::~EcalTBGeometryBuilder
~EcalTBGeometryBuilder() override
Definition:
EcalTBGeometryBuilder.cc:38
EcalTBGeometryBuilder.h
IdealGeometryRecord
Definition:
IdealGeometryRecord.h:25
Generated for CMSSW Reference Manual by
1.8.16