Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-04 06:14:05

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