Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:35

0001 #include "Geometry/CaloEventSetup/plugins/CaloTopologyBuilder.h"
0002 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
0003 #include "Geometry/CaloTopology/interface/EcalBarrelTopology.h"
0004 #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h"
0005 #include "Geometry/CaloTopology/interface/EcalPreshowerTopology.h"
0006 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0007 
0008 CaloTopologyBuilder::CaloTopologyBuilder(const edm::ParameterSet& /*iConfig*/)
0009     : geometryToken_{setWhatProduced(this, &CaloTopologyBuilder::produceCalo)
0010                          .consumesFrom<CaloGeometry, CaloGeometryRecord>(edm::ESInputTag{})} {}
0011 
0012 CaloTopologyBuilder::~CaloTopologyBuilder() {}
0013 
0014 //
0015 // member functions
0016 //
0017 
0018 // ------------ method called to produce the data  ------------
0019 CaloTopologyBuilder::ReturnType CaloTopologyBuilder::produceCalo(const CaloTopologyRecord& iRecord) {
0020   const auto& geometry = iRecord.get(geometryToken_);
0021 
0022   ReturnType ct = std::make_unique<CaloTopology>();
0023   //ECAL parts
0024   ct->setSubdetTopology(DetId::Ecal, EcalBarrel, std::make_unique<EcalBarrelTopology>(geometry));
0025   ct->setSubdetTopology(DetId::Ecal, EcalEndcap, std::make_unique<EcalEndcapTopology>(geometry));
0026   ct->setSubdetTopology(DetId::Ecal, EcalPreshower, std::make_unique<EcalPreshowerTopology>());
0027   return ct;
0028 }