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 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ESGetToken< CaloSubdetectorGeometry, IdealGeometryRecord > barrelToken_
ESHandle< ProductT > getHandle(ESGetToken< ProductT, DepRecordT > const &iToken) const
std::unique_ptr< CaloGeometry > ReturnType
EcalTBGeometryBuilder(const edm::ParameterSet &)
ReturnType produce(const IdealGeometryRecord &)
edm::ESGetToken< CaloSubdetectorGeometry, IdealGeometryRecord > hodoscopeToken_
T const * product() const
Definition: ESHandle.h:86