75 localContCorrParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"localContCorrParameters", std::vector<double>(0) );
76 crackCorrParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"crackCorrParameters", std::vector<double>(0) );
77 energyCorrectionParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"energyCorrectionParameters", std::vector<double>(0) );
78 energyUncertaintyParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"energyUncertaintyParameters", std::vector<double>(0) );
79 energyCorrectionObjectSpecificParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"energyCorrectionObjectSpecificParameters", std::vector<double>(0) );
103 EBtimeCorrAmplitudeBins_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBtimeCorrAmplitudeBins", std::vector<double>() );
104 EBtimeCorrShiftBins_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBtimeCorrShiftBins", std::vector<double>() );
105 EEtimeCorrAmplitudeBins_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEtimeCorrAmplitudeBins", std::vector<double>() );
106 EEtimeCorrShiftBins_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEtimeCorrShiftBins", std::vector<double>() );
108 EBG12samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBG12samplesCorrelation", std::vector<double>() );
109 EBG6samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBG6samplesCorrelation", std::vector<double>() );
110 EBG1samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBG1samplesCorrelation", std::vector<double>() );
111 EEG12samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEG12samplesCorrelation", std::vector<double>() );
112 EEG6samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEG6samplesCorrelation", std::vector<double>() );
113 EEG1samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEG1samplesCorrelation", std::vector<double>() );
119 std::cout <<
" EcalTrivialConditionRetriever " << std::endl;
125 std::cout <<
" EcalTrivialConditionRetriever going to create conditions based on the damage deu to "<<totLumi_<<
126 " fb-1 integrated luminosity" << std::endl;
130 if (weightsForAsynchronousRunning_)
132 getWeightsFromFile_ =
true;
139 std::ostringstream
str;
141 if (!weightsForAsynchronousRunning_)
146 weightType = str.str();
157 amplWeights_.resize(nTDCbins_);
158 amplWeightsAft_.resize(nTDCbins_);
159 pedWeights_.resize(nTDCbins_);
160 pedWeightsAft_.resize(nTDCbins_);
161 jittWeights_.resize(nTDCbins_);
162 jittWeightsAft_.resize(nTDCbins_);
163 chi2Matrix_.resize(nTDCbins_);
164 chi2MatrixAft_.resize(nTDCbins_);
167 getWeightsFromConfiguration(ps);
175 producedEcalMappingElectronics_ = ps.
getUntrackedParameter<
bool>(
"producedEcalMappingElectronics",
true);
178 if ( producedEcalMappingElectronics_ ) {
179 if ( mappingFile_ !=
"" ) {
184 findingRecord<EcalMappingElectronicsRcd>();
188 if(getEBAlignmentFromFile_) {
193 if(getEEAlignmentFromFile_) {
198 if(getESAlignmentFromFile_)
205 if (producedEcalPedestals_)
208 if (producedEcalWeights_) {
213 if (producedEcalGainRatios_)
216 if (producedEcalADCToGeVConstant_)
220 producedEcalTimeOffsetConstant_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeOffsetConstant",
true);
222 if (producedEcalTimeOffsetConstant_) {
224 findingRecord<EcalTimeOffsetConstantRcd>();
228 producedEcalLinearCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalLinearCorrections",
true);
231 if (producedEcalLinearCorrections_) {
232 if(linearCorrectionsFile_ !=
"") {
237 findingRecord<EcalLinearCorrectionsRcd> () ;
243 producedEcalIntercalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstants",
true);
248 if (producedEcalIntercalibConstants_) {
249 if(intercalibConstantsFile_ !=
"") {
254 findingRecord<EcalIntercalibConstantsRcd> () ;
257 producedEcalIntercalibConstantsMC_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstantsMC",
true);
259 if (producedEcalIntercalibConstantsMC_) {
260 if(intercalibConstantsMCFile_ !=
"") {
265 findingRecord<EcalIntercalibConstantsMCRcd> () ;
272 if (producedEcalIntercalibErrors_) {
273 if(intercalibErrorsFile_ !=
"") {
278 findingRecord<EcalIntercalibErrorsRcd> () ;
282 producedEcalTimeCalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeCalibConstants",
true);
285 if (producedEcalTimeCalibConstants_) {
286 if(timeCalibConstantsFile_ !=
"") {
291 findingRecord<EcalTimeCalibConstantsRcd> () ;
298 if (producedEcalTimeCalibErrors_) {
299 if(timeCalibErrorsFile_ !=
"") {
304 findingRecord<EcalTimeCalibErrorsRcd> () ;
308 producedEcalClusterLocalContCorrParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterLocalContCorrParameters",
false);
309 producedEcalClusterCrackCorrParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterCrackCorrParameters",
false);
310 producedEcalClusterEnergyCorrectionParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionParameters",
false);
311 producedEcalClusterEnergyUncertaintyParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyUncertaintyParameters",
false);
312 producedEcalClusterEnergyCorrectionObjectSpecificParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionObjectSpecificParameters",
false);
313 if ( producedEcalClusterLocalContCorrParameters_ ) {
315 findingRecord<EcalClusterLocalContCorrParametersRcd>();
317 if ( producedEcalClusterCrackCorrParameters_ ) {
319 findingRecord<EcalClusterCrackCorrParametersRcd>();
321 if ( producedEcalClusterEnergyCorrectionParameters_ ) {
323 findingRecord<EcalClusterEnergyCorrectionParametersRcd>();
325 if ( producedEcalClusterEnergyUncertaintyParameters_ ) {
327 findingRecord<EcalClusterEnergyUncertaintyParametersRcd>();
329 if ( producedEcalClusterEnergyCorrectionObjectSpecificParameters_ ) {
331 findingRecord<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>();
336 if (producedEcalLaserCorrection_) {
339 findingRecord<EcalLaserAlphasRcd> () ;
344 std::cout <<
" getLaserAlphaFromFileEB_ " << getLaserAlphaFromFileEB_ << std::endl;
345 std::cout <<
" getLaserAlphaFromFileEE_ " << getLaserAlphaFromFileEE_ << std::endl;
346 std::cout <<
" getLaserAlphaFromTypeEB_ " << getLaserAlphaFromTypeEB_ << std::endl;
347 std::cout <<
" getLaserAlphaFromTypeEE_ " << getLaserAlphaFromTypeEE_ << std::endl;
348 if(getLaserAlphaFromFileEB_) {
351 if(getLaserAlphaFromFileEE_) {
354 if(getLaserAlphaFromTypeEB_) {
359 if(getLaserAlphaFromTypeEE_) {
365 findingRecord<EcalLaserAPDPNRatiosRefRcd> () ;
367 findingRecord<EcalLaserAPDPNRatiosRcd> () ;
374 if ( producedEcalChannelStatus_ ) {
375 if ( channelStatusFile_ !=
"" ) {
380 findingRecord<EcalChannelStatusRcd>();
384 if ( producedEcalDQMChannelStatus_ ) {
386 findingRecord<EcalDQMChannelStatusRcd>();
390 if ( producedEcalDCSTowerStatus_ ) {
392 findingRecord<EcalDCSTowerStatusRcd>();
396 if ( producedEcalDAQTowerStatus_ ) {
398 findingRecord<EcalDAQTowerStatusRcd>();
402 if ( producedEcalDQMTowerStatus_ ) {
404 findingRecord<EcalDQMTowerStatusRcd>();
411 if ( producedEcalTrgChannelStatus_ ) {
412 if ( trgChannelStatusFile_ !=
"" ) {
417 findingRecord<EcalTPGCrystalStatusRcd>();
422 if ( producedEcalAlignmentEB_ ) {
424 findingRecord<EBAlignmentRcd>();
427 if ( producedEcalAlignmentEE_ ) {
429 findingRecord<EEAlignmentRcd>();
432 if ( producedEcalAlignmentES_ ) {
434 findingRecord<ESAlignmentRcd>();
437 if (producedEcalPedestals_) findingRecord<EcalPedestalsRcd>();
439 if (producedEcalWeights_) {
440 findingRecord<EcalWeightXtalGroupsRcd>();
441 findingRecord<EcalTBWeightsRcd>();
444 if (producedEcalGainRatios_) findingRecord<EcalGainRatiosRcd>();
446 if (producedEcalADCToGeVConstant_) findingRecord<EcalADCToGeVConstantRcd>();
449 if (producedEcalSampleMask_) {
451 findingRecord<EcalSampleMaskRcd>();
453 producedEcalTimeBiasCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeBiasCorrections",
false);
454 if (producedEcalTimeBiasCorrections_) {
456 findingRecord<EcalTimeBiasCorrectionsRcd>();
458 producedEcalSamplesCorrelation_ = ps.
getUntrackedParameter<
bool>(
"producedEcalSamplesCorrelation",
false);
459 if (producedEcalSamplesCorrelation_) {
461 findingRecord<EcalSamplesCorrelationRcd>();
462 getSamplesCorrelationFromFile_ = ps.
getUntrackedParameter<
bool>(
"getSamplesCorrelationFromFile",
false);
463 if(getSamplesCorrelationFromFile_) {
481 if(verbose_>=1)
std::cout <<
"EcalTrivialConditionRetriever::setIntervalFor(): record key = " << rk.
name() <<
"\ttime: " << iTime.
time().
value() << std::endl;
487 std::unique_ptr<EcalPedestals>
489 auto peds = std::make_unique<EcalPedestals>();
494 EBitem.rms_x1 = EBpedRMSX1_;
495 EBitem.mean_x6 = EBpedMeanX6_;
496 EBitem.rms_x6 = EBpedRMSX6_;
497 EBitem.mean_x12 = EBpedMeanX12_;
498 EBitem.rms_x12 = EBpedRMSX12_;
501 EEitem.
rms_x1 = EEpedRMSX1_;
503 EEitem.
rms_x6 = EEpedRMSX6_;
512 if(iEta==0)
continue;
524 EBitem.rms_x1 = EBpedRMSX1_*noisefactor;
525 EBitem.rms_x6 = EBpedRMSX6_*noisefactor;
526 EBitem.rms_x12 = EBpedRMSX12_*noisefactor;
527 std::cout <<
"rms ped at eta:"<< eta<<
" ="<< EBitem.rms_x12 << std::endl;
537 peds->insert(std::make_pair(ebdetid.
rawId(),EBitem));
548 peds->insert(std::make_pair(eedetidpos.
rawId(),EEitem));
553 peds->insert(std::make_pair(eedetidneg.
rawId(),EEitem));
564 std::unique_ptr<EcalWeightXtalGroups>
567 auto xtalGroups = std::make_unique<EcalWeightXtalGroups>();
570 if(ieta==0)
continue;
577 xtalGroups->setValue(ebid.
rawId(), defaultGroupId );
588 xtalGroups->setValue(eedetidpos.
rawId(), defaultGroupId );
593 xtalGroups->setValue(eedetidneg.
rawId(), defaultGroupId );
601 std::unique_ptr<EcalLinearCorrections>
604 auto ical = std::make_unique<EcalLinearCorrections>();
607 if(ieta==0)
continue;
611 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
614 pairAPDPN.
p1 = linCorrMean_ + r*linCorrSigma_;
615 pairAPDPN.
p2 = linCorrMean_ + r*linCorrSigma_;
616 pairAPDPN.
p3 = linCorrMean_ + r*linCorrSigma_;
617 ical->setValue( ebid, pairAPDPN );
626 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
630 pairAPDPN.
p1 = linCorrMean_ + r*linCorrSigma_;
631 pairAPDPN.
p2 = linCorrMean_ + r*linCorrSigma_;
632 pairAPDPN.
p3 = linCorrMean_ + r*linCorrSigma_;
634 ical->setValue( eedetidpos, pairAPDPN );
638 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
642 pairAPDPN.
p1 = linCorrMean_ + r1*linCorrSigma_;
643 pairAPDPN.
p2 = linCorrMean_ + r1*linCorrSigma_;
644 pairAPDPN.
p3 = linCorrMean_ + r1*linCorrSigma_;
646 ical->setValue( eedetidneg, pairAPDPN );
653 for(
int i=0;
i<92;
i++){
655 if(linearTime2_ == 0 ){
660 if(linearTime3_ == 0 ){
666 ical->setTime(
i, TimeStamp );
675 std::unique_ptr<EcalIntercalibConstants>
678 auto ical = std::make_unique<EcalIntercalibConstants>();
681 if(ieta==0)
continue;
687 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
688 ical->setValue( ebid.
rawId(), intercalibConstantMean_ + r*intercalibConstantSigma_ );
698 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
700 ical->setValue( eedetidpos.
rawId(), intercalibConstantMean_ + r*intercalibConstantSigma_ );
704 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
706 ical->setValue( eedetidneg.
rawId(), intercalibConstantMean_ + r1*intercalibConstantSigma_ );
714 std::unique_ptr<EcalIntercalibConstantsMC>
717 auto ical = std::make_unique<EcalIntercalibConstantsMC>();
720 if(ieta==0)
continue;
726 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
727 ical->setValue( ebid.
rawId(), intercalibConstantMeanMC_ + r*intercalibConstantSigmaMC_ );
737 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
739 ical->setValue( eedetidpos.
rawId(), intercalibConstantMeanMC_ + r*intercalibConstantSigmaMC_ );
743 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
745 ical->setValue( eedetidneg.
rawId(), intercalibConstantMeanMC_ + r1*intercalibConstantSigmaMC_ );
753 std::unique_ptr<EcalIntercalibErrors>
756 auto ical = std::make_unique<EcalIntercalibErrors>();
759 if(ieta==0)
continue;
765 ical->setValue( ebid.
rawId(), intercalibErrorMean_);
776 ical->setValue( eedetidpos.
rawId(), intercalibErrorMean_ );
781 ical->setValue( eedetidneg.
rawId(), intercalibErrorMean_ );
789 std::unique_ptr<EcalTimeCalibConstants>
792 auto ical = std::make_unique<EcalTimeCalibConstants>();
795 if(ieta==0)
continue;
801 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
802 ical->setValue( ebid.
rawId(), timeCalibConstantMean_ + r*timeCalibConstantSigma_ );
812 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
814 ical->setValue( eedetidpos.
rawId(), timeCalibConstantMean_ + r*timeCalibConstantSigma_ );
818 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
820 ical->setValue( eedetidneg.
rawId(), timeCalibConstantMean_ + r1*timeCalibConstantSigma_ );
828 std::unique_ptr<EcalTimeCalibErrors>
831 auto ical = std::make_unique<EcalTimeCalibErrors>();
834 if(ieta==0)
continue;
840 ical->setValue( ebid.
rawId(), timeCalibErrorMean_);
851 ical->setValue( eedetidpos.
rawId(), timeCalibErrorMean_ );
856 ical->setValue( eedetidneg.
rawId(), timeCalibErrorMean_ );
864 std::unique_ptr<EcalTimeOffsetConstant>
867 std::cout <<
" produceEcalTimeOffsetConstant: " << std::endl;
868 std::cout <<
" EB " << timeOffsetEBConstant_ <<
" EE " << timeOffsetEEConstant_<< std::endl;
869 return std::make_unique<EcalTimeOffsetConstant>(timeOffsetEBConstant_,timeOffsetEEConstant_);
872 std::unique_ptr<EcalGainRatios>
875 auto gratio = std::make_unique<EcalGainRatios>();
878 gr.setGain6Over1( gainRatio6over1_ );
881 if(ieta==0)
continue;
886 gratio->setValue( ebid.
rawId(), gr );
897 gratio->setValue( eedetidpos.
rawId(), gr );
902 gratio->setValue( eedetidneg.
rawId(), gr );
910 std::unique_ptr<EcalADCToGeVConstant>
913 return std::make_unique<EcalADCToGeVConstant>(adcToGeVEBConstant_,adcToGeVEEConstant_);
916 std::unique_ptr<EcalTBWeights>
920 auto tbwgt = std::make_unique<EcalTBWeights>();
927 for(
int itdc=1; itdc<=nTDCbins_; ++itdc) {
958 mat1.Place_in_row(amplWeights_[itdc-1],0,0);
959 mat1.Place_in_row(pedWeights_[itdc-1],1,0);
960 mat1.Place_in_row(jittWeights_[itdc-1],2,0);
963 mat2.Place_in_row(amplWeightsAft_[itdc-1],0,0);
964 mat2.Place_in_row(pedWeightsAft_[itdc-1],1,0);
965 mat2.Place_in_row(jittWeightsAft_[itdc-1],2,0);
971 mat3=chi2Matrix_[itdc-1];
972 mat4=chi2MatrixAft_[itdc-1];
997 tbwgt->setValue(std::make_pair(igrp,itdc), wgt);
1005 std::unique_ptr<EcalClusterLocalContCorrParameters>
1008 auto ipar = std::make_unique<EcalClusterLocalContCorrParameters>();
1009 for (
size_t i = 0;
i < localContCorrParameters_.size(); ++
i ) {
1010 ipar->params().push_back( localContCorrParameters_[
i] );
1014 std::unique_ptr<EcalClusterCrackCorrParameters>
1017 auto ipar = std::make_unique<EcalClusterCrackCorrParameters>();
1018 for (
size_t i = 0;
i < crackCorrParameters_.size(); ++
i ) {
1019 ipar->params().push_back( crackCorrParameters_[
i] );
1023 std::unique_ptr<EcalClusterEnergyCorrectionParameters>
1026 auto ipar = std::make_unique<EcalClusterEnergyCorrectionParameters>();
1027 for (
size_t i = 0;
i < energyCorrectionParameters_.size(); ++
i ) {
1028 ipar->params().push_back( energyCorrectionParameters_[
i] );
1032 std::unique_ptr<EcalClusterEnergyUncertaintyParameters>
1035 auto ipar = std::make_unique<EcalClusterEnergyUncertaintyParameters>();
1036 for (
size_t i = 0;
i < energyUncertaintyParameters_.size(); ++
i ) {
1037 ipar->params().push_back( energyUncertaintyParameters_[
i] );
1041 std::unique_ptr<EcalClusterEnergyCorrectionObjectSpecificParameters>
1044 auto ipar = std::make_unique<EcalClusterEnergyCorrectionObjectSpecificParameters>();
1045 for (
size_t i = 0;
i < energyCorrectionObjectSpecificParameters_.size(); ++
i ) {
1046 ipar->params().push_back( energyCorrectionObjectSpecificParameters_[
i] );
1053 std::unique_ptr<EcalLaserAlphas>
1057 std::cout <<
" produceEcalLaserAlphas " << std::endl;
1058 auto ical = std::make_unique<EcalLaserAlphas>();
1061 if(getLaserAlphaFromTypeEB_) {
1062 std::ifstream fEB(
edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1063 int SMpos[36] = {-10, 4, -7, -16, 6, -9, 11, -17, 5, 18, 3, -8, 1, -3, -13, 14, -6, 2,
1064 15, -18, 8, 17, -2, 9, -1, 10, -5, 7, -12, -11, 16, -4, -15, -14, 12, 13};
1066 int SMCal[36] = {12,17,10, 1, 8, 4,27,20,23,25, 6,34,35,15,18,30,21, 9,
1067 24,22,13,31,26,16, 2,11, 5, 0,29,28,14,33,32, 3, 7,19};
1069 for(
int SMcons = 0; SMcons < 36; SMcons++) {
1070 int SM = SMpos[SMcons];
1071 if(SM < 0) SM = 17 +
abs(SM);
1073 if(SMCal[SM] != SMcons)
1074 std::cout <<
" SM pb : read SM " << SMcons<<
" SMpos " << SM
1075 <<
" SMCal " << SMCal[SM] << std::endl;
1079 int readSM,
pos, bar, bar2;
1081 for(
int SMcons = 0; SMcons < 36; SMcons++) {
1082 int SM = SMpos[SMcons];
1083 for(
int ic = 0; ic < 1700; ic++) {
1084 fEB >> readSM >> pos >> bar >> bar2 >> type >>
batch;
1086 if(readSM != SMcons || pos != ic + 1)
1087 std::cout <<
" barrel read pb read SM " << readSM <<
" const SM " << SMcons
1088 <<
" read pos " << pos <<
" ic " << ic << std::endl;
1089 if(SM < 0) SM = 18 +
abs(SM);
1091 if(bar == 33101 || bar == 30301 )
1092 alpha = laserAlphaMeanEBR_;
1093 else if(bar == 33106) {
1095 alpha = laserAlphaMeanEBC_;
1097 std::cout <<
" problem with barcode first " << bar <<
" last " << bar2
1098 <<
" read SM " << readSM <<
" read pos " << pos << std::endl;
1099 alpha = laserAlphaMeanEBR_;
1102 ical->setValue( ebdetid, alpha );
1105 std::cout <<
" ic/alpha "<<ic<<
"/"<<alpha<<std::endl;
1112 }
else if(getLaserAlphaFromFileEB_) {
1114 std::cout <<
"Laser alpha for EB will be taken from File"<<std::endl;
1117 std::ifstream fEB(
edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1119 for(
int ic = 0; ic < 61200; ic++) {
1120 fEB >> ieta>> iphi>>
alpha;
1124 ical->setValue( ebid, alpha );
1125 std::cout <<
" ieta/iphi/alpha "<<ieta<<
"/"<<iphi<<
"/"<<alpha<<std::endl;
1128 std::cout <<
"I will print some alphas from the file... ieta/iphi/alpha "<<ieta<<
"/"<<iphi<<
"/"<<alpha<<std::endl;
1136 if(ieta==0)
continue;
1140 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1141 ical->setValue( ebid, laserAlphaMean_ + r*laserAlphaSigma_ );
1147 std::cout <<
" produceEcalLaserAlphas EE" << std::endl;
1148 if(getLaserAlphaFromTypeEE_) {
1149 std::ifstream fEE(
edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1151 for(
int crystal = 0; crystal < 14648; crystal++) {
1152 int x, y ,z, bid, bar, bar2;
1153 float LY,
alpha = 0;
1154 fEE >> z >> x >> y >> LY >> bid >> bar >> bar2;
1155 if(x < 1 || x > 100 || y < 1 || y > 100)
1156 std::cout <<
" wrong coordinates for barcode " << bar
1157 <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1159 if(bar == 33201 || (bar == 30399 && bar2 < 568))
1160 alpha = laserAlphaMeanEER_;
1161 else if((bar == 33106 && bar2 > 2000 && bar2 < 4669)
1162 || (bar == 30399 && bar2 > 567))
1163 alpha = laserAlphaMeanEEC_;
1165 std::cout <<
" problem with barcode " << bar <<
" " << bar2
1166 <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1167 alpha = laserAlphaMeanEER_;
1172 ical->setValue( eedetidpos, alpha );
1175 std::cout <<
" problem with EEDetId " <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1181 }
else if (getLaserAlphaFromFileEE_) {
1183 std::ifstream fEE(
edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1185 for(
int crystal = 0; crystal < 14648; crystal++) {
1188 fEE >> z >> x >> y >>
alpha;
1189 if(x < 1 || x > 100 || y < 1 || y > 100 || z==0 || z>1 || z<-1 ) {
1190 std::cout <<
"ERROR: wrong coordinates for crystal " 1191 <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1192 std::cout <<
" the format of the file should be z x y alpha " << std::endl;
1196 ical->setValue( eedetidpos, alpha );
1199 std::cout <<
" problem with EEDetId " <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1211 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1213 ical->setValue( eedetidpos, laserAlphaMean_ + r*laserAlphaSigma_ );
1216 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1218 ical->setValue( eedetidneg, laserAlphaMean_ + r1*laserAlphaSigma_ );
1228 std::unique_ptr<EcalLaserAPDPNRatiosRef>
1231 auto ical = std::make_unique<EcalLaserAPDPNRatiosRef>();
1233 if(ieta==0)
continue;
1237 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1238 ical->setValue( ebid, laserAPDPNRefMean_ + r*laserAPDPNRefSigma_ );
1247 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1249 ical->setValue( eedetidpos, laserAPDPNRefMean_ + r*laserAPDPNRefSigma_ );
1253 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1255 ical->setValue( eedetidneg, laserAPDPNRefMean_ + r1*laserAPDPNRefSigma_ );
1264 std::unique_ptr<EcalLaserAPDPNRatios>
1272 auto ical = std::make_unique<EcalLaserAPDPNRatios>();
1274 if(ieta==0)
continue;
1282 std::cout<<
"EB at eta="<<eta<<
" dropping by "<<drop<<std::endl;
1287 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1290 pairAPDPN.
p1 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1291 pairAPDPN.
p2 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1292 pairAPDPN.
p3 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1293 ical->setValue( ebid, pairAPDPN );
1307 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1317 if(iX==50)
std::cout<<
"EE at eta="<<eta<<
" dropping by "<<drop<<std::endl;
1321 pairAPDPN.
p1 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1322 pairAPDPN.
p2 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1323 pairAPDPN.
p3 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1324 ical->setValue( eedetidpos, pairAPDPN );
1328 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1331 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
1334 if(iX==50)
std::cout<<
"EE at eta="<<eta<<
" dropping by "<<drop<<std::endl;
1338 pairAPDPN.
p1 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1339 pairAPDPN.
p2 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1340 pairAPDPN.
p3 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1341 ical->setValue( eedetidneg, pairAPDPN );
1348 for(
int i=0;
i<92;
i++){
1350 if(laserAPDPNTime2_ == 0 ){
1355 if(laserAPDPNTime3_ == 0 ){
1361 ical->setTime(
i, TimeStamp );
1372 std::vector < std::vector<double> > amplwgtv(nTDCbins_);
1374 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1376 std::vector<double> vampl;
1378 vampl.push_back( -0.33333 );
1379 vampl.push_back( -0.33333 );
1380 vampl.push_back( -0.33333 );
1381 vampl.push_back( 0. );
1382 vampl.push_back( 0. );
1383 vampl.push_back( 1. );
1384 vampl.push_back( 0. );
1385 vampl.push_back( 0. );
1386 vampl.push_back( 0. );
1387 vampl.push_back( 0. );
1390 else if (getWeightsFromFile_)
1393 std::ifstream amplFile(
edm::FileInPath(amplWeightsFile_).fullPath().c_str());
1395 while (!amplFile.eof() && tdcBin < nTDCbins_)
1397 for(
int j = 0; j < 10; ++j) {
1400 amplwgtv[tdcBin].push_back(ww);
1404 assert (tdcBin == nTDCbins_);
1410 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1415 for (
int i=0;
i<nTDCbins_;
i++)
1417 assert(amplwgtv[
i].
size() == 10);
1419 for(std::vector<double>::const_iterator it = amplwgtv[
i].
begin(); it != amplwgtv[
i].end(); ++it)
1421 (amplWeights_[
i])[j]=*it;
1427 std::vector < std::vector<double> > amplwgtvAftGain(nTDCbins_);
1429 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1431 std::vector<double> vamplAftGain;
1432 vamplAftGain.push_back( 0. );
1433 vamplAftGain.push_back( 0. );
1434 vamplAftGain.push_back( 0. );
1435 vamplAftGain.push_back( 0. );
1436 vamplAftGain.push_back( 0. );
1437 vamplAftGain.push_back( 1. );
1438 vamplAftGain.push_back( 0. );
1439 vamplAftGain.push_back( 0. );
1440 vamplAftGain.push_back( 0. );
1441 vamplAftGain.push_back( 0. );
1442 amplwgtvAftGain[0] = ps.
getUntrackedParameter< std::vector<double> >(
"amplWeightsAftGain", vamplAftGain);
1444 else if (getWeightsFromFile_)
1448 std::ifstream amplFile(
edm::FileInPath(amplWeightsAftFile_).fullPath().c_str());
1450 while (!amplFile.eof() && tdcBin < nTDCbins_)
1452 for(
int j = 0; j < 10; ++j) {
1455 amplwgtvAftGain[tdcBin].push_back(ww);
1459 assert (tdcBin == nTDCbins_);
1464 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1468 for (
int i=0;
i<nTDCbins_;
i++)
1470 assert(amplwgtvAftGain[
i].
size() == 10);
1472 for(std::vector<double>::const_iterator it = amplwgtvAftGain[
i].
begin(); it != amplwgtvAftGain[
i].end(); ++it) {
1473 (amplWeightsAft_[
i])[j]=*it;
1480 std::vector< std::vector<double> > pedwgtv(nTDCbins_);
1482 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1484 std::vector<double> vped;
1485 vped.push_back( 0.33333 );
1486 vped.push_back( 0.33333 );
1487 vped.push_back( 0.33333 );
1488 vped.push_back( 0. );
1489 vped.push_back( 0. );
1490 vped.push_back( 0. );
1491 vped.push_back( 0. );
1492 vped.push_back( 0. );
1493 vped.push_back( 0. );
1494 vped.push_back( 0. );
1497 else if (getWeightsFromFile_)
1501 std::ifstream pedFile(
edm::FileInPath(pedWeightsFile_).fullPath().c_str());
1503 while (!pedFile.eof() && tdcBin < nTDCbins_)
1505 for(
int j = 0; j < 10; ++j) {
1508 pedwgtv[tdcBin].push_back(ww);
1512 assert (tdcBin == nTDCbins_);
1517 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1521 for (
int i=0;
i<nTDCbins_;
i++)
1523 assert(pedwgtv[
i].
size() == 10);
1525 for(std::vector<double>::const_iterator it = pedwgtv[
i].
begin(); it != pedwgtv[
i].end(); ++it) {
1526 (pedWeights_[
i])[j] = *it;
1531 std::vector< std::vector<double> > pedwgtvaft(nTDCbins_);
1533 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1535 std::vector<double> vped;
1536 vped.push_back( 0. );
1537 vped.push_back( 0. );
1538 vped.push_back( 0. );
1539 vped.push_back( 0. );
1540 vped.push_back( 0. );
1541 vped.push_back( 0. );
1542 vped.push_back( 0. );
1543 vped.push_back( 0. );
1544 vped.push_back( 0. );
1545 vped.push_back( 0. );
1548 else if (getWeightsFromFile_)
1552 std::ifstream pedFile(
edm::FileInPath(pedWeightsAftFile_).fullPath().c_str());
1554 while (!pedFile.eof() && tdcBin < nTDCbins_)
1556 for(
int j = 0; j < 10; ++j) {
1559 pedwgtvaft[tdcBin].push_back(ww);
1563 assert (tdcBin == nTDCbins_);
1568 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1572 for (
int i=0;
i<nTDCbins_;
i++)
1574 assert(pedwgtvaft[
i].
size() == 10);
1576 for(std::vector<double>::const_iterator it = pedwgtvaft[
i].
begin(); it != pedwgtvaft[
i].end(); ++it) {
1577 (pedWeightsAft_[
i])[j]=*it;
1586 std::vector< std::vector<double> > jittwgtv(nTDCbins_);
1588 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1590 std::vector<double> vjitt;
1591 vjitt.push_back( 0.04066309 );
1592 vjitt.push_back( 0.04066309 );
1593 vjitt.push_back( 0.04066309 );
1594 vjitt.push_back( 0.000 );
1595 vjitt.push_back( 1.325176 );
1596 vjitt.push_back( -0.04997078 );
1597 vjitt.push_back( -0.504338 );
1598 vjitt.push_back( -0.5024844 );
1599 vjitt.push_back( -0.3903718 );
1600 vjitt.push_back( 0.000 );
1603 else if (getWeightsFromFile_)
1607 std::ifstream jittFile(
edm::FileInPath(jittWeightsFile_).fullPath().c_str());
1609 while (!jittFile.eof() && tdcBin < nTDCbins_)
1611 for(
int j = 0; j < 10; ++j) {
1614 jittwgtv[tdcBin].push_back(ww);
1618 assert (tdcBin == nTDCbins_);
1623 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1627 for (
int i=0;
i<nTDCbins_;
i++)
1629 assert(jittwgtv[
i].
size() == 10);
1631 for(std::vector<double>::const_iterator it = jittwgtv[
i].
begin(); it != jittwgtv[
i].end(); ++it) {
1632 (jittWeights_[
i])[j]= *it;
1637 std::vector< std::vector<double> > jittwgtvaft(nTDCbins_);
1639 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1641 std::vector<double> vjitt;
1642 vjitt.push_back( 0. );
1643 vjitt.push_back( 0. );
1644 vjitt.push_back( 0. );
1645 vjitt.push_back( 0. );
1646 vjitt.push_back( 1.097871 );
1647 vjitt.push_back( -0.04551035 );
1648 vjitt.push_back( -0.4159156 );
1649 vjitt.push_back( -0.4185352 );
1650 vjitt.push_back( -0.3367127 );
1651 vjitt.push_back( 0. );
1654 else if (getWeightsFromFile_)
1658 std::ifstream jittFile(
edm::FileInPath(jittWeightsAftFile_).fullPath().c_str());
1660 while (!jittFile.eof() && tdcBin < nTDCbins_)
1662 for(
int j = 0; j < 10; ++j) {
1665 jittwgtvaft[tdcBin].push_back(ww);
1669 assert (tdcBin == nTDCbins_);
1674 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1678 for (
int i=0;
i<nTDCbins_;
i++)
1680 assert(jittwgtvaft[
i].
size() == 10);
1682 for(std::vector<double>::const_iterator it = jittwgtvaft[
i].
begin(); it != jittwgtvaft[
i].end(); ++it) {
1683 (jittWeightsAft_[
i])[j]= *it;
1689 std::vector< EcalWeightSet::EcalChi2WeightMatrix > chi2Matrix(nTDCbins_);
1690 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1696 chi2Matrix[0](0,0) = 0.694371;
1697 chi2Matrix[0](0,1) = -0.305629;
1698 chi2Matrix[0](0,2) = -0.305629;
1699 chi2Matrix[0](0,3) = 0.;
1700 chi2Matrix[0](0,4) = 0.;
1701 chi2Matrix[0](0,5) = 0.;
1702 chi2Matrix[0](0,6) = 0.;
1703 chi2Matrix[0](0,7) = 0.;
1704 chi2Matrix[0](0,8) = 0.;
1705 chi2Matrix[0](0,9) = 0.;
1706 chi2Matrix[0](1,0) = -0.305629;
1707 chi2Matrix[0](1,1) = 0.694371;
1708 chi2Matrix[0](1,2) = -0.305629;
1709 chi2Matrix[0](1,3) = 0.;
1710 chi2Matrix[0](1,4) = 0.;
1711 chi2Matrix[0](1,5) = 0.;
1712 chi2Matrix[0](1,6) = 0.;
1713 chi2Matrix[0](1,7) = 0.;
1714 chi2Matrix[0](1,8) = 0.;
1715 chi2Matrix[0](1,9) = 0.;
1716 chi2Matrix[0](2,0) = -0.305629;
1717 chi2Matrix[0](2,1) = -0.305629;
1718 chi2Matrix[0](2,2) = 0.694371;
1719 chi2Matrix[0](2,3) = 0.;
1720 chi2Matrix[0](2,4) = 0.;
1721 chi2Matrix[0](2,5) = 0.;
1722 chi2Matrix[0](2,6) = 0.;
1723 chi2Matrix[0](2,7) = 0.;
1724 chi2Matrix[0](2,8) = 0.;
1725 chi2Matrix[0](2,9) = 0.;
1726 chi2Matrix[0](3,0) = 0.;
1727 chi2Matrix[0](3,1) = 0.;
1728 chi2Matrix[0](3,2) = 0.;
1729 chi2Matrix[0](3,3) = 0.;
1730 chi2Matrix[0](3,4) = 0.;
1731 chi2Matrix[0](3,5) = 0.;
1732 chi2Matrix[0](3,6) = 0.;
1733 chi2Matrix[0](3,7) = 0.;
1734 chi2Matrix[0](3,8) = 0.;
1735 chi2Matrix[0](3,9) = 0.;
1736 chi2Matrix[0](4,0) = 0.;
1737 chi2Matrix[0](4,1) = 0.;
1738 chi2Matrix[0](4,2) = 0.;
1739 chi2Matrix[0](4,3) = 0.;
1740 chi2Matrix[0](4,4) = 0.8027116;
1741 chi2Matrix[0](4,5) = -0.2517103;
1742 chi2Matrix[0](4,6) = -0.2232882;
1743 chi2Matrix[0](4,7) = -0.1716192;
1744 chi2Matrix[0](4,8) = -0.1239006;
1745 chi2Matrix[0](4,9) = 0.;
1746 chi2Matrix[0](5,0) = 0.;
1747 chi2Matrix[0](5,1) = 0.;
1748 chi2Matrix[0](5,2) = 0.;
1749 chi2Matrix[0](5,3) = 0.;
1750 chi2Matrix[0](5,4) = -0.2517103;
1751 chi2Matrix[0](5,5) = 0.6528964;
1752 chi2Matrix[0](5,6) = -0.2972839;
1753 chi2Matrix[0](5,7) = -0.2067162;
1754 chi2Matrix[0](5,8) = -0.1230729;
1755 chi2Matrix[0](5,9) = 0.;
1756 chi2Matrix[0](6,0) = 0.;
1757 chi2Matrix[0](6,1) = 0.;
1758 chi2Matrix[0](6,2) = 0.;
1759 chi2Matrix[0](6,3) = 0.;
1760 chi2Matrix[0](6,4) = -0.2232882;
1761 chi2Matrix[0](6,5) = -0.2972839;
1762 chi2Matrix[0](6,6) = 0.7413607;
1763 chi2Matrix[0](6,7) = -0.1883866;
1764 chi2Matrix[0](6,8) = -0.1235052;
1765 chi2Matrix[0](6,9) = 0.;
1766 chi2Matrix[0](7,0) = 0.;
1767 chi2Matrix[0](7,1) = 0.;
1768 chi2Matrix[0](7,2) = 0.;
1769 chi2Matrix[0](7,3) = 0.;
1770 chi2Matrix[0](7,4) = -0.1716192;
1771 chi2Matrix[0](7,5) = -0.2067162;
1772 chi2Matrix[0](7,6) = -0.1883866;
1773 chi2Matrix[0](7,7) = 0.844935;
1774 chi2Matrix[0](7,8) = -0.124291;
1775 chi2Matrix[0](7,9) = 0.;
1776 chi2Matrix[0](8,0) = 0.;
1777 chi2Matrix[0](8,1) = 0.;
1778 chi2Matrix[0](8,2) = 0.;
1779 chi2Matrix[0](8,3) = 0.;
1780 chi2Matrix[0](8,4) = -0.1239006;
1781 chi2Matrix[0](8,5) = -0.1230729;
1782 chi2Matrix[0](8,6) = -0.1235052;
1783 chi2Matrix[0](8,7) = -0.124291;
1784 chi2Matrix[0](8,8) = 0.8749833;
1785 chi2Matrix[0](8,9) = 0.;
1786 chi2Matrix[0](9,0) = 0.;
1787 chi2Matrix[0](9,1) = 0.;
1788 chi2Matrix[0](9,2) = 0.;
1789 chi2Matrix[0](9,3) = 0.;
1790 chi2Matrix[0](9,4) = 0.;
1791 chi2Matrix[0](9,5) = 0.;
1792 chi2Matrix[0](9,6) = 0.;
1793 chi2Matrix[0](9,7) = 0.;
1794 chi2Matrix[0](9,8) = 0.;
1795 chi2Matrix[0](9,9) = 0.;
1797 else if (getWeightsFromFile_)
1801 std::ifstream chi2MatrixFile(
edm::FileInPath(chi2MatrixFile_).fullPath().c_str());
1803 while (!chi2MatrixFile.eof() && tdcBin < nTDCbins_)
1806 for(
int j = 0; j < 10; ++j) {
1807 for(
int l = 0;
l < 10; ++
l) {
1809 chi2MatrixFile >> ww;
1810 chi2Matrix[tdcBin](j,
l)=ww;
1815 assert (tdcBin == nTDCbins_);
1820 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1827 chi2Matrix_ = chi2Matrix;
1830 std::vector< EcalWeightSet::EcalChi2WeightMatrix > chi2MatrixAft(nTDCbins_);
1831 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1837 chi2MatrixAft[0](0,0) = 0.;
1838 chi2MatrixAft[0](0,1) = 0.;
1839 chi2MatrixAft[0](0,2) = 0.;
1840 chi2MatrixAft[0](0,3) = 0.;
1841 chi2MatrixAft[0](0,4) = 0.;
1842 chi2MatrixAft[0](0,5) = 0.;
1843 chi2MatrixAft[0](0,6) = 0.;
1844 chi2MatrixAft[0](0,7) = 0.;
1845 chi2MatrixAft[0](0,8) = 0.;
1846 chi2MatrixAft[0](0,9) = 0.;
1847 chi2MatrixAft[0](1,0) = 0.;
1848 chi2MatrixAft[0](1,1) = 0.;
1849 chi2MatrixAft[0](1,2) = 0.;
1850 chi2MatrixAft[0](1,3) = 0.;
1851 chi2MatrixAft[0](1,4) = 0.;
1852 chi2MatrixAft[0](1,5) = 0.;
1853 chi2MatrixAft[0](1,6) = 0.;
1854 chi2MatrixAft[0](1,7) = 0.;
1855 chi2MatrixAft[0](1,8) = 0.;
1856 chi2MatrixAft[0](1,9) = 0.;
1857 chi2MatrixAft[0](2,0) = 0.;
1858 chi2MatrixAft[0](2,1) = 0.;
1859 chi2MatrixAft[0](2,2) = 0.;
1860 chi2MatrixAft[0](2,3) = 0.;
1861 chi2MatrixAft[0](2,4) = 0.;
1862 chi2MatrixAft[0](2,5) = 0.;
1863 chi2MatrixAft[0](2,6) = 0.;
1864 chi2MatrixAft[0](2,7) = 0.;
1865 chi2MatrixAft[0](2,8) = 0.;
1866 chi2MatrixAft[0](2,9) = 0.;
1867 chi2MatrixAft[0](3,0) = 0.;
1868 chi2MatrixAft[0](3,1) = 0.;
1869 chi2MatrixAft[0](3,2) = 0.;
1870 chi2MatrixAft[0](3,3) = 0.;
1871 chi2MatrixAft[0](3,4) = 0.;
1872 chi2MatrixAft[0](3,5) = 0.;
1873 chi2MatrixAft[0](3,6) = 0.;
1874 chi2MatrixAft[0](3,7) = 0.;
1875 chi2MatrixAft[0](3,8) = 0.;
1876 chi2MatrixAft[0](3,9) = 0.;
1877 chi2MatrixAft[0](4,0) = 0.;
1878 chi2MatrixAft[0](4,1) = 0.;
1879 chi2MatrixAft[0](4,2) = 0.;
1880 chi2MatrixAft[0](4,3) = 0.;
1881 chi2MatrixAft[0](4,4) = 0.8030884;
1882 chi2MatrixAft[0](4,5) = -0.2543541;
1883 chi2MatrixAft[0](4,6) = -0.2243544;
1884 chi2MatrixAft[0](4,7) = -0.1698177;
1885 chi2MatrixAft[0](4,8) = -0.1194506;
1886 chi2MatrixAft[0](4,9) = 0.;
1887 chi2MatrixAft[0](5,0) = 0.;
1888 chi2MatrixAft[0](5,1) = 0.;
1889 chi2MatrixAft[0](5,2) = 0.;
1890 chi2MatrixAft[0](5,3) = 0.;
1891 chi2MatrixAft[0](5,4) = -0.2543541;
1892 chi2MatrixAft[0](5,5) = 0.6714465;
1893 chi2MatrixAft[0](5,6) = -0.2898025;
1894 chi2MatrixAft[0](5,7) = -0.2193564;
1895 chi2MatrixAft[0](5,8) = -0.1542964;
1896 chi2MatrixAft[0](5,9) = 0.;
1897 chi2MatrixAft[0](6,0) = 0.;
1898 chi2MatrixAft[0](6,1) = 0.;
1899 chi2MatrixAft[0](6,2) = 0.;
1900 chi2MatrixAft[0](6,3) = 0.;
1901 chi2MatrixAft[0](6,4) = -0.2243544;
1902 chi2MatrixAft[0](6,5) = -0.2898025;
1903 chi2MatrixAft[0](6,6) = 0.7443781;
1904 chi2MatrixAft[0](6,7) = -0.1934846;
1905 chi2MatrixAft[0](6,8) = -0.136098;
1906 chi2MatrixAft[0](6,9) = 0.;
1907 chi2MatrixAft[0](7,0) = 0.;
1908 chi2MatrixAft[0](7,1) = 0.;
1909 chi2MatrixAft[0](7,2) = 0.;
1910 chi2MatrixAft[0](7,3) = 0.;
1911 chi2MatrixAft[0](7,4) = -0.1698177;
1912 chi2MatrixAft[0](7,5) = -0.2193564;
1913 chi2MatrixAft[0](7,6) = -0.1934846;
1914 chi2MatrixAft[0](7,7) = 0.8535482;
1915 chi2MatrixAft[0](7,8) = -0.1030149;
1916 chi2MatrixAft[0](7,9) = 0.;
1917 chi2MatrixAft[0](8,0) = 0.;
1918 chi2MatrixAft[0](8,1) = 0.;
1919 chi2MatrixAft[0](8,2) = 0.;
1920 chi2MatrixAft[0](8,3) = 0.;
1921 chi2MatrixAft[0](8,4) = -0.1194506;
1922 chi2MatrixAft[0](8,5) = -0.1542964;
1923 chi2MatrixAft[0](8,6) = -0.136098;
1924 chi2MatrixAft[0](8,7) = -0.1030149;
1925 chi2MatrixAft[0](8,8) = 0.9275388;
1926 chi2MatrixAft[0](8,9) = 0.;
1927 chi2MatrixAft[0](9,0) = 0.;
1928 chi2MatrixAft[0](9,1) = 0.;
1929 chi2MatrixAft[0](9,2) = 0.;
1930 chi2MatrixAft[0](9,3) = 0.;
1931 chi2MatrixAft[0](9,4) = 0.;
1932 chi2MatrixAft[0](9,5) = 0.;
1933 chi2MatrixAft[0](9,6) = 0.;
1934 chi2MatrixAft[0](9,7) = 0.;
1935 chi2MatrixAft[0](9,8) = 0.;
1936 chi2MatrixAft[0](9,9) = 0.;
1938 else if (getWeightsFromFile_)
1942 std::ifstream chi2MatrixAftFile(
edm::FileInPath(chi2MatrixAftFile_).fullPath().c_str());
1944 while (!chi2MatrixAftFile.eof() && tdcBin < nTDCbins_)
1947 for(
int j = 0; j < 10; ++j) {
1948 for(
int l = 0;
l < 10; ++
l) {
1950 chi2MatrixAftFile >> ww;
1951 chi2MatrixAft[tdcBin](j,
l)=ww;
1956 assert (tdcBin == nTDCbins_);
1961 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1968 chi2MatrixAft_ = chi2MatrixAft;
1976 std::unique_ptr<EcalChannelStatus>
1979 auto ecalStatus = std::make_unique<EcalChannelStatus>();
1986 if(ieta==0)
continue;
1990 ecalStatus->setValue( ebid, 0 );
2000 ecalStatus->setValue( eedetidpos, 0 );
2004 ecalStatus->setValue( eedetidneg, 0 );
2014 std::ifstream statusFile(
edm::FileInPath(channelStatusFile_).fullPath().c_str());
2015 if ( !statusFile.good() ) {
2017 <<
"*** Problems opening file: " << channelStatusFile_ ;
2026 while (!statusFile.eof())
2028 statusFile >> EcalSubDet;
2031 std::getline(statusFile,str);
2036 statusFile>> hashIndex >>
status;
2043 ecalStatus->setValue( ebid, status );
2048 ecalStatus->setValue( eedetid, status );
2053 <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2066 std::unique_ptr<EcalChannelStatus>
2070 auto ical = std::make_unique<EcalChannelStatus>();
2073 if(ieta==0)
continue;
2077 ical->setValue( ebid, 0 );
2087 ical->setValue( eedetidpos, 0 );
2091 ical->setValue( eedetidneg, 0 );
2099 std::unique_ptr<EcalDQMChannelStatus>
2104 auto ical = std::make_unique<EcalDQMChannelStatus>();
2107 if(ieta==0)
continue;
2111 ical->setValue( ebid, sta );
2121 ical->setValue( eedetidpos, sta );
2125 ical->setValue( eedetidneg, sta );
2133 std::unique_ptr<EcalDQMTowerStatus>
2137 auto ical = std::make_unique<EcalDQMTowerStatus>();
2143 for(
int k=0 ;
k<2;
k++ ) {
2146 for(
int i=1 ;
i<73;
i++) {
2147 for(
int j=1 ; j<18; j++) {
2151 ical->setValue( ebid, sta );
2159 for(
int k=0 ;
k<2;
k++ ) {
2162 for(
int i=1 ;
i<21;
i++) {
2163 for(
int j=1 ; j<21; j++) {
2166 ical->setValue( eeid, sta );
2176 std::unique_ptr<EcalDCSTowerStatus>
2180 auto ical = std::make_unique<EcalDCSTowerStatus>();
2186 for(
int k=0 ;
k<2;
k++ ) {
2189 for(
int i=1 ;
i<73;
i++) {
2190 for(
int j=1 ; j<18; j++) {
2194 ical->setValue( ebid, status );
2202 for(
int k=0 ;
k<2;
k++ ) {
2205 for(
int i=1 ;
i<21;
i++) {
2206 for(
int j=1 ; j<21; j++) {
2209 ical->setValue( eeid, status );
2219 std::unique_ptr<EcalDAQTowerStatus>
2223 auto ical = std::make_unique<EcalDAQTowerStatus>();
2229 for(
int k=0 ;
k<2;
k++ ) {
2232 for(
int i=1 ;
i<73;
i++) {
2233 for(
int j=1 ; j<18; j++) {
2237 ical->setValue( ebid, status );
2245 for(
int k=0 ;
k<2;
k++ ) {
2248 for(
int i=1 ;
i<21;
i++) {
2249 for(
int j=1 ; j<21; j++) {
2252 ical->setValue( eeid, status );
2262 std::unique_ptr<EcalTPGCrystalStatus>
2265 auto ecalStatus = std::make_unique<EcalTPGCrystalStatus>();
2272 if(ieta==0)
continue;
2276 ecalStatus->setValue( ebid, 0 );
2286 ecalStatus->setValue( eedetidpos, 0 );
2290 ecalStatus->setValue( eedetidneg, 0 );
2300 std::ifstream statusFile(
edm::FileInPath(channelStatusFile_).fullPath().c_str());
2301 if ( !statusFile.good() ) {
2303 <<
"*** Problems opening file: " << channelStatusFile_ ;
2312 while (!statusFile.eof())
2314 statusFile >> EcalSubDet;
2317 std::getline(statusFile,str);
2322 statusFile>> hashIndex >>
status;
2329 ecalStatus->setValue( ebid, status );
2334 ecalStatus->setValue( eedetid, status );
2339 <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2352 std::unique_ptr<EcalTPGCrystalStatus>
2356 auto ical = std::make_unique<EcalTPGCrystalStatus>();
2359 if(ieta==0)
continue;
2363 ical->setValue( ebid, 0 );
2373 ical->setValue( eedetidpos, 0 );
2377 ical->setValue( eedetidneg, 0 );
2387 std::unique_ptr<EcalIntercalibConstants>
2391 std::unique_ptr<EcalIntercalibConstants> ical;
2397 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants from file " 2398 << intercalibConstantsFile_.c_str() ;
2400 if(intercalibConstantsFile_.find(
".xml")!= std::string::npos) {
2402 std::cout<<
"generating Intercalib from xml file"<<std::endl;
2409 if(totLumi_ !=0 || instLumi_!=0) {
2410 std::cout<<
"implementing ageing for intercalib"<<std::endl;
2414 if(intercalibConstantsMCFile_.find(
".xml")!= std::string::npos) {
2416 std::cout<<
"generating IntercalibMC from xml file"<<std::endl;
2422 std::cout<<
"please provide the xml file of the EcalIntercalibConstantsMC"<<std::endl;
2426 TRandom3 * gRandom =
new TRandom3();
2437 if(ieta==0)
continue;
2442 std::cout<<
"EB at eta="<<eta<<
" constant term is "<<constantTerm<<std::endl;
2451 if(idref!=mymap.
end())icalconstant=(*idref);
2455 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2457 double r = gRandom->Gaus(0,constantTerm);
2459 if(iphi==10)
std::cout<<
"EB at eta="<<eta<<
" IC="<<icalconstant<<
" ICMC="<<icalconstantMC<<
" smear="<<r<<
" ";
2461 icalconstant = icalconstant + r*1.29*icalconstantMC;
2464 if(iphi==10)
std::cout<<
"newIC="<<icalconstant<<std::endl;
2467 if(icalconstant !=icalconstant2)
std::cout<<
">>>> error in smearing intercalib"<<std::endl;
2479 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
2482 if(iX==50)
std::cout<<
"EE at eta="<<eta<<
" constant term is "<<constantTerm<<std::endl;
2489 if(idref!=mymap.
end())icalconstant=(*idref);
2493 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2495 double r = gRandom->Gaus(0,constantTerm);
2497 if(iX==10)
std::cout<<
"EE at eta="<<eta<<
" IC="<<icalconstant<<
" ICMC="<<icalconstantMC<<
" smear="<<r<<
" ";
2498 icalconstant = icalconstant + r*1.29*icalconstantMC;
2500 if(iX==10)
std::cout<<
"newIC="<<icalconstant<<std::endl;
2509 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
2517 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2519 double r = gRandom->Gaus(0,constantTerm);
2520 icalconstant = icalconstant + r*1.29*icalconstantMC;
2528 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2537 ical = std::make_unique<EcalIntercalibConstants>();
2540 inpFile = fopen (intercalibConstantsFile_.c_str (),
"r") ;
2544 <<
"*** Can not open file: " << intercalibConstantsFile_ ;
2545 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2549 std::ostringstream
str ;
2550 fgets (line,255,inpFile) ;
2551 int sm_number=atoi (line) ;
2552 str <<
"sm: " << sm_number ;
2554 fgets (line,255,inpFile) ;
2557 fgets (line,255,inpFile) ;
2559 str <<
"gen tag: " << gen_tag ;
2561 fgets (line,255,inpFile) ;
2563 str <<
"cali method: " << cali_method << std::endl ;
2565 fgets (line,255,inpFile) ;
2567 str <<
"cali version: " << cali_version << std::endl ;
2569 fgets (line,255,inpFile) ;
2571 str <<
"cali type: " << cali_type ;
2574 <<
"[PIETRO] Intercalibration file - " 2575 << str.str () << std::endl ;
2577 float calib[1700]={1} ;
2578 int calib_status[1700]={0} ;
2582 while (fgets (line,255,inpFile))
2586 float dmy_calib = 0. ;
2587 float dmy_RMS = 0. ;
2588 int dmy_events = 0 ;
2589 int dmy_status = 0 ;
2590 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2591 &dmy_RMS, &dmy_events,
2593 assert (dmy_num >= 1) ;
2594 assert (dmy_num <= 1700) ;
2595 calib[dmy_num-1] = dmy_calib ;
2596 calib_status[dmy_num-1] = dmy_status ;
2608 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " << ii <<
" xtals " ;
2610 <<
"Some crystals missing, set to 1" << std::endl ;
2618 for (
int i=0 ;
i<1700 ;
i++)
2629 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
2630 else ical->setValue (ebid.
rawId (), 1.) ;
2645 std::unique_ptr<EcalIntercalibConstantsMC>
2649 std::unique_ptr<EcalIntercalibConstantsMC> ical;
2655 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants MC from file " 2656 << intercalibConstantsMCFile_.c_str() ;
2658 if(intercalibConstantsMCFile_.find(
".xml")!= std::string::npos) {
2660 std::cout<<
"generating Intercalib MC from xml file"<<std::endl;
2666 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2670 std::cout <<
"ERROR>>> please provide a xml file"<<std::endl;
2679 std::unique_ptr<EcalIntercalibErrors>
2683 auto ical = std::make_unique<EcalIntercalibErrors>();
2688 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants from file " 2689 << intercalibErrorsFile_.c_str() ;
2692 inpFile = fopen (intercalibErrorsFile_.c_str (),
"r") ;
2696 <<
"*** Can not open file: " << intercalibErrorsFile_ ;
2697 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2701 std::ostringstream
str ;
2702 fgets (line,255,inpFile) ;
2703 int sm_number=atoi (line) ;
2704 str <<
"sm: " << sm_number ;
2706 fgets (line,255,inpFile) ;
2709 fgets (line,255,inpFile) ;
2711 str <<
"gen tag: " << gen_tag ;
2713 fgets (line,255,inpFile) ;
2715 str <<
"cali method: " << cali_method << std::endl ;
2717 fgets (line,255,inpFile) ;
2719 str <<
"cali version: " << cali_version << std::endl ;
2721 fgets (line,255,inpFile) ;
2723 str <<
"cali type: " << cali_type ;
2726 <<
"[PIETRO] Intercalibration file - " 2727 << str.str () << std::endl ;
2729 float calib[1700]={1} ;
2730 int calib_status[1700]={0} ;
2734 while (fgets (line,255,inpFile))
2738 float dmy_calib = 0. ;
2739 float dmy_RMS = 0. ;
2740 int dmy_events = 0 ;
2741 int dmy_status = 0 ;
2742 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2743 &dmy_RMS, &dmy_events,
2745 assert (dmy_num >= 1) ;
2746 assert (dmy_num <= 1700) ;
2747 calib[dmy_num-1] = dmy_calib ;
2748 calib_status[dmy_num-1] = dmy_status ;
2760 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " << ii <<
" xtals " ;
2762 <<
"Some crystals missing, set to 1" << std::endl ;
2770 for (
int i=0 ;
i<1700 ;
i++)
2781 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
2782 else ical->setValue (ebid.
rawId (), 1.) ;
2799 std::unique_ptr<EcalTimeCalibConstants>
2803 auto ical = std::make_unique<EcalTimeCalibConstants>();
2808 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading time calibration constants from file " 2809 << timeCalibConstantsFile_.c_str() ;
2812 inpFile = fopen (timeCalibConstantsFile_.c_str (),
"r") ;
2816 <<
"*** Can not open file: " << timeCalibConstantsFile_ ;
2817 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2821 std::ostringstream
str ;
2822 fgets (line,255,inpFile) ;
2823 int sm_number=atoi (line) ;
2824 str <<
"sm: " << sm_number ;
2826 fgets (line,255,inpFile) ;
2829 fgets (line,255,inpFile) ;
2831 str <<
"gen tag: " << gen_tag ;
2833 fgets (line,255,inpFile) ;
2835 str <<
"cali method: " << cali_method << std::endl ;
2837 fgets (line,255,inpFile) ;
2839 str <<
"cali version: " << cali_version << std::endl ;
2841 fgets (line,255,inpFile) ;
2843 str <<
"cali type: " << cali_type ;
2846 <<
"TimeCalibration file - " 2847 << str.str () << std::endl ;
2849 float calib[1700]={1} ;
2850 int calib_status[1700]={0} ;
2854 while (fgets (line,255,inpFile))
2858 float dmy_calib = 0. ;
2859 float dmy_RMS = 0. ;
2860 int dmy_events = 0 ;
2861 int dmy_status = 0 ;
2862 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2863 &dmy_RMS, &dmy_events,
2865 assert (dmy_num >= 1) ;
2866 assert (dmy_num <= 1700) ;
2867 calib[dmy_num-1] = dmy_calib ;
2868 calib_status[dmy_num-1] = dmy_status ;
2880 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read timeCalibrations for " << ii <<
" xtals " ;
2882 <<
"Some crystals missing, set to 1" << std::endl ;
2890 for (
int i=0 ;
i<1700 ;
i++)
2901 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
2902 else ical->setValue (ebid.
rawId (), 1.) ;
2912 std::unique_ptr<EcalTimeCalibErrors>
2916 auto ical = std::make_unique<EcalTimeCalibErrors>();
2921 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading timeCalibration constants from file " 2922 << timeCalibErrorsFile_.c_str() ;
2925 inpFile = fopen (timeCalibErrorsFile_.c_str (),
"r") ;
2929 <<
"*** Can not open file: " << timeCalibErrorsFile_ ;
2930 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2934 std::ostringstream
str ;
2935 fgets (line,255,inpFile) ;
2936 int sm_number=atoi (line) ;
2937 str <<
"sm: " << sm_number ;
2939 fgets (line,255,inpFile) ;
2942 fgets (line,255,inpFile) ;
2944 str <<
"gen tag: " << gen_tag ;
2946 fgets (line,255,inpFile) ;
2948 str <<
"cali method: " << cali_method << std::endl ;
2950 fgets (line,255,inpFile) ;
2952 str <<
"cali version: " << cali_version << std::endl ;
2954 fgets (line,255,inpFile) ;
2956 str <<
"cali type: " << cali_type ;
2959 <<
"TimeCalibration file - " 2960 << str.str () << std::endl ;
2962 float calib[1700]={1} ;
2963 int calib_status[1700]={0} ;
2967 while (fgets (line,255,inpFile))
2971 float dmy_calib = 0. ;
2972 float dmy_RMS = 0. ;
2973 int dmy_events = 0 ;
2974 int dmy_status = 0 ;
2975 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2976 &dmy_RMS, &dmy_events,
2978 assert (dmy_num >= 1) ;
2979 assert (dmy_num <= 1700) ;
2980 calib[dmy_num-1] = dmy_calib ;
2981 calib_status[dmy_num-1] = dmy_status ;
2993 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read time calibrations for " << ii <<
" xtals " ;
2995 <<
"Some crystals missing, set to 1" << std::endl ;
3003 for (
int i=0 ;
i<1700 ;
i++)
3014 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
3015 else ical->setValue (ebid.
rawId (), 1.) ;
3026 std::unique_ptr<EcalMappingElectronics>
3029 auto mapping = std::make_unique<EcalMappingElectronics>();
3035 edm::LogError(
"EcalTrivialConditionRetriever") <<
"File not found";
3044 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
3045 int tccid, tower, pseudostrip_in_TCC, pseudostrip_in_TT;
3050 f >> ix >> iy >> iz >> CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >> tower >>
3051 pseudostrip_in_TCC >> pseudostrip_in_TT ;
3058 EcalElectronicsId elecid(dccid,towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
3064 (*mapping).setValue(detid, aElement);
3073 std::unique_ptr<EcalMappingElectronics>
3077 auto ical = std::make_unique<EcalMappingElectronics>();
3083 std::unique_ptr<Alignments>
3085 double mytrans[3] = {0., 0., 0.};
3086 double myeuler[3] = {0., 0., 0.};
3088 if(getEBAlignmentFromFile_)
3090 std::vector<AlignTransform> my_align;
3093 for(
int SM = 1 ; SM < 37; SM++ ) {
3096 iphi = 1 + (SM - 19) * 20;
3102 if(getEBAlignmentFromFile_) {
3103 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3104 std::cout <<
" translation " << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3105 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2] << std::endl;
3107 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3108 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3110 my_align.push_back(transform);
3136 return std::make_unique<Alignments>(
a);
3139 std::unique_ptr<Alignments>
3141 double mytrans[3] = {0., 0., 0.};
3142 double myeuler[3] = {0., 0., 0.};
3144 if(getEEAlignmentFromFile_)
3146 std::vector<AlignTransform> my_align;
3150 for(
int Dee = 0 ; Dee < 4; Dee++ ) {
3152 if(Dee == 1 || Dee == 3)
3157 EEDetId eedetId(ix, iy, side);
3158 if(getEEAlignmentFromFile_) {
3159 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3160 std::cout <<
" translation " << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3161 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2] << std::endl;
3163 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3164 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3166 my_align.push_back(transform);
3170 return std::make_unique<Alignments>(
a);
3173 std::unique_ptr<Alignments>
3175 double mytrans[3] = {0., 0., 0.};
3176 double myeuler[3] = {0., 0., 0.};
3178 if(getESAlignmentFromFile_)
3180 std::vector<AlignTransform> my_align;
3182 int pl_vect[10] = {2, 2, 1, 1, 1, 1, 2, 2};
3186 for(
int layer = 0 ; layer < 8; layer++ ) {
3188 int ix = 10 + (layer%2) * 20;
3189 int plane = pl_vect[layer];
3190 if(layer > 3) side = 1;
3191 ESDetId esdetId(strip, ix, iy, plane, side);
3192 if(getESAlignmentFromFile_) {
3193 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3194 std::cout <<
" translation " << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3195 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2] << std::endl;
3197 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3198 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3200 my_align.push_back(transform);
3204 return std::make_unique<Alignments>(
a);
3207 std::unique_ptr<EcalSampleMask>
3210 return std::unique_ptr<EcalSampleMask>(
new EcalSampleMask(sampleMaskEB_, sampleMaskEE_) );
3213 std::unique_ptr<EcalTimeBiasCorrections>
3215 auto ipar = std::make_unique<EcalTimeBiasCorrections>();
3216 copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(),
3217 back_inserter(ipar->EBTimeCorrAmplitudeBins));
3218 copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(),
3219 back_inserter(ipar->EBTimeCorrShiftBins));
3220 copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(),
3221 back_inserter(ipar->EETimeCorrAmplitudeBins));
3222 copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(),
3223 back_inserter(ipar->EETimeCorrShiftBins));
3227 std::unique_ptr<EcalSamplesCorrelation>
3229 if(getSamplesCorrelationFromFile_) {
3233 for(
int j = 0; j < 10; ++j) {
3235 EBG12samplesCorrelation_.push_back(ww);
3237 for(
int j = 0; j < 10; ++j) {
3239 EBG6samplesCorrelation_.push_back(ww);
3241 for(
int j = 0; j < 10; ++j) {
3243 EBG1samplesCorrelation_.push_back(ww);
3245 for(
int j = 0; j < 10; ++j) {
3247 EEG12samplesCorrelation_.push_back(ww);
3249 for(
int j = 0; j < 10; ++j) {
3251 EEG6samplesCorrelation_.push_back(ww);
3253 for(
int j = 0; j < 10; ++j) {
3255 EEG1samplesCorrelation_.push_back(ww);
3259 auto ipar = std::make_unique<EcalSamplesCorrelation>();
3260 copy(EBG12samplesCorrelation_.begin(), EBG12samplesCorrelation_.end(),
3261 back_inserter(ipar->EBG12SamplesCorrelation));
3262 copy(EBG6samplesCorrelation_.begin(), EBG6samplesCorrelation_.end(),
3263 back_inserter(ipar->EBG6SamplesCorrelation));
3264 copy(EBG1samplesCorrelation_.begin(), EBG1samplesCorrelation_.end(),
3265 back_inserter(ipar->EBG1SamplesCorrelation));
3266 copy(EEG12samplesCorrelation_.begin(), EEG12samplesCorrelation_.end(),
3267 back_inserter(ipar->EEG12SamplesCorrelation));
3268 copy(EEG6samplesCorrelation_.begin(), EEG6samplesCorrelation_.end(),
3269 back_inserter(ipar->EEG6SamplesCorrelation));
3270 copy(EEG1samplesCorrelation_.begin(), EEG1samplesCorrelation_.end(),
3271 back_inserter(ipar->EEG1SamplesCorrelation));
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
static bool validDetId(int ix, int iy, int iz)
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
T getUntrackedParameter(std::string const &, T const &) const
static const int MIN_IPHI
virtual void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
static Timestamp endOfTime()
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 &)
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
virtual std::unique_ptr< EcalSamplesCorrelation > produceEcalSamplesCorrelation(const EcalSamplesCorrelationRcd &)
const self & getMap() const
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 &)
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
void getWeightsFromConfiguration(const edm::ParameterSet &ps)
double calcresolutitonConstantTerm(double eta)
static EEDetId unhashIndex(int hi)
std::vector< AlignTransform > m_align
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 &)
uint32_t rawId() const
get the raw id
virtual std::unique_ptr< Alignments > produceEcalAlignmentEB(const EBAlignmentRcd &)
void setValue(const uint32_t id, const Item &item)
T x() const
Cartesian x coordinate.
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 &)
const char * name() const
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 &)
virtual ~EcalTrivialConditionRetriever()
EcalWeightMatrix & getWeightsAfterGainSwitch()
math::Matrix< 10, 10 >::type EcalChi2WeightMatrix
virtual std::unique_ptr< EcalPedestals > produceEcalPedestals(const EcalPedestalsRcd &)
virtual std::unique_ptr< EcalClusterEnergyCorrectionObjectSpecificParameters > produceEcalClusterEnergyCorrectionObjectSpecificParameters(const EcalClusterEnergyCorrectionObjectSpecificParametersRcd &)
static const int MAX_IPHI
EcalWeightMatrix & getWeightsBeforeGainSwitch()
virtual std::unique_ptr< EcalDCSTowerStatus > produceEcalDCSTowerStatus(const EcalDCSTowerStatusRcd &)
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
virtual std::unique_ptr< EcalTPGCrystalStatus > produceEcalTrgChannelStatus(const EcalTPGCrystalStatusRcd &)
virtual std::unique_ptr< EcalTimeCalibErrors > produceEcalTimeCalibErrors(const EcalTimeCalibErrorsRcd &)
batch
Use ROOT's batch mode, unless outputting to C macros, since there is a bug in pyROOT that fails to ex...
virtual std::unique_ptr< EcalTBWeights > produceEcalTBWeights(const EcalTBWeightsRcd &)
virtual std::unique_ptr< EcalTimeOffsetConstant > produceEcalTimeOffsetConstant(const EcalTimeOffsetConstantRcd &)
const_iterator find(uint32_t rawId) const
math::Matrix< 3, 10 >::type EcalWeightMatrix
std::string fullPath() const
const Timestamp & time() const
virtual std::unique_ptr< EcalTimeCalibConstants > getTimeCalibConstantsFromConfiguration(const EcalTimeCalibConstantsRcd &)
const_iterator end() const
virtual std::unique_ptr< EcalTPGCrystalStatus > getTrgChannelStatusFromConfiguration(const EcalTPGCrystalStatusRcd &)
float EcalIntercalibConstantMC
virtual std::unique_ptr< EcalSampleMask > produceEcalSampleMask(const EcalSampleMaskRcd &)
virtual std::unique_ptr< EcalIntercalibErrors > getIntercalibErrorsFromConfiguration(const EcalIntercalibErrorsRcd &)
static const int SMCRYSTALMODE
double calcampDropTotal(double eta)
TimeValue_t value() 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 &)
float EcalIntercalibConstant
virtual std::unique_ptr< EcalClusterCrackCorrParameters > produceEcalClusterCrackCorrParameters(const EcalClusterCrackCorrParametersRcd &)