94 pfRecHitThresholdsNSigmasHEta_ = ps.
getUntrackedParameter<
double>(
"EcalPFRecHitThresholdNSigmasHEta", 1.0);
98 localContCorrParameters_ =
100 crackCorrParameters_ = ps.
getUntrackedParameter<std::vector<double> >(
"crackCorrParameters", std::vector<double>(0));
101 energyCorrectionParameters_ =
102 ps.
getUntrackedParameter<std::vector<double> >(
"energyCorrectionParameters", std::vector<double>(0));
103 energyUncertaintyParameters_ =
104 ps.
getUntrackedParameter<std::vector<double> >(
"energyUncertaintyParameters", std::vector<double>(0));
106 "energyCorrectionObjectSpecificParameters", std::vector<double>(0));
130 EBtimeCorrAmplitudeBins_ =
132 EBtimeCorrShiftBins_ = ps.
getUntrackedParameter<std::vector<double> >(
"EBtimeCorrShiftBins", std::vector<double>());
133 EEtimeCorrAmplitudeBins_ =
135 EEtimeCorrShiftBins_ = ps.
getUntrackedParameter<std::vector<double> >(
"EEtimeCorrShiftBins", std::vector<double>());
137 EBG12samplesCorrelation_ =
139 EBG6samplesCorrelation_ =
141 EBG1samplesCorrelation_ =
143 EEG12samplesCorrelation_ =
145 EEG6samplesCorrelation_ =
147 EEG1samplesCorrelation_ =
150 sim_pulse_shape_EB_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_EB_thresh");
151 sim_pulse_shape_EE_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_EE_thresh");
152 sim_pulse_shape_APD_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_APD_thresh");
163 edm::LogInfo(
" EcalTrivialConditionRetriever going to create conditions based on the damage due to ")
164 << totLumi_ <<
" fb-1 integrated luminosity";
167 if (weightsForAsynchronousRunning_) {
168 getWeightsFromFile_ =
true;
174 std::ostringstream
str;
176 if (!weightsForAsynchronousRunning_)
181 weightType =
str.str();
184 amplWeightsAftFile_ =
191 dataPath_ +
"timeWeightsAfterGainSwitch" + weightType);
196 amplWeights_.resize(nTDCbins_);
197 amplWeightsAft_.resize(nTDCbins_);
198 pedWeights_.resize(nTDCbins_);
199 pedWeightsAft_.resize(nTDCbins_);
200 jittWeights_.resize(nTDCbins_);
201 jittWeightsAft_.resize(nTDCbins_);
202 chi2Matrix_.resize(nTDCbins_);
203 chi2MatrixAft_.resize(nTDCbins_);
206 getWeightsFromConfiguration(ps);
212 producedEcalADCToGeVConstant_ = ps.
getUntrackedParameter<
bool>(
"producedEcalADCToGeVConstant",
true);
214 producedEcalMappingElectronics_ = ps.
getUntrackedParameter<
bool>(
"producedEcalMappingElectronics",
true);
217 if (producedEcalMappingElectronics_) {
218 if (!mappingFile_.empty()) {
223 findingRecord<EcalMappingElectronicsRcd>();
227 if (getEBAlignmentFromFile_) {
232 if (getEEAlignmentFromFile_) {
237 if (getESAlignmentFromFile_)
244 if (producedEcalPedestals_)
247 if (producedEcalWeights_) {
252 if (producedEcalGainRatios_)
255 if (producedEcalADCToGeVConstant_)
259 producedEcalTimeOffsetConstant_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeOffsetConstant",
true);
261 if (producedEcalTimeOffsetConstant_) {
263 findingRecord<EcalTimeOffsetConstantRcd>();
267 producedEcalLinearCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalLinearCorrections",
true);
270 if (producedEcalLinearCorrections_) {
271 if (!linearCorrectionsFile_.empty()) {
276 findingRecord<EcalLinearCorrectionsRcd>();
280 producedEcalIntercalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstants",
true);
285 if (producedEcalIntercalibConstants_) {
286 if (!intercalibConstantsFile_.empty()) {
291 findingRecord<EcalIntercalibConstantsRcd>();
294 producedEcalIntercalibConstantsMC_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstantsMC",
true);
296 if (producedEcalIntercalibConstantsMC_) {
297 if (!intercalibConstantsMCFile_.empty()) {
302 findingRecord<EcalIntercalibConstantsMCRcd>();
306 producedEcalIntercalibErrors_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibErrors",
true);
309 if (producedEcalIntercalibErrors_) {
310 if (!intercalibErrorsFile_.empty()) {
315 findingRecord<EcalIntercalibErrorsRcd>();
319 producedEcalTimeCalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeCalibConstants",
true);
322 if (producedEcalTimeCalibConstants_) {
323 if (!timeCalibConstantsFile_.empty()) {
328 findingRecord<EcalTimeCalibConstantsRcd>();
335 if (producedEcalTimeCalibErrors_) {
336 if (!timeCalibErrorsFile_.empty()) {
341 findingRecord<EcalTimeCalibErrorsRcd>();
345 getSimComponentShapeFromFile_ = ps.
getUntrackedParameter<
bool>(
"getSimComponentShapeFromFile",
false);
346 producedEcalSimComponentShape_ = ps.
getUntrackedParameter<
bool>(
"producedEcalSimComponentShape",
true);
347 std::vector<std::string> vComponentShapes;
348 EBSimComponentShapeFiles_ =
351 if (producedEcalSimComponentShape_) {
353 findingRecord<EcalSimComponentShapeRcd>();
363 if (producedEcalSimPulseShape_) {
365 findingRecord<EcalSimPulseShapeRcd>();
368 producedEcalPFRecHitThresholds_ = ps.
getUntrackedParameter<
bool>(
"producedEcalPFRecHitThresholds",
false);
374 if (producedEcalPFRecHitThresholds_) {
375 if (!pfRecHitFile_.empty()) {
380 findingRecord<EcalPFRecHitThresholdsRcd>();
384 producedEcalClusterLocalContCorrParameters_ =
386 producedEcalClusterCrackCorrParameters_ =
388 producedEcalClusterEnergyCorrectionParameters_ =
390 producedEcalClusterEnergyUncertaintyParameters_ =
392 producedEcalClusterEnergyCorrectionObjectSpecificParameters_ =
393 ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionObjectSpecificParameters",
false);
394 if (producedEcalClusterLocalContCorrParameters_) {
396 findingRecord<EcalClusterLocalContCorrParametersRcd>();
398 if (producedEcalClusterCrackCorrParameters_) {
400 findingRecord<EcalClusterCrackCorrParametersRcd>();
402 if (producedEcalClusterEnergyCorrectionParameters_) {
404 findingRecord<EcalClusterEnergyCorrectionParametersRcd>();
406 if (producedEcalClusterEnergyUncertaintyParameters_) {
408 findingRecord<EcalClusterEnergyUncertaintyParametersRcd>();
410 if (producedEcalClusterEnergyCorrectionObjectSpecificParameters_) {
412 findingRecord<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>();
417 if (producedEcalLaserCorrection_) {
420 findingRecord<EcalLaserAlphasRcd>();
425 edm::LogInfo(
" getLaserAlphaFromFileEB_ ") << getLaserAlphaFromFileEB_;
426 edm::LogInfo(
" getLaserAlphaFromFileEE_ ") << getLaserAlphaFromFileEE_;
427 edm::LogInfo(
" getLaserAlphaFromTypeEB_ ") << getLaserAlphaFromTypeEB_;
428 edm::LogInfo(
" getLaserAlphaFromTypeEE_ ") << getLaserAlphaFromTypeEE_;
429 if (getLaserAlphaFromFileEB_) {
431 "EBLaserAlphaFile", dataPath_ +
"EBLaserAlpha.txt");
433 if (getLaserAlphaFromFileEE_) {
435 "EELaserAlphaFile", dataPath_ +
"EELaserAlpha.txt");
437 if (getLaserAlphaFromTypeEB_) {
441 "EBLaserAlphaFile", dataPath_ +
"EBLaserAlpha.txt");
443 if (getLaserAlphaFromTypeEE_) {
452 dataPath_ +
"EELaserAlpha.txt");
454 "EELaserAlphaFile2", dataPath_ +
"EELaserAlpha2.txt");
457 findingRecord<EcalLaserAPDPNRatiosRefRcd>();
459 findingRecord<EcalLaserAPDPNRatiosRcd>();
466 if (producedEcalChannelStatus_) {
467 if (!channelStatusFile_.empty()) {
472 findingRecord<EcalChannelStatusRcd>();
475 producedEcalDQMChannelStatus_ = ps.
getUntrackedParameter<
bool>(
"producedEcalDQMChannelStatus",
true);
476 if (producedEcalDQMChannelStatus_) {
478 findingRecord<EcalDQMChannelStatusRcd>();
482 if (producedEcalDCSTowerStatus_) {
484 findingRecord<EcalDCSTowerStatusRcd>();
488 if (producedEcalDAQTowerStatus_) {
490 findingRecord<EcalDAQTowerStatusRcd>();
494 if (producedEcalDQMTowerStatus_) {
496 findingRecord<EcalDQMTowerStatusRcd>();
500 producedEcalTrgChannelStatus_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTrgChannelStatus",
true);
503 if (producedEcalTrgChannelStatus_) {
504 if (!trgChannelStatusFile_.empty()) {
509 findingRecord<EcalTPGCrystalStatusRcd>();
514 if (producedEcalAlignmentEB_) {
516 findingRecord<EBAlignmentRcd>();
519 if (producedEcalAlignmentEE_) {
521 findingRecord<EEAlignmentRcd>();
524 if (producedEcalAlignmentES_) {
526 findingRecord<ESAlignmentRcd>();
529 if (producedEcalPedestals_)
530 findingRecord<EcalPedestalsRcd>();
532 if (producedEcalWeights_) {
533 findingRecord<EcalWeightXtalGroupsRcd>();
534 findingRecord<EcalTBWeightsRcd>();
537 if (producedEcalGainRatios_)
538 findingRecord<EcalGainRatiosRcd>();
540 if (producedEcalADCToGeVConstant_)
541 findingRecord<EcalADCToGeVConstantRcd>();
544 if (producedEcalSampleMask_) {
546 findingRecord<EcalSampleMaskRcd>();
548 producedEcalTimeBiasCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeBiasCorrections",
false);
549 if (producedEcalTimeBiasCorrections_) {
551 findingRecord<EcalTimeBiasCorrectionsRcd>();
553 producedEcalSamplesCorrelation_ = ps.
getUntrackedParameter<
bool>(
"producedEcalSamplesCorrelation",
false);
554 if (producedEcalSamplesCorrelation_) {
556 findingRecord<EcalSamplesCorrelationRcd>();
557 getSamplesCorrelationFromFile_ = ps.
getUntrackedParameter<
bool>(
"getSamplesCorrelationFromFile",
false);
558 if (getSamplesCorrelationFromFile_) {
559 SamplesCorrelationFile_ =
574 edm::LogInfo(
"EcalTrivialConditionRetriever::setIntervalFor(): record key = ")
582 auto peds = std::make_unique<EcalPedestals>();
586 EBitem.mean_x1 = EBpedMeanX1_;
587 EBitem.rms_x1 = EBpedRMSX1_;
588 EBitem.mean_x6 = EBpedMeanX6_;
589 EBitem.rms_x6 = EBpedRMSX6_;
590 EBitem.mean_x12 = EBpedMeanX12_;
591 EBitem.rms_x12 = EBpedRMSX12_;
593 EEitem.mean_x1 = EEpedMeanX1_;
594 EEitem.rms_x1 = EEpedRMSX1_;
595 EEitem.mean_x6 = EEpedMeanX6_;
596 EEitem.rms_x6 = EEpedRMSX6_;
597 EEitem.mean_x12 = EEpedMeanX12_;
598 EEitem.rms_x12 = EEpedRMSX12_;
613 EBitem.rms_x1 = EBpedRMSX1_ * noisefactor;
614 EBitem.rms_x6 = EBpedRMSX6_ * noisefactor;
615 EBitem.rms_x12 = EBpedRMSX12_ * noisefactor;
623 peds->insert(std::make_pair(ebdetid.
rawId(), EBitem));
633 peds->insert(std::make_pair(eedetidpos.
rawId(), EEitem));
636 EEDetId eedetidneg(iX, iY, -1);
637 peds->insert(std::make_pair(eedetidneg.
rawId(), EEitem));
648 auto xtalGroups = std::make_unique<EcalWeightXtalGroups>();
658 xtalGroups->setValue(ebid.
rawId(), defaultGroupId);
668 xtalGroups->setValue(eedetidpos.
rawId(), defaultGroupId);
671 EEDetId eedetidneg(iX, iY, -1);
672 xtalGroups->setValue(eedetidneg.
rawId(), defaultGroupId);
681 auto ical = std::make_unique<EcalLinearCorrections>();
689 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
692 pairAPDPN.
p1 = linCorrMean_ +
r * linCorrSigma_;
693 pairAPDPN.
p2 = linCorrMean_ +
r * linCorrSigma_;
694 pairAPDPN.
p3 = linCorrMean_ +
r * linCorrSigma_;
695 ical->setValue(ebid, pairAPDPN);
704 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
708 pairAPDPN.
p1 = linCorrMean_ +
r * linCorrSigma_;
709 pairAPDPN.
p2 = linCorrMean_ +
r * linCorrSigma_;
710 pairAPDPN.
p3 = linCorrMean_ +
r * linCorrSigma_;
712 ical->setValue(eedetidpos, pairAPDPN);
716 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
717 EEDetId eedetidneg(iX, iY, -1);
720 pairAPDPN.
p1 = linCorrMean_ +
r1 * linCorrSigma_;
721 pairAPDPN.
p2 = linCorrMean_ +
r1 * linCorrSigma_;
722 pairAPDPN.
p3 = linCorrMean_ +
r1 * linCorrSigma_;
724 ical->setValue(eedetidneg, pairAPDPN);
731 for (
int i = 0;
i < 92;
i++) {
733 if (linearTime2_ == 0) {
738 if (linearTime3_ == 0) {
744 ical->setTime(
i, TimeStamp);
754 auto ical = std::make_unique<EcalPFRecHitThresholds>();
763 ical->setValue(ebid.
rawId(), pfRecHitThresholdsEB_);
773 ical->setValue(eedetidpos.
rawId(), pfRecHitThresholdsEE_);
776 EEDetId eedetidneg(iX, iY, -1);
777 ical->setValue(eedetidneg.
rawId(), pfRecHitThresholdsEE_);
789 auto ical = std::make_unique<EcalIntercalibConstants>();
798 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
799 ical->setValue(ebid.
rawId(), intercalibConstantMean_ +
r * intercalibConstantSigma_);
808 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
810 ical->setValue(eedetidpos.
rawId(), intercalibConstantMean_ +
r * intercalibConstantSigma_);
813 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
814 EEDetId eedetidneg(iX, iY, -1);
815 ical->setValue(eedetidneg.
rawId(), intercalibConstantMean_ +
r1 * intercalibConstantSigma_);
825 auto ical = std::make_unique<EcalIntercalibConstantsMC>();
834 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
835 ical->setValue(ebid.
rawId(), intercalibConstantMeanMC_ +
r * intercalibConstantSigmaMC_);
844 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
846 ical->setValue(eedetidpos.
rawId(), intercalibConstantMeanMC_ +
r * intercalibConstantSigmaMC_);
849 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
850 EEDetId eedetidneg(iX, iY, -1);
851 ical->setValue(eedetidneg.
rawId(), intercalibConstantMeanMC_ +
r1 * intercalibConstantSigmaMC_);
861 auto ical = std::make_unique<EcalIntercalibErrors>();
870 ical->setValue(ebid.
rawId(), intercalibErrorMean_);
880 ical->setValue(eedetidpos.
rawId(), intercalibErrorMean_);
883 EEDetId eedetidneg(iX, iY, -1);
884 ical->setValue(eedetidneg.
rawId(), intercalibErrorMean_);
894 auto ical = std::make_unique<EcalTimeCalibConstants>();
903 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
904 ical->setValue(ebid.
rawId(), timeCalibConstantMean_ +
r * timeCalibConstantSigma_);
913 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
915 ical->setValue(eedetidpos.
rawId(), timeCalibConstantMean_ +
r * timeCalibConstantSigma_);
918 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
919 EEDetId eedetidneg(iX, iY, -1);
920 ical->setValue(eedetidneg.
rawId(), timeCalibConstantMean_ +
r1 * timeCalibConstantSigma_);
930 auto ical = std::make_unique<EcalTimeCalibErrors>();
939 ical->setValue(ebid.
rawId(), timeCalibErrorMean_);
949 ical->setValue(eedetidpos.
rawId(), timeCalibErrorMean_);
952 EEDetId eedetidneg(iX, iY, -1);
953 ical->setValue(eedetidneg.
rawId(), timeCalibErrorMean_);
964 edm::LogInfo(
" EB ") << timeOffsetEBConstant_ <<
" EE " << timeOffsetEEConstant_;
965 return std::make_unique<EcalTimeOffsetConstant>(timeOffsetEBConstant_, timeOffsetEEConstant_);
969 auto gratio = std::make_unique<EcalGainRatios>();
972 gr.setGain6Over1(gainRatio6over1_);
980 gratio->setValue(ebid.
rawId(), gr);
990 gratio->setValue(eedetidpos.
rawId(), gr);
993 EEDetId eedetidneg(iX, iY, -1);
994 gratio->setValue(eedetidneg.
rawId(), gr);
1004 return std::make_unique<EcalADCToGeVConstant>(adcToGeVEBConstant_, adcToGeVEEConstant_);
1009 auto tbwgt = std::make_unique<EcalTBWeights>();
1016 for (
int itdc = 1; itdc <= nTDCbins_; ++itdc) {
1047 mat1.Place_in_row(amplWeights_[itdc - 1], 0, 0);
1048 mat1.Place_in_row(pedWeights_[itdc - 1], 1, 0);
1049 mat1.Place_in_row(jittWeights_[itdc - 1], 2, 0);
1052 mat2.Place_in_row(amplWeightsAft_[itdc - 1], 0, 0);
1053 mat2.Place_in_row(pedWeightsAft_[itdc - 1], 1, 0);
1054 mat2.Place_in_row(jittWeightsAft_[itdc - 1], 2, 0);
1060 mat3 = chi2Matrix_[itdc - 1];
1061 mat4 = chi2MatrixAft_[itdc - 1];
1083 tbwgt->setValue(std::make_pair(igrp, itdc), wgt);
1090 std::unique_ptr<EcalClusterLocalContCorrParameters>
1092 auto ipar = std::make_unique<EcalClusterLocalContCorrParameters>();
1093 for (
size_t i = 0;
i < localContCorrParameters_.size(); ++
i) {
1094 ipar->params().push_back(localContCorrParameters_[
i]);
1100 auto ipar = std::make_unique<EcalClusterCrackCorrParameters>();
1101 for (
size_t i = 0;
i < crackCorrParameters_.size(); ++
i) {
1102 ipar->params().push_back(crackCorrParameters_[
i]);
1106 std::unique_ptr<EcalClusterEnergyCorrectionParameters>
1109 auto ipar = std::make_unique<EcalClusterEnergyCorrectionParameters>();
1110 for (
size_t i = 0;
i < energyCorrectionParameters_.size(); ++
i) {
1111 ipar->params().push_back(energyCorrectionParameters_[
i]);
1115 std::unique_ptr<EcalClusterEnergyUncertaintyParameters>
1118 auto ipar = std::make_unique<EcalClusterEnergyUncertaintyParameters>();
1119 for (
size_t i = 0;
i < energyUncertaintyParameters_.size(); ++
i) {
1120 ipar->params().push_back(energyUncertaintyParameters_[
i]);
1124 std::unique_ptr<EcalClusterEnergyCorrectionObjectSpecificParameters>
1127 auto ipar = std::make_unique<EcalClusterEnergyCorrectionObjectSpecificParameters>();
1128 for (
size_t i = 0;
i < energyCorrectionObjectSpecificParameters_.size(); ++
i) {
1129 ipar->params().push_back(energyCorrectionObjectSpecificParameters_[
i]);
1314 auto ical = std::make_unique<EcalLaserAlphas>();
1317 if (getLaserAlphaFromTypeEB_) {
1319 int SMpos[36] = {-10, 4, -7, -16, 6, -9, 11, -17, 5, 18, 3, -8, 1, -3, -13, 14, -6, 2,
1320 15, -18, 8, 17, -2, 9, -1, 10, -5, 7, -12, -11, 16, -4, -15, -14, 12, 13};
1322 int SMCal[36] = {12, 17, 10, 1, 8, 4, 27, 20, 23, 25, 6, 34, 35, 15, 18, 30, 21, 9,
1323 24, 22, 13, 31, 26, 16, 2, 11, 5, 0, 29, 28, 14, 33, 32, 3, 7, 19};
1325 for (
int SMcons = 0; SMcons < 36; SMcons++) {
1326 int SM = SMpos[SMcons];
1331 if (SMCal[SM] != SMcons)
1332 edm::LogInfo(
" SM pb : read SM ") << SMcons <<
" SMpos " << SM <<
" SMCal " << SMCal[SM];
1336 int readSM,
pos, bar, bar2;
1338 for (
int SMcons = 0; SMcons < 36; SMcons++) {
1339 int SM = SMpos[SMcons];
1340 for (
int ic = 0; ic < 1700; ic++) {
1343 if (readSM != SMcons ||
pos != ic + 1)
1345 << readSM <<
" const SM " << SMcons <<
" read pos " <<
pos <<
" ic " << ic;
1349 if (bar == 33101 || bar == 30301)
1350 alpha = laserAlphaMeanEBR_;
1351 else if (bar == 33106) {
1353 alpha = laserAlphaMeanEBC_;
1356 << bar <<
" last " << bar2 <<
" read SM " << readSM <<
" read pos " <<
pos;
1357 alpha = laserAlphaMeanEBR_;
1360 ical->setValue(ebdetid,
alpha);
1369 }
else if (getLaserAlphaFromFileEB_) {
1371 edm::LogInfo(
"Laser alpha for EB will be taken from File");
1376 for (
int ic = 0; ic < 61200; ic++) {
1381 ical->setValue(ebid,
alpha);
1385 edm::LogInfo(
"I will print some alphas from the file... ieta/iphi/alpha ")
1401 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1402 ical->setValue(ebid, laserAlphaMean_ +
r * laserAlphaSigma_);
1411 int itype, iring, iyear;
1413 float las[2][140][6];
1415 if (getLaserAlphaFromTypeEE_) {
1419 for (
int i = 0;
i < 1681;
i++) {
1420 fRing >> itype >> iring >> iyear >>
laser;
1421 edm::LogInfo(
" ") << itype <<
" " << iring <<
" " << iyear <<
" " <<
laser << std::endl;
1422 las[itype][iring][iyear] =
laser;
1428 for (
int crystal = 0; crystal < 14648; crystal++) {
1429 int x,
y,
z, bid, bar, bar2;
1430 float LY,
alpha = 0;
1431 fEE >>
z >>
x >>
y >> LY >> bid >> bar >> bar2;
1432 if (x < 1 || x > 100 || y < 1 || y > 100)
1433 edm::LogInfo(
" wrong coordinates for barcode ") << bar <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1436 int iring = (
int)(
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5)) + 85);
1438 double eta = -
log(
tan(0.5 * atan(
sqrt((
x - 50.5) * (
x - 50.5) + (
y - 50.5) * (
y - 50.5)) * 2.98 / 328.)));
1440 if (bar == 33201 || (bar == 30399 && bar2 < 568)) {
1442 alpha = laserAlphaMeanEER_;
1444 double raggio = 50.5 -
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5));
1463 edm::LogInfo(
"R=") << raggio <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z <<
"eta=" <<
eta 1464 <<
" alpha=" <<
alpha <<
" R";
1466 }
else if ((bar == 33106 && bar2 > 2000 && bar2 < 4669) || (bar == 30399 && bar2 > 567)) {
1469 alpha = laserAlphaMeanEEC_;
1471 double raggio = 50.5 -
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5));
1477 float r =
sqrt((
x - 50.5) * (
x - 50.5) + (
y - 50.5) * (
y - 50.5));
1482 if (las[itype][iring][iyear] != 999) {
1483 alpha = 0.7312 + 0.2688 * las[itype][iring][iyear];
1488 edm::LogInfo(
"R=") << raggio <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z <<
"eta=" <<
eta 1489 <<
" alpha=" <<
alpha <<
" C";
1492 edm::LogInfo(
" problem with barcode ") << bar <<
" " << bar2 <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1493 alpha = laserAlphaMeanEER_;
1499 ical->setValue(eedetidpos,
alpha);
1503 edm::LogInfo(
" problem with EEDetId ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1506 edm::LogInfo(
"Number of inner SIC crystals with different alpha= ") << nxt;
1509 }
else if (getLaserAlphaFromFileEE_) {
1514 for (
int crystal = 0; crystal < 14648; crystal++) {
1518 if (x < 1 || x > 100 || y < 1 || y > 100 ||
z == 0 ||
z > 1 ||
z < -1) {
1519 edm::LogInfo(
"ERROR: wrong coordinates for crystal ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1520 edm::LogInfo(
" the format of the file should be z x y alpha ");
1524 ical->setValue(eedetidpos,
alpha);
1526 edm::LogInfo(
" problem with EEDetId ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1539 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1540 EEDetId eedetidpos(iX, iY, 1);
1541 ical->setValue(eedetidpos, laserAlphaMean_ +
r * laserAlphaSigma_);
1544 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1545 EEDetId eedetidneg(iX, iY, -1);
1546 ical->setValue(eedetidneg, laserAlphaMean_ +
r1 * laserAlphaSigma_);
1557 auto ical = std::make_unique<EcalLaserAPDPNRatiosRef>();
1564 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1565 ical->setValue(ebid, laserAPDPNRefMean_ +
r * laserAPDPNRefSigma_);
1574 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1575 EEDetId eedetidpos(iX, iY, 1);
1576 ical->setValue(eedetidpos, laserAPDPNRefMean_ +
r * laserAPDPNRefSigma_);
1580 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1581 EEDetId eedetidneg(iX, iY, -1);
1582 ical->setValue(eedetidneg, laserAPDPNRefMean_ +
r1 * laserAPDPNRefSigma_);
1596 auto ical = std::make_unique<EcalLaserAPDPNRatios>();
1610 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1613 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1614 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1615 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1616 ical->setValue(ebid, pairAPDPN);
1628 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1629 EEDetId eedetidpos(iX, iY, 1);
1631 double eta = -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
1637 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1638 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1639 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1640 ical->setValue(eedetidpos, pairAPDPN);
1644 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1645 EEDetId eedetidneg(iX, iY, -1);
1647 double eta = -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
1653 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1654 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1655 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1656 ical->setValue(eedetidneg, pairAPDPN);
1663 for (
int i = 0;
i < 92;
i++) {
1665 if (laserAPDPNTime2_ == 0) {
1670 if (laserAPDPNTime3_ == 0) {
1676 ical->setTime(
i, TimeStamp);
1683 std::vector<std::vector<double> > amplwgtv(nTDCbins_);
1685 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1686 std::vector<double> vampl;
1688 vampl.push_back(-0.33333);
1689 vampl.push_back(-0.33333);
1690 vampl.push_back(-0.33333);
1691 vampl.push_back(0.);
1692 vampl.push_back(0.);
1693 vampl.push_back(1.);
1694 vampl.push_back(0.);
1695 vampl.push_back(0.);
1696 vampl.push_back(0.);
1697 vampl.push_back(0.);
1699 }
else if (getWeightsFromFile_) {
1704 while (!amplFile.eof() && tdcBin < nTDCbins_) {
1705 for (
int j = 0;
j < 10; ++
j) {
1708 amplwgtv[tdcBin].push_back(
ww);
1712 assert(tdcBin == nTDCbins_);
1716 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1720 for (
int i = 0;
i < nTDCbins_;
i++) {
1723 for (std::vector<double>::const_iterator
it = amplwgtv[
i].
begin();
it != amplwgtv[
i].end(); ++
it) {
1724 (amplWeights_[
i])[
j] = *
it;
1729 std::vector<std::vector<double> > amplwgtvAftGain(nTDCbins_);
1731 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1732 std::vector<double> vamplAftGain;
1733 vamplAftGain.push_back(0.);
1734 vamplAftGain.push_back(0.);
1735 vamplAftGain.push_back(0.);
1736 vamplAftGain.push_back(0.);
1737 vamplAftGain.push_back(0.);
1738 vamplAftGain.push_back(1.);
1739 vamplAftGain.push_back(0.);
1740 vamplAftGain.push_back(0.);
1741 vamplAftGain.push_back(0.);
1742 vamplAftGain.push_back(0.);
1743 amplwgtvAftGain[0] = ps.
getUntrackedParameter<std::vector<double> >(
"amplWeightsAftGain", vamplAftGain);
1744 }
else if (getWeightsFromFile_) {
1746 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading amplitude weights aftre gain switch from file " 1750 while (!amplFile.eof() && tdcBin < nTDCbins_) {
1751 for (
int j = 0;
j < 10; ++
j) {
1754 amplwgtvAftGain[tdcBin].push_back(
ww);
1758 assert(tdcBin == nTDCbins_);
1761 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1765 for (
int i = 0;
i < nTDCbins_;
i++) {
1768 for (std::vector<double>::const_iterator
it = amplwgtvAftGain[
i].
begin();
it != amplwgtvAftGain[
i].end(); ++
it) {
1769 (amplWeightsAft_[
i])[
j] = *
it;
1776 std::vector<std::vector<double> > pedwgtv(nTDCbins_);
1778 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1779 std::vector<double> vped;
1780 vped.push_back(0.33333);
1781 vped.push_back(0.33333);
1782 vped.push_back(0.33333);
1791 }
else if (getWeightsFromFile_) {
1797 while (!pedFile.eof() && tdcBin < nTDCbins_) {
1798 for (
int j = 0;
j < 10; ++
j) {
1801 pedwgtv[tdcBin].push_back(
ww);
1805 assert(tdcBin == nTDCbins_);
1808 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1812 for (
int i = 0;
i < nTDCbins_;
i++) {
1815 for (std::vector<double>::const_iterator
it = pedwgtv[
i].
begin();
it != pedwgtv[
i].end(); ++
it) {
1816 (pedWeights_[
i])[
j] = *
it;
1821 std::vector<std::vector<double> > pedwgtvaft(nTDCbins_);
1823 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1824 std::vector<double> vped;
1836 }
else if (getWeightsFromFile_) {
1838 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading pedestal after gain switch weights from file " 1842 while (!pedFile.eof() && tdcBin < nTDCbins_) {
1843 for (
int j = 0;
j < 10; ++
j) {
1846 pedwgtvaft[tdcBin].push_back(
ww);
1850 assert(tdcBin == nTDCbins_);
1853 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1857 for (
int i = 0;
i < nTDCbins_;
i++) {
1860 for (std::vector<double>::const_iterator
it = pedwgtvaft[
i].
begin();
it != pedwgtvaft[
i].end(); ++
it) {
1861 (pedWeightsAft_[
i])[
j] = *
it;
1868 std::vector<std::vector<double> > jittwgtv(nTDCbins_);
1870 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1871 std::vector<double> vjitt;
1872 vjitt.push_back(0.04066309);
1873 vjitt.push_back(0.04066309);
1874 vjitt.push_back(0.04066309);
1875 vjitt.push_back(0.000);
1876 vjitt.push_back(1.325176);
1877 vjitt.push_back(-0.04997078);
1878 vjitt.push_back(-0.504338);
1879 vjitt.push_back(-0.5024844);
1880 vjitt.push_back(-0.3903718);
1881 vjitt.push_back(0.000);
1883 }
else if (getWeightsFromFile_) {
1889 while (!jittFile.eof() && tdcBin < nTDCbins_) {
1890 for (
int j = 0;
j < 10; ++
j) {
1893 jittwgtv[tdcBin].push_back(
ww);
1897 assert(tdcBin == nTDCbins_);
1900 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1904 for (
int i = 0;
i < nTDCbins_;
i++) {
1907 for (std::vector<double>::const_iterator
it = jittwgtv[
i].
begin();
it != jittwgtv[
i].end(); ++
it) {
1908 (jittWeights_[
i])[
j] = *
it;
1913 std::vector<std::vector<double> > jittwgtvaft(nTDCbins_);
1915 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1916 std::vector<double> vjitt;
1917 vjitt.push_back(0.);
1918 vjitt.push_back(0.);
1919 vjitt.push_back(0.);
1920 vjitt.push_back(0.);
1921 vjitt.push_back(1.097871);
1922 vjitt.push_back(-0.04551035);
1923 vjitt.push_back(-0.4159156);
1924 vjitt.push_back(-0.4185352);
1925 vjitt.push_back(-0.3367127);
1926 vjitt.push_back(0.);
1928 }
else if (getWeightsFromFile_) {
1930 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading jitter after gain switch weights from file " 1934 while (!jittFile.eof() && tdcBin < nTDCbins_) {
1935 for (
int j = 0;
j < 10; ++
j) {
1938 jittwgtvaft[tdcBin].push_back(
ww);
1942 assert(tdcBin == nTDCbins_);
1945 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1949 for (
int i = 0;
i < nTDCbins_;
i++) {
1952 for (std::vector<double>::const_iterator
it = jittwgtvaft[
i].
begin();
it != jittwgtvaft[
i].end(); ++
it) {
1953 (jittWeightsAft_[
i])[
j] = *
it;
1958 std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2Matrix(nTDCbins_);
1959 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1964 chi2Matrix[0](0, 0) = 0.694371;
1965 chi2Matrix[0](0, 1) = -0.305629;
1966 chi2Matrix[0](0, 2) = -0.305629;
1967 chi2Matrix[0](0, 3) = 0.;
1968 chi2Matrix[0](0, 4) = 0.;
1969 chi2Matrix[0](0, 5) = 0.;
1970 chi2Matrix[0](0, 6) = 0.;
1971 chi2Matrix[0](0, 7) = 0.;
1972 chi2Matrix[0](0, 8) = 0.;
1973 chi2Matrix[0](0, 9) = 0.;
1974 chi2Matrix[0](1, 0) = -0.305629;
1975 chi2Matrix[0](1, 1) = 0.694371;
1976 chi2Matrix[0](1, 2) = -0.305629;
1977 chi2Matrix[0](1, 3) = 0.;
1978 chi2Matrix[0](1, 4) = 0.;
1979 chi2Matrix[0](1, 5) = 0.;
1980 chi2Matrix[0](1, 6) = 0.;
1981 chi2Matrix[0](1, 7) = 0.;
1982 chi2Matrix[0](1, 8) = 0.;
1983 chi2Matrix[0](1, 9) = 0.;
1984 chi2Matrix[0](2, 0) = -0.305629;
1985 chi2Matrix[0](2, 1) = -0.305629;
1986 chi2Matrix[0](2, 2) = 0.694371;
1987 chi2Matrix[0](2, 3) = 0.;
1988 chi2Matrix[0](2, 4) = 0.;
1989 chi2Matrix[0](2, 5) = 0.;
1990 chi2Matrix[0](2, 6) = 0.;
1991 chi2Matrix[0](2, 7) = 0.;
1992 chi2Matrix[0](2, 8) = 0.;
1993 chi2Matrix[0](2, 9) = 0.;
1994 chi2Matrix[0](3, 0) = 0.;
1995 chi2Matrix[0](3, 1) = 0.;
1996 chi2Matrix[0](3, 2) = 0.;
1997 chi2Matrix[0](3, 3) = 0.;
1998 chi2Matrix[0](3, 4) = 0.;
1999 chi2Matrix[0](3, 5) = 0.;
2000 chi2Matrix[0](3, 6) = 0.;
2001 chi2Matrix[0](3, 7) = 0.;
2002 chi2Matrix[0](3, 8) = 0.;
2003 chi2Matrix[0](3, 9) = 0.;
2004 chi2Matrix[0](4, 0) = 0.;
2005 chi2Matrix[0](4, 1) = 0.;
2006 chi2Matrix[0](4, 2) = 0.;
2007 chi2Matrix[0](4, 3) = 0.;
2008 chi2Matrix[0](4, 4) = 0.8027116;
2009 chi2Matrix[0](4, 5) = -0.2517103;
2010 chi2Matrix[0](4, 6) = -0.2232882;
2011 chi2Matrix[0](4, 7) = -0.1716192;
2012 chi2Matrix[0](4, 8) = -0.1239006;
2013 chi2Matrix[0](4, 9) = 0.;
2014 chi2Matrix[0](5, 0) = 0.;
2015 chi2Matrix[0](5, 1) = 0.;
2016 chi2Matrix[0](5, 2) = 0.;
2017 chi2Matrix[0](5, 3) = 0.;
2018 chi2Matrix[0](5, 4) = -0.2517103;
2019 chi2Matrix[0](5, 5) = 0.6528964;
2020 chi2Matrix[0](5, 6) = -0.2972839;
2021 chi2Matrix[0](5, 7) = -0.2067162;
2022 chi2Matrix[0](5, 8) = -0.1230729;
2023 chi2Matrix[0](5, 9) = 0.;
2024 chi2Matrix[0](6, 0) = 0.;
2025 chi2Matrix[0](6, 1) = 0.;
2026 chi2Matrix[0](6, 2) = 0.;
2027 chi2Matrix[0](6, 3) = 0.;
2028 chi2Matrix[0](6, 4) = -0.2232882;
2029 chi2Matrix[0](6, 5) = -0.2972839;
2030 chi2Matrix[0](6, 6) = 0.7413607;
2031 chi2Matrix[0](6, 7) = -0.1883866;
2032 chi2Matrix[0](6, 8) = -0.1235052;
2033 chi2Matrix[0](6, 9) = 0.;
2034 chi2Matrix[0](7, 0) = 0.;
2035 chi2Matrix[0](7, 1) = 0.;
2036 chi2Matrix[0](7, 2) = 0.;
2037 chi2Matrix[0](7, 3) = 0.;
2038 chi2Matrix[0](7, 4) = -0.1716192;
2039 chi2Matrix[0](7, 5) = -0.2067162;
2040 chi2Matrix[0](7, 6) = -0.1883866;
2041 chi2Matrix[0](7, 7) = 0.844935;
2042 chi2Matrix[0](7, 8) = -0.124291;
2043 chi2Matrix[0](7, 9) = 0.;
2044 chi2Matrix[0](8, 0) = 0.;
2045 chi2Matrix[0](8, 1) = 0.;
2046 chi2Matrix[0](8, 2) = 0.;
2047 chi2Matrix[0](8, 3) = 0.;
2048 chi2Matrix[0](8, 4) = -0.1239006;
2049 chi2Matrix[0](8, 5) = -0.1230729;
2050 chi2Matrix[0](8, 6) = -0.1235052;
2051 chi2Matrix[0](8, 7) = -0.124291;
2052 chi2Matrix[0](8, 8) = 0.8749833;
2053 chi2Matrix[0](8, 9) = 0.;
2054 chi2Matrix[0](9, 0) = 0.;
2055 chi2Matrix[0](9, 1) = 0.;
2056 chi2Matrix[0](9, 2) = 0.;
2057 chi2Matrix[0](9, 3) = 0.;
2058 chi2Matrix[0](9, 4) = 0.;
2059 chi2Matrix[0](9, 5) = 0.;
2060 chi2Matrix[0](9, 6) = 0.;
2061 chi2Matrix[0](9, 7) = 0.;
2062 chi2Matrix[0](9, 8) = 0.;
2063 chi2Matrix[0](9, 9) = 0.;
2064 }
else if (getWeightsFromFile_) {
2070 while (!chi2MatrixFile.eof() && tdcBin < nTDCbins_) {
2072 for (
int j = 0;
j < 10; ++
j) {
2073 for (
int l = 0;
l < 10; ++
l) {
2075 chi2MatrixFile >>
ww;
2076 chi2Matrix[tdcBin](
j,
l) =
ww;
2081 assert(tdcBin == nTDCbins_);
2084 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2091 chi2Matrix_ = chi2Matrix;
2094 std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2MatrixAft(nTDCbins_);
2095 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
2100 chi2MatrixAft[0](0, 0) = 0.;
2101 chi2MatrixAft[0](0, 1) = 0.;
2102 chi2MatrixAft[0](0, 2) = 0.;
2103 chi2MatrixAft[0](0, 3) = 0.;
2104 chi2MatrixAft[0](0, 4) = 0.;
2105 chi2MatrixAft[0](0, 5) = 0.;
2106 chi2MatrixAft[0](0, 6) = 0.;
2107 chi2MatrixAft[0](0, 7) = 0.;
2108 chi2MatrixAft[0](0, 8) = 0.;
2109 chi2MatrixAft[0](0, 9) = 0.;
2110 chi2MatrixAft[0](1, 0) = 0.;
2111 chi2MatrixAft[0](1, 1) = 0.;
2112 chi2MatrixAft[0](1, 2) = 0.;
2113 chi2MatrixAft[0](1, 3) = 0.;
2114 chi2MatrixAft[0](1, 4) = 0.;
2115 chi2MatrixAft[0](1, 5) = 0.;
2116 chi2MatrixAft[0](1, 6) = 0.;
2117 chi2MatrixAft[0](1, 7) = 0.;
2118 chi2MatrixAft[0](1, 8) = 0.;
2119 chi2MatrixAft[0](1, 9) = 0.;
2120 chi2MatrixAft[0](2, 0) = 0.;
2121 chi2MatrixAft[0](2, 1) = 0.;
2122 chi2MatrixAft[0](2, 2) = 0.;
2123 chi2MatrixAft[0](2, 3) = 0.;
2124 chi2MatrixAft[0](2, 4) = 0.;
2125 chi2MatrixAft[0](2, 5) = 0.;
2126 chi2MatrixAft[0](2, 6) = 0.;
2127 chi2MatrixAft[0](2, 7) = 0.;
2128 chi2MatrixAft[0](2, 8) = 0.;
2129 chi2MatrixAft[0](2, 9) = 0.;
2130 chi2MatrixAft[0](3, 0) = 0.;
2131 chi2MatrixAft[0](3, 1) = 0.;
2132 chi2MatrixAft[0](3, 2) = 0.;
2133 chi2MatrixAft[0](3, 3) = 0.;
2134 chi2MatrixAft[0](3, 4) = 0.;
2135 chi2MatrixAft[0](3, 5) = 0.;
2136 chi2MatrixAft[0](3, 6) = 0.;
2137 chi2MatrixAft[0](3, 7) = 0.;
2138 chi2MatrixAft[0](3, 8) = 0.;
2139 chi2MatrixAft[0](3, 9) = 0.;
2140 chi2MatrixAft[0](4, 0) = 0.;
2141 chi2MatrixAft[0](4, 1) = 0.;
2142 chi2MatrixAft[0](4, 2) = 0.;
2143 chi2MatrixAft[0](4, 3) = 0.;
2144 chi2MatrixAft[0](4, 4) = 0.8030884;
2145 chi2MatrixAft[0](4, 5) = -0.2543541;
2146 chi2MatrixAft[0](4, 6) = -0.2243544;
2147 chi2MatrixAft[0](4, 7) = -0.1698177;
2148 chi2MatrixAft[0](4, 8) = -0.1194506;
2149 chi2MatrixAft[0](4, 9) = 0.;
2150 chi2MatrixAft[0](5, 0) = 0.;
2151 chi2MatrixAft[0](5, 1) = 0.;
2152 chi2MatrixAft[0](5, 2) = 0.;
2153 chi2MatrixAft[0](5, 3) = 0.;
2154 chi2MatrixAft[0](5, 4) = -0.2543541;
2155 chi2MatrixAft[0](5, 5) = 0.6714465;
2156 chi2MatrixAft[0](5, 6) = -0.2898025;
2157 chi2MatrixAft[0](5, 7) = -0.2193564;
2158 chi2MatrixAft[0](5, 8) = -0.1542964;
2159 chi2MatrixAft[0](5, 9) = 0.;
2160 chi2MatrixAft[0](6, 0) = 0.;
2161 chi2MatrixAft[0](6, 1) = 0.;
2162 chi2MatrixAft[0](6, 2) = 0.;
2163 chi2MatrixAft[0](6, 3) = 0.;
2164 chi2MatrixAft[0](6, 4) = -0.2243544;
2165 chi2MatrixAft[0](6, 5) = -0.2898025;
2166 chi2MatrixAft[0](6, 6) = 0.7443781;
2167 chi2MatrixAft[0](6, 7) = -0.1934846;
2168 chi2MatrixAft[0](6, 8) = -0.136098;
2169 chi2MatrixAft[0](6, 9) = 0.;
2170 chi2MatrixAft[0](7, 0) = 0.;
2171 chi2MatrixAft[0](7, 1) = 0.;
2172 chi2MatrixAft[0](7, 2) = 0.;
2173 chi2MatrixAft[0](7, 3) = 0.;
2174 chi2MatrixAft[0](7, 4) = -0.1698177;
2175 chi2MatrixAft[0](7, 5) = -0.2193564;
2176 chi2MatrixAft[0](7, 6) = -0.1934846;
2177 chi2MatrixAft[0](7, 7) = 0.8535482;
2178 chi2MatrixAft[0](7, 8) = -0.1030149;
2179 chi2MatrixAft[0](7, 9) = 0.;
2180 chi2MatrixAft[0](8, 0) = 0.;
2181 chi2MatrixAft[0](8, 1) = 0.;
2182 chi2MatrixAft[0](8, 2) = 0.;
2183 chi2MatrixAft[0](8, 3) = 0.;
2184 chi2MatrixAft[0](8, 4) = -0.1194506;
2185 chi2MatrixAft[0](8, 5) = -0.1542964;
2186 chi2MatrixAft[0](8, 6) = -0.136098;
2187 chi2MatrixAft[0](8, 7) = -0.1030149;
2188 chi2MatrixAft[0](8, 8) = 0.9275388;
2189 chi2MatrixAft[0](8, 9) = 0.;
2190 chi2MatrixAft[0](9, 0) = 0.;
2191 chi2MatrixAft[0](9, 1) = 0.;
2192 chi2MatrixAft[0](9, 2) = 0.;
2193 chi2MatrixAft[0](9, 3) = 0.;
2194 chi2MatrixAft[0](9, 4) = 0.;
2195 chi2MatrixAft[0](9, 5) = 0.;
2196 chi2MatrixAft[0](9, 6) = 0.;
2197 chi2MatrixAft[0](9, 7) = 0.;
2198 chi2MatrixAft[0](9, 8) = 0.;
2199 chi2MatrixAft[0](9, 9) = 0.;
2200 }
else if (getWeightsFromFile_) {
2206 while (!chi2MatrixAftFile.eof() && tdcBin < nTDCbins_) {
2208 for (
int j = 0;
j < 10; ++
j) {
2209 for (
int l = 0;
l < 10; ++
l) {
2211 chi2MatrixAftFile >>
ww;
2212 chi2MatrixAft[tdcBin](
j,
l) =
ww;
2217 assert(tdcBin == nTDCbins_);
2220 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2227 chi2MatrixAft_ = chi2MatrixAft;
2235 auto ecalStatus = std::make_unique<EcalChannelStatus>();
2246 ecalStatus->setValue(ebid, 0);
2255 EEDetId eedetidpos(iX, iY, 1);
2256 ecalStatus->setValue(eedetidpos, 0);
2259 EEDetId eedetidneg(iX, iY, -1);
2260 ecalStatus->setValue(eedetidneg, 0);
2270 if (!statusFile.good()) {
2271 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Problems opening file: " << channelStatusFile_;
2280 while (!statusFile.eof()) {
2281 statusFile >> EcalSubDet;
2283 std::getline(statusFile,
str);
2286 statusFile >> hashIndex >>
status;
2292 ecalStatus->setValue(ebid,
status);
2295 ecalStatus->setValue(eedetid,
status);
2297 edm::LogError(
"EcalTrivialConditionRetriever") <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2307 auto ical = std::make_unique<EcalChannelStatus>();
2315 ical->setValue(ebid, 0);
2324 EEDetId eedetidpos(iX, iY, 1);
2325 ical->setValue(eedetidpos, 0);
2328 EEDetId eedetidneg(iX, iY, -1);
2329 ical->setValue(eedetidneg, 0);
2341 auto ical = std::make_unique<EcalDQMChannelStatus>();
2349 ical->setValue(ebid, sta);
2358 EEDetId eedetidpos(iX, iY, 1);
2359 ical->setValue(eedetidpos, sta);
2362 EEDetId eedetidneg(iX, iY, -1);
2363 ical->setValue(eedetidneg, sta);
2373 auto ical = std::make_unique<EcalDQMTowerStatus>();
2379 for (
int k = 0;
k < 2;
k++) {
2384 for (
int i = 1;
i < 73;
i++) {
2385 for (
int j = 1;
j < 18;
j++) {
2389 ical->setValue(ebid, sta);
2396 for (
int k = 0;
k < 2;
k++) {
2401 for (
int i = 1;
i < 21;
i++) {
2402 for (
int j = 1;
j < 21;
j++) {
2405 ical->setValue(eeid, sta);
2417 auto ical = std::make_unique<EcalDCSTowerStatus>();
2423 for (
int k = 0;
k < 2;
k++) {
2428 for (
int i = 1;
i < 73;
i++) {
2429 for (
int j = 1;
j < 18;
j++) {
2433 ical->setValue(ebid,
status);
2440 for (
int k = 0;
k < 2;
k++) {
2445 for (
int i = 1;
i < 21;
i++) {
2446 for (
int j = 1;
j < 21;
j++) {
2449 ical->setValue(eeid,
status);
2461 auto ical = std::make_unique<EcalDAQTowerStatus>();
2467 for (
int k = 0;
k < 2;
k++) {
2472 for (
int i = 1;
i < 73;
i++) {
2473 for (
int j = 1;
j < 18;
j++) {
2477 ical->setValue(ebid,
status);
2484 for (
int k = 0;
k < 2;
k++) {
2489 for (
int i = 1;
i < 21;
i++) {
2490 for (
int j = 1;
j < 21;
j++) {
2493 ical->setValue(eeid,
status);
2505 auto ecalStatus = std::make_unique<EcalTPGCrystalStatus>();
2516 ecalStatus->setValue(ebid, 0);
2525 EEDetId eedetidpos(iX, iY, 1);
2526 ecalStatus->setValue(eedetidpos, 0);
2529 EEDetId eedetidneg(iX, iY, -1);
2530 ecalStatus->setValue(eedetidneg, 0);
2540 if (!statusFile.good()) {
2541 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Problems opening file: " << channelStatusFile_;
2550 while (!statusFile.eof()) {
2551 statusFile >> EcalSubDet;
2553 std::getline(statusFile,
str);
2556 statusFile >> hashIndex >>
status;
2562 ecalStatus->setValue(ebid,
status);
2565 ecalStatus->setValue(eedetid,
status);
2567 edm::LogError(
"EcalTrivialConditionRetriever") <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2578 auto ical = std::make_unique<EcalTPGCrystalStatus>();
2586 ical->setValue(ebid, 0);
2595 EEDetId eedetidpos(iX, iY, 1);
2596 ical->setValue(eedetidpos, 0);
2599 EEDetId eedetidneg(iX, iY, -1);
2600 ical->setValue(eedetidneg, 0);
2609 std::unique_ptr<EcalIntercalibConstants> ical;
2616 <<
"Reading intercalibration constants from file " << intercalibConstantsFile_.c_str();
2618 if (intercalibConstantsFile_.find(
".xml") != std::string::npos) {
2625 if (totLumi_ != 0 || instLumi_ != 0) {
2630 if (intercalibConstantsMCFile_.find(
".xml") != std::string::npos) {
2637 edm::LogInfo(
"please provide the xml file of the EcalIntercalibConstantsMC");
2640 TRandom3* gRandom =
new TRandom3();
2664 if (idref != mymap.
end())
2665 icalconstant = (*idref);
2669 if (idrefMC != mymapMC.
end())
2670 icalconstantMC = (*idrefMC);
2675 edm::LogInfo(
"EB at eta=") <<
eta <<
" IC=" << icalconstant <<
" ICMC=" << icalconstantMC
2676 <<
" smear=" <<
r <<
" ";
2678 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2685 if (icalconstant != icalconstant2)
2695 EEDetId eedetidpos(iX, iY, 1);
2697 -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
2705 if (idref != mymap.
end())
2706 icalconstant = (*idref);
2710 if (idrefMC != mymapMC.
end())
2711 icalconstantMC = (*idrefMC);
2716 edm::LogInfo(
"EE at eta=") <<
eta <<
" IC=" << icalconstant <<
" ICMC=" << icalconstantMC
2717 <<
" smear=" <<
r <<
" ";
2718 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2724 EEDetId eedetidneg(iX, iY, -1);
2726 -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
2733 if (idrefMC != mymapMC.
end())
2734 icalconstantMC = (*idrefMC);
2737 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2743 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2749 ical = std::make_unique<EcalIntercalibConstants>();
2752 inpFile = fopen(intercalibConstantsFile_.c_str(),
"r");
2754 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << intercalibConstantsFile_;
2755 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
2759 std::ostringstream
str;
2760 fgets(
line, 255, inpFile);
2761 int sm_number = atoi(
line);
2762 str <<
"sm: " << sm_number;
2764 fgets(
line, 255, inpFile);
2767 fgets(
line, 255, inpFile);
2769 str <<
"gen tag: " << gen_tag;
2771 fgets(
line, 255, inpFile);
2773 str <<
"cali method: " << cali_method << std::endl;
2775 fgets(
line, 255, inpFile);
2777 str <<
"cali version: " << cali_version << std::endl;
2779 fgets(
line, 255, inpFile);
2781 str <<
"cali type: " << cali_type;
2783 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"[PIETRO] Intercalibration file - " <<
str.str();
2785 float calib[1700] = {1};
2786 int calib_status[1700] = {0};
2790 while (fgets(
line, 255, inpFile)) {
2793 float dmy_calib = 0.;
2797 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
2800 calib[dmy_num - 1] = dmy_calib;
2801 calib_status[dmy_num - 1] = dmy_status;
2813 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " <<
ii <<
" xtals ";
2815 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
2823 for (
int i = 0;
i < 1700;
i++) {
2833 if (calib_status[
i])
2836 ical->setValue(ebid.
rawId(), 1.);
2849 std::unique_ptr<EcalPFRecHitThresholds> ical;
2857 ical = std::make_unique<EcalPFRecHitThresholds>();
2863 edm::LogInfo(
"Going to multiply the sigmas by ") << pfRecHitThresholdsNSigmas_;
2866 while (!PFRecHitsFile.eof()) {
2879 <<
" thresh: " <<
thresh;
2886 PFRecHitsFile.close();
2893 edm::LogInfo(
"We will multiply the sigma in EE by ") << pfRecHitThresholdsNSigmas_;
2894 edm::LogInfo(
"We will multiply the sigma in EE at high eta by") << pfRecHitThresholdsNSigmasHEta_;
2903 while (!PFRecHitsFileEE.eof()) {
2913 -
log(
tan(0.5 * atan(
sqrt((
ix - 50.5) * (
ix - 50.5) + (
iy - 50.5) * (
iy - 50.5)) * 2.98 / 328.)));
2929 PFRecHitsFileEE.close();
2939 std::unique_ptr<EcalIntercalibConstantsMC> ical;
2946 <<
"Reading intercalibration constants MC from file " << intercalibConstantsMCFile_.c_str();
2948 if (intercalibConstantsMCFile_.find(
".xml") != std::string::npos) {
2949 edm::LogInfo(
"generating Intercalib MC from xml file");
2955 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2966 auto ical = std::make_unique<EcalIntercalibErrors>();
2972 <<
"Reading intercalibration constants from file " << intercalibErrorsFile_.c_str();
2975 inpFile = fopen(intercalibErrorsFile_.c_str(),
"r");
2977 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << intercalibErrorsFile_;
2978 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
2982 std::ostringstream
str;
2983 fgets(
line, 255, inpFile);
2984 int sm_number = atoi(
line);
2985 str <<
"sm: " << sm_number;
2987 fgets(
line, 255, inpFile);
2990 fgets(
line, 255, inpFile);
2992 str <<
"gen tag: " << gen_tag;
2994 fgets(
line, 255, inpFile);
2996 str <<
"cali method: " << cali_method << std::endl;
2998 fgets(
line, 255, inpFile);
3000 str <<
"cali version: " << cali_version << std::endl;
3002 fgets(
line, 255, inpFile);
3004 str <<
"cali type: " << cali_type;
3006 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"[PIETRO] Intercalibration file - " <<
str.str() << std::endl;
3008 float calib[1700] = {1};
3009 int calib_status[1700] = {0};
3013 while (fgets(
line, 255, inpFile)) {
3016 float dmy_calib = 0.;
3020 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3023 calib[dmy_num - 1] = dmy_calib;
3024 calib_status[dmy_num - 1] = dmy_status;
3036 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " <<
ii <<
" xtals ";
3038 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3046 for (
int i = 0;
i < 1700;
i++) {
3056 if (calib_status[
i])
3059 ical->setValue(ebid.
rawId(), 1.);
3072 auto ical = std::make_unique<EcalTimeCalibConstants>();
3078 <<
"Reading time calibration constants from file " << timeCalibConstantsFile_.c_str();
3081 inpFile = fopen(timeCalibConstantsFile_.c_str(),
"r");
3083 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << timeCalibConstantsFile_;
3084 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
3088 std::ostringstream
str;
3089 fgets(
line, 255, inpFile);
3090 int sm_number = atoi(
line);
3091 str <<
"sm: " << sm_number;
3093 fgets(
line, 255, inpFile);
3096 fgets(
line, 255, inpFile);
3098 str <<
"gen tag: " << gen_tag;
3100 fgets(
line, 255, inpFile);
3102 str <<
"cali method: " << cali_method << std::endl;
3104 fgets(
line, 255, inpFile);
3106 str <<
"cali version: " << cali_version << std::endl;
3108 fgets(
line, 255, inpFile);
3110 str <<
"cali type: " << cali_type;
3112 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"TimeCalibration file - " <<
str.str() << std::endl;
3114 float calib[1700] = {1};
3115 int calib_status[1700] = {0};
3119 while (fgets(
line, 255, inpFile)) {
3122 float dmy_calib = 0.;
3126 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3129 calib[dmy_num - 1] = dmy_calib;
3130 calib_status[dmy_num - 1] = dmy_status;
3142 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read timeCalibrations for " <<
ii <<
" xtals ";
3144 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3152 for (
int i = 0;
i < 1700;
i++) {
3162 if (calib_status[
i])
3165 ical->setValue(ebid.
rawId(), 1.);
3176 auto ical = std::make_unique<EcalTimeCalibErrors>();
3182 <<
"Reading timeCalibration constants from file " << timeCalibErrorsFile_.c_str();
3185 inpFile = fopen(timeCalibErrorsFile_.c_str(),
"r");
3187 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << timeCalibErrorsFile_;
3188 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
3192 std::ostringstream
str;
3193 fgets(
line, 255, inpFile);
3194 int sm_number = atoi(
line);
3195 str <<
"sm: " << sm_number;
3197 fgets(
line, 255, inpFile);
3200 fgets(
line, 255, inpFile);
3202 str <<
"gen tag: " << gen_tag;
3204 fgets(
line, 255, inpFile);
3206 str <<
"cali method: " << cali_method << std::endl;
3208 fgets(
line, 255, inpFile);
3210 str <<
"cali version: " << cali_version << std::endl;
3212 fgets(
line, 255, inpFile);
3214 str <<
"cali type: " << cali_type;
3216 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"TimeCalibration file - " <<
str.str() << std::endl;
3218 float calib[1700] = {1};
3219 int calib_status[1700] = {0};
3223 while (fgets(
line, 255, inpFile)) {
3226 float dmy_calib = 0.;
3230 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3233 calib[dmy_num - 1] = dmy_calib;
3234 calib_status[dmy_num - 1] = dmy_status;
3246 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read time calibrations for " <<
ii <<
" xtals ";
3248 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3256 for (
int i = 0;
i < 1700;
i++) {
3266 if (calib_status[
i])
3269 ical->setValue(ebid.
rawId(), 1.);
3282 auto mapping = std::make_unique<EcalMappingElectronics>();
3288 edm::LogError(
"EcalTrivialConditionRetriever") <<
"File not found";
3297 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
3298 int tccid,
tower, pseudostrip_in_TCC, pseudostrip_in_TT;
3302 f >>
ix >>
iy >> iz >>
CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >>
tower >>
3303 pseudostrip_in_TCC >> pseudostrip_in_TT;
3310 EcalElectronicsId elecid(dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
3316 (*mapping).setValue(
detid, aElement);
3325 auto ical = std::make_unique<EcalMappingElectronics>();
3332 double mytrans[3] = {0., 0., 0.};
3333 double myeuler[3] = {0., 0., 0.};
3335 if (getEBAlignmentFromFile_)
3337 std::vector<AlignTransform> my_align;
3340 for (
int SM = 1; SM < 37; SM++) {
3343 iphi = 1 + (SM - 19) * 20;
3348 if (getEBAlignmentFromFile_) {
3349 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3350 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3351 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3353 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3354 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3380 a.m_align = my_align;
3382 return std::make_unique<Alignments>(
a);
3386 double mytrans[3] = {0., 0., 0.};
3387 double myeuler[3] = {0., 0., 0.};
3389 if (getEEAlignmentFromFile_)
3391 std::vector<AlignTransform> my_align;
3395 for (
int Dee = 0; Dee < 4; Dee++) {
3397 if (Dee == 1 || Dee == 3)
3404 if (getEEAlignmentFromFile_) {
3405 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3406 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3407 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3409 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3410 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3415 a.m_align = my_align;
3416 return std::make_unique<Alignments>(
a);
3420 double mytrans[3] = {0., 0., 0.};
3421 double myeuler[3] = {0., 0., 0.};
3423 if (getESAlignmentFromFile_)
3425 std::vector<AlignTransform> my_align;
3427 int pl_vect[10] = {2, 2, 1, 1, 1, 1, 2, 2};
3433 int ix = 10 + (
layer % 2) * 20;
3434 int plane = pl_vect[
layer];
3438 if (getESAlignmentFromFile_) {
3439 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3440 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3441 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3443 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3444 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3449 a.m_align = my_align;
3450 return std::make_unique<Alignments>(
a);
3454 return std::make_unique<EcalSampleMask>(sampleMaskEB_, sampleMaskEE_);
3459 auto ipar = std::make_unique<EcalTimeBiasCorrections>();
3460 copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(), back_inserter(ipar->EBTimeCorrAmplitudeBins));
3461 copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(), back_inserter(ipar->EBTimeCorrShiftBins));
3462 copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(), back_inserter(ipar->EETimeCorrAmplitudeBins));
3463 copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(), back_inserter(ipar->EETimeCorrShiftBins));
3469 if (getSamplesCorrelationFromFile_) {
3473 for (
int j = 0;
j < 10; ++
j) {
3475 EBG12samplesCorrelation_.push_back(
ww);
3477 for (
int j = 0;
j < 10; ++
j) {
3479 EBG6samplesCorrelation_.push_back(
ww);
3481 for (
int j = 0;
j < 10; ++
j) {
3483 EBG1samplesCorrelation_.push_back(
ww);
3485 for (
int j = 0;
j < 10; ++
j) {
3487 EEG12samplesCorrelation_.push_back(
ww);
3489 for (
int j = 0;
j < 10; ++
j) {
3491 EEG6samplesCorrelation_.push_back(
ww);
3493 for (
int j = 0;
j < 10; ++
j) {
3495 EEG1samplesCorrelation_.push_back(
ww);
3499 auto ipar = std::make_unique<EcalSamplesCorrelation>();
3500 copy(EBG12samplesCorrelation_.begin(), EBG12samplesCorrelation_.end(), back_inserter(ipar->EBG12SamplesCorrelation));
3501 copy(EBG6samplesCorrelation_.begin(), EBG6samplesCorrelation_.end(), back_inserter(ipar->EBG6SamplesCorrelation));
3502 copy(EBG1samplesCorrelation_.begin(), EBG1samplesCorrelation_.end(), back_inserter(ipar->EBG1SamplesCorrelation));
3503 copy(EEG12samplesCorrelation_.begin(), EEG12samplesCorrelation_.end(), back_inserter(ipar->EEG12SamplesCorrelation));
3504 copy(EEG6samplesCorrelation_.begin(), EEG6samplesCorrelation_.end(), back_inserter(ipar->EEG6SamplesCorrelation));
3505 copy(EEG1samplesCorrelation_.begin(), EEG1samplesCorrelation_.end(), back_inserter(ipar->EEG1SamplesCorrelation));
3511 auto result = std::make_unique<EcalSimPulseShape>();
3514 result->time_interval = sim_pulse_shape_TI_;
3517 std::vector<double> EBshape;
3518 std::vector<double> EEshape;
3519 std::vector<double> APDshape;
3522 if (!EBSimPulseShapeFile_.empty()) {
3523 std::ifstream shapeEBFile;
3524 shapeEBFile.open(EBSimPulseShapeFile_.c_str());
3526 while (shapeEBFile >>
ww)
3527 EBshape.push_back(
ww);
3528 shapeEBFile.close();
3530 if (!EESimPulseShapeFile_.empty()) {
3531 std::ifstream shapeEEFile;
3532 shapeEEFile.open(EESimPulseShapeFile_.c_str());
3534 while (shapeEEFile >>
ww)
3535 EEshape.push_back(
ww);
3536 shapeEEFile.close();
3538 if (!APDSimPulseShapeFile_.empty()) {
3539 std::ifstream shapeAPDFile;
3540 shapeAPDFile.open(APDSimPulseShapeFile_.c_str());
3542 while (shapeAPDFile >>
ww)
3543 APDshape.push_back(
ww);
3544 shapeAPDFile.close();
3548 result->barrel_thresh = sim_pulse_shape_EB_thresh_;
3549 result->endcap_thresh = sim_pulse_shape_EE_thresh_;
3550 result->apd_thresh = sim_pulse_shape_APD_thresh_;
3553 copy(EBshape.begin(), EBshape.end(), back_inserter(
result->barrel_shape));
3554 copy(EEshape.begin(), EEshape.end(), back_inserter(
result->endcap_shape));
3555 copy(APDshape.begin(), APDshape.end(), back_inserter(
result->apd_shape));
3562 auto result = std::make_unique<EcalSimComponentShape>();
3565 result->time_interval = sim_pulse_shape_TI_;
3568 std::vector<std::vector<float> > EBshapes;
3571 if (!EBSimComponentShapeFiles_.empty()) {
3573 for (
auto filename : EBSimComponentShapeFiles_) {
3574 std::ifstream shapeEBFile;
3575 EBshapes.emplace_back();
3576 shapeEBFile.open(EBSimComponentShapeFiles_[iShape].c_str());
3578 while (shapeEBFile >>
ww)
3579 EBshapes[iShape].push_back(
ww);
3580 shapeEBFile.close();
3586 result->barrel_thresh = sim_pulse_shape_EB_thresh_;
3589 copy(EBshapes.begin(), EBshapes.end(), back_inserter(
result->barrel_shapes));
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
static bool validDetId(int ix, int iy, int iz)
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
T getParameter(std::string const &) const
static const int MIN_IPHI
static Timestamp endOfTime()
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
virtual std::unique_ptr< EcalDQMChannelStatus > produceEcalDQMChannelStatus(const EcalDQMChannelStatusRcd &)
virtual std::unique_ptr< EcalIntercalibConstants > produceEcalIntercalibConstants(const EcalIntercalibConstantsRcd &)
virtual std::unique_ptr< EcalIntercalibErrors > produceEcalIntercalibErrors(const EcalIntercalibErrorsRcd &)
virtual std::unique_ptr< EcalLaserAPDPNRatiosRef > produceEcalLaserAPDPNRatiosRef(const EcalLaserAPDPNRatiosRefRcd &)
virtual std::unique_ptr< EcalSamplesCorrelation > produceEcalSamplesCorrelation(const EcalSamplesCorrelationRcd &)
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
virtual std::unique_ptr< EcalTimeCalibConstants > produceEcalTimeCalibConstants(const EcalTimeCalibConstantsRcd &)
~EcalTrivialConditionRetriever() override
virtual std::unique_ptr< EcalMappingElectronics > getMappingFromConfiguration(const EcalMappingElectronicsRcd &)
static const IOVSyncValue & endOfTime()
virtual std::unique_ptr< EcalADCToGeVConstant > produceEcalADCToGeVConstant(const EcalADCToGeVConstantRcd &)
ALPAKA_FN_ACC int side(int ieta, int iphi)
virtual std::unique_ptr< EcalWeightXtalGroups > produceEcalWeightXtalGroups(const EcalWeightXtalGroupsRcd &)
virtual std::unique_ptr< EcalChannelStatus > produceEcalChannelStatus(const EcalChannelStatusRcd &)
std::pair< Time_t, Time_t > ValidityInterval
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
void getWeightsFromConfiguration(const edm::ParameterSet &ps)
math::Matrix< 3, 10 >::type EcalWeightMatrix
double calcresolutitonConstantTerm(double eta)
Log< level::Error, false > LogError
static EEDetId unhashIndex(int hi)
void setInstLumi(double x)
static int readXML(const std::string &filename, EcalCondHeader &header, EcalFloatCondObjectContainer &record)
static bool validDetId(int i, int j)
check if a valid index combination
virtual std::unique_ptr< EcalLaserAlphas > produceEcalLaserAlphas(const EcalLaserAlphasRcd &)
void setGain12Over6(const float &g)
virtual std::unique_ptr< EcalClusterEnergyUncertaintyParameters > produceEcalClusterEnergyUncertaintyParameters(const EcalClusterEnergyUncertaintyParametersRcd &)
T getUntrackedParameter(std::string const &, T const &) const
virtual std::unique_ptr< Alignments > produceEcalAlignmentEB(const EBAlignmentRcd &)
void setValue(const uint32_t id, const Item &item)
virtual std::unique_ptr< EcalClusterEnergyCorrectionParameters > produceEcalClusterEnergyCorrectionParameters(const EcalClusterEnergyCorrectionParametersRcd &)
virtual std::unique_ptr< EcalIntercalibConstantsMC > getIntercalibConstantsMCFromConfiguration(const EcalIntercalibConstantsMCRcd &)
static const IOVSyncValue & beginOfTime()
double calcnoiseIncreaseADC(double eta)
virtual std::unique_ptr< EcalDQMTowerStatus > produceEcalDQMTowerStatus(const EcalDQMTowerStatusRcd &)
virtual std::unique_ptr< EcalSimComponentShape > getEcalSimComponentShapeFromConfiguration(const EcalSimComponentShapeRcd &)
virtual std::unique_ptr< Alignments > produceEcalAlignmentEE(const EEAlignmentRcd &)
virtual std::unique_ptr< EcalLinearCorrections > produceEcalLinearCorrections(const EcalLinearCorrectionsRcd &)
virtual std::unique_ptr< EcalMappingElectronics > produceEcalMappingElectronics(const EcalMappingElectronicsRcd &)
Tan< T >::type tan(const T &t)
Abs< T >::type abs(const T &t)
EcalChi2WeightMatrix & getChi2WeightsAfterGainSwitch()
virtual std::unique_ptr< EcalLaserAPDPNRatios > produceEcalLaserAPDPNRatios(const EcalLaserAPDPNRatiosRcd &)
virtual std::unique_ptr< EcalChannelStatus > getChannelStatusFromConfiguration(const EcalChannelStatusRcd &)
virtual std::unique_ptr< EcalTimeBiasCorrections > produceEcalTimeBiasCorrections(const EcalTimeBiasCorrectionsRcd &)
virtual std::unique_ptr< EcalIntercalibConstants > getIntercalibConstantsFromConfiguration(const EcalIntercalibConstantsRcd &)
virtual std::unique_ptr< EcalIntercalibConstantsMC > produceEcalIntercalibConstantsMC(const EcalIntercalibConstantsMCRcd &)
virtual std::unique_ptr< Alignments > produceEcalAlignmentES(const ESAlignmentRcd &)
EcalWeightMatrix & getWeightsAfterGainSwitch()
const_iterator find(uint32_t rawId) const
Log< level::Info, false > LogInfo
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t ix(uint32_t id)
virtual std::unique_ptr< EcalPedestals > produceEcalPedestals(const EcalPedestalsRcd &)
virtual std::unique_ptr< EcalClusterEnergyCorrectionObjectSpecificParameters > produceEcalClusterEnergyCorrectionObjectSpecificParameters(const EcalClusterEnergyCorrectionObjectSpecificParametersRcd &)
static const int MAX_IPHI
EcalWeightMatrix & getWeightsBeforeGainSwitch()
TimeValue_t value() const
virtual std::unique_ptr< EcalDCSTowerStatus > produceEcalDCSTowerStatus(const EcalDCSTowerStatusRcd &)
constexpr uint32_t rawId() const
get the raw id
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
EcalTrivialConditionRetriever(const edm::ParameterSet &pset)
std::vector< Item >::const_iterator const_iterator
static const int MAX_IETA
virtual std::unique_ptr< EcalClusterLocalContCorrParameters > produceEcalClusterLocalContCorrParameters(const EcalClusterLocalContCorrParametersRcd &)
virtual std::unique_ptr< EcalTimeCalibErrors > getTimeCalibErrorsFromConfiguration(const EcalTimeCalibErrorsRcd &)
static EBDetId unhashIndex(int hi)
get a DetId from a compact index for arrays
EcalIntercalibConstantMap EcalIntercalibConstants
virtual std::unique_ptr< EcalGainRatios > produceEcalGainRatios(const EcalGainRatiosRcd &)
static bool validDetId(int iz, EcalSubdetector sd, int i, int j)
check if a valid index combination
const Timestamp & time() const
virtual std::unique_ptr< EcalTPGCrystalStatus > produceEcalTrgChannelStatus(const EcalTPGCrystalStatusRcd &)
virtual std::unique_ptr< EcalTimeCalibErrors > produceEcalTimeCalibErrors(const EcalTimeCalibErrorsRcd &)
virtual std::unique_ptr< EcalTBWeights > produceEcalTBWeights(const EcalTBWeightsRcd &)
virtual std::unique_ptr< EcalTimeOffsetConstant > produceEcalTimeOffsetConstant(const EcalTimeOffsetConstantRcd &)
virtual std::unique_ptr< EcalPFRecHitThresholds > getPFRecHitThresholdsFromConfiguration(const EcalPFRecHitThresholdsRcd &)
ALPAKA_FN_ACC ALPAKA_FN_INLINE uint32_t iy(uint32_t id)
const self & getMap() const
const_iterator end() const
virtual std::unique_ptr< EcalTimeCalibConstants > getTimeCalibConstantsFromConfiguration(const EcalTimeCalibConstantsRcd &)
const std::string & fullPath() const
virtual std::unique_ptr< EcalTPGCrystalStatus > getTrgChannelStatusFromConfiguration(const EcalTPGCrystalStatusRcd &)
virtual std::unique_ptr< EcalPFRecHitThresholds > produceEcalPFRecHitThresholds(const EcalPFRecHitThresholdsRcd &)
float EcalIntercalibConstantMC
virtual std::unique_ptr< EcalSampleMask > produceEcalSampleMask(const EcalSampleMaskRcd &)
Log< level::Warning, false > LogWarning
virtual std::unique_ptr< EcalIntercalibErrors > getIntercalibErrorsFromConfiguration(const EcalIntercalibErrorsRcd &)
static const int SMCRYSTALMODE
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
double calcampDropTotal(double eta)
const char * name() const
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
virtual std::unique_ptr< EcalDAQTowerStatus > produceEcalDAQTowerStatus(const EcalDAQTowerStatusRcd &)
virtual std::unique_ptr< EcalSimPulseShape > getEcalSimPulseShapeFromConfiguration(const EcalSimPulseShapeRcd &)
float EcalIntercalibConstant
virtual std::unique_ptr< EcalClusterCrackCorrParameters > produceEcalClusterCrackCorrParameters(const EcalClusterCrackCorrParametersRcd &)