CMS 3D CMS Logo

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
23 
24 //
25 // constructors and destructor
26 //
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 
39 
40 //
41 // member functions
42 //
43 
44 // ------------ method called to produce the data ------------
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:87
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