File indexing completed on 2024-09-18 05:06:29
0001
0002
0003
0004
0005
0006 #include <map>
0007 #include <unordered_map>
0008 #include <string>
0009
0010 #include "FWCore/Framework/interface/ESProducer.h"
0011 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0012 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0013 #include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
0014 #include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
0015 #include "Geometry/CaloTopology/interface/HcalTopology.h"
0016 #include "Geometry/ForwardGeometry/interface/ZdcTopology.h"
0017 #include "CondFormats/HcalObjects/interface/AllObjects.h"
0018 #include "CalibCalorimetry/HcalAlgos/interface/HBHERecalibration.h"
0019 #include "CondFormats/DataRecord/interface/HcalTPParametersRcd.h"
0020 #include "CalibCalorimetry/HcalAlgos/interface/HFRecalibration.h"
0021 #include "CalibCalorimetry/HcalAlgos/interface/HcalDbHardcode.h"
0022 #include "Geometry/Records/interface/HcalRecNumberingRecord.h"
0023 #include "CondFormats/DataRecord/interface/HcalAllRcds.h"
0024
0025 class ParameterSet;
0026
0027 class HcalPedestalsRcd;
0028 class HcalPedestalWidthsRcd;
0029 class HcalGainsRcd;
0030 class HcalGainWidthsRcd;
0031 class HcalPFCutsRcd;
0032 class HcalQIEDataRcd;
0033 class HcalQIETypesRcd;
0034 class HcalChannelQualityRcd;
0035 class HcalElectronicsMapRcd;
0036 class HcalRespCorrsRcd;
0037 class HcalZSThresholdsRcd;
0038 class HcalL1TriggerObjectsRcd;
0039 class HcalTimeCorrsRcd;
0040 class HcalLUTCorrsRcd;
0041 class HcalPFCorrsRcd;
0042 class HcalValidationCorrsRcd;
0043 class HcalLutMetadataRcd;
0044 class HcalDcsRcd;
0045 class HcalDcsMapRcd;
0046 class HcalRecoParamsRcd;
0047 class HcalLongRecoParamsRcd;
0048 class HcalZDCLowGainFractionsRcd;
0049 class HcalMCParamsRcd;
0050 class HcalFlagHFDigiTimeParamsRcd;
0051 class HcalTimingParamsRcd;
0052 class HcalFrontEndMapRcd;
0053 class HcalSiPMParametersRcd;
0054 class HcalSiPMCharacteristicsRcd;
0055 class HcalTPChannelParametersRcd;
0056 class HcalTPParaamersRcd;
0057
0058 class HcalHardcodeCalibrations : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder {
0059 public:
0060 HcalHardcodeCalibrations(const edm::ParameterSet&);
0061 ~HcalHardcodeCalibrations() override;
0062
0063 static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0064
0065 protected:
0066 void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0067 const edm::IOVSyncValue&,
0068 edm::ValidityInterval&) override;
0069
0070 std::unique_ptr<HcalPedestals> producePedestals_(const HcalPedestalsRcd& rcd,
0071 const edm::ESGetToken<HcalTopology, HcalRecNumberingRecord>&,
0072 const edm::ESGetToken<ZdcTopology, HcalRecNumberingRecord>&,
0073 bool eff);
0074 std::unique_ptr<HcalPedestalWidths> producePedestalWidths_(
0075 const HcalPedestalWidthsRcd& rcd,
0076 const edm::ESGetToken<HcalTopology, HcalRecNumberingRecord>&,
0077 const edm::ESGetToken<ZdcTopology, HcalRecNumberingRecord>&,
0078 bool eff);
0079 std::unique_ptr<HcalPedestals> producePedestals(const HcalPedestalsRcd& rcd);
0080 std::unique_ptr<HcalPedestalWidths> producePedestalWidths(const HcalPedestalWidthsRcd& rcd);
0081 std::unique_ptr<HcalPedestals> produceEffectivePedestals(const HcalPedestalsRcd& rcd);
0082 std::unique_ptr<HcalPedestalWidths> produceEffectivePedestalWidths(const HcalPedestalWidthsRcd& rcd);
0083 std::unique_ptr<HcalGains> produceGains(const HcalGainsRcd& rcd);
0084 std::unique_ptr<HcalGainWidths> produceGainWidths(const HcalGainWidthsRcd& rcd);
0085 std::unique_ptr<HcalPFCuts> producePFCuts(const HcalPFCutsRcd& rcd);
0086 std::unique_ptr<HcalQIEData> produceQIEData(const HcalQIEDataRcd& rcd);
0087 std::unique_ptr<HcalQIETypes> produceQIETypes(const HcalQIETypesRcd& rcd);
0088 std::unique_ptr<HcalChannelQuality> produceChannelQuality(const HcalChannelQualityRcd& rcd);
0089 std::unique_ptr<HcalElectronicsMap> produceElectronicsMap(const HcalElectronicsMapRcd& rcd);
0090
0091 std::unique_ptr<HcalRespCorrs> produceRespCorrs(const HcalRespCorrsRcd& rcd);
0092 std::unique_ptr<HcalZSThresholds> produceZSThresholds(const HcalZSThresholdsRcd& rcd);
0093 std::unique_ptr<HcalL1TriggerObjects> produceL1TriggerObjects(const HcalL1TriggerObjectsRcd& rcd);
0094 std::unique_ptr<HcalTimeCorrs> produceTimeCorrs(const HcalTimeCorrsRcd& rcd);
0095 std::unique_ptr<HcalLUTCorrs> produceLUTCorrs(const HcalLUTCorrsRcd& rcd);
0096 std::unique_ptr<HcalPFCorrs> producePFCorrs(const HcalPFCorrsRcd& rcd);
0097
0098 std::unique_ptr<HcalValidationCorrs> produceValidationCorrs(const HcalValidationCorrsRcd& rcd);
0099 std::unique_ptr<HcalLutMetadata> produceLutMetadata(const HcalLutMetadataRcd& rcd);
0100 std::unique_ptr<HcalDcsValues> produceDcsValues(const HcalDcsRcd& rcd);
0101 std::unique_ptr<HcalDcsMap> produceDcsMap(const HcalDcsMapRcd& rcd);
0102
0103 std::unique_ptr<HcalRecoParams> produceRecoParams(const HcalRecoParamsRcd& rcd);
0104 std::unique_ptr<HcalTimingParams> produceTimingParams(const HcalTimingParamsRcd& rcd);
0105 std::unique_ptr<HcalLongRecoParams> produceLongRecoParams(const HcalLongRecoParamsRcd& rcd);
0106 std::unique_ptr<HcalZDCLowGainFractions> produceZDCLowGainFractions(const HcalZDCLowGainFractionsRcd& rcd);
0107
0108 std::unique_ptr<HcalMCParams> produceMCParams(const HcalMCParamsRcd& rcd);
0109 std::unique_ptr<HcalFlagHFDigiTimeParams> produceFlagHFDigiTimeParams(const HcalFlagHFDigiTimeParamsRcd& rcd);
0110
0111 std::unique_ptr<HcalFrontEndMap> produceFrontEndMap(const HcalFrontEndMapRcd& rcd);
0112
0113 std::unique_ptr<HcalSiPMParameters> produceSiPMParameters(const HcalSiPMParametersRcd& rcd);
0114 std::unique_ptr<HcalSiPMCharacteristics> produceSiPMCharacteristics(const HcalSiPMCharacteristicsRcd& rcd);
0115 std::unique_ptr<HcalTPChannelParameters> produceTPChannelParameters(const HcalTPChannelParametersRcd& rcd);
0116 std::unique_ptr<HcalTPParameters> produceTPParameters(const HcalTPParametersRcd& rcd);
0117
0118 private:
0119 enum {
0120 kPedestals,
0121 kPedestalWidths,
0122 kEffectivePedestals,
0123 kEffectivePedestalWidths,
0124 kGains,
0125 kGainWidths,
0126 kPFCuts,
0127 kQIEData,
0128 kQIETypes,
0129 kChannelQuality,
0130 kRespCorrs,
0131 kLUTCorrs,
0132 kPFCorrs,
0133 kTimeCorrs,
0134 kZSThresholds,
0135 kL1TriggerObjects,
0136 kElectronicsMap,
0137 kValidationCorrs,
0138 kLutMetadata,
0139 kRecoParams,
0140 kTimingParams,
0141 kLongRecoParams,
0142 kZDCLowGainFractions,
0143 kMCParams,
0144 kFlagHFDigiTimeParams,
0145 kFrontEndMap,
0146 kSiPMParameters,
0147 kTPChannelParameters
0148 };
0149 HcalDbHardcode dbHardcode;
0150 double iLumi;
0151 std::unique_ptr<HBHERecalibration> hb_recalibration;
0152 std::unique_ptr<HBHERecalibration> he_recalibration;
0153 std::unique_ptr<HFRecalibration> hf_recalibration;
0154 std::unordered_map<int, edm::ESGetToken<HcalTopology, HcalRecNumberingRecord>> topoTokens_;
0155 std::unordered_map<int, edm::ESGetToken<ZdcTopology, HcalRecNumberingRecord>> zdcTopoTokens_;
0156 edm::ESGetToken<HBHEDarkening, HBHEDarkeningRecord> heDarkeningToken_;
0157 edm::ESGetToken<HBHEDarkening, HBHEDarkeningRecord> hbDarkeningToken_;
0158 bool switchGainWidthsForTrigPrims;
0159 bool setHEdsegm;
0160 bool setHBdsegm;
0161 bool useLayer0Weight;
0162 bool useIeta18depth1;
0163 bool testHEPlan1;
0164 };