File indexing completed on 2024-04-06 11:58:03
0001
0002
0003
0004
0005 #ifndef CalibCalorimetry_EcalPlugins_EcalTrivialConditionRetriever_H
0006 #define CalibCalorimetry_EcalPlugins_EcalTrivialConditionRetriever_H
0007
0008 #include <string>
0009 #include <vector>
0010
0011
0012 #include "FWCore/Framework/interface/ESProducer.h"
0013 #include "FWCore/Framework/interface/EventSetupRecordIntervalFinder.h"
0014
0015 #include "CondFormats/EcalObjects/interface/EcalPedestals.h"
0016 #include "CondFormats/DataRecord/interface/EcalPedestalsRcd.h"
0017
0018 #include "CondFormats/EcalObjects/interface/EcalDCSTowerStatus.h"
0019 #include "CondFormats/DataRecord/interface/EcalDCSTowerStatusRcd.h"
0020 #include "CondFormats/EcalObjects/interface/EcalDAQTowerStatus.h"
0021 #include "CondFormats/DataRecord/interface/EcalDAQTowerStatusRcd.h"
0022
0023 #include "CondFormats/EcalObjects/interface/EcalXtalGroupId.h"
0024 #include "CondFormats/EcalObjects/interface/EcalWeightXtalGroups.h"
0025 #include "CondFormats/DataRecord/interface/EcalWeightXtalGroupsRcd.h"
0026
0027 #include "CondFormats/EcalObjects/interface/EcalWeight.h"
0028 #include "CondFormats/EcalObjects/interface/EcalWeightSet.h"
0029 #include "CondFormats/EcalObjects/interface/EcalTBWeights.h"
0030 #include "CondFormats/DataRecord/interface/EcalTBWeightsRcd.h"
0031
0032 #include "CondFormats/EcalObjects/interface/EcalLinearCorrections.h"
0033 #include "CondFormats/DataRecord/interface/EcalLinearCorrectionsRcd.h"
0034
0035 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstants.h"
0036 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsRcd.h"
0037
0038 #include "CondFormats/EcalObjects/interface/EcalIntercalibConstantsMC.h"
0039 #include "CondFormats/DataRecord/interface/EcalIntercalibConstantsMCRcd.h"
0040
0041 #include "CondFormats/EcalObjects/interface/EcalIntercalibErrors.h"
0042 #include "CondFormats/DataRecord/interface/EcalIntercalibErrorsRcd.h"
0043
0044 #include "CondFormats/EcalObjects/interface/EcalTimeCalibConstants.h"
0045 #include "CondFormats/DataRecord/interface/EcalTimeCalibConstantsRcd.h"
0046
0047 #include "CondFormats/EcalObjects/interface/EcalTimeCalibErrors.h"
0048 #include "CondFormats/DataRecord/interface/EcalTimeCalibErrorsRcd.h"
0049
0050 #include "CondFormats/EcalObjects/interface/EcalTimeOffsetConstant.h"
0051 #include "CondFormats/DataRecord/interface/EcalTimeOffsetConstantRcd.h"
0052
0053 #include "CondFormats/EcalObjects/interface/EcalMGPAGainRatio.h"
0054 #include "CondFormats/EcalObjects/interface/EcalGainRatios.h"
0055 #include "CondFormats/DataRecord/interface/EcalGainRatiosRcd.h"
0056
0057 #include "CondFormats/EcalObjects/interface/EcalADCToGeVConstant.h"
0058 #include "CondFormats/DataRecord/interface/EcalADCToGeVConstantRcd.h"
0059
0060 #include "CondFormats/EcalObjects/interface/EcalLaserAlphas.h"
0061 #include "CondFormats/DataRecord/interface/EcalLaserAlphasRcd.h"
0062
0063 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatiosRef.h"
0064 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRefRcd.h"
0065
0066 #include "CondFormats/EcalObjects/interface/EcalLaserAPDPNRatios.h"
0067 #include "CondFormats/DataRecord/interface/EcalLaserAPDPNRatiosRcd.h"
0068
0069 #include "CondFormats/EcalObjects/interface/EcalChannelStatus.h"
0070 #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
0071
0072 #include "CondFormats/EcalObjects/interface/EcalDQMChannelStatus.h"
0073 #include "CondFormats/DataRecord/interface/EcalDQMChannelStatusRcd.h"
0074 #include "CondFormats/EcalObjects/interface/EcalDQMTowerStatus.h"
0075 #include "CondFormats/DataRecord/interface/EcalDQMTowerStatusRcd.h"
0076
0077 #include "CondFormats/EcalObjects/interface/EcalClusterLocalContCorrParameters.h"
0078 #include "CondFormats/EcalObjects/interface/EcalClusterCrackCorrParameters.h"
0079 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionParameters.h"
0080 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyUncertaintyParameters.h"
0081 #include "CondFormats/EcalObjects/interface/EcalClusterEnergyCorrectionObjectSpecificParameters.h"
0082 #include "CondFormats/DataRecord/interface/EcalClusterLocalContCorrParametersRcd.h"
0083 #include "CondFormats/DataRecord/interface/EcalClusterCrackCorrParametersRcd.h"
0084 #include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionParametersRcd.h"
0085 #include "CondFormats/DataRecord/interface/EcalClusterEnergyUncertaintyParametersRcd.h"
0086 #include "CondFormats/DataRecord/interface/EcalClusterEnergyCorrectionObjectSpecificParametersRcd.h"
0087 #include "CondFormats/EcalObjects/interface/EcalTPGCrystalStatus.h"
0088 #include "CondFormats/DataRecord/interface/EcalTPGCrystalStatusRcd.h"
0089 #include "CondFormats/EcalObjects/interface/EcalMappingElectronics.h"
0090 #include "CondFormats/DataRecord/interface/EcalMappingElectronicsRcd.h"
0091 #include "CondFormats/EcalObjects/interface/EcalPFRecHitThresholds.h"
0092 #include "CondFormats/DataRecord/interface/EcalPFRecHitThresholdsRcd.h"
0093
0094 #include "FWCore/Framework/interface/IOVSyncValue.h"
0095
0096 #include "CondFormats/Alignment/interface/Alignments.h"
0097 #include "CondFormats/AlignmentRecord/interface/EBAlignmentRcd.h"
0098 #include "CondFormats/AlignmentRecord/interface/EEAlignmentRcd.h"
0099 #include "CondFormats/AlignmentRecord/interface/ESAlignmentRcd.h"
0100
0101 #include "CondFormats/EcalObjects/interface/EcalSampleMask.h"
0102 #include "CondFormats/DataRecord/interface/EcalSampleMaskRcd.h"
0103
0104 #include "CondFormats/EcalObjects/interface/EcalTimeBiasCorrections.h"
0105 #include "CondFormats/DataRecord/interface/EcalTimeBiasCorrectionsRcd.h"
0106
0107 #include "CondFormats/EcalObjects/interface/EcalSamplesCorrelation.h"
0108 #include "CondFormats/DataRecord/interface/EcalSamplesCorrelationRcd.h"
0109
0110 #include "CondFormats/EcalObjects/interface/EcalSimComponentShape.h"
0111 #include "CondFormats/DataRecord/interface/EcalSimComponentShapeRcd.h"
0112
0113 #include "CondFormats/EcalObjects/interface/EcalSimPulseShape.h"
0114 #include "CondFormats/DataRecord/interface/EcalSimPulseShapeRcd.h"
0115
0116 #include "SimG4CMS/Calo/interface/EnergyResolutionVsLumi.h"
0117 #include "SimG4CMS/Calo/interface/EvolutionECAL.h"
0118
0119 #include "DataFormats/EcalDigi/interface/EcalDataFrame.h"
0120
0121
0122 namespace edm {
0123 class ParameterSet;
0124 }
0125
0126 class EcalTrivialConditionRetriever : public edm::ESProducer, public edm::EventSetupRecordIntervalFinder {
0127 public:
0128 EcalTrivialConditionRetriever(const edm::ParameterSet& pset);
0129 EcalTrivialConditionRetriever(const EcalTrivialConditionRetriever&) = delete;
0130 const EcalTrivialConditionRetriever& operator=(const EcalTrivialConditionRetriever&) = delete;
0131 ~EcalTrivialConditionRetriever() override;
0132
0133
0134 virtual std::unique_ptr<EcalPedestals> produceEcalPedestals(const EcalPedestalsRcd&);
0135 virtual std::unique_ptr<EcalWeightXtalGroups> produceEcalWeightXtalGroups(const EcalWeightXtalGroupsRcd&);
0136 virtual std::unique_ptr<EcalLinearCorrections> produceEcalLinearCorrections(const EcalLinearCorrectionsRcd&);
0137 virtual std::unique_ptr<EcalIntercalibConstants> produceEcalIntercalibConstants(const EcalIntercalibConstantsRcd&);
0138 virtual std::unique_ptr<EcalIntercalibConstantsMC> produceEcalIntercalibConstantsMC(
0139 const EcalIntercalibConstantsMCRcd&);
0140 virtual std::unique_ptr<EcalIntercalibErrors> produceEcalIntercalibErrors(const EcalIntercalibErrorsRcd&);
0141 virtual std::unique_ptr<EcalTimeCalibConstants> produceEcalTimeCalibConstants(const EcalTimeCalibConstantsRcd&);
0142 virtual std::unique_ptr<EcalTimeCalibErrors> produceEcalTimeCalibErrors(const EcalTimeCalibErrorsRcd&);
0143 virtual std::unique_ptr<EcalGainRatios> produceEcalGainRatios(const EcalGainRatiosRcd&);
0144 virtual std::unique_ptr<EcalADCToGeVConstant> produceEcalADCToGeVConstant(const EcalADCToGeVConstantRcd&);
0145 virtual std::unique_ptr<EcalTBWeights> produceEcalTBWeights(const EcalTBWeightsRcd&);
0146 virtual std::unique_ptr<EcalIntercalibConstants> getIntercalibConstantsFromConfiguration(
0147 const EcalIntercalibConstantsRcd&);
0148 virtual std::unique_ptr<EcalIntercalibConstantsMC> getIntercalibConstantsMCFromConfiguration(
0149 const EcalIntercalibConstantsMCRcd&);
0150 virtual std::unique_ptr<EcalSimComponentShape> getEcalSimComponentShapeFromConfiguration(
0151 const EcalSimComponentShapeRcd&);
0152 virtual std::unique_ptr<EcalSimPulseShape> getEcalSimPulseShapeFromConfiguration(const EcalSimPulseShapeRcd&);
0153 virtual std::unique_ptr<EcalIntercalibErrors> getIntercalibErrorsFromConfiguration(const EcalIntercalibErrorsRcd&);
0154 virtual std::unique_ptr<EcalTimeCalibConstants> getTimeCalibConstantsFromConfiguration(
0155 const EcalTimeCalibConstantsRcd&);
0156 virtual std::unique_ptr<EcalTimeCalibErrors> getTimeCalibErrorsFromConfiguration(const EcalTimeCalibErrorsRcd&);
0157 virtual std::unique_ptr<EcalTimeOffsetConstant> produceEcalTimeOffsetConstant(const EcalTimeOffsetConstantRcd&);
0158
0159 virtual std::unique_ptr<EcalLaserAlphas> produceEcalLaserAlphas(const EcalLaserAlphasRcd&);
0160 virtual std::unique_ptr<EcalLaserAPDPNRatiosRef> produceEcalLaserAPDPNRatiosRef(const EcalLaserAPDPNRatiosRefRcd&);
0161 virtual std::unique_ptr<EcalLaserAPDPNRatios> produceEcalLaserAPDPNRatios(const EcalLaserAPDPNRatiosRcd&);
0162
0163 virtual std::unique_ptr<EcalClusterLocalContCorrParameters> produceEcalClusterLocalContCorrParameters(
0164 const EcalClusterLocalContCorrParametersRcd&);
0165 virtual std::unique_ptr<EcalClusterCrackCorrParameters> produceEcalClusterCrackCorrParameters(
0166 const EcalClusterCrackCorrParametersRcd&);
0167 virtual std::unique_ptr<EcalClusterEnergyCorrectionParameters> produceEcalClusterEnergyCorrectionParameters(
0168 const EcalClusterEnergyCorrectionParametersRcd&);
0169 virtual std::unique_ptr<EcalClusterEnergyUncertaintyParameters> produceEcalClusterEnergyUncertaintyParameters(
0170 const EcalClusterEnergyUncertaintyParametersRcd&);
0171 virtual std::unique_ptr<EcalClusterEnergyCorrectionObjectSpecificParameters>
0172 produceEcalClusterEnergyCorrectionObjectSpecificParameters(
0173 const EcalClusterEnergyCorrectionObjectSpecificParametersRcd&);
0174 virtual std::unique_ptr<EcalPFRecHitThresholds> produceEcalPFRecHitThresholds(const EcalPFRecHitThresholdsRcd&);
0175 virtual std::unique_ptr<EcalPFRecHitThresholds> getPFRecHitThresholdsFromConfiguration(
0176 const EcalPFRecHitThresholdsRcd&);
0177
0178 virtual std::unique_ptr<EcalChannelStatus> produceEcalChannelStatus(const EcalChannelStatusRcd&);
0179 virtual std::unique_ptr<EcalChannelStatus> getChannelStatusFromConfiguration(const EcalChannelStatusRcd&);
0180
0181 virtual std::unique_ptr<EcalTPGCrystalStatus> produceEcalTrgChannelStatus(const EcalTPGCrystalStatusRcd&);
0182 virtual std::unique_ptr<EcalTPGCrystalStatus> getTrgChannelStatusFromConfiguration(const EcalTPGCrystalStatusRcd&);
0183
0184 virtual std::unique_ptr<EcalDCSTowerStatus> produceEcalDCSTowerStatus(const EcalDCSTowerStatusRcd&);
0185 virtual std::unique_ptr<EcalDAQTowerStatus> produceEcalDAQTowerStatus(const EcalDAQTowerStatusRcd&);
0186 virtual std::unique_ptr<EcalDQMTowerStatus> produceEcalDQMTowerStatus(const EcalDQMTowerStatusRcd&);
0187 virtual std::unique_ptr<EcalDQMChannelStatus> produceEcalDQMChannelStatus(const EcalDQMChannelStatusRcd&);
0188
0189 virtual std::unique_ptr<EcalMappingElectronics> produceEcalMappingElectronics(const EcalMappingElectronicsRcd&);
0190 virtual std::unique_ptr<EcalMappingElectronics> getMappingFromConfiguration(const EcalMappingElectronicsRcd&);
0191
0192
0193
0194
0195 virtual std::unique_ptr<Alignments> produceEcalAlignmentEB(const EBAlignmentRcd&);
0196 virtual std::unique_ptr<Alignments> produceEcalAlignmentEE(const EEAlignmentRcd&);
0197 virtual std::unique_ptr<Alignments> produceEcalAlignmentES(const ESAlignmentRcd&);
0198
0199 virtual std::unique_ptr<EcalSampleMask> produceEcalSampleMask(const EcalSampleMaskRcd&);
0200
0201 virtual std::unique_ptr<EcalTimeBiasCorrections> produceEcalTimeBiasCorrections(const EcalTimeBiasCorrectionsRcd&);
0202
0203 virtual std::unique_ptr<EcalSamplesCorrelation> produceEcalSamplesCorrelation(const EcalSamplesCorrelationRcd&);
0204
0205 protected:
0206
0207 void setIntervalFor(const edm::eventsetup::EventSetupRecordKey&,
0208 const edm::IOVSyncValue&,
0209 edm::ValidityInterval&) override;
0210
0211 private:
0212 void getWeightsFromConfiguration(const edm::ParameterSet& ps);
0213
0214
0215 double adcToGeVEBConstant_;
0216 double adcToGeVEEConstant_;
0217
0218 double intercalibConstantMean_;
0219 double intercalibConstantSigma_;
0220
0221 double intercalibConstantMeanMC_;
0222 double intercalibConstantSigmaMC_;
0223
0224
0225 double intercalibErrorMean_;
0226
0227 double timeCalibConstantMean_;
0228 double timeCalibConstantSigma_;
0229 double timeCalibErrorMean_;
0230
0231 double timeOffsetEBConstant_;
0232 double timeOffsetEEConstant_;
0233
0234
0235 std::vector<double> localContCorrParameters_;
0236 std::vector<double> crackCorrParameters_;
0237 std::vector<double> energyCorrectionParameters_;
0238 std::vector<double> energyUncertaintyParameters_;
0239 std::vector<double> energyCorrectionObjectSpecificParameters_;
0240 double pfRecHitThresholdsNSigmas_;
0241 double pfRecHitThresholdsNSigmasHEta_;
0242 double pfRecHitThresholdsEB_;
0243 double pfRecHitThresholdsEE_;
0244
0245 double sim_pulse_shape_EB_thresh_;
0246 double sim_pulse_shape_EE_thresh_;
0247 double sim_pulse_shape_APD_thresh_;
0248 float sim_pulse_shape_TI_;
0249
0250 double laserAlphaMeanEER_higheta_;
0251 double laserAlphaMeanEEC_higheta_;
0252
0253 std::string pfRecHitFile_;
0254 std::string pfRecHitFileEE_;
0255
0256 std::string EELaserAlphaFile2_;
0257
0258
0259 double totLumi_;
0260 double instLumi_;
0261
0262
0263 double laserAlphaMean_;
0264 double laserAlphaSigma_;
0265 double laserAlphaMeanEBR_;
0266 double laserAlphaMeanEBC_;
0267 double laserAlphaMeanEER_;
0268 double laserAlphaMeanEEC_;
0269
0270 double laserAPDPNRefMean_;
0271 double laserAPDPNRefSigma_;
0272 double laserAPDPNMean_;
0273 double laserAPDPNSigma_;
0274 unsigned long laserAPDPNTime1_;
0275 unsigned long laserAPDPNTime2_;
0276 unsigned long laserAPDPNTime3_;
0277
0278 double linCorrMean_;
0279 double linCorrSigma_;
0280
0281 unsigned long linearTime1_;
0282 unsigned long linearTime2_;
0283 unsigned long linearTime3_;
0284
0285 double EBpedMeanX12_;
0286 double EBpedRMSX12_;
0287 double EBpedMeanX6_;
0288 double EBpedRMSX6_;
0289 double EBpedMeanX1_;
0290 double EBpedRMSX1_;
0291
0292 double EEpedMeanX12_;
0293 double EEpedRMSX12_;
0294 double EEpedMeanX6_;
0295 double EEpedRMSX6_;
0296 double EEpedMeanX1_;
0297 double EEpedRMSX1_;
0298
0299 double gainRatio12over6_;
0300 double gainRatio6over1_;
0301
0302 std::vector<ROOT::Math::SVector<double, EcalDataFrame::MAXSAMPLES> >
0303 amplWeights_;
0304 std::vector<ROOT::Math::SVector<double, EcalDataFrame::MAXSAMPLES> >
0305 amplWeightsAft_;
0306
0307 std::vector<ROOT::Math::SVector<double, EcalDataFrame::MAXSAMPLES> >
0308 pedWeights_;
0309 std::vector<ROOT::Math::SVector<double, EcalDataFrame::MAXSAMPLES> >
0310 pedWeightsAft_;
0311
0312 std::vector<ROOT::Math::SVector<double, EcalDataFrame::MAXSAMPLES> > jittWeights_;
0313 std::vector<ROOT::Math::SVector<double, EcalDataFrame::MAXSAMPLES> > jittWeightsAft_;
0314
0315 std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2Matrix_;
0316 std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2MatrixAft_;
0317
0318 std::string amplWeightsFile_;
0319 std::string amplWeightsAftFile_;
0320 std::string pedWeightsFile_;
0321 std::string pedWeightsAftFile_;
0322 std::string jittWeightsFile_;
0323 std::string jittWeightsAftFile_;
0324 std::string chi2MatrixFile_;
0325 std::string chi2MatrixAftFile_;
0326 std::string linearCorrectionsFile_;
0327 std::string intercalibConstantsFile_;
0328 std::string intercalibConstantsMCFile_;
0329 std::string intercalibErrorsFile_;
0330 std::string timeCalibConstantsFile_;
0331 std::string timeCalibErrorsFile_;
0332 std::string channelStatusFile_;
0333 std::string trgChannelStatusFile_;
0334 std::string mappingFile_;
0335 std::string EBAlignmentFile_;
0336 std::string EEAlignmentFile_;
0337 std::string ESAlignmentFile_;
0338 std::string EBLaserAlphaFile_;
0339 std::string EELaserAlphaFile_;
0340 unsigned int sampleMaskEB_;
0341 unsigned int sampleMaskEE_;
0342 std::vector<double> EBtimeCorrAmplitudeBins_;
0343 std::vector<double> EBtimeCorrShiftBins_;
0344 std::vector<double> EEtimeCorrAmplitudeBins_;
0345 std::vector<double> EEtimeCorrShiftBins_;
0346
0347 std::vector<double> EBG12samplesCorrelation_;
0348 std::vector<double> EBG6samplesCorrelation_;
0349 std::vector<double> EBG1samplesCorrelation_;
0350 std::vector<double> EEG12samplesCorrelation_;
0351 std::vector<double> EEG6samplesCorrelation_;
0352 std::vector<double> EEG1samplesCorrelation_;
0353 std::string SamplesCorrelationFile_;
0354 std::string EBSimPulseShapeFile_;
0355 std::string EESimPulseShapeFile_;
0356 std::string APDSimPulseShapeFile_;
0357 std::vector<std::string> EBSimComponentShapeFiles_;
0358
0359 int nTDCbins_;
0360
0361 bool getWeightsFromFile_;
0362 bool weightsForAsynchronousRunning_;
0363 bool producedEcalPedestals_;
0364 bool producedEcalWeights_;
0365 bool producedEcalLinearCorrections_;
0366 bool producedEcalIntercalibConstants_;
0367 bool producedEcalIntercalibConstantsMC_;
0368 bool producedEcalIntercalibErrors_;
0369 bool producedEcalTimeCalibConstants_;
0370 bool producedEcalTimeCalibErrors_;
0371 bool producedEcalTimeOffsetConstant_;
0372 bool producedEcalGainRatios_;
0373 bool producedEcalADCToGeVConstant_;
0374 bool producedEcalLaserCorrection_;
0375 bool producedEcalChannelStatus_;
0376 bool producedEcalDQMTowerStatus_;
0377 bool producedEcalDQMChannelStatus_;
0378 bool producedEcalDCSTowerStatus_;
0379 bool producedEcalDAQTowerStatus_;
0380 bool producedEcalTrgChannelStatus_;
0381 bool producedEcalClusterLocalContCorrParameters_;
0382 bool producedEcalClusterCrackCorrParameters_;
0383 bool producedEcalClusterEnergyCorrectionParameters_;
0384 bool producedEcalClusterEnergyUncertaintyParameters_;
0385 bool producedEcalClusterEnergyCorrectionObjectSpecificParameters_;
0386 bool producedEcalMappingElectronics_;
0387 bool producedEcalAlignmentEB_;
0388 bool producedEcalAlignmentEE_;
0389 bool producedEcalAlignmentES_;
0390 bool producedEcalSimComponentShape_;
0391 bool producedEcalSimPulseShape_;
0392 bool producedEcalPFRecHitThresholds_;
0393 bool getEBAlignmentFromFile_;
0394 bool getEEAlignmentFromFile_;
0395 bool getESAlignmentFromFile_;
0396
0397 bool getSimComponentShapeFromFile_;
0398 bool getSimPulseShapeFromFile_;
0399
0400 bool getLaserAlphaFromFileEB_;
0401 bool getLaserAlphaFromFileEE_;
0402 bool getLaserAlphaFromTypeEB_;
0403 bool getLaserAlphaFromTypeEE_;
0404 bool producedEcalSampleMask_;
0405 bool producedEcalTimeBiasCorrections_;
0406 bool producedEcalSamplesCorrelation_;
0407 bool getSamplesCorrelationFromFile_;
0408
0409 int verbose_;
0410 };
0411 #endif