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 
20 // user include files
24 
25 
26 //
27 // constructors and destructor
28 //
30 {
31  //the following line is needed to tell the framework what
32  // data is being produced
33  auto cc = setWhatProduced(this);
34 
35  barrelToken_ = cc.consumes<CaloSubdetectorGeometry>(edm::ESInputTag{"", "EcalBarrel"});
36  hodoscopeToken_ = cc.consumes<CaloSubdetectorGeometry>(edm::ESInputTag{"", "EcalLaserPnDiode"});
37 
38  //now do what ever other initialization is needed
39 }
40 
41 
43 {
44 }
45 
46 
47 //
48 // member functions
49 //
50 
51 // ------------ method called to produce the data ------------
54 {
56 
57  auto pCaloGeom = std::make_unique<CaloGeometry>();
58 
59  // TODO: Look for ECAL parts
60  if(auto pG = iRecord.getHandle(barrelToken_)) {
61  pCaloGeom->setSubdetGeometry(DetId::Ecal,EcalBarrel,pG.product());
62  }
63  else {
64  edm::LogWarning("MissingInput") << "No Ecal Barrel Geometry found";
65  }
66  if(auto pG = iRecord.getHandle(hodoscopeToken_)) {
67  pCaloGeom->setSubdetGeometry(DetId::Ecal,EcalLaserPnDiode,pG.product());
68  }
69  else {
70  edm::LogWarning("MissingInput") << "No Ecal TB Hodoscope Geometry found";
71  }
72 
73  return pCaloGeom;
74 }
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
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