90 pfRecHitThresholdsNSigmasHEta_ = ps.
getUntrackedParameter<
double>(
"EcalPFRecHitThresholdNSigmasHEta", 1.0);
94 localContCorrParameters_ =
96 crackCorrParameters_ = ps.
getUntrackedParameter<std::vector<double> >(
"crackCorrParameters", std::vector<double>(0));
97 energyCorrectionParameters_ =
99 energyUncertaintyParameters_ =
100 ps.
getUntrackedParameter<std::vector<double> >(
"energyUncertaintyParameters", std::vector<double>(0));
102 "energyCorrectionObjectSpecificParameters", std::vector<double>(0));
126 EBtimeCorrAmplitudeBins_ =
128 EBtimeCorrShiftBins_ = ps.
getUntrackedParameter<std::vector<double> >(
"EBtimeCorrShiftBins", std::vector<double>());
129 EEtimeCorrAmplitudeBins_ =
131 EEtimeCorrShiftBins_ = ps.
getUntrackedParameter<std::vector<double> >(
"EEtimeCorrShiftBins", std::vector<double>());
133 EBG12samplesCorrelation_ =
135 EBG6samplesCorrelation_ =
137 EBG1samplesCorrelation_ =
139 EEG12samplesCorrelation_ =
141 EEG6samplesCorrelation_ =
143 EEG1samplesCorrelation_ =
146 sim_pulse_shape_EB_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_EB_thresh");
147 sim_pulse_shape_EE_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_EE_thresh");
148 sim_pulse_shape_APD_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_APD_thresh");
159 edm::LogInfo(
" EcalTrivialConditionRetriever going to create conditions based on the damage due to ")
160 << totLumi_ <<
" fb-1 integrated luminosity";
163 if (weightsForAsynchronousRunning_) {
164 getWeightsFromFile_ =
true;
170 std::ostringstream
str;
172 if (!weightsForAsynchronousRunning_)
177 weightType =
str.str();
180 amplWeightsAftFile_ =
186 jittWeightsAftFile_ =
192 amplWeights_.resize(nTDCbins_);
193 amplWeightsAft_.resize(nTDCbins_);
194 pedWeights_.resize(nTDCbins_);
195 pedWeightsAft_.resize(nTDCbins_);
196 jittWeights_.resize(nTDCbins_);
197 jittWeightsAft_.resize(nTDCbins_);
198 chi2Matrix_.resize(nTDCbins_);
199 chi2MatrixAft_.resize(nTDCbins_);
202 getWeightsFromConfiguration(ps);
208 producedEcalADCToGeVConstant_ = ps.
getUntrackedParameter<
bool>(
"producedEcalADCToGeVConstant",
true);
210 producedEcalMappingElectronics_ = ps.
getUntrackedParameter<
bool>(
"producedEcalMappingElectronics",
true);
213 if (producedEcalMappingElectronics_) {
214 if (!mappingFile_.empty()) {
219 findingRecord<EcalMappingElectronicsRcd>();
223 if (getEBAlignmentFromFile_) {
228 if (getEEAlignmentFromFile_) {
233 if (getESAlignmentFromFile_)
240 if (producedEcalPedestals_)
243 if (producedEcalWeights_) {
248 if (producedEcalGainRatios_)
251 if (producedEcalADCToGeVConstant_)
255 producedEcalTimeOffsetConstant_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeOffsetConstant",
true);
257 if (producedEcalTimeOffsetConstant_) {
259 findingRecord<EcalTimeOffsetConstantRcd>();
263 producedEcalLinearCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalLinearCorrections",
true);
266 if (producedEcalLinearCorrections_) {
267 if (!linearCorrectionsFile_.empty()) {
272 findingRecord<EcalLinearCorrectionsRcd>();
276 producedEcalIntercalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstants",
true);
281 if (producedEcalIntercalibConstants_) {
282 if (!intercalibConstantsFile_.empty()) {
287 findingRecord<EcalIntercalibConstantsRcd>();
290 producedEcalIntercalibConstantsMC_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstantsMC",
true);
292 if (producedEcalIntercalibConstantsMC_) {
293 if (!intercalibConstantsMCFile_.empty()) {
298 findingRecord<EcalIntercalibConstantsMCRcd>();
302 producedEcalIntercalibErrors_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibErrors",
true);
305 if (producedEcalIntercalibErrors_) {
306 if (!intercalibErrorsFile_.empty()) {
311 findingRecord<EcalIntercalibErrorsRcd>();
315 producedEcalTimeCalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeCalibConstants",
true);
318 if (producedEcalTimeCalibConstants_) {
319 if (!timeCalibConstantsFile_.empty()) {
324 findingRecord<EcalTimeCalibConstantsRcd>();
331 if (producedEcalTimeCalibErrors_) {
332 if (!timeCalibErrorsFile_.empty()) {
337 findingRecord<EcalTimeCalibErrorsRcd>();
347 if (producedEcalSimPulseShape_) {
349 findingRecord<EcalSimPulseShapeRcd>();
352 producedEcalPFRecHitThresholds_ = ps.
getUntrackedParameter<
bool>(
"producedEcalPFRecHitThresholds",
false);
358 if (producedEcalPFRecHitThresholds_) {
359 if (!pfRecHitFile_.empty()) {
364 findingRecord<EcalPFRecHitThresholdsRcd>();
368 producedEcalClusterLocalContCorrParameters_ =
370 producedEcalClusterCrackCorrParameters_ =
372 producedEcalClusterEnergyCorrectionParameters_ =
374 producedEcalClusterEnergyUncertaintyParameters_ =
376 producedEcalClusterEnergyCorrectionObjectSpecificParameters_ =
377 ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionObjectSpecificParameters",
false);
378 if (producedEcalClusterLocalContCorrParameters_) {
380 findingRecord<EcalClusterLocalContCorrParametersRcd>();
382 if (producedEcalClusterCrackCorrParameters_) {
384 findingRecord<EcalClusterCrackCorrParametersRcd>();
386 if (producedEcalClusterEnergyCorrectionParameters_) {
388 findingRecord<EcalClusterEnergyCorrectionParametersRcd>();
390 if (producedEcalClusterEnergyUncertaintyParameters_) {
392 findingRecord<EcalClusterEnergyUncertaintyParametersRcd>();
394 if (producedEcalClusterEnergyCorrectionObjectSpecificParameters_) {
396 findingRecord<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>();
401 if (producedEcalLaserCorrection_) {
404 findingRecord<EcalLaserAlphasRcd>();
409 edm::LogInfo(
" getLaserAlphaFromFileEB_ ") << getLaserAlphaFromFileEB_;
410 edm::LogInfo(
" getLaserAlphaFromFileEE_ ") << getLaserAlphaFromFileEE_;
411 edm::LogInfo(
" getLaserAlphaFromTypeEB_ ") << getLaserAlphaFromTypeEB_;
412 edm::LogInfo(
" getLaserAlphaFromTypeEE_ ") << getLaserAlphaFromTypeEE_;
413 if (getLaserAlphaFromFileEB_) {
415 "EBLaserAlphaFile",
path +
"EBLaserAlpha.txt");
417 if (getLaserAlphaFromFileEE_) {
419 "EELaserAlphaFile",
path +
"EELaserAlpha.txt");
421 if (getLaserAlphaFromTypeEB_) {
425 "EBLaserAlphaFile",
path +
"EBLaserAlpha.txt");
427 if (getLaserAlphaFromTypeEE_) {
435 "EELaserAlphaFile",
path +
"EELaserAlpha.txt");
437 "EELaserAlphaFile2",
path +
"EELaserAlpha2.txt");
440 findingRecord<EcalLaserAPDPNRatiosRefRcd>();
442 findingRecord<EcalLaserAPDPNRatiosRcd>();
449 if (producedEcalChannelStatus_) {
450 if (!channelStatusFile_.empty()) {
455 findingRecord<EcalChannelStatusRcd>();
458 producedEcalDQMChannelStatus_ = ps.
getUntrackedParameter<
bool>(
"producedEcalDQMChannelStatus",
true);
459 if (producedEcalDQMChannelStatus_) {
461 findingRecord<EcalDQMChannelStatusRcd>();
465 if (producedEcalDCSTowerStatus_) {
467 findingRecord<EcalDCSTowerStatusRcd>();
471 if (producedEcalDAQTowerStatus_) {
473 findingRecord<EcalDAQTowerStatusRcd>();
477 if (producedEcalDQMTowerStatus_) {
479 findingRecord<EcalDQMTowerStatusRcd>();
483 producedEcalTrgChannelStatus_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTrgChannelStatus",
true);
486 if (producedEcalTrgChannelStatus_) {
487 if (!trgChannelStatusFile_.empty()) {
492 findingRecord<EcalTPGCrystalStatusRcd>();
497 if (producedEcalAlignmentEB_) {
499 findingRecord<EBAlignmentRcd>();
502 if (producedEcalAlignmentEE_) {
504 findingRecord<EEAlignmentRcd>();
507 if (producedEcalAlignmentES_) {
509 findingRecord<ESAlignmentRcd>();
512 if (producedEcalPedestals_)
513 findingRecord<EcalPedestalsRcd>();
515 if (producedEcalWeights_) {
516 findingRecord<EcalWeightXtalGroupsRcd>();
517 findingRecord<EcalTBWeightsRcd>();
520 if (producedEcalGainRatios_)
521 findingRecord<EcalGainRatiosRcd>();
523 if (producedEcalADCToGeVConstant_)
524 findingRecord<EcalADCToGeVConstantRcd>();
527 if (producedEcalSampleMask_) {
529 findingRecord<EcalSampleMaskRcd>();
531 producedEcalTimeBiasCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeBiasCorrections",
false);
532 if (producedEcalTimeBiasCorrections_) {
534 findingRecord<EcalTimeBiasCorrectionsRcd>();
536 producedEcalSamplesCorrelation_ = ps.
getUntrackedParameter<
bool>(
"producedEcalSamplesCorrelation",
false);
537 if (producedEcalSamplesCorrelation_) {
539 findingRecord<EcalSamplesCorrelationRcd>();
540 getSamplesCorrelationFromFile_ = ps.
getUntrackedParameter<
bool>(
"getSamplesCorrelationFromFile",
false);
541 if (getSamplesCorrelationFromFile_) {
542 SamplesCorrelationFile_ =
557 edm::LogInfo(
"EcalTrivialConditionRetriever::setIntervalFor(): record key = ")
565 auto peds = std::make_unique<EcalPedestals>();
570 EBitem.
rms_x1 = EBpedRMSX1_;
572 EBitem.
rms_x6 = EBpedRMSX6_;
577 EEitem.
rms_x1 = EEpedRMSX1_;
579 EEitem.
rms_x6 = EEpedRMSX6_;
596 EBitem.
rms_x1 = EBpedRMSX1_ * noisefactor;
597 EBitem.
rms_x6 = EBpedRMSX6_ * noisefactor;
598 EBitem.
rms_x12 = EBpedRMSX12_ * noisefactor;
606 peds->insert(std::make_pair(ebdetid.
rawId(), EBitem));
616 peds->insert(std::make_pair(eedetidpos.
rawId(), EEitem));
619 EEDetId eedetidneg(iX, iY, -1);
620 peds->insert(std::make_pair(eedetidneg.
rawId(), EEitem));
631 auto xtalGroups = std::make_unique<EcalWeightXtalGroups>();
641 xtalGroups->setValue(ebid.
rawId(), defaultGroupId);
651 xtalGroups->setValue(eedetidpos.
rawId(), defaultGroupId);
654 EEDetId eedetidneg(iX, iY, -1);
655 xtalGroups->setValue(eedetidneg.
rawId(), defaultGroupId);
664 auto ical = std::make_unique<EcalLinearCorrections>();
672 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
675 pairAPDPN.
p1 = linCorrMean_ +
r * linCorrSigma_;
676 pairAPDPN.
p2 = linCorrMean_ +
r * linCorrSigma_;
677 pairAPDPN.
p3 = linCorrMean_ +
r * linCorrSigma_;
678 ical->setValue(ebid, pairAPDPN);
687 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
691 pairAPDPN.
p1 = linCorrMean_ +
r * linCorrSigma_;
692 pairAPDPN.
p2 = linCorrMean_ +
r * linCorrSigma_;
693 pairAPDPN.
p3 = linCorrMean_ +
r * linCorrSigma_;
695 ical->setValue(eedetidpos, pairAPDPN);
699 double r1 = (double)
std::rand() / (double(RAND_MAX) + double(1));
700 EEDetId eedetidneg(iX, iY, -1);
703 pairAPDPN.
p1 = linCorrMean_ +
r1 * linCorrSigma_;
704 pairAPDPN.
p2 = linCorrMean_ +
r1 * linCorrSigma_;
705 pairAPDPN.
p3 = linCorrMean_ +
r1 * linCorrSigma_;
707 ical->setValue(eedetidneg, pairAPDPN);
714 for (
int i = 0;
i < 92;
i++) {
716 if (linearTime2_ == 0) {
721 if (linearTime3_ == 0) {
727 ical->setTime(
i, TimeStamp);
737 auto ical = std::make_unique<EcalPFRecHitThresholds>();
746 ical->setValue(ebid.
rawId(), pfRecHitThresholdsEB_);
756 ical->setValue(eedetidpos.
rawId(), pfRecHitThresholdsEE_);
759 EEDetId eedetidneg(iX, iY, -1);
760 ical->setValue(eedetidneg.
rawId(), pfRecHitThresholdsEE_);
772 auto ical = std::make_unique<EcalIntercalibConstants>();
781 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
782 ical->setValue(ebid.
rawId(), intercalibConstantMean_ +
r * intercalibConstantSigma_);
791 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
793 ical->setValue(eedetidpos.
rawId(), intercalibConstantMean_ +
r * intercalibConstantSigma_);
796 double r1 = (double)
std::rand() / (double(RAND_MAX) + double(1));
797 EEDetId eedetidneg(iX, iY, -1);
798 ical->setValue(eedetidneg.
rawId(), intercalibConstantMean_ +
r1 * intercalibConstantSigma_);
808 auto ical = std::make_unique<EcalIntercalibConstantsMC>();
817 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
818 ical->setValue(ebid.
rawId(), intercalibConstantMeanMC_ +
r * intercalibConstantSigmaMC_);
827 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
829 ical->setValue(eedetidpos.
rawId(), intercalibConstantMeanMC_ +
r * intercalibConstantSigmaMC_);
832 double r1 = (double)
std::rand() / (double(RAND_MAX) + double(1));
833 EEDetId eedetidneg(iX, iY, -1);
834 ical->setValue(eedetidneg.
rawId(), intercalibConstantMeanMC_ +
r1 * intercalibConstantSigmaMC_);
844 auto ical = std::make_unique<EcalIntercalibErrors>();
853 ical->setValue(ebid.
rawId(), intercalibErrorMean_);
863 ical->setValue(eedetidpos.
rawId(), intercalibErrorMean_);
866 EEDetId eedetidneg(iX, iY, -1);
867 ical->setValue(eedetidneg.
rawId(), intercalibErrorMean_);
877 auto ical = std::make_unique<EcalTimeCalibConstants>();
886 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
887 ical->setValue(ebid.
rawId(), timeCalibConstantMean_ +
r * timeCalibConstantSigma_);
896 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
898 ical->setValue(eedetidpos.
rawId(), timeCalibConstantMean_ +
r * timeCalibConstantSigma_);
901 double r1 = (double)
std::rand() / (double(RAND_MAX) + double(1));
902 EEDetId eedetidneg(iX, iY, -1);
903 ical->setValue(eedetidneg.
rawId(), timeCalibConstantMean_ +
r1 * timeCalibConstantSigma_);
913 auto ical = std::make_unique<EcalTimeCalibErrors>();
922 ical->setValue(ebid.
rawId(), timeCalibErrorMean_);
932 ical->setValue(eedetidpos.
rawId(), timeCalibErrorMean_);
935 EEDetId eedetidneg(iX, iY, -1);
936 ical->setValue(eedetidneg.
rawId(), timeCalibErrorMean_);
947 edm::LogInfo(
" EB ") << timeOffsetEBConstant_ <<
" EE " << timeOffsetEEConstant_;
948 return std::make_unique<EcalTimeOffsetConstant>(timeOffsetEBConstant_, timeOffsetEEConstant_);
952 auto gratio = std::make_unique<EcalGainRatios>();
963 gratio->setValue(ebid.
rawId(), gr);
973 gratio->setValue(eedetidpos.
rawId(), gr);
976 EEDetId eedetidneg(iX, iY, -1);
977 gratio->setValue(eedetidneg.
rawId(), gr);
987 return std::make_unique<EcalADCToGeVConstant>(adcToGeVEBConstant_, adcToGeVEEConstant_);
992 auto tbwgt = std::make_unique<EcalTBWeights>();
999 for (
int itdc = 1; itdc <= nTDCbins_; ++itdc) {
1030 mat1.Place_in_row(amplWeights_[itdc - 1], 0, 0);
1031 mat1.Place_in_row(pedWeights_[itdc - 1], 1, 0);
1032 mat1.Place_in_row(jittWeights_[itdc - 1], 2, 0);
1035 mat2.Place_in_row(amplWeightsAft_[itdc - 1], 0, 0);
1036 mat2.Place_in_row(pedWeightsAft_[itdc - 1], 1, 0);
1037 mat2.Place_in_row(jittWeightsAft_[itdc - 1], 2, 0);
1043 mat3 = chi2Matrix_[itdc - 1];
1044 mat4 = chi2MatrixAft_[itdc - 1];
1066 tbwgt->setValue(std::make_pair(igrp, itdc), wgt);
1073 std::unique_ptr<EcalClusterLocalContCorrParameters>
1075 auto ipar = std::make_unique<EcalClusterLocalContCorrParameters>();
1076 for (
size_t i = 0;
i < localContCorrParameters_.size(); ++
i) {
1077 ipar->params().push_back(localContCorrParameters_[
i]);
1083 auto ipar = std::make_unique<EcalClusterCrackCorrParameters>();
1084 for (
size_t i = 0;
i < crackCorrParameters_.size(); ++
i) {
1085 ipar->params().push_back(crackCorrParameters_[
i]);
1089 std::unique_ptr<EcalClusterEnergyCorrectionParameters>
1092 auto ipar = std::make_unique<EcalClusterEnergyCorrectionParameters>();
1093 for (
size_t i = 0;
i < energyCorrectionParameters_.size(); ++
i) {
1094 ipar->params().push_back(energyCorrectionParameters_[
i]);
1098 std::unique_ptr<EcalClusterEnergyUncertaintyParameters>
1101 auto ipar = std::make_unique<EcalClusterEnergyUncertaintyParameters>();
1102 for (
size_t i = 0;
i < energyUncertaintyParameters_.size(); ++
i) {
1103 ipar->params().push_back(energyUncertaintyParameters_[
i]);
1107 std::unique_ptr<EcalClusterEnergyCorrectionObjectSpecificParameters>
1110 auto ipar = std::make_unique<EcalClusterEnergyCorrectionObjectSpecificParameters>();
1111 for (
size_t i = 0;
i < energyCorrectionObjectSpecificParameters_.size(); ++
i) {
1112 ipar->params().push_back(energyCorrectionObjectSpecificParameters_[
i]);
1297 auto ical = std::make_unique<EcalLaserAlphas>();
1300 if (getLaserAlphaFromTypeEB_) {
1302 int SMpos[36] = {-10, 4, -7, -16, 6, -9, 11, -17, 5, 18, 3, -8, 1, -3, -13, 14, -6, 2,
1303 15, -18, 8, 17, -2, 9, -1, 10, -5, 7, -12, -11, 16, -4, -15, -14, 12, 13};
1305 int SMCal[36] = {12, 17, 10, 1, 8, 4, 27, 20, 23, 25, 6, 34, 35, 15, 18, 30, 21, 9,
1306 24, 22, 13, 31, 26, 16, 2, 11, 5, 0, 29, 28, 14, 33, 32, 3, 7, 19};
1308 for (
int SMcons = 0; SMcons < 36; SMcons++) {
1309 int SM = SMpos[SMcons];
1314 if (SMCal[SM] != SMcons)
1315 edm::LogInfo(
" SM pb : read SM ") << SMcons <<
" SMpos " << SM <<
" SMCal " << SMCal[SM];
1319 int readSM,
pos, bar, bar2;
1321 for (
int SMcons = 0; SMcons < 36; SMcons++) {
1322 int SM = SMpos[SMcons];
1323 for (
int ic = 0; ic < 1700; ic++) {
1326 if (readSM != SMcons ||
pos != ic + 1)
1328 << readSM <<
" const SM " << SMcons <<
" read pos " <<
pos <<
" ic " << ic;
1332 if (bar == 33101 || bar == 30301)
1333 alpha = laserAlphaMeanEBR_;
1334 else if (bar == 33106) {
1336 alpha = laserAlphaMeanEBC_;
1339 << bar <<
" last " << bar2 <<
" read SM " << readSM <<
" read pos " <<
pos;
1340 alpha = laserAlphaMeanEBR_;
1343 ical->setValue(ebdetid,
alpha);
1352 }
else if (getLaserAlphaFromFileEB_) {
1354 edm::LogInfo(
"Laser alpha for EB will be taken from File");
1359 for (
int ic = 0; ic < 61200; ic++) {
1364 ical->setValue(ebid,
alpha);
1368 edm::LogInfo(
"I will print some alphas from the file... ieta/iphi/alpha ")
1384 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
1385 ical->setValue(ebid, laserAlphaMean_ +
r * laserAlphaSigma_);
1394 int itype, iring, iyear;
1396 float las[2][140][6];
1398 if (getLaserAlphaFromTypeEE_) {
1402 for (
int i = 0;
i < 1681;
i++) {
1403 fRing >> itype >> iring >> iyear >>
laser;
1404 edm::LogInfo(
" ") << itype <<
" " << iring <<
" " << iyear <<
" " <<
laser << std::endl;
1405 las[itype][iring][iyear] =
laser;
1411 for (
int crystal = 0; crystal < 14648; crystal++) {
1412 int x,
y,
z, bid, bar, bar2;
1413 float LY,
alpha = 0;
1414 fEE >>
z >>
x >>
y >> LY >> bid >> bar >> bar2;
1415 if (x < 1 || x > 100 || y < 1 || y > 100)
1416 edm::LogInfo(
" wrong coordinates for barcode ") << bar <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1419 int iring = (
int)(
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5)) + 85);
1421 double eta = -
log(
tan(0.5 * atan(
sqrt((
x - 50.5) * (
x - 50.5) + (
y - 50.5) * (
y - 50.5)) * 2.98 / 328.)));
1423 if (bar == 33201 || (bar == 30399 && bar2 < 568)) {
1425 alpha = laserAlphaMeanEER_;
1427 double raggio = 50.5 -
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5));
1446 edm::LogInfo(
"R=") << raggio <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z <<
"eta=" <<
eta
1447 <<
" alpha=" <<
alpha <<
" R";
1449 }
else if ((bar == 33106 && bar2 > 2000 && bar2 < 4669) || (bar == 30399 && bar2 > 567)) {
1452 alpha = laserAlphaMeanEEC_;
1454 double raggio = 50.5 -
sqrt(((
float)
x - 50.5) * ((
float)
x - 50.5) + ((
float)
y - 50.5) * ((
float)
y - 50.5));
1460 float r =
sqrt((
x - 50.5) * (
x - 50.5) + (
y - 50.5) * (
y - 50.5));
1465 if (las[itype][iring][iyear] != 999) {
1466 alpha = 0.7312 + 0.2688 * las[itype][iring][iyear];
1471 edm::LogInfo(
"R=") << raggio <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z <<
"eta=" <<
eta
1472 <<
" alpha=" <<
alpha <<
" C";
1475 edm::LogInfo(
" problem with barcode ") << bar <<
" " << bar2 <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1476 alpha = laserAlphaMeanEER_;
1482 ical->setValue(eedetidpos,
alpha);
1486 edm::LogInfo(
" problem with EEDetId ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1489 edm::LogInfo(
"Number of inner SIC crystals with different alpha= ") << nxt;
1492 }
else if (getLaserAlphaFromFileEE_) {
1497 for (
int crystal = 0; crystal < 14648; crystal++) {
1501 if (x < 1 || x > 100 || y < 1 || y > 100 ||
z == 0 ||
z > 1 ||
z < -1) {
1502 edm::LogInfo(
"ERROR: wrong coordinates for crystal ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1503 edm::LogInfo(
" the format of the file should be z x y alpha ");
1507 ical->setValue(eedetidpos,
alpha);
1509 edm::LogInfo(
" problem with EEDetId ") <<
" x " <<
x <<
" y " <<
y <<
" z " <<
z;
1522 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
1523 EEDetId eedetidpos(iX, iY, 1);
1524 ical->setValue(eedetidpos, laserAlphaMean_ +
r * laserAlphaSigma_);
1527 double r1 = (double)
std::rand() / (double(RAND_MAX) + double(1));
1528 EEDetId eedetidneg(iX, iY, -1);
1529 ical->setValue(eedetidneg, laserAlphaMean_ +
r1 * laserAlphaSigma_);
1540 auto ical = std::make_unique<EcalLaserAPDPNRatiosRef>();
1547 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
1548 ical->setValue(ebid, laserAPDPNRefMean_ +
r * laserAPDPNRefSigma_);
1557 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
1558 EEDetId eedetidpos(iX, iY, 1);
1559 ical->setValue(eedetidpos, laserAPDPNRefMean_ +
r * laserAPDPNRefSigma_);
1563 double r1 = (double)
std::rand() / (double(RAND_MAX) + double(1));
1564 EEDetId eedetidneg(iX, iY, -1);
1565 ical->setValue(eedetidneg, laserAPDPNRefMean_ +
r1 * laserAPDPNRefSigma_);
1579 auto ical = std::make_unique<EcalLaserAPDPNRatios>();
1593 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
1596 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1597 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1598 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1599 ical->setValue(ebid, pairAPDPN);
1611 double r = (double)
std::rand() / (double(RAND_MAX) + double(1));
1612 EEDetId eedetidpos(iX, iY, 1);
1614 double eta = -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
1620 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1621 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1622 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r * laserAPDPNSigma_;
1623 ical->setValue(eedetidpos, pairAPDPN);
1627 double r1 = (double)
std::rand() / (double(RAND_MAX) + double(1));
1628 EEDetId eedetidneg(iX, iY, -1);
1630 double eta = -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
1636 pairAPDPN.
p1 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1637 pairAPDPN.
p2 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1638 pairAPDPN.
p3 = laserAPDPNMean_ *
drop +
r1 * laserAPDPNSigma_;
1639 ical->setValue(eedetidneg, pairAPDPN);
1646 for (
int i = 0;
i < 92;
i++) {
1648 if (laserAPDPNTime2_ == 0) {
1653 if (laserAPDPNTime3_ == 0) {
1659 ical->setTime(
i, TimeStamp);
1666 std::vector<std::vector<double> > amplwgtv(nTDCbins_);
1668 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1669 std::vector<double> vampl;
1671 vampl.push_back(-0.33333);
1672 vampl.push_back(-0.33333);
1673 vampl.push_back(-0.33333);
1674 vampl.push_back(0.);
1675 vampl.push_back(0.);
1676 vampl.push_back(1.);
1677 vampl.push_back(0.);
1678 vampl.push_back(0.);
1679 vampl.push_back(0.);
1680 vampl.push_back(0.);
1682 }
else if (getWeightsFromFile_) {
1687 while (!amplFile.eof() && tdcBin < nTDCbins_) {
1688 for (
int j = 0;
j < 10; ++
j) {
1691 amplwgtv[tdcBin].push_back(ww);
1695 assert(tdcBin == nTDCbins_);
1699 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1703 for (
int i = 0;
i < nTDCbins_;
i++) {
1706 for (std::vector<double>::const_iterator it = amplwgtv[
i].
begin(); it != amplwgtv[
i].end(); ++it) {
1707 (amplWeights_[
i])[
j] = *it;
1712 std::vector<std::vector<double> > amplwgtvAftGain(nTDCbins_);
1714 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1715 std::vector<double> vamplAftGain;
1716 vamplAftGain.push_back(0.);
1717 vamplAftGain.push_back(0.);
1718 vamplAftGain.push_back(0.);
1719 vamplAftGain.push_back(0.);
1720 vamplAftGain.push_back(0.);
1721 vamplAftGain.push_back(1.);
1722 vamplAftGain.push_back(0.);
1723 vamplAftGain.push_back(0.);
1724 vamplAftGain.push_back(0.);
1725 vamplAftGain.push_back(0.);
1726 amplwgtvAftGain[0] = ps.
getUntrackedParameter<std::vector<double> >(
"amplWeightsAftGain", vamplAftGain);
1727 }
else if (getWeightsFromFile_) {
1729 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading amplitude weights aftre gain switch from file "
1733 while (!amplFile.eof() && tdcBin < nTDCbins_) {
1734 for (
int j = 0;
j < 10; ++
j) {
1737 amplwgtvAftGain[tdcBin].push_back(ww);
1741 assert(tdcBin == nTDCbins_);
1744 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1748 for (
int i = 0;
i < nTDCbins_;
i++) {
1751 for (std::vector<double>::const_iterator it = amplwgtvAftGain[
i].
begin(); it != amplwgtvAftGain[
i].end(); ++it) {
1752 (amplWeightsAft_[
i])[
j] = *it;
1759 std::vector<std::vector<double> > pedwgtv(nTDCbins_);
1761 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1762 std::vector<double> vped;
1763 vped.push_back(0.33333);
1764 vped.push_back(0.33333);
1765 vped.push_back(0.33333);
1774 }
else if (getWeightsFromFile_) {
1780 while (!pedFile.eof() && tdcBin < nTDCbins_) {
1781 for (
int j = 0;
j < 10; ++
j) {
1784 pedwgtv[tdcBin].push_back(ww);
1788 assert(tdcBin == nTDCbins_);
1791 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1795 for (
int i = 0;
i < nTDCbins_;
i++) {
1798 for (std::vector<double>::const_iterator it = pedwgtv[
i].
begin(); it != pedwgtv[
i].end(); ++it) {
1799 (pedWeights_[
i])[
j] = *it;
1804 std::vector<std::vector<double> > pedwgtvaft(nTDCbins_);
1806 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1807 std::vector<double> vped;
1819 }
else if (getWeightsFromFile_) {
1821 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading pedestal after gain switch weights from file "
1825 while (!pedFile.eof() && tdcBin < nTDCbins_) {
1826 for (
int j = 0;
j < 10; ++
j) {
1829 pedwgtvaft[tdcBin].push_back(ww);
1833 assert(tdcBin == nTDCbins_);
1836 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1840 for (
int i = 0;
i < nTDCbins_;
i++) {
1843 for (std::vector<double>::const_iterator it = pedwgtvaft[
i].
begin(); it != pedwgtvaft[
i].end(); ++it) {
1844 (pedWeightsAft_[
i])[
j] = *it;
1851 std::vector<std::vector<double> > jittwgtv(nTDCbins_);
1853 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1854 std::vector<double> vjitt;
1855 vjitt.push_back(0.04066309);
1856 vjitt.push_back(0.04066309);
1857 vjitt.push_back(0.04066309);
1858 vjitt.push_back(0.000);
1859 vjitt.push_back(1.325176);
1860 vjitt.push_back(-0.04997078);
1861 vjitt.push_back(-0.504338);
1862 vjitt.push_back(-0.5024844);
1863 vjitt.push_back(-0.3903718);
1864 vjitt.push_back(0.000);
1866 }
else if (getWeightsFromFile_) {
1872 while (!jittFile.eof() && tdcBin < nTDCbins_) {
1873 for (
int j = 0;
j < 10; ++
j) {
1876 jittwgtv[tdcBin].push_back(ww);
1880 assert(tdcBin == nTDCbins_);
1883 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1887 for (
int i = 0;
i < nTDCbins_;
i++) {
1890 for (std::vector<double>::const_iterator it = jittwgtv[
i].
begin(); it != jittwgtv[
i].end(); ++it) {
1891 (jittWeights_[
i])[
j] = *it;
1896 std::vector<std::vector<double> > jittwgtvaft(nTDCbins_);
1898 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1899 std::vector<double> vjitt;
1900 vjitt.push_back(0.);
1901 vjitt.push_back(0.);
1902 vjitt.push_back(0.);
1903 vjitt.push_back(0.);
1904 vjitt.push_back(1.097871);
1905 vjitt.push_back(-0.04551035);
1906 vjitt.push_back(-0.4159156);
1907 vjitt.push_back(-0.4185352);
1908 vjitt.push_back(-0.3367127);
1909 vjitt.push_back(0.);
1911 }
else if (getWeightsFromFile_) {
1913 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading jitter after gain switch weights from file "
1917 while (!jittFile.eof() && tdcBin < nTDCbins_) {
1918 for (
int j = 0;
j < 10; ++
j) {
1921 jittwgtvaft[tdcBin].push_back(ww);
1925 assert(tdcBin == nTDCbins_);
1928 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1932 for (
int i = 0;
i < nTDCbins_;
i++) {
1935 for (std::vector<double>::const_iterator it = jittwgtvaft[
i].
begin(); it != jittwgtvaft[
i].end(); ++it) {
1936 (jittWeightsAft_[
i])[
j] = *it;
1941 std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2Matrix(nTDCbins_);
1942 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
1947 chi2Matrix[0](0, 0) = 0.694371;
1948 chi2Matrix[0](0, 1) = -0.305629;
1949 chi2Matrix[0](0, 2) = -0.305629;
1950 chi2Matrix[0](0, 3) = 0.;
1951 chi2Matrix[0](0, 4) = 0.;
1952 chi2Matrix[0](0, 5) = 0.;
1953 chi2Matrix[0](0, 6) = 0.;
1954 chi2Matrix[0](0, 7) = 0.;
1955 chi2Matrix[0](0, 8) = 0.;
1956 chi2Matrix[0](0, 9) = 0.;
1957 chi2Matrix[0](1, 0) = -0.305629;
1958 chi2Matrix[0](1, 1) = 0.694371;
1959 chi2Matrix[0](1, 2) = -0.305629;
1960 chi2Matrix[0](1, 3) = 0.;
1961 chi2Matrix[0](1, 4) = 0.;
1962 chi2Matrix[0](1, 5) = 0.;
1963 chi2Matrix[0](1, 6) = 0.;
1964 chi2Matrix[0](1, 7) = 0.;
1965 chi2Matrix[0](1, 8) = 0.;
1966 chi2Matrix[0](1, 9) = 0.;
1967 chi2Matrix[0](2, 0) = -0.305629;
1968 chi2Matrix[0](2, 1) = -0.305629;
1969 chi2Matrix[0](2, 2) = 0.694371;
1970 chi2Matrix[0](2, 3) = 0.;
1971 chi2Matrix[0](2, 4) = 0.;
1972 chi2Matrix[0](2, 5) = 0.;
1973 chi2Matrix[0](2, 6) = 0.;
1974 chi2Matrix[0](2, 7) = 0.;
1975 chi2Matrix[0](2, 8) = 0.;
1976 chi2Matrix[0](2, 9) = 0.;
1977 chi2Matrix[0](3, 0) = 0.;
1978 chi2Matrix[0](3, 1) = 0.;
1979 chi2Matrix[0](3, 2) = 0.;
1980 chi2Matrix[0](3, 3) = 0.;
1981 chi2Matrix[0](3, 4) = 0.;
1982 chi2Matrix[0](3, 5) = 0.;
1983 chi2Matrix[0](3, 6) = 0.;
1984 chi2Matrix[0](3, 7) = 0.;
1985 chi2Matrix[0](3, 8) = 0.;
1986 chi2Matrix[0](3, 9) = 0.;
1987 chi2Matrix[0](4, 0) = 0.;
1988 chi2Matrix[0](4, 1) = 0.;
1989 chi2Matrix[0](4, 2) = 0.;
1990 chi2Matrix[0](4, 3) = 0.;
1991 chi2Matrix[0](4, 4) = 0.8027116;
1992 chi2Matrix[0](4, 5) = -0.2517103;
1993 chi2Matrix[0](4, 6) = -0.2232882;
1994 chi2Matrix[0](4, 7) = -0.1716192;
1995 chi2Matrix[0](4, 8) = -0.1239006;
1996 chi2Matrix[0](4, 9) = 0.;
1997 chi2Matrix[0](5, 0) = 0.;
1998 chi2Matrix[0](5, 1) = 0.;
1999 chi2Matrix[0](5, 2) = 0.;
2000 chi2Matrix[0](5, 3) = 0.;
2001 chi2Matrix[0](5, 4) = -0.2517103;
2002 chi2Matrix[0](5, 5) = 0.6528964;
2003 chi2Matrix[0](5, 6) = -0.2972839;
2004 chi2Matrix[0](5, 7) = -0.2067162;
2005 chi2Matrix[0](5, 8) = -0.1230729;
2006 chi2Matrix[0](5, 9) = 0.;
2007 chi2Matrix[0](6, 0) = 0.;
2008 chi2Matrix[0](6, 1) = 0.;
2009 chi2Matrix[0](6, 2) = 0.;
2010 chi2Matrix[0](6, 3) = 0.;
2011 chi2Matrix[0](6, 4) = -0.2232882;
2012 chi2Matrix[0](6, 5) = -0.2972839;
2013 chi2Matrix[0](6, 6) = 0.7413607;
2014 chi2Matrix[0](6, 7) = -0.1883866;
2015 chi2Matrix[0](6, 8) = -0.1235052;
2016 chi2Matrix[0](6, 9) = 0.;
2017 chi2Matrix[0](7, 0) = 0.;
2018 chi2Matrix[0](7, 1) = 0.;
2019 chi2Matrix[0](7, 2) = 0.;
2020 chi2Matrix[0](7, 3) = 0.;
2021 chi2Matrix[0](7, 4) = -0.1716192;
2022 chi2Matrix[0](7, 5) = -0.2067162;
2023 chi2Matrix[0](7, 6) = -0.1883866;
2024 chi2Matrix[0](7, 7) = 0.844935;
2025 chi2Matrix[0](7, 8) = -0.124291;
2026 chi2Matrix[0](7, 9) = 0.;
2027 chi2Matrix[0](8, 0) = 0.;
2028 chi2Matrix[0](8, 1) = 0.;
2029 chi2Matrix[0](8, 2) = 0.;
2030 chi2Matrix[0](8, 3) = 0.;
2031 chi2Matrix[0](8, 4) = -0.1239006;
2032 chi2Matrix[0](8, 5) = -0.1230729;
2033 chi2Matrix[0](8, 6) = -0.1235052;
2034 chi2Matrix[0](8, 7) = -0.124291;
2035 chi2Matrix[0](8, 8) = 0.8749833;
2036 chi2Matrix[0](8, 9) = 0.;
2037 chi2Matrix[0](9, 0) = 0.;
2038 chi2Matrix[0](9, 1) = 0.;
2039 chi2Matrix[0](9, 2) = 0.;
2040 chi2Matrix[0](9, 3) = 0.;
2041 chi2Matrix[0](9, 4) = 0.;
2042 chi2Matrix[0](9, 5) = 0.;
2043 chi2Matrix[0](9, 6) = 0.;
2044 chi2Matrix[0](9, 7) = 0.;
2045 chi2Matrix[0](9, 8) = 0.;
2046 chi2Matrix[0](9, 9) = 0.;
2047 }
else if (getWeightsFromFile_) {
2053 while (!chi2MatrixFile.eof() && tdcBin < nTDCbins_) {
2055 for (
int j = 0;
j < 10; ++
j) {
2056 for (
int l = 0;
l < 10; ++
l) {
2058 chi2MatrixFile >> ww;
2059 chi2Matrix[tdcBin](
j,
l) = ww;
2064 assert(tdcBin == nTDCbins_);
2067 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2074 chi2Matrix_ = chi2Matrix;
2077 std::vector<EcalWeightSet::EcalChi2WeightMatrix> chi2MatrixAft(nTDCbins_);
2078 if (!getWeightsFromFile_ && nTDCbins_ == 1) {
2083 chi2MatrixAft[0](0, 0) = 0.;
2084 chi2MatrixAft[0](0, 1) = 0.;
2085 chi2MatrixAft[0](0, 2) = 0.;
2086 chi2MatrixAft[0](0, 3) = 0.;
2087 chi2MatrixAft[0](0, 4) = 0.;
2088 chi2MatrixAft[0](0, 5) = 0.;
2089 chi2MatrixAft[0](0, 6) = 0.;
2090 chi2MatrixAft[0](0, 7) = 0.;
2091 chi2MatrixAft[0](0, 8) = 0.;
2092 chi2MatrixAft[0](0, 9) = 0.;
2093 chi2MatrixAft[0](1, 0) = 0.;
2094 chi2MatrixAft[0](1, 1) = 0.;
2095 chi2MatrixAft[0](1, 2) = 0.;
2096 chi2MatrixAft[0](1, 3) = 0.;
2097 chi2MatrixAft[0](1, 4) = 0.;
2098 chi2MatrixAft[0](1, 5) = 0.;
2099 chi2MatrixAft[0](1, 6) = 0.;
2100 chi2MatrixAft[0](1, 7) = 0.;
2101 chi2MatrixAft[0](1, 8) = 0.;
2102 chi2MatrixAft[0](1, 9) = 0.;
2103 chi2MatrixAft[0](2, 0) = 0.;
2104 chi2MatrixAft[0](2, 1) = 0.;
2105 chi2MatrixAft[0](2, 2) = 0.;
2106 chi2MatrixAft[0](2, 3) = 0.;
2107 chi2MatrixAft[0](2, 4) = 0.;
2108 chi2MatrixAft[0](2, 5) = 0.;
2109 chi2MatrixAft[0](2, 6) = 0.;
2110 chi2MatrixAft[0](2, 7) = 0.;
2111 chi2MatrixAft[0](2, 8) = 0.;
2112 chi2MatrixAft[0](2, 9) = 0.;
2113 chi2MatrixAft[0](3, 0) = 0.;
2114 chi2MatrixAft[0](3, 1) = 0.;
2115 chi2MatrixAft[0](3, 2) = 0.;
2116 chi2MatrixAft[0](3, 3) = 0.;
2117 chi2MatrixAft[0](3, 4) = 0.;
2118 chi2MatrixAft[0](3, 5) = 0.;
2119 chi2MatrixAft[0](3, 6) = 0.;
2120 chi2MatrixAft[0](3, 7) = 0.;
2121 chi2MatrixAft[0](3, 8) = 0.;
2122 chi2MatrixAft[0](3, 9) = 0.;
2123 chi2MatrixAft[0](4, 0) = 0.;
2124 chi2MatrixAft[0](4, 1) = 0.;
2125 chi2MatrixAft[0](4, 2) = 0.;
2126 chi2MatrixAft[0](4, 3) = 0.;
2127 chi2MatrixAft[0](4, 4) = 0.8030884;
2128 chi2MatrixAft[0](4, 5) = -0.2543541;
2129 chi2MatrixAft[0](4, 6) = -0.2243544;
2130 chi2MatrixAft[0](4, 7) = -0.1698177;
2131 chi2MatrixAft[0](4, 8) = -0.1194506;
2132 chi2MatrixAft[0](4, 9) = 0.;
2133 chi2MatrixAft[0](5, 0) = 0.;
2134 chi2MatrixAft[0](5, 1) = 0.;
2135 chi2MatrixAft[0](5, 2) = 0.;
2136 chi2MatrixAft[0](5, 3) = 0.;
2137 chi2MatrixAft[0](5, 4) = -0.2543541;
2138 chi2MatrixAft[0](5, 5) = 0.6714465;
2139 chi2MatrixAft[0](5, 6) = -0.2898025;
2140 chi2MatrixAft[0](5, 7) = -0.2193564;
2141 chi2MatrixAft[0](5, 8) = -0.1542964;
2142 chi2MatrixAft[0](5, 9) = 0.;
2143 chi2MatrixAft[0](6, 0) = 0.;
2144 chi2MatrixAft[0](6, 1) = 0.;
2145 chi2MatrixAft[0](6, 2) = 0.;
2146 chi2MatrixAft[0](6, 3) = 0.;
2147 chi2MatrixAft[0](6, 4) = -0.2243544;
2148 chi2MatrixAft[0](6, 5) = -0.2898025;
2149 chi2MatrixAft[0](6, 6) = 0.7443781;
2150 chi2MatrixAft[0](6, 7) = -0.1934846;
2151 chi2MatrixAft[0](6, 8) = -0.136098;
2152 chi2MatrixAft[0](6, 9) = 0.;
2153 chi2MatrixAft[0](7, 0) = 0.;
2154 chi2MatrixAft[0](7, 1) = 0.;
2155 chi2MatrixAft[0](7, 2) = 0.;
2156 chi2MatrixAft[0](7, 3) = 0.;
2157 chi2MatrixAft[0](7, 4) = -0.1698177;
2158 chi2MatrixAft[0](7, 5) = -0.2193564;
2159 chi2MatrixAft[0](7, 6) = -0.1934846;
2160 chi2MatrixAft[0](7, 7) = 0.8535482;
2161 chi2MatrixAft[0](7, 8) = -0.1030149;
2162 chi2MatrixAft[0](7, 9) = 0.;
2163 chi2MatrixAft[0](8, 0) = 0.;
2164 chi2MatrixAft[0](8, 1) = 0.;
2165 chi2MatrixAft[0](8, 2) = 0.;
2166 chi2MatrixAft[0](8, 3) = 0.;
2167 chi2MatrixAft[0](8, 4) = -0.1194506;
2168 chi2MatrixAft[0](8, 5) = -0.1542964;
2169 chi2MatrixAft[0](8, 6) = -0.136098;
2170 chi2MatrixAft[0](8, 7) = -0.1030149;
2171 chi2MatrixAft[0](8, 8) = 0.9275388;
2172 chi2MatrixAft[0](8, 9) = 0.;
2173 chi2MatrixAft[0](9, 0) = 0.;
2174 chi2MatrixAft[0](9, 1) = 0.;
2175 chi2MatrixAft[0](9, 2) = 0.;
2176 chi2MatrixAft[0](9, 3) = 0.;
2177 chi2MatrixAft[0](9, 4) = 0.;
2178 chi2MatrixAft[0](9, 5) = 0.;
2179 chi2MatrixAft[0](9, 6) = 0.;
2180 chi2MatrixAft[0](9, 7) = 0.;
2181 chi2MatrixAft[0](9, 8) = 0.;
2182 chi2MatrixAft[0](9, 9) = 0.;
2183 }
else if (getWeightsFromFile_) {
2189 while (!chi2MatrixAftFile.eof() && tdcBin < nTDCbins_) {
2191 for (
int j = 0;
j < 10; ++
j) {
2192 for (
int l = 0;
l < 10; ++
l) {
2194 chi2MatrixAftFile >> ww;
2195 chi2MatrixAft[tdcBin](
j,
l) = ww;
2200 assert(tdcBin == nTDCbins_);
2203 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2210 chi2MatrixAft_ = chi2MatrixAft;
2218 auto ecalStatus = std::make_unique<EcalChannelStatus>();
2229 ecalStatus->setValue(ebid, 0);
2238 EEDetId eedetidpos(iX, iY, 1);
2239 ecalStatus->setValue(eedetidpos, 0);
2242 EEDetId eedetidneg(iX, iY, -1);
2243 ecalStatus->setValue(eedetidneg, 0);
2253 if (!statusFile.good()) {
2254 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Problems opening file: " << channelStatusFile_;
2263 while (!statusFile.eof()) {
2264 statusFile >> EcalSubDet;
2266 std::getline(statusFile,
str);
2269 statusFile >> hashIndex >>
status;
2275 ecalStatus->setValue(ebid,
status);
2278 ecalStatus->setValue(eedetid,
status);
2280 edm::LogError(
"EcalTrivialConditionRetriever") <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2290 auto ical = std::make_unique<EcalChannelStatus>();
2298 ical->setValue(ebid, 0);
2307 EEDetId eedetidpos(iX, iY, 1);
2308 ical->setValue(eedetidpos, 0);
2311 EEDetId eedetidneg(iX, iY, -1);
2312 ical->setValue(eedetidneg, 0);
2324 auto ical = std::make_unique<EcalDQMChannelStatus>();
2332 ical->setValue(ebid, sta);
2341 EEDetId eedetidpos(iX, iY, 1);
2342 ical->setValue(eedetidpos, sta);
2345 EEDetId eedetidneg(iX, iY, -1);
2346 ical->setValue(eedetidneg, sta);
2356 auto ical = std::make_unique<EcalDQMTowerStatus>();
2362 for (
int k = 0;
k < 2;
k++) {
2367 for (
int i = 1;
i < 73;
i++) {
2368 for (
int j = 1;
j < 18;
j++) {
2372 ical->setValue(ebid, sta);
2379 for (
int k = 0;
k < 2;
k++) {
2384 for (
int i = 1;
i < 21;
i++) {
2385 for (
int j = 1;
j < 21;
j++) {
2388 ical->setValue(eeid, sta);
2400 auto ical = std::make_unique<EcalDCSTowerStatus>();
2406 for (
int k = 0;
k < 2;
k++) {
2411 for (
int i = 1;
i < 73;
i++) {
2412 for (
int j = 1;
j < 18;
j++) {
2416 ical->setValue(ebid,
status);
2423 for (
int k = 0;
k < 2;
k++) {
2428 for (
int i = 1;
i < 21;
i++) {
2429 for (
int j = 1;
j < 21;
j++) {
2432 ical->setValue(eeid,
status);
2444 auto ical = std::make_unique<EcalDAQTowerStatus>();
2450 for (
int k = 0;
k < 2;
k++) {
2455 for (
int i = 1;
i < 73;
i++) {
2456 for (
int j = 1;
j < 18;
j++) {
2460 ical->setValue(ebid,
status);
2467 for (
int k = 0;
k < 2;
k++) {
2472 for (
int i = 1;
i < 21;
i++) {
2473 for (
int j = 1;
j < 21;
j++) {
2476 ical->setValue(eeid,
status);
2488 auto ecalStatus = std::make_unique<EcalTPGCrystalStatus>();
2499 ecalStatus->setValue(ebid, 0);
2508 EEDetId eedetidpos(iX, iY, 1);
2509 ecalStatus->setValue(eedetidpos, 0);
2512 EEDetId eedetidneg(iX, iY, -1);
2513 ecalStatus->setValue(eedetidneg, 0);
2523 if (!statusFile.good()) {
2524 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Problems opening file: " << channelStatusFile_;
2533 while (!statusFile.eof()) {
2534 statusFile >> EcalSubDet;
2536 std::getline(statusFile,
str);
2539 statusFile >> hashIndex >>
status;
2545 ecalStatus->setValue(ebid,
status);
2548 ecalStatus->setValue(eedetid,
status);
2550 edm::LogError(
"EcalTrivialConditionRetriever") <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2561 auto ical = std::make_unique<EcalTPGCrystalStatus>();
2569 ical->setValue(ebid, 0);
2578 EEDetId eedetidpos(iX, iY, 1);
2579 ical->setValue(eedetidpos, 0);
2582 EEDetId eedetidneg(iX, iY, -1);
2583 ical->setValue(eedetidneg, 0);
2592 std::unique_ptr<EcalIntercalibConstants> ical;
2599 <<
"Reading intercalibration constants from file " << intercalibConstantsFile_.c_str();
2601 if (intercalibConstantsFile_.find(
".xml") != std::string::npos) {
2608 if (totLumi_ != 0 || instLumi_ != 0) {
2613 if (intercalibConstantsMCFile_.find(
".xml") != std::string::npos) {
2620 edm::LogInfo(
"please provide the xml file of the EcalIntercalibConstantsMC");
2623 TRandom3* gRandom =
new TRandom3();
2647 if (idref != mymap.
end())
2648 icalconstant = (*idref);
2652 if (idrefMC != mymapMC.
end())
2653 icalconstantMC = (*idrefMC);
2658 edm::LogInfo(
"EB at eta=") <<
eta <<
" IC=" << icalconstant <<
" ICMC=" << icalconstantMC
2659 <<
" smear=" <<
r <<
" ";
2661 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2668 if (icalconstant != icalconstant2)
2678 EEDetId eedetidpos(iX, iY, 1);
2680 -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
2688 if (idref != mymap.
end())
2689 icalconstant = (*idref);
2693 if (idrefMC != mymapMC.
end())
2694 icalconstantMC = (*idrefMC);
2699 edm::LogInfo(
"EE at eta=") <<
eta <<
" IC=" << icalconstant <<
" ICMC=" << icalconstantMC
2700 <<
" smear=" <<
r <<
" ";
2701 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2707 EEDetId eedetidneg(iX, iY, -1);
2709 -
log(
tan(0.5 * atan(
sqrt((iX - 50.0) * (iX - 50.0) + (iY - 50.0) * (iY - 50.0)) * 2.98 / 328.)));
2716 if (idrefMC != mymapMC.
end())
2717 icalconstantMC = (*idrefMC);
2720 icalconstant = icalconstant +
r * 1.29 * icalconstantMC;
2726 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2732 ical = std::make_unique<EcalIntercalibConstants>();
2735 inpFile = fopen(intercalibConstantsFile_.c_str(),
"r");
2737 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << intercalibConstantsFile_;
2738 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
2742 std::ostringstream
str;
2743 fgets(
line, 255, inpFile);
2744 int sm_number = atoi(
line);
2745 str <<
"sm: " << sm_number;
2747 fgets(
line, 255, inpFile);
2750 fgets(
line, 255, inpFile);
2752 str <<
"gen tag: " << gen_tag;
2754 fgets(
line, 255, inpFile);
2756 str <<
"cali method: " << cali_method << std::endl;
2758 fgets(
line, 255, inpFile);
2760 str <<
"cali version: " << cali_version << std::endl;
2762 fgets(
line, 255, inpFile);
2764 str <<
"cali type: " << cali_type;
2766 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"[PIETRO] Intercalibration file - " <<
str.str();
2768 float calib[1700] = {1};
2769 int calib_status[1700] = {0};
2773 while (fgets(
line, 255, inpFile)) {
2776 float dmy_calib = 0.;
2780 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
2783 calib[dmy_num - 1] = dmy_calib;
2784 calib_status[dmy_num - 1] = dmy_status;
2796 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " <<
ii <<
" xtals ";
2798 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
2806 for (
int i = 0;
i < 1700;
i++) {
2816 if (calib_status[
i])
2819 ical->setValue(ebid.
rawId(), 1.);
2832 std::unique_ptr<EcalPFRecHitThresholds> ical;
2840 ical = std::make_unique<EcalPFRecHitThresholds>();
2846 edm::LogInfo(
"Going to multiply the sigmas by ") << pfRecHitThresholdsNSigmas_;
2849 while (!PFRecHitsFile.eof()) {
2862 <<
" thresh: " <<
thresh;
2866 ical->setValue(ebid,
thresh);
2868 PFRecHitsFile.close();
2875 edm::LogInfo(
"We will multiply the sigma in EE by ") << pfRecHitThresholdsNSigmas_;
2876 edm::LogInfo(
"We will multiply the sigma in EE at high eta by") << pfRecHitThresholdsNSigmasHEta_;
2885 while (!PFRecHitsFileEE.eof()) {
2891 PFRecHitsFileEE >> ix >> iy >> iz >>
thresh;
2895 -
log(
tan(0.5 * atan(
sqrt((ix - 50.5) * (ix - 50.5) + (iy - 50.5) * (iy - 50.5)) * 2.98 / 328.)));
2908 ical->setValue(eeid,
thresh);
2912 PFRecHitsFileEE.close();
2922 std::unique_ptr<EcalIntercalibConstantsMC> ical;
2929 <<
"Reading intercalibration constants MC from file " << intercalibConstantsMCFile_.c_str();
2931 if (intercalibConstantsMCFile_.find(
".xml") != std::string::npos) {
2932 edm::LogInfo(
"generating Intercalib MC from xml file");
2938 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2949 auto ical = std::make_unique<EcalIntercalibErrors>();
2955 <<
"Reading intercalibration constants from file " << intercalibErrorsFile_.c_str();
2958 inpFile = fopen(intercalibErrorsFile_.c_str(),
"r");
2960 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << intercalibErrorsFile_;
2961 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
2965 std::ostringstream
str;
2966 fgets(
line, 255, inpFile);
2967 int sm_number = atoi(
line);
2968 str <<
"sm: " << sm_number;
2970 fgets(
line, 255, inpFile);
2973 fgets(
line, 255, inpFile);
2975 str <<
"gen tag: " << gen_tag;
2977 fgets(
line, 255, inpFile);
2979 str <<
"cali method: " << cali_method << std::endl;
2981 fgets(
line, 255, inpFile);
2983 str <<
"cali version: " << cali_version << std::endl;
2985 fgets(
line, 255, inpFile);
2987 str <<
"cali type: " << cali_type;
2989 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"[PIETRO] Intercalibration file - " <<
str.str() << std::endl;
2991 float calib[1700] = {1};
2992 int calib_status[1700] = {0};
2996 while (fgets(
line, 255, inpFile)) {
2999 float dmy_calib = 0.;
3003 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3006 calib[dmy_num - 1] = dmy_calib;
3007 calib_status[dmy_num - 1] = dmy_status;
3019 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " <<
ii <<
" xtals ";
3021 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3029 for (
int i = 0;
i < 1700;
i++) {
3039 if (calib_status[
i])
3042 ical->setValue(ebid.
rawId(), 1.);
3055 auto ical = std::make_unique<EcalTimeCalibConstants>();
3061 <<
"Reading time calibration constants from file " << timeCalibConstantsFile_.c_str();
3064 inpFile = fopen(timeCalibConstantsFile_.c_str(),
"r");
3066 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << timeCalibConstantsFile_;
3067 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
3071 std::ostringstream
str;
3072 fgets(
line, 255, inpFile);
3073 int sm_number = atoi(
line);
3074 str <<
"sm: " << sm_number;
3076 fgets(
line, 255, inpFile);
3079 fgets(
line, 255, inpFile);
3081 str <<
"gen tag: " << gen_tag;
3083 fgets(
line, 255, inpFile);
3085 str <<
"cali method: " << cali_method << std::endl;
3087 fgets(
line, 255, inpFile);
3089 str <<
"cali version: " << cali_version << std::endl;
3091 fgets(
line, 255, inpFile);
3093 str <<
"cali type: " << cali_type;
3095 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"TimeCalibration file - " <<
str.str() << std::endl;
3097 float calib[1700] = {1};
3098 int calib_status[1700] = {0};
3102 while (fgets(
line, 255, inpFile)) {
3105 float dmy_calib = 0.;
3109 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3112 calib[dmy_num - 1] = dmy_calib;
3113 calib_status[dmy_num - 1] = dmy_status;
3125 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read timeCalibrations for " <<
ii <<
" xtals ";
3127 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3135 for (
int i = 0;
i < 1700;
i++) {
3145 if (calib_status[
i])
3148 ical->setValue(ebid.
rawId(), 1.);
3159 auto ical = std::make_unique<EcalTimeCalibErrors>();
3165 <<
"Reading timeCalibration constants from file " << timeCalibErrorsFile_.c_str();
3168 inpFile = fopen(timeCalibErrorsFile_.c_str(),
"r");
3170 edm::LogError(
"EcalTrivialConditionRetriever") <<
"*** Can not open file: " << timeCalibErrorsFile_;
3171 throw cms::Exception(
"Cannot open inter-calibration coefficients txt file");
3175 std::ostringstream
str;
3176 fgets(
line, 255, inpFile);
3177 int sm_number = atoi(
line);
3178 str <<
"sm: " << sm_number;
3180 fgets(
line, 255, inpFile);
3183 fgets(
line, 255, inpFile);
3185 str <<
"gen tag: " << gen_tag;
3187 fgets(
line, 255, inpFile);
3189 str <<
"cali method: " << cali_method << std::endl;
3191 fgets(
line, 255, inpFile);
3193 str <<
"cali version: " << cali_version << std::endl;
3195 fgets(
line, 255, inpFile);
3197 str <<
"cali type: " << cali_type;
3199 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"TimeCalibration file - " <<
str.str() << std::endl;
3201 float calib[1700] = {1};
3202 int calib_status[1700] = {0};
3206 while (fgets(
line, 255, inpFile)) {
3209 float dmy_calib = 0.;
3213 sscanf(
line,
"%d %f %f %d %d", &dmy_num, &dmy_calib, &dmy_RMS, &dmy_events, &dmy_status);
3216 calib[dmy_num - 1] = dmy_calib;
3217 calib_status[dmy_num - 1] = dmy_status;
3229 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Read time calibrations for " <<
ii <<
" xtals ";
3231 edm::LogWarning(
"StoreEcalCondition") <<
"Some crystals missing, set to 1" << std::endl;
3239 for (
int i = 0;
i < 1700;
i++) {
3249 if (calib_status[
i])
3252 ical->setValue(ebid.
rawId(), 1.);
3265 auto mapping = std::make_unique<EcalMappingElectronics>();
3271 edm::LogError(
"EcalTrivialConditionRetriever") <<
"File not found";
3280 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
3281 int tccid,
tower, pseudostrip_in_TCC, pseudostrip_in_TT;
3285 f >> ix >> iy >> iz >>
CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >>
tower >>
3286 pseudostrip_in_TCC >> pseudostrip_in_TT;
3293 EcalElectronicsId elecid(dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
3299 (*mapping).setValue(detid, aElement);
3308 auto ical = std::make_unique<EcalMappingElectronics>();
3315 double mytrans[3] = {0., 0., 0.};
3316 double myeuler[3] = {0., 0., 0.};
3318 if (getEBAlignmentFromFile_)
3320 std::vector<AlignTransform> my_align;
3323 for (
int SM = 1; SM < 37; SM++) {
3326 iphi = 1 + (SM - 19) * 20;
3331 if (getEBAlignmentFromFile_) {
3332 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3333 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n"
3334 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3336 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3337 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3363 a.m_align = my_align;
3365 return std::make_unique<Alignments>(
a);
3369 double mytrans[3] = {0., 0., 0.};
3370 double myeuler[3] = {0., 0., 0.};
3372 if (getEEAlignmentFromFile_)
3374 std::vector<AlignTransform> my_align;
3378 for (
int Dee = 0; Dee < 4; Dee++) {
3380 if (Dee == 1 || Dee == 3)
3386 EEDetId eedetId(ix, iy, side);
3387 if (getEEAlignmentFromFile_) {
3388 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3389 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n"
3390 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3392 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3393 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3398 a.m_align = my_align;
3399 return std::make_unique<Alignments>(
a);
3403 double mytrans[3] = {0., 0., 0.};
3404 double myeuler[3] = {0., 0., 0.};
3406 if (getESAlignmentFromFile_)
3408 std::vector<AlignTransform> my_align;
3410 int pl_vect[10] = {2, 2, 1, 1, 1, 1, 2, 2};
3414 for (
int layer = 0; layer < 8; layer++) {
3416 int ix = 10 + (layer % 2) * 20;
3417 int plane = pl_vect[layer];
3421 if (getESAlignmentFromFile_) {
3422 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3423 edm::LogInfo(
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n"
3424 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3426 CLHEP::Hep3Vector translation(mytrans[0], mytrans[1], mytrans[2]);
3427 CLHEP::HepEulerAngles euler(myeuler[0], myeuler[1], myeuler[2]);
3432 a.m_align = my_align;
3433 return std::make_unique<Alignments>(
a);
3437 return std::unique_ptr<EcalSampleMask>(
new EcalSampleMask(sampleMaskEB_, sampleMaskEE_));
3442 auto ipar = std::make_unique<EcalTimeBiasCorrections>();
3443 copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(), back_inserter(ipar->EBTimeCorrAmplitudeBins));
3444 copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(), back_inserter(ipar->EBTimeCorrShiftBins));
3445 copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(), back_inserter(ipar->EETimeCorrAmplitudeBins));
3446 copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(), back_inserter(ipar->EETimeCorrShiftBins));
3452 if (getSamplesCorrelationFromFile_) {
3456 for (
int j = 0;
j < 10; ++
j) {
3458 EBG12samplesCorrelation_.push_back(ww);
3460 for (
int j = 0;
j < 10; ++
j) {
3462 EBG6samplesCorrelation_.push_back(ww);
3464 for (
int j = 0;
j < 10; ++
j) {
3466 EBG1samplesCorrelation_.push_back(ww);
3468 for (
int j = 0;
j < 10; ++
j) {
3470 EEG12samplesCorrelation_.push_back(ww);
3472 for (
int j = 0;
j < 10; ++
j) {
3474 EEG6samplesCorrelation_.push_back(ww);
3476 for (
int j = 0;
j < 10; ++
j) {
3478 EEG1samplesCorrelation_.push_back(ww);
3482 auto ipar = std::make_unique<EcalSamplesCorrelation>();
3483 copy(EBG12samplesCorrelation_.begin(), EBG12samplesCorrelation_.end(), back_inserter(ipar->EBG12SamplesCorrelation));
3484 copy(EBG6samplesCorrelation_.begin(), EBG6samplesCorrelation_.end(), back_inserter(ipar->EBG6SamplesCorrelation));
3485 copy(EBG1samplesCorrelation_.begin(), EBG1samplesCorrelation_.end(), back_inserter(ipar->EBG1SamplesCorrelation));
3486 copy(EEG12samplesCorrelation_.begin(), EEG12samplesCorrelation_.end(), back_inserter(ipar->EEG12SamplesCorrelation));
3487 copy(EEG6samplesCorrelation_.begin(), EEG6samplesCorrelation_.end(), back_inserter(ipar->EEG6SamplesCorrelation));
3488 copy(EEG1samplesCorrelation_.begin(), EEG1samplesCorrelation_.end(), back_inserter(ipar->EEG1SamplesCorrelation));
3494 auto result = std::make_unique<EcalSimPulseShape>();
3497 result->time_interval = sim_pulse_shape_TI_;
3500 std::vector<double> EBshape;
3501 std::vector<double> EEshape;
3502 std::vector<double> APDshape;
3505 if (!EBSimPulseShapeFile_.empty()) {
3506 std::ifstream shapeEBFile;
3507 shapeEBFile.open(EBSimPulseShapeFile_.c_str());
3509 while (shapeEBFile >> ww)
3510 EBshape.push_back(ww);
3511 shapeEBFile.close();
3513 if (!EESimPulseShapeFile_.empty()) {
3514 std::ifstream shapeEEFile;
3515 shapeEEFile.open(EESimPulseShapeFile_.c_str());
3517 while (shapeEEFile >> ww)
3518 EEshape.push_back(ww);
3519 shapeEEFile.close();
3521 if (!APDSimPulseShapeFile_.empty()) {
3522 std::ifstream shapeAPDFile;
3523 shapeAPDFile.open(APDSimPulseShapeFile_.c_str());
3525 while (shapeAPDFile >> ww)
3526 APDshape.push_back(ww);
3527 shapeAPDFile.close();
3531 result->barrel_thresh = sim_pulse_shape_EB_thresh_;
3532 result->endcap_thresh = sim_pulse_shape_EE_thresh_;
3533 result->apd_thresh = sim_pulse_shape_APD_thresh_;
3536 copy(EBshape.begin(), EBshape.end(), back_inserter(
result->barrel_shape));
3537 copy(EEshape.begin(), EEshape.end(), back_inserter(
result->endcap_shape));
3538 copy(APDshape.begin(), APDshape.end(), back_inserter(
result->apd_shape));