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>();
351 if (producedEcalSimPulseShape_) {
353 findingRecord<EcalSimPulseShapeRcd>();
356 producedEcalPFRecHitThresholds_ = ps.
getUntrackedParameter<
bool>(
"producedEcalPFRecHitThresholds",
false);
362 if (producedEcalPFRecHitThresholds_) {
363 if (!pfRecHitFile_.empty()) {
368 findingRecord<EcalPFRecHitThresholdsRcd>();
372 producedEcalClusterLocalContCorrParameters_ =
374 producedEcalClusterCrackCorrParameters_ =
376 producedEcalClusterEnergyCorrectionParameters_ =
378 producedEcalClusterEnergyUncertaintyParameters_ =
380 producedEcalClusterEnergyCorrectionObjectSpecificParameters_ =
381 ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionObjectSpecificParameters",
false);
382 if (producedEcalClusterLocalContCorrParameters_) {
384 findingRecord<EcalClusterLocalContCorrParametersRcd>();
386 if (producedEcalClusterCrackCorrParameters_) {
388 findingRecord<EcalClusterCrackCorrParametersRcd>();
390 if (producedEcalClusterEnergyCorrectionParameters_) {
392 findingRecord<EcalClusterEnergyCorrectionParametersRcd>();
394 if (producedEcalClusterEnergyUncertaintyParameters_) {
396 findingRecord<EcalClusterEnergyUncertaintyParametersRcd>();
398 if (producedEcalClusterEnergyCorrectionObjectSpecificParameters_) {
400 findingRecord<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>();
405 if (producedEcalLaserCorrection_) {
408 findingRecord<EcalLaserAlphasRcd>();
413 edm::LogInfo(
" getLaserAlphaFromFileEB_ ") << getLaserAlphaFromFileEB_;
414 edm::LogInfo(
" getLaserAlphaFromFileEE_ ") << getLaserAlphaFromFileEE_;
415 edm::LogInfo(
" getLaserAlphaFromTypeEB_ ") << getLaserAlphaFromTypeEB_;
416 edm::LogInfo(
" getLaserAlphaFromTypeEE_ ") << getLaserAlphaFromTypeEE_;
417 if (getLaserAlphaFromFileEB_) {
419 "EBLaserAlphaFile", dataPath_ +
"EBLaserAlpha.txt");
421 if (getLaserAlphaFromFileEE_) {
423 "EELaserAlphaFile", dataPath_ +
"EELaserAlpha.txt");
425 if (getLaserAlphaFromTypeEB_) {
429 "EBLaserAlphaFile", dataPath_ +
"EBLaserAlpha.txt");
431 if (getLaserAlphaFromTypeEE_) {
440 dataPath_ +
"EELaserAlpha.txt");
442 "EELaserAlphaFile2", dataPath_ +
"EELaserAlpha2.txt");
445 findingRecord<EcalLaserAPDPNRatiosRefRcd>();
447 findingRecord<EcalLaserAPDPNRatiosRcd>();
454 if (producedEcalChannelStatus_) {
455 if (!channelStatusFile_.empty()) {
460 findingRecord<EcalChannelStatusRcd>();
463 producedEcalDQMChannelStatus_ = ps.
getUntrackedParameter<
bool>(
"producedEcalDQMChannelStatus",
true);
464 if (producedEcalDQMChannelStatus_) {
466 findingRecord<EcalDQMChannelStatusRcd>();
470 if (producedEcalDCSTowerStatus_) {
472 findingRecord<EcalDCSTowerStatusRcd>();
476 if (producedEcalDAQTowerStatus_) {
478 findingRecord<EcalDAQTowerStatusRcd>();
482 if (producedEcalDQMTowerStatus_) {
484 findingRecord<EcalDQMTowerStatusRcd>();
488 producedEcalTrgChannelStatus_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTrgChannelStatus",
true);
491 if (producedEcalTrgChannelStatus_) {
492 if (!trgChannelStatusFile_.empty()) {
497 findingRecord<EcalTPGCrystalStatusRcd>();
502 if (producedEcalAlignmentEB_) {
504 findingRecord<EBAlignmentRcd>();
507 if (producedEcalAlignmentEE_) {
509 findingRecord<EEAlignmentRcd>();
512 if (producedEcalAlignmentES_) {
514 findingRecord<ESAlignmentRcd>();
517 if (producedEcalPedestals_)
518 findingRecord<EcalPedestalsRcd>();
520 if (producedEcalWeights_) {
521 findingRecord<EcalWeightXtalGroupsRcd>();
522 findingRecord<EcalTBWeightsRcd>();
525 if (producedEcalGainRatios_)
526 findingRecord<EcalGainRatiosRcd>();
528 if (producedEcalADCToGeVConstant_)
529 findingRecord<EcalADCToGeVConstantRcd>();
532 if (producedEcalSampleMask_) {
534 findingRecord<EcalSampleMaskRcd>();
536 producedEcalTimeBiasCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeBiasCorrections",
false);
537 if (producedEcalTimeBiasCorrections_) {
539 findingRecord<EcalTimeBiasCorrectionsRcd>();
541 producedEcalSamplesCorrelation_ = ps.
getUntrackedParameter<
bool>(
"producedEcalSamplesCorrelation",
false);
542 if (producedEcalSamplesCorrelation_) {
544 findingRecord<EcalSamplesCorrelationRcd>();
545 getSamplesCorrelationFromFile_ = ps.
getUntrackedParameter<
bool>(
"getSamplesCorrelationFromFile",
false);
546 if (getSamplesCorrelationFromFile_) {
547 SamplesCorrelationFile_ =
562 edm::LogInfo(
"EcalTrivialConditionRetriever::setIntervalFor(): record key = ")
570 auto peds = std::make_unique<EcalPedestals>();
574 EBitem.mean_x1 = EBpedMeanX1_;
575 EBitem.rms_x1 = EBpedRMSX1_;
576 EBitem.mean_x6 = EBpedMeanX6_;
577 EBitem.rms_x6 = EBpedRMSX6_;
578 EBitem.mean_x12 = EBpedMeanX12_;
579 EBitem.rms_x12 = EBpedRMSX12_;
581 EEitem.mean_x1 = EEpedMeanX1_;
582 EEitem.rms_x1 = EEpedRMSX1_;
583 EEitem.mean_x6 = EEpedMeanX6_;
584 EEitem.rms_x6 = EEpedRMSX6_;
585 EEitem.mean_x12 = EEpedMeanX12_;
586 EEitem.rms_x12 = EEpedRMSX12_;
601 EBitem.rms_x1 = EBpedRMSX1_ * noisefactor;
602 EBitem.rms_x6 = EBpedRMSX6_ * noisefactor;
603 EBitem.rms_x12 = EBpedRMSX12_ * noisefactor;
611 peds->insert(std::make_pair(ebdetid.
rawId(), EBitem));
621 peds->insert(std::make_pair(eedetidpos.
rawId(), EEitem));
624 EEDetId eedetidneg(iX, iY, -1);
625 peds->insert(std::make_pair(eedetidneg.
rawId(), EEitem));
636 auto xtalGroups = std::make_unique<EcalWeightXtalGroups>();
646 xtalGroups->setValue(ebid.
rawId(), defaultGroupId);
656 xtalGroups->setValue(eedetidpos.
rawId(), defaultGroupId);
659 EEDetId eedetidneg(iX, iY, -1);
660 xtalGroups->setValue(eedetidneg.
rawId(), defaultGroupId);
669 auto ical = std::make_unique<EcalLinearCorrections>();
677 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
680 pairAPDPN.
p1 = linCorrMean_ +
r * linCorrSigma_;
681 pairAPDPN.
p2 = linCorrMean_ +
r * linCorrSigma_;
682 pairAPDPN.
p3 = linCorrMean_ +
r * linCorrSigma_;
683 ical->setValue(ebid, pairAPDPN);
692 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
696 pairAPDPN.
p1 = linCorrMean_ +
r * linCorrSigma_;
697 pairAPDPN.
p2 = linCorrMean_ +
r * linCorrSigma_;
698 pairAPDPN.
p3 = linCorrMean_ +
r * linCorrSigma_;
700 ical->setValue(eedetidpos, pairAPDPN);
704 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
705 EEDetId eedetidneg(iX, iY, -1);
708 pairAPDPN.
p1 = linCorrMean_ +
r1 * linCorrSigma_;
709 pairAPDPN.
p2 = linCorrMean_ +
r1 * linCorrSigma_;
710 pairAPDPN.
p3 = linCorrMean_ +
r1 * linCorrSigma_;
712 ical->setValue(eedetidneg, pairAPDPN);
719 for (
int i = 0;
i < 92;
i++) {
721 if (linearTime2_ == 0) {
726 if (linearTime3_ == 0) {
732 ical->setTime(
i, TimeStamp);
742 auto ical = std::make_unique<EcalPFRecHitThresholds>();
751 ical->setValue(ebid.
rawId(), pfRecHitThresholdsEB_);
761 ical->setValue(eedetidpos.
rawId(), pfRecHitThresholdsEE_);
764 EEDetId eedetidneg(iX, iY, -1);
765 ical->setValue(eedetidneg.
rawId(), pfRecHitThresholdsEE_);
777 auto ical = std::make_unique<EcalIntercalibConstants>();
786 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
787 ical->setValue(ebid.
rawId(), intercalibConstantMean_ +
r * intercalibConstantSigma_);
796 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
798 ical->setValue(eedetidpos.
rawId(), intercalibConstantMean_ +
r * intercalibConstantSigma_);
801 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
802 EEDetId eedetidneg(iX, iY, -1);
803 ical->setValue(eedetidneg.
rawId(), intercalibConstantMean_ +
r1 * intercalibConstantSigma_);
813 auto ical = std::make_unique<EcalIntercalibConstantsMC>();
822 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
823 ical->setValue(ebid.
rawId(), intercalibConstantMeanMC_ +
r * intercalibConstantSigmaMC_);
832 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
834 ical->setValue(eedetidpos.
rawId(), intercalibConstantMeanMC_ +
r * intercalibConstantSigmaMC_);
837 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
838 EEDetId eedetidneg(iX, iY, -1);
839 ical->setValue(eedetidneg.
rawId(), intercalibConstantMeanMC_ +
r1 * intercalibConstantSigmaMC_);
849 auto ical = std::make_unique<EcalIntercalibErrors>();
858 ical->setValue(ebid.
rawId(), intercalibErrorMean_);
868 ical->setValue(eedetidpos.
rawId(), intercalibErrorMean_);
871 EEDetId eedetidneg(iX, iY, -1);
872 ical->setValue(eedetidneg.
rawId(), intercalibErrorMean_);
882 auto ical = std::make_unique<EcalTimeCalibConstants>();
891 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
892 ical->setValue(ebid.
rawId(), timeCalibConstantMean_ +
r * timeCalibConstantSigma_);
901 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
903 ical->setValue(eedetidpos.
rawId(), timeCalibConstantMean_ +
r * timeCalibConstantSigma_);
906 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
907 EEDetId eedetidneg(iX, iY, -1);
908 ical->setValue(eedetidneg.
rawId(), timeCalibConstantMean_ +
r1 * timeCalibConstantSigma_);
918 auto ical = std::make_unique<EcalTimeCalibErrors>();
927 ical->setValue(ebid.
rawId(), timeCalibErrorMean_);
937 ical->setValue(eedetidpos.
rawId(), timeCalibErrorMean_);
940 EEDetId eedetidneg(iX, iY, -1);
941 ical->setValue(eedetidneg.
rawId(), timeCalibErrorMean_);
952 edm::LogInfo(
" EB ") << timeOffsetEBConstant_ <<
" EE " << timeOffsetEEConstant_;
953 return std::make_unique<EcalTimeOffsetConstant>(timeOffsetEBConstant_, timeOffsetEEConstant_);
957 auto gratio = std::make_unique<EcalGainRatios>();
960 gr.setGain6Over1(gainRatio6over1_);
968 gratio->setValue(ebid.
rawId(), gr);
978 gratio->setValue(eedetidpos.
rawId(), gr);
981 EEDetId eedetidneg(iX, iY, -1);
982 gratio->setValue(eedetidneg.
rawId(), gr);
992 return std::make_unique<EcalADCToGeVConstant>(adcToGeVEBConstant_, adcToGeVEEConstant_);
997 auto tbwgt = std::make_unique<EcalTBWeights>();
1004 for (
int itdc = 1; itdc <= nTDCbins_; ++itdc) {
1035 mat1.Place_in_row(amplWeights_[itdc - 1], 0, 0);
1036 mat1.Place_in_row(pedWeights_[itdc - 1], 1, 0);
1037 mat1.Place_in_row(jittWeights_[itdc - 1], 2, 0);
1040 mat2.Place_in_row(amplWeightsAft_[itdc - 1], 0, 0);
1041 mat2.Place_in_row(pedWeightsAft_[itdc - 1], 1, 0);
1042 mat2.Place_in_row(jittWeightsAft_[itdc - 1], 2, 0);
1048 mat3 = chi2Matrix_[itdc - 1];
1049 mat4 = chi2MatrixAft_[itdc - 1];
1071 tbwgt->setValue(std::make_pair(igrp, itdc), wgt);
1078 std::unique_ptr<EcalClusterLocalContCorrParameters>
1080 auto ipar = std::make_unique<EcalClusterLocalContCorrParameters>();
1081 for (
size_t i = 0;
i < localContCorrParameters_.size(); ++
i) {
1082 ipar->params().push_back(localContCorrParameters_[
i]);
1088 auto ipar = std::make_unique<EcalClusterCrackCorrParameters>();
1089 for (
size_t i = 0;
i < crackCorrParameters_.size(); ++
i) {
1090 ipar->params().push_back(crackCorrParameters_[
i]);
1094 std::unique_ptr<EcalClusterEnergyCorrectionParameters>
1097 auto ipar = std::make_unique<EcalClusterEnergyCorrectionParameters>();
1098 for (
size_t i = 0;
i < energyCorrectionParameters_.size(); ++
i) {
1099 ipar->params().push_back(energyCorrectionParameters_[
i]);
1103 std::unique_ptr<EcalClusterEnergyUncertaintyParameters>
1106 auto ipar = std::make_unique<EcalClusterEnergyUncertaintyParameters>();
1107 for (
size_t i = 0;
i < energyUncertaintyParameters_.size(); ++
i) {
1108 ipar->params().push_back(energyUncertaintyParameters_[
i]);
1112 std::unique_ptr<EcalClusterEnergyCorrectionObjectSpecificParameters>
1115 auto ipar = std::make_unique<EcalClusterEnergyCorrectionObjectSpecificParameters>();
1116 for (
size_t i = 0;
i < energyCorrectionObjectSpecificParameters_.size(); ++
i) {
1117 ipar->params().push_back(energyCorrectionObjectSpecificParameters_[
i]);
1302 auto ical = std::make_unique<EcalLaserAlphas>();
1305 if (getLaserAlphaFromTypeEB_) {
1307 int SMpos[36] = {-10, 4, -7, -16, 6, -9, 11, -17, 5, 18, 3, -8, 1, -3, -13, 14, -6, 2,
1308 15, -18, 8, 17, -2, 9, -1, 10, -5, 7, -12, -11, 16, -4, -15, -14, 12, 13};
1310 int SMCal[36] = {12, 17, 10, 1, 8, 4, 27, 20, 23, 25, 6, 34, 35, 15, 18, 30, 21, 9,
1311 24, 22, 13, 31, 26, 16, 2, 11, 5, 0, 29, 28, 14, 33, 32, 3, 7, 19};
1313 for (
int SMcons = 0; SMcons < 36; SMcons++) {
1314 int SM = SMpos[SMcons];
1319 if (SMCal[SM] != SMcons)
1320 edm::LogInfo(
" SM pb : read SM ") << SMcons <<
" SMpos " << SM <<
" SMCal " << SMCal[SM];
1324 int readSM,
pos, bar, bar2;
1326 for (
int SMcons = 0; SMcons < 36; SMcons++) {
1327 int SM = SMpos[SMcons];
1328 for (
int ic = 0; ic < 1700; ic++) {
1331 if (readSM != SMcons ||
pos != ic + 1)
1333 << readSM <<
" const SM " << SMcons <<
" read pos " <<
pos <<
" ic " << ic;
1337 if (bar == 33101 || bar == 30301)
1338 alpha = laserAlphaMeanEBR_;
1339 else if (bar == 33106) {
1341 alpha = laserAlphaMeanEBC_;
1344 << bar <<
" last " << bar2 <<
" read SM " << readSM <<
" read pos " <<
pos;
1345 alpha = laserAlphaMeanEBR_;
1348 ical->setValue(ebdetid,
alpha);
1357 }
else if (getLaserAlphaFromFileEB_) {
1359 edm::LogInfo(
"Laser alpha for EB will be taken from File");
1364 for (
int ic = 0; ic < 61200; ic++) {
1369 ical->setValue(ebid,
alpha);
1373 edm::LogInfo(
"I will print some alphas from the file... ieta/iphi/alpha ")
1389 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1390 ical->setValue(ebid, laserAlphaMean_ +
r * laserAlphaSigma_);
1399 int itype, iring, iyear;
1401 float las[2][140][6];
1403 if (getLaserAlphaFromTypeEE_) {
1407 for (
int i = 0;
i < 1681;
i++) {
1408 fRing >> itype >> iring >> iyear >>
laser;
1409 edm::LogInfo(
" ") << itype <<
" " << iring <<
" " << iyear <<
" " <<
laser << std::endl;
1410 las[itype][iring][iyear] =
laser;
1416 for (
int crystal = 0; crystal < 14648; crystal++) {
1417 int x,
y,
z, bid, bar, bar2;
1418 float LY,
alpha = 0;
1419 fEE >>
z >>
x >>
y >> LY >> bid >> bar >> bar2;
1420 if (x < 1 || x > 100 || y < 1 || y > 100)
1421 edm::LogInfo(
" wrong coordinates for barcode ") << bar <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1424 int iring = (
int)(
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5)) + 85);
1426 double eta = -
log(
tan(0.5 * atan(
sqrt((
x - 50.5) * (
x - 50.5) + (
y - 50.5) * (
y - 50.5)) * 2.98 / 328.)));
1428 if (bar == 33201 || (bar == 30399 && bar2 < 568)) {
1430 alpha = laserAlphaMeanEER_;
1432 double raggio = 50.5 -
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5));
1451 edm::LogInfo(
"R=") << raggio <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z <<
"eta=" <<
eta 1452 <<
" alpha=" <<
alpha <<
" R";
1454 }
else if ((bar == 33106 && bar2 > 2000 && bar2 < 4669) || (bar == 30399 && bar2 > 567)) {
1457 alpha = laserAlphaMeanEEC_;
1459 double raggio = 50.5 -
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5));
1465 float r =
sqrt((
x - 50.5) * (
x - 50.5) + (
y - 50.5) * (
y - 50.5));
1470 if (las[itype][iring][iyear] != 999) {
1471 alpha = 0.7312 + 0.2688 * las[itype][iring][iyear];
1476 edm::LogInfo(
"R=") << raggio <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z <<
"eta=" <<
eta 1477 <<
" alpha=" <<
alpha <<
" C";
1480 edm::LogInfo(
" problem with barcode ") << bar <<
" " << bar2 <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1481 alpha = laserAlphaMeanEER_;
1487 ical->setValue(eedetidpos,
alpha);
1491 edm::LogInfo(
" problem with EEDetId ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1494 edm::LogInfo(
"Number of inner SIC crystals with different alpha= ") << nxt;
1497 }
else if (getLaserAlphaFromFileEE_) {
1502 for (
int crystal = 0; crystal < 14648; crystal++) {
1506 if (x < 1 || x > 100 || y < 1 || y > 100 ||
z == 0 ||
z > 1 ||
z < -1) {
1507 edm::LogInfo(
"ERROR: wrong coordinates for crystal ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1508 edm::LogInfo(
" the format of the file should be z x y alpha ");
1512 ical->setValue(eedetidpos,
alpha);
1514 edm::LogInfo(
" problem with EEDetId ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1527 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1528 EEDetId eedetidpos(iX, iY, 1);
1529 ical->setValue(eedetidpos, laserAlphaMean_ +
r * laserAlphaSigma_);
1532 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1533 EEDetId eedetidneg(iX, iY, -1);
1534 ical->setValue(eedetidneg, laserAlphaMean_ +
r1 * laserAlphaSigma_);
1545 auto ical = std::make_unique<EcalLaserAPDPNRatiosRef>();
1552 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1553 ical->setValue(ebid, laserAPDPNRefMean_ +
r * laserAPDPNRefSigma_);
1562 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1563 EEDetId eedetidpos(iX, iY, 1);
1564 ical->setValue(eedetidpos, laserAPDPNRefMean_ +
r * laserAPDPNRefSigma_);
1568 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1569 EEDetId eedetidneg(iX, iY, -1);
1570 ical->setValue(eedetidneg, laserAPDPNRefMean_ +
r1 * laserAPDPNRefSigma_);
1584 auto ical = std::make_unique<EcalLaserAPDPNRatios>();
1598 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1601 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1602 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1603 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1604 ical->setValue(ebid, pairAPDPN);
1616 double r = (double)std::rand() / (double(RAND_MAX) + double(1));
1617 EEDetId eedetidpos(iX, iY, 1);
1619 double eta = -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
1625 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1626 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1627 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1628 ical->setValue(eedetidpos, pairAPDPN);
1632 double r1 = (double)std::rand() / (double(RAND_MAX) + double(1));
1633 EEDetId eedetidneg(iX, iY, -1);
1635 double eta = -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
1641 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1642 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1643 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1644 ical->setValue(eedetidneg, pairAPDPN);
1651 for (
int i = 0;
i < 92;
i++) {
1653 if (laserAPDPNTime2_ == 0) {
1658 if (laserAPDPNTime3_ == 0) {
1664 ical->setTime(
i, TimeStamp);
1671 std::vector<std::vector<double> > amplwgtv(nTDCbins_);
1673 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1674 std::vector<double> vampl;
1676 vampl.push_back(-0.33333);
1677 vampl.push_back(-0.33333);
1678 vampl.push_back(-0.33333);
1679 vampl.push_back(0.);
1680 vampl.push_back(0.);
1681 vampl.push_back(1.);
1682 vampl.push_back(0.);
1683 vampl.push_back(0.);
1684 vampl.push_back(0.);
1685 vampl.push_back(0.);
1687 }
else if (getWeightsFromFile_) {
1692 while (!amplFile.eof() && tdcBin < nTDCbins_) {
1693 for (
int j = 0;
j < 10; ++
j) {
1696 amplwgtv[tdcBin].push_back(ww);
1700 assert(tdcBin == nTDCbins_);
1704 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1708 for (
int i = 0;
i < nTDCbins_;
i++) {
1711 for (std::vector<double>::const_iterator it = amplwgtv[
i].begin(); it != amplwgtv[
i].end(); ++it) {
1712 (amplWeights_[
i])[
j] = *it;
1717 std::vector<std::vector<double> > amplwgtvAftGain(nTDCbins_);
1719 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1720 std::vector<double> vamplAftGain;
1721 vamplAftGain.push_back(0.);
1722 vamplAftGain.push_back(0.);
1723 vamplAftGain.push_back(0.);
1724 vamplAftGain.push_back(0.);
1725 vamplAftGain.push_back(0.);
1726 vamplAftGain.push_back(1.);
1727 vamplAftGain.push_back(0.);
1728 vamplAftGain.push_back(0.);
1729 vamplAftGain.push_back(0.);
1730 vamplAftGain.push_back(0.);
1731 amplwgtvAftGain[0] = ps.
getUntrackedParameter<std::vector<double> >(
"amplWeightsAftGain", vamplAftGain);
1732 }
else if (getWeightsFromFile_) {
1734 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading amplitude weights aftre gain switch from file " 1738 while (!amplFile.eof() && tdcBin < nTDCbins_) {
1739 for (
int j = 0;
j < 10; ++
j) {
1742 amplwgtvAftGain[tdcBin].push_back(ww);
1746 assert(tdcBin == nTDCbins_);
1749 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1753 for (
int i = 0;
i < nTDCbins_;
i++) {
1756 for (std::vector<double>::const_iterator it = amplwgtvAftGain[
i].begin(); it != amplwgtvAftGain[
i].end(); ++it) {
1757 (amplWeightsAft_[
i])[
j] = *it;
1764 std::vector<std::vector<double> > pedwgtv(nTDCbins_);
1766 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1767 std::vector<double> vped;
1768 vped.push_back(0.33333);
1769 vped.push_back(0.33333);
1770 vped.push_back(0.33333);
1779 }
else if (getWeightsFromFile_) {
1785 while (!pedFile.eof() && tdcBin < nTDCbins_) {
1786 for (
int j = 0;
j < 10; ++
j) {
1789 pedwgtv[tdcBin].push_back(ww);
1793 assert(tdcBin == nTDCbins_);
1796 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1800 for (
int i = 0;
i < nTDCbins_;
i++) {
1803 for (std::vector<double>::const_iterator it = pedwgtv[
i].begin(); it != pedwgtv[
i].end(); ++it) {
1804 (pedWeights_[
i])[
j] = *it;
1809 std::vector<std::vector<double> > pedwgtvaft(nTDCbins_);
1811 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1812 std::vector<double> vped;
1824 }
else if (getWeightsFromFile_) {
1826 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading pedestal after gain switch weights from file " 1830 while (!pedFile.eof() && tdcBin < nTDCbins_) {
1831 for (
int j = 0;
j < 10; ++
j) {
1834 pedwgtvaft[tdcBin].push_back(ww);
1838 assert(tdcBin == nTDCbins_);
1841 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1845 for (
int i = 0;
i < nTDCbins_;
i++) {
1848 for (std::vector<double>::const_iterator it = pedwgtvaft[
i].begin(); it != pedwgtvaft[
i].end(); ++it) {
1849 (pedWeightsAft_[
i])[
j] = *it;
1856 std::vector<std::vector<double> > jittwgtv(nTDCbins_);
1858 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1859 std::vector<double> vjitt;
1860 vjitt.push_back(0.04066309);
1861 vjitt.push_back(0.04066309);
1862 vjitt.push_back(0.04066309);
1863 vjitt.push_back(0.000);
1864 vjitt.push_back(1.325176);
1865 vjitt.push_back(-0.04997078);
1866 vjitt.push_back(-0.504338);
1867 vjitt.push_back(-0.5024844);
1868 vjitt.push_back(-0.3903718);
1869 vjitt.push_back(0.000);
1871 }
else if (getWeightsFromFile_) {
1877 while (!jittFile.eof() && tdcBin < nTDCbins_) {
1878 for (
int j = 0;
j < 10; ++
j) {
1881 jittwgtv[tdcBin].push_back(ww);
1885 assert(tdcBin == nTDCbins_);
1888 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1892 for (
int i = 0;
i < nTDCbins_;
i++) {
1895 for (std::vector<double>::const_iterator it = jittwgtv[
i].begin(); it != jittwgtv[
i].end(); ++it) {
1896 (jittWeights_[
i])[
j] = *it;
1901 std::vector<std::vector<double> > jittwgtvaft(nTDCbins_);
1903 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1904 std::vector<double> vjitt;
1905 vjitt.push_back(0.);
1906 vjitt.push_back(0.);
1907 vjitt.push_back(0.);
1908 vjitt.push_back(0.);
1909 vjitt.push_back(1.097871);
1910 vjitt.push_back(-0.04551035);
1911 vjitt.push_back(-0.4159156);
1912 vjitt.push_back(-0.4185352);
1913 vjitt.push_back(-0.3367127);
1914 vjitt.push_back(0.);
1916 }
else if (getWeightsFromFile_) {
1918 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading jitter after gain switch weights from file " 1922 while (!jittFile.eof() && tdcBin < nTDCbins_) {
1923 for (
int j = 0;
j < 10; ++
j) {
1926 jittwgtvaft[tdcBin].push_back(ww);
1930 assert(tdcBin == nTDCbins_);
1933 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1937 for (
int i = 0;
i < nTDCbins_;
i++) {
1940 for (std::vector<double>::const_iterator it = jittwgtvaft[
i].begin(); it != jittwgtvaft[
i].end(); ++it) {
1941 (jittWeightsAft_[
i])[
j] = *it;
1946 std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2Matrix(nTDCbins_);
1947 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1952 chi2Matrix[0](0, 0) = 0.694371;
1953 chi2Matrix[0](0, 1) = -0.305629;
1954 chi2Matrix[0](0, 2) = -0.305629;
1955 chi2Matrix[0](0, 3) = 0.;
1956 chi2Matrix[0](0, 4) = 0.;
1957 chi2Matrix[0](0, 5) = 0.;
1958 chi2Matrix[0](0, 6) = 0.;
1959 chi2Matrix[0](0, 7) = 0.;
1960 chi2Matrix[0](0, 8) = 0.;
1961 chi2Matrix[0](0, 9) = 0.;
1962 chi2Matrix[0](1, 0) = -0.305629;
1963 chi2Matrix[0](1, 1) = 0.694371;
1964 chi2Matrix[0](1, 2) = -0.305629;
1965 chi2Matrix[0](1, 3) = 0.;
1966 chi2Matrix[0](1, 4) = 0.;
1967 chi2Matrix[0](1, 5) = 0.;
1968 chi2Matrix[0](1, 6) = 0.;
1969 chi2Matrix[0](1, 7) = 0.;
1970 chi2Matrix[0](1, 8) = 0.;
1971 chi2Matrix[0](1, 9) = 0.;
1972 chi2Matrix[0](2, 0) = -0.305629;
1973 chi2Matrix[0](2, 1) = -0.305629;
1974 chi2Matrix[0](2, 2) = 0.694371;
1975 chi2Matrix[0](2, 3) = 0.;
1976 chi2Matrix[0](2, 4) = 0.;
1977 chi2Matrix[0](2, 5) = 0.;
1978 chi2Matrix[0](2, 6) = 0.;
1979 chi2Matrix[0](2, 7) = 0.;
1980 chi2Matrix[0](2, 8) = 0.;
1981 chi2Matrix[0](2, 9) = 0.;
1982 chi2Matrix[0](3, 0) = 0.;
1983 chi2Matrix[0](3, 1) = 0.;
1984 chi2Matrix[0](3, 2) = 0.;
1985 chi2Matrix[0](3, 3) = 0.;
1986 chi2Matrix[0](3, 4) = 0.;
1987 chi2Matrix[0](3, 5) = 0.;
1988 chi2Matrix[0](3, 6) = 0.;
1989 chi2Matrix[0](3, 7) = 0.;
1990 chi2Matrix[0](3, 8) = 0.;
1991 chi2Matrix[0](3, 9) = 0.;
1992 chi2Matrix[0](4, 0) = 0.;
1993 chi2Matrix[0](4, 1) = 0.;
1994 chi2Matrix[0](4, 2) = 0.;
1995 chi2Matrix[0](4, 3) = 0.;
1996 chi2Matrix[0](4, 4) = 0.8027116;
1997 chi2Matrix[0](4, 5) = -0.2517103;
1998 chi2Matrix[0](4, 6) = -0.2232882;
1999 chi2Matrix[0](4, 7) = -0.1716192;
2000 chi2Matrix[0](4, 8) = -0.1239006;
2001 chi2Matrix[0](4, 9) = 0.;
2002 chi2Matrix[0](5, 0) = 0.;
2003 chi2Matrix[0](5, 1) = 0.;
2004 chi2Matrix[0](5, 2) = 0.;
2005 chi2Matrix[0](5, 3) = 0.;
2006 chi2Matrix[0](5, 4) = -0.2517103;
2007 chi2Matrix[0](5, 5) = 0.6528964;
2008 chi2Matrix[0](5, 6) = -0.2972839;
2009 chi2Matrix[0](5, 7) = -0.2067162;
2010 chi2Matrix[0](5, 8) = -0.1230729;
2011 chi2Matrix[0](5, 9) = 0.;
2012 chi2Matrix[0](6, 0) = 0.;
2013 chi2Matrix[0](6, 1) = 0.;
2014 chi2Matrix[0](6, 2) = 0.;
2015 chi2Matrix[0](6, 3) = 0.;
2016 chi2Matrix[0](6, 4) = -0.2232882;
2017 chi2Matrix[0](6, 5) = -0.2972839;
2018 chi2Matrix[0](6, 6) = 0.7413607;
2019 chi2Matrix[0](6, 7) = -0.1883866;
2020 chi2Matrix[0](6, 8) = -0.1235052;
2021 chi2Matrix[0](6, 9) = 0.;
2022 chi2Matrix[0](7, 0) = 0.;
2023 chi2Matrix[0](7, 1) = 0.;
2024 chi2Matrix[0](7, 2) = 0.;
2025 chi2Matrix[0](7, 3) = 0.;
2026 chi2Matrix[0](7, 4) = -0.1716192;
2027 chi2Matrix[0](7, 5) = -0.2067162;
2028 chi2Matrix[0](7, 6) = -0.1883866;
2029 chi2Matrix[0](7, 7) = 0.844935;
2030 chi2Matrix[0](7, 8) = -0.124291;
2031 chi2Matrix[0](7, 9) = 0.;
2032 chi2Matrix[0](8, 0) = 0.;
2033 chi2Matrix[0](8, 1) = 0.;
2034 chi2Matrix[0](8, 2) = 0.;
2035 chi2Matrix[0](8, 3) = 0.;
2036 chi2Matrix[0](8, 4) = -0.1239006;
2037 chi2Matrix[0](8, 5) = -0.1230729;
2038 chi2Matrix[0](8, 6) = -0.1235052;
2039 chi2Matrix[0](8, 7) = -0.124291;
2040 chi2Matrix[0](8, 8) = 0.8749833;
2041 chi2Matrix[0](8, 9) = 0.;
2042 chi2Matrix[0](9, 0) = 0.;
2043 chi2Matrix[0](9, 1) = 0.;
2044 chi2Matrix[0](9, 2) = 0.;
2045 chi2Matrix[0](9, 3) = 0.;
2046 chi2Matrix[0](9, 4) = 0.;
2047 chi2Matrix[0](9, 5) = 0.;
2048 chi2Matrix[0](9, 6) = 0.;
2049 chi2Matrix[0](9, 7) = 0.;
2050 chi2Matrix[0](9, 8) = 0.;
2051 chi2Matrix[0](9, 9) = 0.;
2052 }
else if (getWeightsFromFile_) {
2058 while (!chi2MatrixFile.eof() && tdcBin < nTDCbins_) {
2060 for (
int j = 0;
j < 10; ++
j) {
2061 for (
int l = 0;
l < 10; ++
l) {
2063 chi2MatrixFile >> ww;
2064 chi2Matrix[tdcBin](
j,
l) = ww;
2069 assert(tdcBin == nTDCbins_);
2072 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2079 chi2Matrix_ = chi2Matrix;
2082 std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2MatrixAft(nTDCbins_);
2083 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
2088 chi2MatrixAft[0](0, 0) = 0.;
2089 chi2MatrixAft[0](0, 1) = 0.;
2090 chi2MatrixAft[0](0, 2) = 0.;
2091 chi2MatrixAft[0](0, 3) = 0.;
2092 chi2MatrixAft[0](0, 4) = 0.;
2093 chi2MatrixAft[0](0, 5) = 0.;
2094 chi2MatrixAft[0](0, 6) = 0.;
2095 chi2MatrixAft[0](0, 7) = 0.;
2096 chi2MatrixAft[0](0, 8) = 0.;
2097 chi2MatrixAft[0](0, 9) = 0.;
2098 chi2MatrixAft[0](1, 0) = 0.;
2099 chi2MatrixAft[0](1, 1) = 0.;
2100 chi2MatrixAft[0](1, 2) = 0.;
2101 chi2MatrixAft[0](1, 3) = 0.;
2102 chi2MatrixAft[0](1, 4) = 0.;
2103 chi2MatrixAft[0](1, 5) = 0.;
2104 chi2MatrixAft[0](1, 6) = 0.;
2105 chi2MatrixAft[0](1, 7) = 0.;
2106 chi2MatrixAft[0](1, 8) = 0.;
2107 chi2MatrixAft[0](1, 9) = 0.;
2108 chi2MatrixAft[0](2, 0) = 0.;
2109 chi2MatrixAft[0](2, 1) = 0.;
2110 chi2MatrixAft[0](2, 2) = 0.;
2111 chi2MatrixAft[0](2, 3) = 0.;
2112 chi2MatrixAft[0](2, 4) = 0.;
2113 chi2MatrixAft[0](2, 5) = 0.;
2114 chi2MatrixAft[0](2, 6) = 0.;
2115 chi2MatrixAft[0](2, 7) = 0.;
2116 chi2MatrixAft[0](2, 8) = 0.;
2117 chi2MatrixAft[0](2, 9) = 0.;
2118 chi2MatrixAft[0](3, 0) = 0.;
2119 chi2MatrixAft[0](3, 1) = 0.;
2120 chi2MatrixAft[0](3, 2) = 0.;
2121 chi2MatrixAft[0](3, 3) = 0.;
2122 chi2MatrixAft[0](3, 4) = 0.;
2123 chi2MatrixAft[0](3, 5) = 0.;
2124 chi2MatrixAft[0](3, 6) = 0.;
2125 chi2MatrixAft[0](3, 7) = 0.;
2126 chi2MatrixAft[0](3, 8) = 0.;
2127 chi2MatrixAft[0](3, 9) = 0.;
2128 chi2MatrixAft[0](4, 0) = 0.;
2129 chi2MatrixAft[0](4, 1) = 0.;
2130 chi2MatrixAft[0](4, 2) = 0.;
2131 chi2MatrixAft[0](4, 3) = 0.;
2132 chi2MatrixAft[0](4, 4) = 0.8030884;
2133 chi2MatrixAft[0](4, 5) = -0.2543541;
2134 chi2MatrixAft[0](4, 6) = -0.2243544;
2135 chi2MatrixAft[0](4, 7) = -0.1698177;
2136 chi2MatrixAft[0](4, 8) = -0.1194506;
2137 chi2MatrixAft[0](4, 9) = 0.;
2138 chi2MatrixAft[0](5, 0) = 0.;
2139 chi2MatrixAft[0](5, 1) = 0.;
2140 chi2MatrixAft[0](5, 2) = 0.;
2141 chi2MatrixAft[0](5, 3) = 0.;
2142 chi2MatrixAft[0](5, 4) = -0.2543541;
2143 chi2MatrixAft[0](5, 5) = 0.6714465;
2144 chi2MatrixAft[0](5, 6) = -0.2898025;
2145 chi2MatrixAft[0](5, 7) = -0.2193564;
2146 chi2MatrixAft[0](5, 8) = -0.1542964;
2147 chi2MatrixAft[0](5, 9) = 0.;
2148 chi2MatrixAft[0](6, 0) = 0.;
2149 chi2MatrixAft[0](6, 1) = 0.;
2150 chi2MatrixAft[0](6, 2) = 0.;
2151 chi2MatrixAft[0](6, 3) = 0.;
2152 chi2MatrixAft[0](6, 4) = -0.2243544;
2153 chi2MatrixAft[0](6, 5) = -0.2898025;
2154 chi2MatrixAft[0](6, 6) = 0.7443781;
2155 chi2MatrixAft[0](6, 7) = -0.1934846;
2156 chi2MatrixAft[0](6, 8) = -0.136098;
2157 chi2MatrixAft[0](6, 9) = 0.;
2158 chi2MatrixAft[0](7, 0) = 0.;
2159 chi2MatrixAft[0](7, 1) = 0.;
2160 chi2MatrixAft[0](7, 2) = 0.;
2161 chi2MatrixAft[0](7, 3) = 0.;
2162 chi2MatrixAft[0](7, 4) = -0.1698177;
2163 chi2MatrixAft[0](7, 5) = -0.2193564;
2164 chi2MatrixAft[0](7, 6) = -0.1934846;
2165 chi2MatrixAft[0](7, 7) = 0.8535482;
2166 chi2MatrixAft[0](7, 8) = -0.1030149;
2167 chi2MatrixAft[0](7, 9) = 0.;
2168 chi2MatrixAft[0](8, 0) = 0.;
2169 chi2MatrixAft[0](8, 1) = 0.;
2170 chi2MatrixAft[0](8, 2) = 0.;
2171 chi2MatrixAft[0](8, 3) = 0.;
2172 chi2MatrixAft[0](8, 4) = -0.1194506;
2173 chi2MatrixAft[0](8, 5) = -0.1542964;
2174 chi2MatrixAft[0](8, 6) = -0.136098;
2175 chi2MatrixAft[0](8, 7) = -0.1030149;
2176 chi2MatrixAft[0](8, 8) = 0.9275388;
2177 chi2MatrixAft[0](8, 9) = 0.;
2178 chi2MatrixAft[0](9, 0) = 0.;
2179 chi2MatrixAft[0](9, 1) = 0.;
2180 chi2MatrixAft[0](9, 2) = 0.;
2181 chi2MatrixAft[0](9, 3) = 0.;
2182 chi2MatrixAft[0](9, 4) = 0.;
2183 chi2MatrixAft[0](9, 5) = 0.;
2184 chi2MatrixAft[0](9, 6) = 0.;
2185 chi2MatrixAft[0](9, 7) = 0.;
2186 chi2MatrixAft[0](9, 8) = 0.;
2187 chi2MatrixAft[0](9, 9) = 0.;
2188 }
else if (getWeightsFromFile_) {
2194 while (!chi2MatrixAftFile.eof() && tdcBin < nTDCbins_) {
2196 for (
int j = 0;
j < 10; ++
j) {
2197 for (
int l = 0;
l < 10; ++
l) {
2199 chi2MatrixAftFile >> ww;
2200 chi2MatrixAft[tdcBin](
j,
l) = ww;
2205 assert(tdcBin == nTDCbins_);
2208 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2215 chi2MatrixAft_ = chi2MatrixAft;
2223 auto ecalStatus = std::make_unique<EcalChannelStatus>();
2234 ecalStatus->setValue(ebid, 0);
2243 EEDetId eedetidpos(iX, iY, 1);
2244 ecalStatus->setValue(eedetidpos, 0);
2247 EEDetId eedetidneg(iX, iY, -1);
2248 ecalStatus->setValue(eedetidneg, 0);
2258 if (!statusFile.good()) {
2259 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Problems opening file: " << channelStatusFile_;
2268 while (!statusFile.eof()) {
2269 statusFile >> EcalSubDet;
2271 std::getline(statusFile,
str);
2274 statusFile >> hashIndex >>
status;
2280 ecalStatus->setValue(ebid,
status);
2283 ecalStatus->setValue(eedetid,
status);
2285 edm::LogError(
"EcalTrivialConditionRetriever") <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2295 auto ical = std::make_unique<EcalChannelStatus>();
2303 ical->setValue(ebid, 0);
2312 EEDetId eedetidpos(iX, iY, 1);
2313 ical->setValue(eedetidpos, 0);
2316 EEDetId eedetidneg(iX, iY, -1);
2317 ical->setValue(eedetidneg, 0);
2329 auto ical = std::make_unique<EcalDQMChannelStatus>();
2337 ical->setValue(ebid, sta);
2346 EEDetId eedetidpos(iX, iY, 1);
2347 ical->setValue(eedetidpos, sta);
2350 EEDetId eedetidneg(iX, iY, -1);
2351 ical->setValue(eedetidneg, sta);
2361 auto ical = std::make_unique<EcalDQMTowerStatus>();
2367 for (
int k = 0;
k < 2;
k++) {
2372 for (
int i = 1;
i < 73;
i++) {
2373 for (
int j = 1;
j < 18;
j++) {
2377 ical->setValue(ebid, sta);
2384 for (
int k = 0;
k < 2;
k++) {
2389 for (
int i = 1;
i < 21;
i++) {
2390 for (
int j = 1;
j < 21;
j++) {
2393 ical->setValue(eeid, sta);
2405 auto ical = std::make_unique<EcalDCSTowerStatus>();
2411 for (
int k = 0;
k < 2;
k++) {
2416 for (
int i = 1;
i < 73;
i++) {
2417 for (
int j = 1;
j < 18;
j++) {
2421 ical->setValue(ebid,
status);
2428 for (
int k = 0;
k < 2;
k++) {
2433 for (
int i = 1;
i < 21;
i++) {
2434 for (
int j = 1;
j < 21;
j++) {
2437 ical->setValue(eeid,
status);
2449 auto ical = std::make_unique<EcalDAQTowerStatus>();
2455 for (
int k = 0;
k < 2;
k++) {
2460 for (
int i = 1;
i < 73;
i++) {
2461 for (
int j = 1;
j < 18;
j++) {
2465 ical->setValue(ebid,
status);
2472 for (
int k = 0;
k < 2;
k++) {
2477 for (
int i = 1;
i < 21;
i++) {
2478 for (
int j = 1;
j < 21;
j++) {
2481 ical->setValue(eeid,
status);
2493 auto ecalStatus = std::make_unique<EcalTPGCrystalStatus>();
2504 ecalStatus->setValue(ebid, 0);
2513 EEDetId eedetidpos(iX, iY, 1);
2514 ecalStatus->setValue(eedetidpos, 0);
2517 EEDetId eedetidneg(iX, iY, -1);
2518 ecalStatus->setValue(eedetidneg, 0);
2528 if (!statusFile.good()) {
2529 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Problems opening file: " << channelStatusFile_;
2538 while (!statusFile.eof()) {
2539 statusFile >> EcalSubDet;
2541 std::getline(statusFile,
str);
2544 statusFile >> hashIndex >>
status;
2550 ecalStatus->setValue(ebid,
status);
2553 ecalStatus->setValue(eedetid,
status);
2555 edm::LogError(
"EcalTrivialConditionRetriever") <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2566 auto ical = std::make_unique<EcalTPGCrystalStatus>();
2574 ical->setValue(ebid, 0);
2583 EEDetId eedetidpos(iX, iY, 1);
2584 ical->setValue(eedetidpos, 0);
2587 EEDetId eedetidneg(iX, iY, -1);
2588 ical->setValue(eedetidneg, 0);
2597 std::unique_ptr<EcalIntercalibConstants> ical;
2604 <<
"Reading intercalibration constants from file " << intercalibConstantsFile_.c_str();
2606 if (intercalibConstantsFile_.find(
".xml") != std::string::npos) {
2613 if (totLumi_ != 0 || instLumi_ != 0) {
2618 if (intercalibConstantsMCFile_.find(
".xml") != std::string::npos) {
2625 edm::LogInfo(
"please provide the xml file of the EcalIntercalibConstantsMC");
2628 TRandom3* gRandom =
new TRandom3();
2652 if (idref != mymap.
end())
2653 icalconstant = (*idref);
2657 if (idrefMC != mymapMC.
end())
2658 icalconstantMC = (*idrefMC);
2663 edm::LogInfo(
"EB at eta=") <<
eta <<
" IC=" << icalconstant <<
" ICMC=" << icalconstantMC
2664 <<
" smear=" <<
r <<
" ";
2666 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2673 if (icalconstant != icalconstant2)
2683 EEDetId eedetidpos(iX, iY, 1);
2685 -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
2693 if (idref != mymap.
end())
2694 icalconstant = (*idref);
2698 if (idrefMC != mymapMC.
end())
2699 icalconstantMC = (*idrefMC);
2704 edm::LogInfo(
"EE at eta=") <<
eta <<
" IC=" << icalconstant <<
" ICMC=" << icalconstantMC
2705 <<
" smear=" <<
r <<
" ";
2706 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2712 EEDetId eedetidneg(iX, iY, -1);
2714 -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
2721 if (idrefMC != mymapMC.
end())
2722 icalconstantMC = (*idrefMC);
2725 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2731 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2737 ical = std::make_unique<EcalIntercalibConstants>();
2740 inpFile = fopen(intercalibConstantsFile_.c_str(),
"r");
2742 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << intercalibConstantsFile_;
2743 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
2747 std::ostringstream
str;
2748 fgets(
line, 255, inpFile);
2749 int sm_number = atoi(
line);
2750 str <<
"sm: " << sm_number;
2752 fgets(
line, 255, inpFile);
2755 fgets(
line, 255, inpFile);
2757 str <<
"gen tag: " << gen_tag;
2759 fgets(
line, 255, inpFile);
2761 str <<
"cali method: " << cali_method << std::endl;
2763 fgets(
line, 255, inpFile);
2765 str <<
"cali version: " << cali_version << std::endl;
2767 fgets(
line, 255, inpFile);
2769 str <<
"cali type: " << cali_type;
2771 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"[PIETRO] Intercalibration file - " <<
str.str();
2773 float calib[1700] = {1};
2774 int calib_status[1700] = {0};
2778 while (fgets(
line, 255, inpFile)) {
2781 float dmy_calib = 0.;
2785 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
2788 calib[dmy_num - 1] = dmy_calib;
2789 calib_status[dmy_num - 1] = dmy_status;
2801 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " <<
ii <<
" xtals ";
2803 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
2811 for (
int i = 0;
i < 1700;
i++) {
2821 if (calib_status[
i])
2824 ical->setValue(ebid.
rawId(), 1.);
2837 std::unique_ptr<EcalPFRecHitThresholds> ical;
2845 ical = std::make_unique<EcalPFRecHitThresholds>();
2851 edm::LogInfo(
"Going to multiply the sigmas by ") << pfRecHitThresholdsNSigmas_;
2854 while (!PFRecHitsFile.eof()) {
2867 <<
" thresh: " <<
thresh;
2874 PFRecHitsFile.close();
2881 edm::LogInfo(
"We will multiply the sigma in EE by ") << pfRecHitThresholdsNSigmas_;
2882 edm::LogInfo(
"We will multiply the sigma in EE at high eta by") << pfRecHitThresholdsNSigmasHEta_;
2891 while (!PFRecHitsFileEE.eof()) {
2897 PFRecHitsFileEE >> ix >> iy >> iz >>
thresh;
2901 -
log(
tan(0.5 * atan(
sqrt((ix - 50.5) * (ix - 50.5) + (iy - 50.5) * (iy - 50.5)) * 2.98 / 328.)));
2917 PFRecHitsFileEE.close();
2927 std::unique_ptr<EcalIntercalibConstantsMC> ical;
2934 <<
"Reading intercalibration constants MC from file " << intercalibConstantsMCFile_.c_str();
2936 if (intercalibConstantsMCFile_.find(
".xml") != std::string::npos) {
2937 edm::LogInfo(
"generating Intercalib MC from xml file");
2943 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2954 auto ical = std::make_unique<EcalIntercalibErrors>();
2960 <<
"Reading intercalibration constants from file " << intercalibErrorsFile_.c_str();
2963 inpFile = fopen(intercalibErrorsFile_.c_str(),
"r");
2965 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << intercalibErrorsFile_;
2966 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
2970 std::ostringstream
str;
2971 fgets(
line, 255, inpFile);
2972 int sm_number = atoi(
line);
2973 str <<
"sm: " << sm_number;
2975 fgets(
line, 255, inpFile);
2978 fgets(
line, 255, inpFile);
2980 str <<
"gen tag: " << gen_tag;
2982 fgets(
line, 255, inpFile);
2984 str <<
"cali method: " << cali_method << std::endl;
2986 fgets(
line, 255, inpFile);
2988 str <<
"cali version: " << cali_version << std::endl;
2990 fgets(
line, 255, inpFile);
2992 str <<
"cali type: " << cali_type;
2994 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"[PIETRO] Intercalibration file - " <<
str.str() << std::endl;
2996 float calib[1700] = {1};
2997 int calib_status[1700] = {0};
3001 while (fgets(
line, 255, inpFile)) {
3004 float dmy_calib = 0.;
3008 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3011 calib[dmy_num - 1] = dmy_calib;
3012 calib_status[dmy_num - 1] = dmy_status;
3024 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " <<
ii <<
" xtals ";
3026 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3034 for (
int i = 0;
i < 1700;
i++) {
3044 if (calib_status[
i])
3047 ical->setValue(ebid.
rawId(), 1.);
3060 auto ical = std::make_unique<EcalTimeCalibConstants>();
3066 <<
"Reading time calibration constants from file " << timeCalibConstantsFile_.c_str();
3069 inpFile = fopen(timeCalibConstantsFile_.c_str(),
"r");
3071 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << timeCalibConstantsFile_;
3072 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
3076 std::ostringstream
str;
3077 fgets(
line, 255, inpFile);
3078 int sm_number = atoi(
line);
3079 str <<
"sm: " << sm_number;
3081 fgets(
line, 255, inpFile);
3084 fgets(
line, 255, inpFile);
3086 str <<
"gen tag: " << gen_tag;
3088 fgets(
line, 255, inpFile);
3090 str <<
"cali method: " << cali_method << std::endl;
3092 fgets(
line, 255, inpFile);
3094 str <<
"cali version: " << cali_version << std::endl;
3096 fgets(
line, 255, inpFile);
3098 str <<
"cali type: " << cali_type;
3100 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"TimeCalibration file - " <<
str.str() << std::endl;
3102 float calib[1700] = {1};
3103 int calib_status[1700] = {0};
3107 while (fgets(
line, 255, inpFile)) {
3110 float dmy_calib = 0.;
3114 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3117 calib[dmy_num - 1] = dmy_calib;
3118 calib_status[dmy_num - 1] = dmy_status;
3130 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read timeCalibrations for " <<
ii <<
" xtals ";
3132 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3140 for (
int i = 0;
i < 1700;
i++) {
3150 if (calib_status[
i])
3153 ical->setValue(ebid.
rawId(), 1.);
3164 auto ical = std::make_unique<EcalTimeCalibErrors>();
3170 <<
"Reading timeCalibration constants from file " << timeCalibErrorsFile_.c_str();
3173 inpFile = fopen(timeCalibErrorsFile_.c_str(),
"r");
3175 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << timeCalibErrorsFile_;
3176 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
3180 std::ostringstream
str;
3181 fgets(
line, 255, inpFile);
3182 int sm_number = atoi(
line);
3183 str <<
"sm: " << sm_number;
3185 fgets(
line, 255, inpFile);
3188 fgets(
line, 255, inpFile);
3190 str <<
"gen tag: " << gen_tag;
3192 fgets(
line, 255, inpFile);
3194 str <<
"cali method: " << cali_method << std::endl;
3196 fgets(
line, 255, inpFile);
3198 str <<
"cali version: " << cali_version << std::endl;
3200 fgets(
line, 255, inpFile);
3202 str <<
"cali type: " << cali_type;
3204 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"TimeCalibration file - " <<
str.str() << std::endl;
3206 float calib[1700] = {1};
3207 int calib_status[1700] = {0};
3211 while (fgets(
line, 255, inpFile)) {
3214 float dmy_calib = 0.;
3218 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3221 calib[dmy_num - 1] = dmy_calib;
3222 calib_status[dmy_num - 1] = dmy_status;
3234 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read time calibrations for " <<
ii <<
" xtals ";
3236 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3244 for (
int i = 0;
i < 1700;
i++) {
3254 if (calib_status[
i])
3257 ical->setValue(ebid.
rawId(), 1.);
3270 auto mapping = std::make_unique<EcalMappingElectronics>();
3276 edm::LogError(
"EcalTrivialConditionRetriever") <<
"File not found";
3285 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
3286 int tccid,
tower, pseudostrip_in_TCC, pseudostrip_in_TT;
3290 f >> ix >> iy >> iz >>
CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >>
tower >>
3291 pseudostrip_in_TCC >> pseudostrip_in_TT;
3298 EcalElectronicsId elecid(dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
3304 (*mapping).setValue(detid, aElement);
3313 auto ical = std::make_unique<EcalMappingElectronics>();
3320 double mytrans[3] = {0., 0., 0.};
3321 double myeuler[3] = {0., 0., 0.};
3323 if (getEBAlignmentFromFile_)
3325 std::vector<AlignTransform> my_align;
3328 for (
int SM = 1; SM < 37; SM++) {
3331 iphi = 1 + (SM - 19) * 20;
3336 if (getEBAlignmentFromFile_) {
3337 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3338 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3339 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3341 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3342 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3368 a.m_align = my_align;
3370 return std::make_unique<Alignments>(
a);
3374 double mytrans[3] = {0., 0., 0.};
3375 double myeuler[3] = {0., 0., 0.};
3377 if (getEEAlignmentFromFile_)
3379 std::vector<AlignTransform> my_align;
3383 for (
int Dee = 0; Dee < 4; Dee++) {
3385 if (Dee == 1 || Dee == 3)
3391 EEDetId eedetId(ix, iy, side);
3392 if (getEEAlignmentFromFile_) {
3393 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3394 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3395 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3397 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3398 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3403 a.m_align = my_align;
3404 return std::make_unique<Alignments>(
a);
3408 double mytrans[3] = {0., 0., 0.};
3409 double myeuler[3] = {0., 0., 0.};
3411 if (getESAlignmentFromFile_)
3413 std::vector<AlignTransform> my_align;
3415 int pl_vect[10] = {2, 2, 1, 1, 1, 1, 2, 2};
3421 int ix = 10 + (
layer % 2) * 20;
3422 int plane = pl_vect[
layer];
3426 if (getESAlignmentFromFile_) {
3427 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3428 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3429 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3431 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3432 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3437 a.m_align = my_align;
3438 return std::make_unique<Alignments>(
a);
3442 return std::make_unique<EcalSampleMask>(sampleMaskEB_, sampleMaskEE_);
3447 auto ipar = std::make_unique<EcalTimeBiasCorrections>();
3448 copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(), back_inserter(ipar->EBTimeCorrAmplitudeBins));
3449 copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(), back_inserter(ipar->EBTimeCorrShiftBins));
3450 copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(), back_inserter(ipar->EETimeCorrAmplitudeBins));
3451 copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(), back_inserter(ipar->EETimeCorrShiftBins));
3457 if (getSamplesCorrelationFromFile_) {
3461 for (
int j = 0;
j < 10; ++
j) {
3463 EBG12samplesCorrelation_.push_back(ww);
3465 for (
int j = 0;
j < 10; ++
j) {
3467 EBG6samplesCorrelation_.push_back(ww);
3469 for (
int j = 0;
j < 10; ++
j) {
3471 EBG1samplesCorrelation_.push_back(ww);
3473 for (
int j = 0;
j < 10; ++
j) {
3475 EEG12samplesCorrelation_.push_back(ww);
3477 for (
int j = 0;
j < 10; ++
j) {
3479 EEG6samplesCorrelation_.push_back(ww);
3481 for (
int j = 0;
j < 10; ++
j) {
3483 EEG1samplesCorrelation_.push_back(ww);
3487 auto ipar = std::make_unique<EcalSamplesCorrelation>();
3488 copy(EBG12samplesCorrelation_.begin(), EBG12samplesCorrelation_.end(), back_inserter(ipar->EBG12SamplesCorrelation));
3489 copy(EBG6samplesCorrelation_.begin(), EBG6samplesCorrelation_.end(), back_inserter(ipar->EBG6SamplesCorrelation));
3490 copy(EBG1samplesCorrelation_.begin(), EBG1samplesCorrelation_.end(), back_inserter(ipar->EBG1SamplesCorrelation));
3491 copy(EEG12samplesCorrelation_.begin(), EEG12samplesCorrelation_.end(), back_inserter(ipar->EEG12SamplesCorrelation));
3492 copy(EEG6samplesCorrelation_.begin(), EEG6samplesCorrelation_.end(), back_inserter(ipar->EEG6SamplesCorrelation));
3493 copy(EEG1samplesCorrelation_.begin(), EEG1samplesCorrelation_.end(), back_inserter(ipar->EEG1SamplesCorrelation));
3499 auto result = std::make_unique<EcalSimPulseShape>();
3502 result->time_interval = sim_pulse_shape_TI_;
3505 std::vector<double> EBshape;
3506 std::vector<double> EEshape;
3507 std::vector<double> APDshape;
3510 if (!EBSimPulseShapeFile_.empty()) {
3511 std::ifstream shapeEBFile;
3512 shapeEBFile.open(EBSimPulseShapeFile_.c_str());
3514 while (shapeEBFile >> ww)
3515 EBshape.push_back(ww);
3516 shapeEBFile.close();
3518 if (!EESimPulseShapeFile_.empty()) {
3519 std::ifstream shapeEEFile;
3520 shapeEEFile.open(EESimPulseShapeFile_.c_str());
3522 while (shapeEEFile >> ww)
3523 EEshape.push_back(ww);
3524 shapeEEFile.close();
3526 if (!APDSimPulseShapeFile_.empty()) {
3527 std::ifstream shapeAPDFile;
3528 shapeAPDFile.open(APDSimPulseShapeFile_.c_str());
3530 while (shapeAPDFile >> ww)
3531 APDshape.push_back(ww);
3532 shapeAPDFile.close();
3536 result->barrel_thresh = sim_pulse_shape_EB_thresh_;
3537 result->endcap_thresh = sim_pulse_shape_EE_thresh_;
3538 result->apd_thresh = sim_pulse_shape_APD_thresh_;
3541 copy(EBshape.begin(), EBshape.end(), back_inserter(
result->barrel_shape));
3542 copy(EEshape.begin(), EEshape.end(), back_inserter(
result->endcap_shape));
3543 copy(APDshape.begin(), APDshape.end(), back_inserter(
result->apd_shape));
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 &)
std::string fullPath() const
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 &)
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
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
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< 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
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 &)
const self & getMap() const
const_iterator end() const
virtual std::unique_ptr< EcalTimeCalibConstants > getTimeCalibConstantsFromConfiguration(const EcalTimeCalibConstantsRcd &)
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 &)