File indexing completed on 2024-04-06 12:14:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include "Geometry/EcalTestBeam/plugins/EcalTBGeometryBuilder.h"
0021 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0022 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0023
0024
0025
0026
0027 EcalTBGeometryBuilder::EcalTBGeometryBuilder(const edm::ParameterSet& iConfig) {
0028
0029
0030 auto cc = setWhatProduced(this);
0031
0032 barrelToken_ = cc.consumes<CaloSubdetectorGeometry>(edm::ESInputTag{"", "EcalBarrel"});
0033 hodoscopeToken_ = cc.consumes<CaloSubdetectorGeometry>(edm::ESInputTag{"", "EcalLaserPnDiode"});
0034
0035
0036 }
0037
0038 EcalTBGeometryBuilder::~EcalTBGeometryBuilder() {}
0039
0040
0041
0042
0043
0044
0045 EcalTBGeometryBuilder::ReturnType EcalTBGeometryBuilder::produce(const IdealGeometryRecord& iRecord) {
0046 auto pCaloGeom = std::make_unique<CaloGeometry>();
0047
0048
0049 if (auto pG = iRecord.getHandle(barrelToken_)) {
0050 pCaloGeom->setSubdetGeometry(DetId::Ecal, EcalBarrel, pG.product());
0051 } else {
0052 edm::LogWarning("MissingInput") << "No Ecal Barrel Geometry found";
0053 }
0054 if (auto pG = iRecord.getHandle(hodoscopeToken_)) {
0055 pCaloGeom->setSubdetGeometry(DetId::Ecal, EcalLaserPnDiode, pG.product());
0056 } else {
0057 edm::LogWarning("MissingInput") << "No Ecal TB Hodoscope Geometry found";
0058 }
0059
0060 return pCaloGeom;
0061 }