Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-18 05:06:58

0001 // -*- C++ -*-
0002 //
0003 // Package:    ZdcHardcodeGeometryEP
0004 // Class:      ZdcHardcodeGeometryEP
0005 //
0006 /**\class ZdcHardcodeGeometryEP ZdcHardcodeGeometryEP.h
0007    
0008     Description: <one line class summary>
0009 
0010     Implementation:
0011     <Notes on implementation>
0012 */
0013 //
0014 // Original Author:  Edmundo Garcia
0015 //         Created:  Mon Aug  6 12:33:33 CDT 2007
0016 //
0017 #include "Geometry/Records/interface/ZDCGeometryRecord.h"
0018 #include "Geometry/ForwardGeometry/plugins/ZdcHardcodeGeometryEP.h"
0019 #include "Geometry/ForwardGeometry/interface/ZdcGeometry.h"
0020 #include "Geometry/ForwardGeometry/interface/ZdcTopology.h"
0021 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0022 
0023 ZdcHardcodeGeometryEP::ZdcHardcodeGeometryEP(const edm::ParameterSet& ps)
0024     : m_loader(nullptr),
0025       m_applyAlignment(ps.getParameter<bool>("applyAlignment")),
0026       m_zdcAddRPD(ps.getParameter<bool>("zdcAddRPD")) {
0027   //the following line is needed to tell the framework what
0028   // data is being produced
0029   //auto cc = setWhatProduced(this, &ZdcHardcodeGeometryEP::produce, ZdcGeometry::producerTag());
0030   auto cc = setWhatProduced(this, ZdcGeometry::producerTag());
0031   m_zdcTopoToken = cc.consumesFrom<ZdcTopology, HcalRecNumberingRecord>(edm::ESInputTag{});
0032   // disable
0033   //   setWhatProduced( this,
0034   //            &ZdcHardcodeGeometryEP::produceIdeal,
0035   //            edm::es::Label( "ZDC" ) );
0036 }
0037 
0038 ZdcHardcodeGeometryEP::~ZdcHardcodeGeometryEP() {}
0039 
0040 //
0041 // member functions
0042 //
0043 
0044 // ------------ method called to produce the data  ------------
0045 
0046 ZdcHardcodeGeometryEP::ReturnType ZdcHardcodeGeometryEP::produce(const ZDCGeometryRecord& iRecord) {
0047   //   ZdcHardcodeGeometryLoader loader ( m_topology ) ;
0048   const ZdcTopology& m_topology = iRecord.get(m_zdcTopoToken);
0049   m_loader = std::make_unique<ZdcHardcodeGeometryLoader>(m_topology);
0050   m_loader->setAddRPD(m_zdcAddRPD);
0051   return ReturnType(m_loader->load());
0052 }
0053 
0054 void ZdcHardcodeGeometryEP::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0055   edm::ParameterSetDescription desc;
0056   desc.add<bool>("applyAlignment", false);
0057   desc.add<bool>("zdcAddRPD", false);
0058   descriptions.addWithDefaultLabel(desc);
0059 }