Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:33:59

0001 // -*- C++ -*-
0002 //
0003 // Package:    RecoEcal/EgammaCoreTools
0004 // Class:      EcalSCDynamicDPhiParametersESProducer
0005 //
0006 /**\class EcalSCDynamicDPhiParametersESProducer
0007 
0008  Description: Produces the supercluster dynamic dPhi parameters
0009 
0010  Implementation:
0011      [Notes on implementation]
0012 */
0013 //
0014 // Original Author:  Thomas Reis <Thomas.Reis@stfc.ac.uk>
0015 //         Created:  Wed, 28 Oct 2020 16:17:26 GMT
0016 //
0017 //
0018 
0019 // system include files
0020 #include <memory>
0021 
0022 // user include files
0023 #include "FWCore/Framework/interface/ModuleFactory.h"
0024 #include "FWCore/Framework/interface/ESProducer.h"
0025 #include <FWCore/ParameterSet/interface/ConfigurationDescriptions.h>
0026 #include <FWCore/ParameterSet/interface/ParameterSetDescription.h>
0027 
0028 #include "CondFormats/DataRecord/interface/EcalSCDynamicDPhiParametersRcd.h"
0029 #include "RecoEcal/EgammaCoreTools/interface/SCDynamicDPhiParametersHelper.h"
0030 
0031 //
0032 // class declaration
0033 //
0034 
0035 class EcalSCDynamicDPhiParametersESProducer : public edm::ESProducer {
0036 public:
0037   EcalSCDynamicDPhiParametersESProducer(const edm::ParameterSet&);
0038   ~EcalSCDynamicDPhiParametersESProducer() override;
0039 
0040   static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0041 
0042   using ReturnType = std::unique_ptr<EcalSCDynamicDPhiParameters>;
0043 
0044   ReturnType produce(const EcalSCDynamicDPhiParametersRcd&);
0045 
0046 private:
0047   EcalSCDynamicDPhiParameters params_;
0048 };
0049 
0050 //
0051 // constructors and destructor
0052 //
0053 EcalSCDynamicDPhiParametersESProducer::EcalSCDynamicDPhiParametersESProducer(const edm::ParameterSet& iConfig) {
0054   setWhatProduced(this);
0055 
0056   reco::SCDynamicDPhiParametersHelper scDynamicDPhiParams(params_, iConfig);
0057 }
0058 
0059 EcalSCDynamicDPhiParametersESProducer::~EcalSCDynamicDPhiParametersESProducer() {}
0060 
0061 //
0062 // member functions
0063 //
0064 
0065 // ------------ method called to produce the data  ------------
0066 EcalSCDynamicDPhiParametersESProducer::ReturnType EcalSCDynamicDPhiParametersESProducer::produce(
0067     const EcalSCDynamicDPhiParametersRcd& iRecord) {
0068   auto product = std::make_unique<EcalSCDynamicDPhiParameters>(params_);
0069   return product;
0070 }
0071 
0072 void EcalSCDynamicDPhiParametersESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0073   edm::ParameterSetDescription desc;
0074   {
0075     edm::ParameterSetDescription vpsd1;
0076     vpsd1.add<double>("eMin");
0077     vpsd1.add<double>("etaMin");
0078     vpsd1.add<double>("yoffset");
0079     vpsd1.add<double>("scale");
0080     vpsd1.add<double>("xoffset");
0081     vpsd1.add<double>("width");
0082     vpsd1.add<double>("saturation");
0083     vpsd1.add<double>("cutoff");
0084     std::vector<edm::ParameterSet> temp1;
0085     temp1.reserve(1);
0086     {
0087       edm::ParameterSet temp2;
0088       temp2.addParameter<double>("eMin", 0.);
0089       temp2.addParameter<double>("etaMin", 0.);
0090       temp2.addParameter<double>("yoffset", 0.0280506);
0091       temp2.addParameter<double>("scale", 0.946048);
0092       temp2.addParameter<double>("xoffset", -0.101172);
0093       temp2.addParameter<double>("width", 0.432767);
0094       temp2.addParameter<double>("saturation", 0.14);
0095       temp2.addParameter<double>("cutoff", 0.6);
0096       temp1.push_back(temp2);
0097     }
0098     desc.addVPSet("dynamicDPhiParameterSets", vpsd1, temp1);
0099   }
0100   descriptions.add("ecalSCDynamicDPhiParametersESProducer", desc);
0101 }
0102 
0103 //define this as a plug-in
0104 DEFINE_FWK_EVENTSETUP_MODULE(EcalSCDynamicDPhiParametersESProducer);