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
auto
pCaloGeom = std::make_unique<CaloGeometry>();
47
48
// TODO: Look for ECAL parts
49
if
(
auto
pG = iRecord.
getHandle
(
barrelToken_
)) {
50
pCaloGeom->setSubdetGeometry(
DetId::Ecal
,
EcalBarrel
, pG.product());
51
}
else
{
52
edm::LogWarning
(
"MissingInput"
) <<
"No Ecal Barrel Geometry found"
;
53
}
54
if
(
auto
pG = iRecord.
getHandle
(
hodoscopeToken_
)) {
55
pCaloGeom->setSubdetGeometry(
DetId::Ecal
,
EcalLaserPnDiode
, pG.product());
56
}
else
{
57
edm::LogWarning
(
"MissingInput"
) <<
"No Ecal TB Hodoscope Geometry found"
;
58
}
59
60
return
pCaloGeom;
61
}
EcalTBGeometryBuilder::ReturnType
std::unique_ptr< CaloGeometry > ReturnType
Definition:
EcalTBGeometryBuilder.h:40
edm::ESInputTag
Definition:
ESInputTag.h:87
MessageLogger.h
edm::eventsetup::DependentRecordImplementation::getHandle
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
Definition:
DependentRecordImplementation.h:87
EcalLaserPnDiode
Definition:
EcalSubdetector.h:10
EcalTBGeometryBuilder::barrelToken_
edm::ESGetToken< CaloSubdetectorGeometry, IdealGeometryRecord > barrelToken_
Definition:
EcalTBGeometryBuilder.h:46
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:47
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
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