00001
00002
00003
00004
00005
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #include <memory>
00023 #include "boost/shared_ptr.hpp"
00024
00025
00026 #include "FWCore/Framework/interface/ModuleFactory.h"
00027 #include "FWCore/Framework/interface/ESProducer.h"
00028 #include "FWCore/Framework/interface/ESProducts.h"
00029 #include "FWCore/Framework/interface/ESHandle.h"
00030
00031 #include "CondFormats/DataRecord/interface/L1RCTParametersRcd.h"
00032 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
00033 #include "CondFormats/DataRecord/interface/L1RCTChannelMaskRcd.h"
00034 #include "CondFormats/L1TObjects/interface/L1RCTChannelMask.h"
00035
00036
00037
00038
00039
00040 class RCTConfigProducers : public edm::ESProducer {
00041 public:
00042 RCTConfigProducers(const edm::ParameterSet&);
00043 ~RCTConfigProducers();
00044
00045
00046
00047
00048
00049 boost::shared_ptr<L1RCTParameters> produceL1RCTParameters(const L1RCTParametersRcd&);
00050 boost::shared_ptr<L1RCTChannelMask> produceL1RCTChannelMask(const L1RCTChannelMaskRcd&);
00051
00052 private:
00053
00054 L1RCTParameters *rctParameters;
00055 L1RCTChannelMask *rctChannelMask;
00056 };
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 RCTConfigProducers::RCTConfigProducers(const edm::ParameterSet& iConfig)
00070 {
00071
00072
00073
00074 setWhatProduced(this, &RCTConfigProducers::produceL1RCTParameters);
00075 setWhatProduced(this, &RCTConfigProducers::produceL1RCTChannelMask);
00076
00077
00078 rctParameters =
00079 new L1RCTParameters(iConfig.getParameter<double>("eGammaLSB"),
00080 iConfig.getParameter<double>("jetMETLSB"),
00081 iConfig.getParameter<double>("eMinForFGCut"),
00082 iConfig.getParameter<double>("eMaxForFGCut"),
00083 iConfig.getParameter<double>("hOeCut"),
00084 iConfig.getParameter<double>("eMinForHoECut"),
00085 iConfig.getParameter<double>("eMaxForHoECut"),
00086 iConfig.getParameter<double>("hMinForHoECut"),
00087 iConfig.getParameter<double>("eActivityCut"),
00088 iConfig.getParameter<double>("hActivityCut"),
00089 iConfig.getParameter<unsigned>("eicIsolationThreshold"),
00090 iConfig.getParameter<unsigned>("jscQuietThresholdBarrel"),
00091 iConfig.getParameter<unsigned>("jscQuietThresholdEndcap"),
00092 iConfig.getParameter<bool>("noiseVetoHB"),
00093 iConfig.getParameter<bool>("noiseVetoHEplus"),
00094 iConfig.getParameter<bool>("noiseVetoHEminus"),
00095 iConfig.getParameter<std::vector< double > >("eGammaECalScaleFactors"),
00096 iConfig.getParameter<std::vector< double > >("eGammaHCalScaleFactors"),
00097 iConfig.getParameter<std::vector< double > >("jetMETECalScaleFactors"),
00098 iConfig.getParameter<std::vector< double > >("jetMETHCalScaleFactors")
00099 );
00100
00101
00102 rctChannelMask = new L1RCTChannelMask ;
00103 for (int i = 0; i < 18; i++)
00104 {
00105 for (int j = 0; j < 2; j++)
00106 {
00107 for (int k = 0; k < 28; k++)
00108 {
00109 rctChannelMask->ecalMask[i][j][k] = false;
00110 rctChannelMask->hcalMask[i][j][k] = false;
00111 }
00112 for (int k = 0; k < 4; k++)
00113 {
00114 rctChannelMask->hfMask[i][j][k] = false;
00115 }
00116 }
00117 }
00118 }
00119
00120
00121 RCTConfigProducers::~RCTConfigProducers()
00122 {
00123
00124
00125
00126
00127 }
00128
00129
00130
00131
00132
00133
00134
00135
00136 boost::shared_ptr<L1RCTParameters>
00137 RCTConfigProducers::produceL1RCTParameters(const L1RCTParametersRcd& iRecord)
00138 {
00139 using namespace edm::es;
00140 boost::shared_ptr<L1RCTParameters> pL1RCTParameters =
00141 (boost::shared_ptr<L1RCTParameters>) rctParameters;
00142 return pL1RCTParameters ;
00143
00144 }
00145
00146 boost::shared_ptr<L1RCTChannelMask>
00147 RCTConfigProducers::produceL1RCTChannelMask(const L1RCTChannelMaskRcd& iRecord)
00148 {
00149 using namespace edm::es;
00150 boost::shared_ptr<L1RCTChannelMask> pL1RCTChannelMask =
00151 (boost::shared_ptr<L1RCTChannelMask>) rctChannelMask;
00152 return pL1RCTChannelMask ;
00153 }
00154
00155
00156 DEFINE_FWK_EVENTSETUP_MODULE(RCTConfigProducers);