Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 // -*- C++ -*-
0002 //
0003 // Package:    EcalBasicClusterLocalContCorrectionsESProducer
0004 // Class:      EcalBasicClusterLocalContCorrectionsESProducer
0005 //
0006 /**\class EcalBasicClusterLocalContCorrectionsESProducer EcalBasicClusterLocalContCorrectionsESProducer.h User/EcalBasicClusterLocalContCorrectionsESProducer/interface/EcalBasicClusterLocalContCorrectionsESProducer.h
0007 
0008  Description: Trivial ESProducer to provide EventSetup with (hard coded)
0009               shower containment corrections
0010 
0011      
0012  \author  Stefano Argiro
0013          Created:  Mon Mar  5 08:39:12 CET 2007
0014 */
0015 
0016 #include "FWCore/Framework/interface/ESProducer.h"
0017 #include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h"
0018 #include "CondFormats/DataRecord/interface/EcalClusterLocalContCorrParametersRcd.h"
0019 #include "FWCore/Framework/interface/ModuleFactory.h"
0020 #include "FWCore/Framework/interface/ESHandle.h"
0021 #include "DataFormats/EcalDetId/interface/EBDetId.h"
0022 
0023 class EcalBasicClusterLocalContCorrectionsESProducer : public edm::ESProducer {
0024 public:
0025   EcalBasicClusterLocalContCorrectionsESProducer(const edm::ParameterSet&) { setWhatProduced(this); }
0026 
0027   typedef std::unique_ptr<EcalClusterLocalContCorrParameters> ReturnType;
0028 
0029   ReturnType produce(const EcalClusterLocalContCorrParametersRcd&);
0030 };
0031 
0032 //
0033 // member functions
0034 //
0035 
0036 EcalBasicClusterLocalContCorrectionsESProducer::ReturnType EcalBasicClusterLocalContCorrectionsESProducer::produce(
0037     const EcalClusterLocalContCorrParametersRcd& iRecord) {
0038   using namespace edm::es;
0039   using namespace std;
0040 
0041   auto pEcalClusterLocalContCorrParameters = std::make_unique<EcalClusterLocalContCorrParameters>();
0042 
0043   double values[] = {
0044       1.00603, 0.00300789,   0.0667232,  // local eta, mod1
0045       1.00655, 0.00386189,   0.073931,   // local eta, mod2
0046       1.00634, 0.00631341,   0.0764134,  // local eta, mod3
0047       1.00957, 0.0113306,    0.123808,   // local eta, mod4
0048       1.00402, 0.00108324,   0.0428149,  // local phi, mod1
0049       1.00393, 0.000937121,  0.041658,   // local phi, mod2
0050       1.00299, 0.00126836,   0.0321188,  // local phi, mod3
0051       1.00279, -0.000700709, 0.0293207   // local phi, mod4
0052   };
0053 
0054   size_t size = 24;
0055   pEcalClusterLocalContCorrParameters->params().resize(size);
0056   std::copy(values, values + size, pEcalClusterLocalContCorrParameters->params().begin());
0057 
0058   return pEcalClusterLocalContCorrParameters;
0059 }
0060 
0061 DEFINE_FWK_EVENTSETUP_MODULE(EcalBasicClusterLocalContCorrectionsESProducer);