CMS 3D CMS Logo

HcalHardcodeGeometryEP.cc

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 //
00003 // Package:    HcalHardcodeGeometryEP
00004 // Class:      HcalHardcodeGeometryEP
00005 // 
00013 //
00014 // Original Author:  Jeremiah Mans
00015 //         Created:  Mon Oct  3 11:35:27 CDT 2005
00016 // $Id: HcalHardcodeGeometryEP.cc,v 1.8 2008/05/19 20:12:41 heltsley Exp $
00017 //
00018 //
00019 
00020 #include "Geometry/HcalEventSetup/interface/HcalHardcodeGeometryEP.h"
00021 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00022 
00023 //
00024 // constants, enums and typedefs
00025 //
00026 
00027 //
00028 // static data member definitions
00029 //
00030 
00031 //
00032 // constructors and destructor
00033 //
00034 
00035 HcalHardcodeGeometryEP::HcalHardcodeGeometryEP( const edm::ParameterSet& ps ) :
00036    m_loader ( 0 ) ,
00037    m_applyAlignment ( ps.getUntrackedParameter<bool>("applyAlignment", false) )
00038 {
00039    //the following line is needed to tell the framework what
00040    // data is being produced
00041    setWhatProduced( this,
00042                     &HcalHardcodeGeometryEP::produceAligned,
00043                     dependsOn( &HcalHardcodeGeometryEP::idealRecordCallBack ),
00044                     "HCAL");
00045 
00046 // disable
00047 //   setWhatProduced( this,
00048 //                  &HcalHardcodeGeometryEP::produceIdeal,
00049 //                  edm::es::Label( "HCAL" ) );
00050 }
00051 
00052 
00053 HcalHardcodeGeometryEP::~HcalHardcodeGeometryEP()
00054 { 
00055    delete m_loader ;
00056 }
00057 
00058 
00059 //
00060 // member functions
00061 //
00062 
00063 // ------------ method called to produce the data  ------------
00064 
00065 void
00066 HcalHardcodeGeometryEP::idealRecordCallBack( const IdealGeometryRecord& iRecord )
00067 {
00068 }
00069 
00070 HcalHardcodeGeometryEP::ReturnType
00071 HcalHardcodeGeometryEP::produceIdeal( const IdealGeometryRecord& iRecord )
00072 {
00073    assert( !m_applyAlignment ) ;
00074 
00075    //now do what ever other initialization is needed
00076    ReturnType ptr ;
00077    edm::LogInfo("HCAL") << "Using default HCAL topology" ;
00078    edm::ESHandle<HcalTopology> topology ;
00079    iRecord.get( topology ) ;
00080    m_loader = new HcalHardcodeGeometryLoader( *topology ) ;
00081    ptr = ReturnType( m_loader->load() ) ;
00082    return ptr ;
00083 }
00084 
00085 HcalHardcodeGeometryEP::ReturnType
00086 HcalHardcodeGeometryEP::produceAligned( const HcalGeometryRecord& iRecord )
00087 {
00088    //now do what ever other initialization is needed
00089    ReturnType ptr ;
00090    edm::LogInfo("HCAL") << "Using default HCAL topology" ;
00091 
00092    edm::ESHandle<HcalTopology> topology ;
00093    iRecord.getRecord<IdealGeometryRecord>().get( topology ) ;
00094    if( 0 == m_loader ) m_loader = new HcalHardcodeGeometryLoader( *topology ) ;
00095    ptr = ReturnType( m_loader->load() ) ; 
00096    return ptr ;
00097 }

Generated on Tue Jun 9 17:37:30 2009 for CMSSW by  doxygen 1.5.4