CMS 3D CMS Logo

CMSSW_4_4_3_patch1/src/Geometry/CaloEventSetup/plugins/CaloTopologyBuilder.cc

Go to the documentation of this file.
00001 #include "Geometry/CaloEventSetup/plugins/CaloTopologyBuilder.h"
00002 #include "Geometry/CaloTopology/interface/CaloSubdetectorTopology.h"
00003 #include "Geometry/CaloTopology/interface/EcalBarrelTopology.h"
00004 #include "Geometry/CaloTopology/interface/EcalEndcapTopology.h"
00005 #include "Geometry/CaloTopology/interface/EcalPreshowerTopology.h"
00006 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00007 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00008 
00009 
00010 CaloTopologyBuilder::CaloTopologyBuilder( const edm::ParameterSet& iConfig )
00011 {
00012    //the following line is needed to tell the framework what
00013    // data is being produced
00014 
00015 // disable
00016 //   setWhatProduced( this, &CaloTopologyBuilder::produceIdeal );
00017    setWhatProduced( this, &CaloTopologyBuilder::produceCalo  );
00018 }
00019 
00020 
00021 CaloTopologyBuilder::~CaloTopologyBuilder()
00022 { 
00023 }
00024 
00025 
00026 //
00027 // member functions
00028 //
00029 
00030 // ------------ method called to produce the data  ------------
00031 CaloTopologyBuilder::ReturnType
00032 CaloTopologyBuilder::produceCalo( const CaloTopologyRecord& iRecord )
00033 {
00034    edm::ESHandle<CaloGeometry>                  theGeometry   ;
00035    iRecord.getRecord<CaloGeometryRecord>().get( theGeometry ) ;
00036 
00037    ReturnType ct ( new CaloTopology ) ;
00038    //ECAL parts      
00039    ct->setSubdetTopology( DetId::Ecal,
00040                           EcalBarrel,
00041                           new EcalBarrelTopology( theGeometry ) ) ;
00042    ct->setSubdetTopology( DetId::Ecal,
00043                           EcalEndcap,
00044                           new EcalEndcapTopology( theGeometry ) ) ;
00045    ct->setSubdetTopology( DetId::Ecal,
00046                           EcalPreshower,
00047                           new EcalPreshowerTopology(theGeometry));
00048    return ct ;
00049 }