Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:24

0001 #include <memory>
0002 #include "FWCore/Framework/interface/ModuleFactory.h"
0003 #include "FWCore/Framework/interface/ESProducer.h"
0004 #include "FWCore/Framework/interface/ESHandle.h"
0005 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0006 #include "CondFormats/DataRecord/interface/EcalSampleMaskRcd.h"
0007 #include "CondFormats/EcalObjects/interface/EcalSampleMask.h"
0008 
0009 /**
0010    ESProducer to fill the EcalSampleMaskRecord
0011    starting from EcalChannelStatus information
0012    
0013 
0014    \author Stefano Argiro
0015    \date 9 May 2012
0016 */
0017 
0018 class EcalSampleMaskRecordESProducer : public edm::ESProducer {
0019 public:
0020   EcalSampleMaskRecordESProducer(const edm::ParameterSet& iConfig);
0021 
0022   using ReturnType = std::unique_ptr<EcalSampleMask>;
0023 
0024   ReturnType produce(const EcalSampleMaskRcd& iRecord);
0025 
0026   unsigned int maskeb_;
0027   unsigned int maskee_;
0028 };
0029 
0030 EcalSampleMaskRecordESProducer::EcalSampleMaskRecordESProducer(const edm::ParameterSet& iConfig) {
0031   //the following line is needed to tell the framework what
0032   // data is being produced
0033   setWhatProduced(this);
0034 
0035   maskeb_ = iConfig.getParameter<unsigned int>("maskeb");
0036   maskee_ = iConfig.getParameter<unsigned int>("maskee");
0037 }
0038 
0039 EcalSampleMaskRecordESProducer::ReturnType EcalSampleMaskRecordESProducer::produce(const EcalSampleMaskRcd& iRecord) {
0040   return std::make_unique<EcalSampleMask>(maskeb_, maskee_);
0041 }
0042 
0043 //define this as a plug-in
0044 DEFINE_FWK_EVENTSETUP_MODULE(EcalSampleMaskRecordESProducer);
0045 
0046 // Configure (x)emacs for this file ...
0047 // Local Variables:
0048 // mode:c++
0049 // compile-command: "cd .. ; scram b"
0050 // End: