File indexing completed on 2024-04-06 12:22:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #include <memory>
0021
0022
0023 #include "FWCore/Framework/interface/ModuleFactory.h"
0024 #include "FWCore/Framework/interface/ESProducer.h"
0025 #include "FWCore/Framework/interface/ESProducts.h"
0026 #include "FWCore/Framework/interface/ESHandle.h"
0027
0028 #include "CondFormats/DataRecord/interface/L1RCTParametersRcd.h"
0029 #include "CondFormats/L1TObjects/interface/L1RCTParameters.h"
0030 #include "CondFormats/DataRecord/interface/L1RCTChannelMaskRcd.h"
0031 #include "CondFormats/L1TObjects/interface/L1RCTChannelMask.h"
0032 #include "CondFormats/DataRecord/interface/L1RCTNoisyChannelMaskRcd.h"
0033 #include "CondFormats/L1TObjects/interface/L1RCTNoisyChannelMask.h"
0034
0035
0036
0037
0038
0039 class RCTConfigProducers : public edm::ESProducer {
0040 public:
0041 RCTConfigProducers(const edm::ParameterSet&);
0042 ~RCTConfigProducers() override;
0043
0044
0045
0046
0047
0048 std::unique_ptr<L1RCTParameters> produceL1RCTParameters(const L1RCTParametersRcd&);
0049 std::unique_ptr<L1RCTChannelMask> produceL1RCTChannelMask(const L1RCTChannelMaskRcd&);
0050 std::unique_ptr<L1RCTNoisyChannelMask> produceL1RCTNoisyChannelMask(const L1RCTNoisyChannelMaskRcd&);
0051
0052 private:
0053
0054 L1RCTParameters rctParameters;
0055 L1RCTChannelMask rctChannelMask;
0056 L1RCTNoisyChannelMask rctNoisyChannelMask;
0057 };
0058
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 RCTConfigProducers::RCTConfigProducers(const edm::ParameterSet& iConfig) {
0071
0072
0073
0074 setWhatProduced(this, &RCTConfigProducers::produceL1RCTParameters);
0075 setWhatProduced(this, &RCTConfigProducers::produceL1RCTChannelMask);
0076 setWhatProduced(this, &RCTConfigProducers::produceL1RCTNoisyChannelMask);
0077
0078
0079 rctParameters = L1RCTParameters(iConfig.getParameter<double>("eGammaLSB"),
0080 iConfig.getParameter<double>("jetMETLSB"),
0081 iConfig.getParameter<double>("eMinForFGCut"),
0082 iConfig.getParameter<double>("eMaxForFGCut"),
0083 iConfig.getParameter<double>("hOeCut"),
0084 iConfig.getParameter<double>("eMinForHoECut"),
0085 iConfig.getParameter<double>("eMaxForHoECut"),
0086 iConfig.getParameter<double>("hMinForHoECut"),
0087 iConfig.getParameter<double>("eActivityCut"),
0088 iConfig.getParameter<double>("hActivityCut"),
0089 iConfig.getParameter<unsigned>("eicIsolationThreshold"),
0090 iConfig.getParameter<unsigned>("jscQuietThresholdBarrel"),
0091 iConfig.getParameter<unsigned>("jscQuietThresholdEndcap"),
0092 iConfig.getParameter<bool>("noiseVetoHB"),
0093 iConfig.getParameter<bool>("noiseVetoHEplus"),
0094 iConfig.getParameter<bool>("noiseVetoHEminus"),
0095 iConfig.getParameter<bool>("useCorrectionsLindsey"),
0096 iConfig.getParameter<std::vector<double> >("eGammaECalScaleFactors"),
0097 iConfig.getParameter<std::vector<double> >("eGammaHCalScaleFactors"),
0098 iConfig.getParameter<std::vector<double> >("jetMETECalScaleFactors"),
0099 iConfig.getParameter<std::vector<double> >("jetMETHCalScaleFactors"),
0100 iConfig.getParameter<std::vector<double> >("ecal_calib_Lindsey"),
0101 iConfig.getParameter<std::vector<double> >("hcal_calib_Lindsey"),
0102 iConfig.getParameter<std::vector<double> >("hcal_high_calib_Lindsey"),
0103 iConfig.getParameter<std::vector<double> >("cross_terms_Lindsey"),
0104 iConfig.getParameter<std::vector<double> >("HoverE_low_Lindsey"),
0105 iConfig.getParameter<std::vector<double> >("HoverE_high_Lindsey"));
0106
0107
0108 for (int i = 0; i < 18; i++) {
0109 for (int j = 0; j < 2; j++) {
0110 for (int k = 0; k < 28; k++) {
0111 rctChannelMask.ecalMask[i][j][k] = false;
0112 rctChannelMask.hcalMask[i][j][k] = false;
0113 }
0114 for (int k = 0; k < 4; k++) {
0115 rctChannelMask.hfMask[i][j][k] = false;
0116 }
0117 }
0118 }
0119
0120
0121
0122
0123
0124 rctNoisyChannelMask.ecalThreshold = 0.0;
0125 rctNoisyChannelMask.hcalThreshold = 0.0;
0126 rctNoisyChannelMask.hfThreshold = 0.0;
0127
0128 for (int i = 0; i < 18; i++) {
0129 for (int j = 0; j < 2; j++) {
0130 for (int k = 0; k < 28; k++) {
0131 rctNoisyChannelMask.ecalMask[i][j][k] = false;
0132 rctNoisyChannelMask.hcalMask[i][j][k] = false;
0133 }
0134 for (int k = 0; k < 4; k++) {
0135 rctNoisyChannelMask.hfMask[i][j][k] = false;
0136 }
0137 }
0138 }
0139 }
0140
0141 RCTConfigProducers::~RCTConfigProducers() {
0142
0143
0144 }
0145
0146
0147
0148
0149
0150
0151
0152 std::unique_ptr<L1RCTParameters> RCTConfigProducers::produceL1RCTParameters(const L1RCTParametersRcd& iRecord) {
0153 return std::make_unique<L1RCTParameters>(rctParameters);
0154 }
0155
0156 std::unique_ptr<L1RCTChannelMask> RCTConfigProducers::produceL1RCTChannelMask(const L1RCTChannelMaskRcd& iRecord) {
0157 return std::make_unique<L1RCTChannelMask>(rctChannelMask);
0158 }
0159
0160 std::unique_ptr<L1RCTNoisyChannelMask> RCTConfigProducers::produceL1RCTNoisyChannelMask(
0161 const L1RCTNoisyChannelMaskRcd& iRecord) {
0162 return std::make_unique<L1RCTNoisyChannelMask>(rctNoisyChannelMask);
0163 }
0164
0165
0166 DEFINE_FWK_EVENTSETUP_MODULE(RCTConfigProducers);