CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/Geometry/EcalTestBeam/plugins/EcalTBGeometryBuilder.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    EcalTBGeometryBuilder
00004 // Class:      EcalTBGeometryBuilder
00005 // 
00013 //
00014 // Original Author:  Jeremiah Mans
00015 //         Created:  Mon Oct  3 11:35:27 CDT 2005
00016 // $Id: EcalTBGeometryBuilder.cc,v 1.3 2010/03/26 19:51:48 sunanda Exp $
00017 //
00018 //
00019 
00020 
00021 // user include files
00022 #include "Geometry/EcalTestBeam/plugins/EcalTBGeometryBuilder.h"
00023 #include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
00024 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00025 
00026 
00027 //
00028 // constructors and destructor
00029 //
00030 EcalTBGeometryBuilder::EcalTBGeometryBuilder(const edm::ParameterSet& iConfig)
00031 {
00032    //the following line is needed to tell the framework what
00033    // data is being produced
00034    setWhatProduced(this);
00035 
00036    //now do what ever other initialization is needed
00037 }
00038 
00039 
00040 EcalTBGeometryBuilder::~EcalTBGeometryBuilder()
00041 { 
00042 }
00043 
00044 
00045 //
00046 // member functions
00047 //
00048 
00049 // ------------ method called to produce the data  ------------
00050 EcalTBGeometryBuilder::ReturnType
00051 EcalTBGeometryBuilder::produce(const IdealGeometryRecord& iRecord)
00052 {
00053    edm::ESHandle<CaloSubdetectorGeometry> pG;
00054 
00055    std::auto_ptr<CaloGeometry> pCaloGeom(new CaloGeometry());
00056 
00057    // TODO: Look for ECAL parts
00058    try {
00059      iRecord.get("EcalBarrel", pG); 
00060      pCaloGeom->setSubdetGeometry(DetId::Ecal,EcalBarrel,pG.product());
00061    } catch (...) {
00062      edm::LogWarning("MissingInput") << "No Ecal Barrel Geometry found";     
00063    }
00064    try {
00065      iRecord.get("EcalLaserPnDiode", pG); 
00066      pCaloGeom->setSubdetGeometry(DetId::Ecal,EcalLaserPnDiode,pG.product());
00067    } catch (...) {
00068      edm::LogWarning("MissingInput") << "No Ecal TB Hodoscope Geometry found";     
00069    }
00070 
00071    return pCaloGeom;
00072 }