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>() );
116 sim_pulse_shape_EB_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_EB_thresh" );
117 sim_pulse_shape_EE_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_EE_thresh" );
118 sim_pulse_shape_APD_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_APD_thresh");
126 std::cout <<
" EcalTrivialConditionRetriever " << std::endl;
132 std::cout <<
" EcalTrivialConditionRetriever going to create conditions based on the damage deu to "<<totLumi_<<
133 " fb-1 integrated luminosity" << std::endl;
137 if (weightsForAsynchronousRunning_)
139 getWeightsFromFile_ =
true;
146 std::ostringstream
str;
148 if (!weightsForAsynchronousRunning_)
153 weightType = str.str();
164 amplWeights_.resize(nTDCbins_);
165 amplWeightsAft_.resize(nTDCbins_);
166 pedWeights_.resize(nTDCbins_);
167 pedWeightsAft_.resize(nTDCbins_);
168 jittWeights_.resize(nTDCbins_);
169 jittWeightsAft_.resize(nTDCbins_);
170 chi2Matrix_.resize(nTDCbins_);
171 chi2MatrixAft_.resize(nTDCbins_);
174 getWeightsFromConfiguration(ps);
182 producedEcalMappingElectronics_ = ps.
getUntrackedParameter<
bool>(
"producedEcalMappingElectronics",
true);
185 if ( producedEcalMappingElectronics_ ) {
186 if ( !mappingFile_.empty() ) {
191 findingRecord<EcalMappingElectronicsRcd>();
195 if(getEBAlignmentFromFile_) {
200 if(getEEAlignmentFromFile_) {
205 if(getESAlignmentFromFile_)
212 if (producedEcalPedestals_)
215 if (producedEcalWeights_) {
220 if (producedEcalGainRatios_)
223 if (producedEcalADCToGeVConstant_)
227 producedEcalTimeOffsetConstant_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeOffsetConstant",
true);
229 if (producedEcalTimeOffsetConstant_) {
231 findingRecord<EcalTimeOffsetConstantRcd>();
235 producedEcalLinearCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalLinearCorrections",
true);
238 if (producedEcalLinearCorrections_) {
239 if(!linearCorrectionsFile_.empty()) {
244 findingRecord<EcalLinearCorrectionsRcd> () ;
250 producedEcalIntercalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstants",
true);
255 if (producedEcalIntercalibConstants_) {
256 if(!intercalibConstantsFile_.empty()) {
261 findingRecord<EcalIntercalibConstantsRcd> () ;
264 producedEcalIntercalibConstantsMC_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstantsMC",
true);
266 if (producedEcalIntercalibConstantsMC_) {
267 if(!intercalibConstantsMCFile_.empty()) {
272 findingRecord<EcalIntercalibConstantsMCRcd> () ;
279 if (producedEcalIntercalibErrors_) {
280 if(!intercalibErrorsFile_.empty()) {
285 findingRecord<EcalIntercalibErrorsRcd> () ;
289 producedEcalTimeCalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeCalibConstants",
true);
292 if (producedEcalTimeCalibConstants_) {
293 if(!timeCalibConstantsFile_.empty()) {
298 findingRecord<EcalTimeCalibConstantsRcd> () ;
305 if (producedEcalTimeCalibErrors_) {
306 if(!timeCalibErrorsFile_.empty()) {
311 findingRecord<EcalTimeCalibErrorsRcd> () ;
321 if (producedEcalSimPulseShape_) {
323 findingRecord<EcalSimPulseShapeRcd> () ;
328 producedEcalClusterLocalContCorrParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterLocalContCorrParameters",
false);
329 producedEcalClusterCrackCorrParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterCrackCorrParameters",
false);
330 producedEcalClusterEnergyCorrectionParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionParameters",
false);
331 producedEcalClusterEnergyUncertaintyParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyUncertaintyParameters",
false);
332 producedEcalClusterEnergyCorrectionObjectSpecificParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionObjectSpecificParameters",
false);
333 if ( producedEcalClusterLocalContCorrParameters_ ) {
335 findingRecord<EcalClusterLocalContCorrParametersRcd>();
337 if ( producedEcalClusterCrackCorrParameters_ ) {
339 findingRecord<EcalClusterCrackCorrParametersRcd>();
341 if ( producedEcalClusterEnergyCorrectionParameters_ ) {
343 findingRecord<EcalClusterEnergyCorrectionParametersRcd>();
345 if ( producedEcalClusterEnergyUncertaintyParameters_ ) {
347 findingRecord<EcalClusterEnergyUncertaintyParametersRcd>();
349 if ( producedEcalClusterEnergyCorrectionObjectSpecificParameters_ ) {
351 findingRecord<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>();
356 if (producedEcalLaserCorrection_) {
359 findingRecord<EcalLaserAlphasRcd> () ;
364 std::cout <<
" getLaserAlphaFromFileEB_ " << getLaserAlphaFromFileEB_ << std::endl;
365 std::cout <<
" getLaserAlphaFromFileEE_ " << getLaserAlphaFromFileEE_ << std::endl;
366 std::cout <<
" getLaserAlphaFromTypeEB_ " << getLaserAlphaFromTypeEB_ << std::endl;
367 std::cout <<
" getLaserAlphaFromTypeEE_ " << getLaserAlphaFromTypeEE_ << std::endl;
368 if(getLaserAlphaFromFileEB_) {
371 if(getLaserAlphaFromFileEE_) {
374 if(getLaserAlphaFromTypeEB_) {
379 if(getLaserAlphaFromTypeEE_) {
385 findingRecord<EcalLaserAPDPNRatiosRefRcd> () ;
387 findingRecord<EcalLaserAPDPNRatiosRcd> () ;
394 if ( producedEcalChannelStatus_ ) {
395 if ( !channelStatusFile_.empty() ) {
400 findingRecord<EcalChannelStatusRcd>();
404 if ( producedEcalDQMChannelStatus_ ) {
406 findingRecord<EcalDQMChannelStatusRcd>();
410 if ( producedEcalDCSTowerStatus_ ) {
412 findingRecord<EcalDCSTowerStatusRcd>();
416 if ( producedEcalDAQTowerStatus_ ) {
418 findingRecord<EcalDAQTowerStatusRcd>();
422 if ( producedEcalDQMTowerStatus_ ) {
424 findingRecord<EcalDQMTowerStatusRcd>();
431 if ( producedEcalTrgChannelStatus_ ) {
432 if ( !trgChannelStatusFile_.empty() ) {
437 findingRecord<EcalTPGCrystalStatusRcd>();
442 if ( producedEcalAlignmentEB_ ) {
444 findingRecord<EBAlignmentRcd>();
447 if ( producedEcalAlignmentEE_ ) {
449 findingRecord<EEAlignmentRcd>();
452 if ( producedEcalAlignmentES_ ) {
454 findingRecord<ESAlignmentRcd>();
457 if (producedEcalPedestals_) findingRecord<EcalPedestalsRcd>();
459 if (producedEcalWeights_) {
460 findingRecord<EcalWeightXtalGroupsRcd>();
461 findingRecord<EcalTBWeightsRcd>();
464 if (producedEcalGainRatios_) findingRecord<EcalGainRatiosRcd>();
466 if (producedEcalADCToGeVConstant_) findingRecord<EcalADCToGeVConstantRcd>();
469 if (producedEcalSampleMask_) {
471 findingRecord<EcalSampleMaskRcd>();
473 producedEcalTimeBiasCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeBiasCorrections",
false);
474 if (producedEcalTimeBiasCorrections_) {
476 findingRecord<EcalTimeBiasCorrectionsRcd>();
478 producedEcalSamplesCorrelation_ = ps.
getUntrackedParameter<
bool>(
"producedEcalSamplesCorrelation",
false);
479 if (producedEcalSamplesCorrelation_) {
481 findingRecord<EcalSamplesCorrelationRcd>();
482 getSamplesCorrelationFromFile_ = ps.
getUntrackedParameter<
bool>(
"getSamplesCorrelationFromFile",
false);
483 if(getSamplesCorrelationFromFile_) {
501 if(verbose_>=1)
std::cout <<
"EcalTrivialConditionRetriever::setIntervalFor(): record key = " << rk.
name() <<
"\ttime: " << iTime.
time().
value() << std::endl;
507 std::unique_ptr<EcalPedestals>
509 auto peds = std::make_unique<EcalPedestals>();
514 EBitem.rms_x1 = EBpedRMSX1_;
515 EBitem.mean_x6 = EBpedMeanX6_;
516 EBitem.rms_x6 = EBpedRMSX6_;
517 EBitem.mean_x12 = EBpedMeanX12_;
518 EBitem.rms_x12 = EBpedRMSX12_;
521 EEitem.
rms_x1 = EEpedRMSX1_;
523 EEitem.
rms_x6 = EEpedRMSX6_;
532 if(iEta==0)
continue;
544 EBitem.rms_x1 = EBpedRMSX1_*noisefactor;
545 EBitem.rms_x6 = EBpedRMSX6_*noisefactor;
546 EBitem.rms_x12 = EBpedRMSX12_*noisefactor;
547 std::cout <<
"rms ped at eta:"<< eta<<
" ="<< EBitem.rms_x12 << std::endl;
557 peds->insert(std::make_pair(ebdetid.
rawId(),EBitem));
568 peds->insert(std::make_pair(eedetidpos.
rawId(),EEitem));
573 peds->insert(std::make_pair(eedetidneg.
rawId(),EEitem));
584 std::unique_ptr<EcalWeightXtalGroups>
587 auto xtalGroups = std::make_unique<EcalWeightXtalGroups>();
590 if(ieta==0)
continue;
597 xtalGroups->setValue(ebid.
rawId(), defaultGroupId );
608 xtalGroups->setValue(eedetidpos.
rawId(), defaultGroupId );
613 xtalGroups->setValue(eedetidneg.
rawId(), defaultGroupId );
621 std::unique_ptr<EcalLinearCorrections>
624 auto ical = std::make_unique<EcalLinearCorrections>();
627 if(ieta==0)
continue;
631 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
634 pairAPDPN.
p1 = linCorrMean_ + r*linCorrSigma_;
635 pairAPDPN.
p2 = linCorrMean_ + r*linCorrSigma_;
636 pairAPDPN.
p3 = linCorrMean_ + r*linCorrSigma_;
637 ical->setValue( ebid, pairAPDPN );
646 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
650 pairAPDPN.
p1 = linCorrMean_ + r*linCorrSigma_;
651 pairAPDPN.
p2 = linCorrMean_ + r*linCorrSigma_;
652 pairAPDPN.
p3 = linCorrMean_ + r*linCorrSigma_;
654 ical->setValue( eedetidpos, pairAPDPN );
658 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
662 pairAPDPN.
p1 = linCorrMean_ + r1*linCorrSigma_;
663 pairAPDPN.
p2 = linCorrMean_ + r1*linCorrSigma_;
664 pairAPDPN.
p3 = linCorrMean_ + r1*linCorrSigma_;
666 ical->setValue( eedetidneg, pairAPDPN );
673 for(
int i=0;
i<92;
i++){
675 if(linearTime2_ == 0 ){
680 if(linearTime3_ == 0 ){
686 ical->setTime(
i, TimeStamp );
695 std::unique_ptr<EcalIntercalibConstants>
698 auto ical = std::make_unique<EcalIntercalibConstants>();
701 if(ieta==0)
continue;
707 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
708 ical->setValue( ebid.
rawId(), intercalibConstantMean_ + r*intercalibConstantSigma_ );
718 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
720 ical->setValue( eedetidpos.
rawId(), intercalibConstantMean_ + r*intercalibConstantSigma_ );
724 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
726 ical->setValue( eedetidneg.
rawId(), intercalibConstantMean_ + r1*intercalibConstantSigma_ );
734 std::unique_ptr<EcalIntercalibConstantsMC>
737 auto ical = std::make_unique<EcalIntercalibConstantsMC>();
740 if(ieta==0)
continue;
746 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
747 ical->setValue( ebid.
rawId(), intercalibConstantMeanMC_ + r*intercalibConstantSigmaMC_ );
757 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
759 ical->setValue( eedetidpos.
rawId(), intercalibConstantMeanMC_ + r*intercalibConstantSigmaMC_ );
763 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
765 ical->setValue( eedetidneg.
rawId(), intercalibConstantMeanMC_ + r1*intercalibConstantSigmaMC_ );
773 std::unique_ptr<EcalIntercalibErrors>
776 auto ical = std::make_unique<EcalIntercalibErrors>();
779 if(ieta==0)
continue;
785 ical->setValue( ebid.
rawId(), intercalibErrorMean_);
796 ical->setValue( eedetidpos.
rawId(), intercalibErrorMean_ );
801 ical->setValue( eedetidneg.
rawId(), intercalibErrorMean_ );
809 std::unique_ptr<EcalTimeCalibConstants>
812 auto ical = std::make_unique<EcalTimeCalibConstants>();
815 if(ieta==0)
continue;
821 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
822 ical->setValue( ebid.
rawId(), timeCalibConstantMean_ + r*timeCalibConstantSigma_ );
832 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
834 ical->setValue( eedetidpos.
rawId(), timeCalibConstantMean_ + r*timeCalibConstantSigma_ );
838 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
840 ical->setValue( eedetidneg.
rawId(), timeCalibConstantMean_ + r1*timeCalibConstantSigma_ );
848 std::unique_ptr<EcalTimeCalibErrors>
851 auto ical = std::make_unique<EcalTimeCalibErrors>();
854 if(ieta==0)
continue;
860 ical->setValue( ebid.
rawId(), timeCalibErrorMean_);
871 ical->setValue( eedetidpos.
rawId(), timeCalibErrorMean_ );
876 ical->setValue( eedetidneg.
rawId(), timeCalibErrorMean_ );
884 std::unique_ptr<EcalTimeOffsetConstant>
887 std::cout <<
" produceEcalTimeOffsetConstant: " << std::endl;
888 std::cout <<
" EB " << timeOffsetEBConstant_ <<
" EE " << timeOffsetEEConstant_<< std::endl;
889 return std::make_unique<EcalTimeOffsetConstant>(timeOffsetEBConstant_,timeOffsetEEConstant_);
892 std::unique_ptr<EcalGainRatios>
895 auto gratio = std::make_unique<EcalGainRatios>();
898 gr.setGain6Over1( gainRatio6over1_ );
901 if(ieta==0)
continue;
906 gratio->setValue( ebid.
rawId(), gr );
917 gratio->setValue( eedetidpos.
rawId(), gr );
922 gratio->setValue( eedetidneg.
rawId(), gr );
930 std::unique_ptr<EcalADCToGeVConstant>
933 return std::make_unique<EcalADCToGeVConstant>(adcToGeVEBConstant_,adcToGeVEEConstant_);
936 std::unique_ptr<EcalTBWeights>
940 auto tbwgt = std::make_unique<EcalTBWeights>();
947 for(
int itdc=1; itdc<=nTDCbins_; ++itdc) {
978 mat1.Place_in_row(amplWeights_[itdc-1],0,0);
979 mat1.Place_in_row(pedWeights_[itdc-1],1,0);
980 mat1.Place_in_row(jittWeights_[itdc-1],2,0);
983 mat2.Place_in_row(amplWeightsAft_[itdc-1],0,0);
984 mat2.Place_in_row(pedWeightsAft_[itdc-1],1,0);
985 mat2.Place_in_row(jittWeightsAft_[itdc-1],2,0);
991 mat3=chi2Matrix_[itdc-1];
992 mat4=chi2MatrixAft_[itdc-1];
1017 tbwgt->setValue(std::make_pair(igrp,itdc), wgt);
1026 std::unique_ptr<EcalClusterLocalContCorrParameters>
1029 auto ipar = std::make_unique<EcalClusterLocalContCorrParameters>();
1030 for (
size_t i = 0;
i < localContCorrParameters_.size(); ++
i ) {
1031 ipar->params().push_back( localContCorrParameters_[
i] );
1035 std::unique_ptr<EcalClusterCrackCorrParameters>
1038 auto ipar = std::make_unique<EcalClusterCrackCorrParameters>();
1039 for (
size_t i = 0;
i < crackCorrParameters_.size(); ++
i ) {
1040 ipar->params().push_back( crackCorrParameters_[
i] );
1044 std::unique_ptr<EcalClusterEnergyCorrectionParameters>
1047 auto ipar = std::make_unique<EcalClusterEnergyCorrectionParameters>();
1048 for (
size_t i = 0;
i < energyCorrectionParameters_.size(); ++
i ) {
1049 ipar->params().push_back( energyCorrectionParameters_[
i] );
1053 std::unique_ptr<EcalClusterEnergyUncertaintyParameters>
1056 auto ipar = std::make_unique<EcalClusterEnergyUncertaintyParameters>();
1057 for (
size_t i = 0;
i < energyUncertaintyParameters_.size(); ++
i ) {
1058 ipar->params().push_back( energyUncertaintyParameters_[
i] );
1062 std::unique_ptr<EcalClusterEnergyCorrectionObjectSpecificParameters>
1065 auto ipar = std::make_unique<EcalClusterEnergyCorrectionObjectSpecificParameters>();
1066 for (
size_t i = 0;
i < energyCorrectionObjectSpecificParameters_.size(); ++
i ) {
1067 ipar->params().push_back( energyCorrectionObjectSpecificParameters_[
i] );
1074 std::unique_ptr<EcalLaserAlphas>
1078 std::cout <<
" produceEcalLaserAlphas " << std::endl;
1079 auto ical = std::make_unique<EcalLaserAlphas>();
1082 if(getLaserAlphaFromTypeEB_) {
1083 std::ifstream fEB(
edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1084 int SMpos[36] = {-10, 4, -7, -16, 6, -9, 11, -17, 5, 18, 3, -8, 1, -3, -13, 14, -6, 2,
1085 15, -18, 8, 17, -2, 9, -1, 10, -5, 7, -12, -11, 16, -4, -15, -14, 12, 13};
1087 int SMCal[36] = {12,17,10, 1, 8, 4,27,20,23,25, 6,34,35,15,18,30,21, 9,
1088 24,22,13,31,26,16, 2,11, 5, 0,29,28,14,33,32, 3, 7,19};
1090 for(
int SMcons = 0; SMcons < 36; SMcons++) {
1091 int SM = SMpos[SMcons];
1092 if(SM < 0) SM = 17 +
abs(SM);
1094 if(SMCal[SM] != SMcons)
1095 std::cout <<
" SM pb : read SM " << SMcons<<
" SMpos " << SM
1096 <<
" SMCal " << SMCal[SM] << std::endl;
1100 int readSM,
pos, bar, bar2;
1102 for(
int SMcons = 0; SMcons < 36; SMcons++) {
1103 int SM = SMpos[SMcons];
1104 for(
int ic = 0; ic < 1700; ic++) {
1105 fEB >> readSM >> pos >> bar >> bar2 >> type >>
batch;
1107 if(readSM != SMcons || pos != ic + 1)
1108 std::cout <<
" barrel read pb read SM " << readSM <<
" const SM " << SMcons
1109 <<
" read pos " << pos <<
" ic " << ic << std::endl;
1110 if(SM < 0) SM = 18 +
abs(SM);
1112 if(bar == 33101 || bar == 30301 )
1113 alpha = laserAlphaMeanEBR_;
1114 else if(bar == 33106) {
1116 alpha = laserAlphaMeanEBC_;
1118 std::cout <<
" problem with barcode first " << bar <<
" last " << bar2
1119 <<
" read SM " << readSM <<
" read pos " << pos << std::endl;
1120 alpha = laserAlphaMeanEBR_;
1123 ical->setValue( ebdetid, alpha );
1126 std::cout <<
" ic/alpha "<<ic<<
"/"<<alpha<<std::endl;
1133 }
else if(getLaserAlphaFromFileEB_) {
1135 std::cout <<
"Laser alpha for EB will be taken from File"<<std::endl;
1138 std::ifstream fEB(
edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1140 for(
int ic = 0; ic < 61200; ic++) {
1141 fEB >> ieta>> iphi>>
alpha;
1145 ical->setValue( ebid, alpha );
1146 std::cout <<
" ieta/iphi/alpha "<<ieta<<
"/"<<iphi<<
"/"<<alpha<<std::endl;
1149 std::cout <<
"I will print some alphas from the file... ieta/iphi/alpha "<<ieta<<
"/"<<iphi<<
"/"<<alpha<<std::endl;
1157 if(ieta==0)
continue;
1161 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1162 ical->setValue( ebid, laserAlphaMean_ + r*laserAlphaSigma_ );
1168 std::cout <<
" produceEcalLaserAlphas EE" << std::endl;
1169 if(getLaserAlphaFromTypeEE_) {
1170 std::ifstream fEE(
edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1172 for(
int crystal = 0; crystal < 14648; crystal++) {
1173 int x, y ,z, bid, bar, bar2;
1174 float LY,
alpha = 0;
1175 fEE >> z >> x >> y >> LY >> bid >> bar >> bar2;
1176 if(x < 1 || x > 100 || y < 1 || y > 100)
1177 std::cout <<
" wrong coordinates for barcode " << bar
1178 <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1180 if(bar == 33201 || (bar == 30399 && bar2 < 568))
1181 alpha = laserAlphaMeanEER_;
1182 else if((bar == 33106 && bar2 > 2000 && bar2 < 4669)
1183 || (bar == 30399 && bar2 > 567))
1184 alpha = laserAlphaMeanEEC_;
1186 std::cout <<
" problem with barcode " << bar <<
" " << bar2
1187 <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1188 alpha = laserAlphaMeanEER_;
1193 ical->setValue( eedetidpos, alpha );
1196 std::cout <<
" problem with EEDetId " <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1202 }
else if (getLaserAlphaFromFileEE_) {
1204 std::ifstream fEE(
edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1206 for(
int crystal = 0; crystal < 14648; crystal++) {
1209 fEE >> z >> x >> y >>
alpha;
1210 if(x < 1 || x > 100 || y < 1 || y > 100 || z==0 || z>1 || z<-1 ) {
1211 std::cout <<
"ERROR: wrong coordinates for crystal " 1212 <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1213 std::cout <<
" the format of the file should be z x y alpha " << std::endl;
1217 ical->setValue( eedetidpos, alpha );
1220 std::cout <<
" problem with EEDetId " <<
" x " << x <<
" y " << y <<
" z " << z << std::endl;
1232 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1234 ical->setValue( eedetidpos, laserAlphaMean_ + r*laserAlphaSigma_ );
1237 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1239 ical->setValue( eedetidneg, laserAlphaMean_ + r1*laserAlphaSigma_ );
1249 std::unique_ptr<EcalLaserAPDPNRatiosRef>
1252 auto ical = std::make_unique<EcalLaserAPDPNRatiosRef>();
1254 if(ieta==0)
continue;
1258 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1259 ical->setValue( ebid, laserAPDPNRefMean_ + r*laserAPDPNRefSigma_ );
1268 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1270 ical->setValue( eedetidpos, laserAPDPNRefMean_ + r*laserAPDPNRefSigma_ );
1274 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1276 ical->setValue( eedetidneg, laserAPDPNRefMean_ + r1*laserAPDPNRefSigma_ );
1285 std::unique_ptr<EcalLaserAPDPNRatios>
1293 auto ical = std::make_unique<EcalLaserAPDPNRatios>();
1295 if(ieta==0)
continue;
1303 std::cout<<
"EB at eta="<<eta<<
" dropping by "<<drop<<std::endl;
1308 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1311 pairAPDPN.
p1 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1312 pairAPDPN.
p2 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1313 pairAPDPN.
p3 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1314 ical->setValue( ebid, pairAPDPN );
1328 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1338 if(iX==50)
std::cout<<
"EE at eta="<<eta<<
" dropping by "<<drop<<std::endl;
1342 pairAPDPN.
p1 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1343 pairAPDPN.
p2 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1344 pairAPDPN.
p3 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1345 ical->setValue( eedetidpos, pairAPDPN );
1349 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1352 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
1355 if(iX==50)
std::cout<<
"EE at eta="<<eta<<
" dropping by "<<drop<<std::endl;
1359 pairAPDPN.
p1 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1360 pairAPDPN.
p2 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1361 pairAPDPN.
p3 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1362 ical->setValue( eedetidneg, pairAPDPN );
1369 for(
int i=0;
i<92;
i++){
1371 if(laserAPDPNTime2_ == 0 ){
1376 if(laserAPDPNTime3_ == 0 ){
1382 ical->setTime(
i, TimeStamp );
1393 std::vector < std::vector<double> > amplwgtv(nTDCbins_);
1395 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1397 std::vector<double> vampl;
1399 vampl.push_back( -0.33333 );
1400 vampl.push_back( -0.33333 );
1401 vampl.push_back( -0.33333 );
1402 vampl.push_back( 0. );
1403 vampl.push_back( 0. );
1404 vampl.push_back( 1. );
1405 vampl.push_back( 0. );
1406 vampl.push_back( 0. );
1407 vampl.push_back( 0. );
1408 vampl.push_back( 0. );
1411 else if (getWeightsFromFile_)
1414 std::ifstream amplFile(
edm::FileInPath(amplWeightsFile_).fullPath().c_str());
1416 while (!amplFile.eof() && tdcBin < nTDCbins_)
1418 for(
int j = 0; j < 10; ++j) {
1421 amplwgtv[tdcBin].push_back(ww);
1425 assert (tdcBin == nTDCbins_);
1431 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1436 for (
int i=0;
i<nTDCbins_;
i++)
1438 assert(amplwgtv[
i].
size() == 10);
1440 for(std::vector<double>::const_iterator it = amplwgtv[
i].
begin(); it != amplwgtv[
i].end(); ++it)
1442 (amplWeights_[
i])[j]=*it;
1448 std::vector < std::vector<double> > amplwgtvAftGain(nTDCbins_);
1450 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1452 std::vector<double> vamplAftGain;
1453 vamplAftGain.push_back( 0. );
1454 vamplAftGain.push_back( 0. );
1455 vamplAftGain.push_back( 0. );
1456 vamplAftGain.push_back( 0. );
1457 vamplAftGain.push_back( 0. );
1458 vamplAftGain.push_back( 1. );
1459 vamplAftGain.push_back( 0. );
1460 vamplAftGain.push_back( 0. );
1461 vamplAftGain.push_back( 0. );
1462 vamplAftGain.push_back( 0. );
1463 amplwgtvAftGain[0] = ps.
getUntrackedParameter< std::vector<double> >(
"amplWeightsAftGain", vamplAftGain);
1465 else if (getWeightsFromFile_)
1469 std::ifstream amplFile(
edm::FileInPath(amplWeightsAftFile_).fullPath().c_str());
1471 while (!amplFile.eof() && tdcBin < nTDCbins_)
1473 for(
int j = 0; j < 10; ++j) {
1476 amplwgtvAftGain[tdcBin].push_back(ww);
1480 assert (tdcBin == nTDCbins_);
1485 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1489 for (
int i=0;
i<nTDCbins_;
i++)
1491 assert(amplwgtvAftGain[
i].
size() == 10);
1493 for(std::vector<double>::const_iterator it = amplwgtvAftGain[
i].
begin(); it != amplwgtvAftGain[
i].end(); ++it) {
1494 (amplWeightsAft_[
i])[j]=*it;
1501 std::vector< std::vector<double> > pedwgtv(nTDCbins_);
1503 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1505 std::vector<double> vped;
1506 vped.push_back( 0.33333 );
1507 vped.push_back( 0.33333 );
1508 vped.push_back( 0.33333 );
1509 vped.push_back( 0. );
1510 vped.push_back( 0. );
1511 vped.push_back( 0. );
1512 vped.push_back( 0. );
1513 vped.push_back( 0. );
1514 vped.push_back( 0. );
1515 vped.push_back( 0. );
1518 else if (getWeightsFromFile_)
1522 std::ifstream pedFile(
edm::FileInPath(pedWeightsFile_).fullPath().c_str());
1524 while (!pedFile.eof() && tdcBin < nTDCbins_)
1526 for(
int j = 0; j < 10; ++j) {
1529 pedwgtv[tdcBin].push_back(ww);
1533 assert (tdcBin == nTDCbins_);
1538 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1542 for (
int i=0;
i<nTDCbins_;
i++)
1544 assert(pedwgtv[
i].
size() == 10);
1546 for(std::vector<double>::const_iterator it = pedwgtv[
i].
begin(); it != pedwgtv[
i].end(); ++it) {
1547 (pedWeights_[
i])[j] = *it;
1552 std::vector< std::vector<double> > pedwgtvaft(nTDCbins_);
1554 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1556 std::vector<double> vped;
1557 vped.push_back( 0. );
1558 vped.push_back( 0. );
1559 vped.push_back( 0. );
1560 vped.push_back( 0. );
1561 vped.push_back( 0. );
1562 vped.push_back( 0. );
1563 vped.push_back( 0. );
1564 vped.push_back( 0. );
1565 vped.push_back( 0. );
1566 vped.push_back( 0. );
1569 else if (getWeightsFromFile_)
1573 std::ifstream pedFile(
edm::FileInPath(pedWeightsAftFile_).fullPath().c_str());
1575 while (!pedFile.eof() && tdcBin < nTDCbins_)
1577 for(
int j = 0; j < 10; ++j) {
1580 pedwgtvaft[tdcBin].push_back(ww);
1584 assert (tdcBin == nTDCbins_);
1589 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1593 for (
int i=0;
i<nTDCbins_;
i++)
1595 assert(pedwgtvaft[
i].
size() == 10);
1597 for(std::vector<double>::const_iterator it = pedwgtvaft[
i].
begin(); it != pedwgtvaft[
i].end(); ++it) {
1598 (pedWeightsAft_[
i])[j]=*it;
1607 std::vector< std::vector<double> > jittwgtv(nTDCbins_);
1609 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1611 std::vector<double> vjitt;
1612 vjitt.push_back( 0.04066309 );
1613 vjitt.push_back( 0.04066309 );
1614 vjitt.push_back( 0.04066309 );
1615 vjitt.push_back( 0.000 );
1616 vjitt.push_back( 1.325176 );
1617 vjitt.push_back( -0.04997078 );
1618 vjitt.push_back( -0.504338 );
1619 vjitt.push_back( -0.5024844 );
1620 vjitt.push_back( -0.3903718 );
1621 vjitt.push_back( 0.000 );
1624 else if (getWeightsFromFile_)
1628 std::ifstream jittFile(
edm::FileInPath(jittWeightsFile_).fullPath().c_str());
1630 while (!jittFile.eof() && tdcBin < nTDCbins_)
1632 for(
int j = 0; j < 10; ++j) {
1635 jittwgtv[tdcBin].push_back(ww);
1639 assert (tdcBin == nTDCbins_);
1644 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1648 for (
int i=0;
i<nTDCbins_;
i++)
1650 assert(jittwgtv[
i].
size() == 10);
1652 for(std::vector<double>::const_iterator it = jittwgtv[
i].
begin(); it != jittwgtv[
i].end(); ++it) {
1653 (jittWeights_[
i])[j]= *it;
1658 std::vector< std::vector<double> > jittwgtvaft(nTDCbins_);
1660 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1662 std::vector<double> vjitt;
1663 vjitt.push_back( 0. );
1664 vjitt.push_back( 0. );
1665 vjitt.push_back( 0. );
1666 vjitt.push_back( 0. );
1667 vjitt.push_back( 1.097871 );
1668 vjitt.push_back( -0.04551035 );
1669 vjitt.push_back( -0.4159156 );
1670 vjitt.push_back( -0.4185352 );
1671 vjitt.push_back( -0.3367127 );
1672 vjitt.push_back( 0. );
1675 else if (getWeightsFromFile_)
1679 std::ifstream jittFile(
edm::FileInPath(jittWeightsAftFile_).fullPath().c_str());
1681 while (!jittFile.eof() && tdcBin < nTDCbins_)
1683 for(
int j = 0; j < 10; ++j) {
1686 jittwgtvaft[tdcBin].push_back(ww);
1690 assert (tdcBin == nTDCbins_);
1695 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1699 for (
int i=0;
i<nTDCbins_;
i++)
1701 assert(jittwgtvaft[
i].
size() == 10);
1703 for(std::vector<double>::const_iterator it = jittwgtvaft[
i].
begin(); it != jittwgtvaft[
i].end(); ++it) {
1704 (jittWeightsAft_[
i])[j]= *it;
1710 std::vector< EcalWeightSet::EcalChi2WeightMatrix > chi2Matrix(nTDCbins_);
1711 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1717 chi2Matrix[0](0,0) = 0.694371;
1718 chi2Matrix[0](0,1) = -0.305629;
1719 chi2Matrix[0](0,2) = -0.305629;
1720 chi2Matrix[0](0,3) = 0.;
1721 chi2Matrix[0](0,4) = 0.;
1722 chi2Matrix[0](0,5) = 0.;
1723 chi2Matrix[0](0,6) = 0.;
1724 chi2Matrix[0](0,7) = 0.;
1725 chi2Matrix[0](0,8) = 0.;
1726 chi2Matrix[0](0,9) = 0.;
1727 chi2Matrix[0](1,0) = -0.305629;
1728 chi2Matrix[0](1,1) = 0.694371;
1729 chi2Matrix[0](1,2) = -0.305629;
1730 chi2Matrix[0](1,3) = 0.;
1731 chi2Matrix[0](1,4) = 0.;
1732 chi2Matrix[0](1,5) = 0.;
1733 chi2Matrix[0](1,6) = 0.;
1734 chi2Matrix[0](1,7) = 0.;
1735 chi2Matrix[0](1,8) = 0.;
1736 chi2Matrix[0](1,9) = 0.;
1737 chi2Matrix[0](2,0) = -0.305629;
1738 chi2Matrix[0](2,1) = -0.305629;
1739 chi2Matrix[0](2,2) = 0.694371;
1740 chi2Matrix[0](2,3) = 0.;
1741 chi2Matrix[0](2,4) = 0.;
1742 chi2Matrix[0](2,5) = 0.;
1743 chi2Matrix[0](2,6) = 0.;
1744 chi2Matrix[0](2,7) = 0.;
1745 chi2Matrix[0](2,8) = 0.;
1746 chi2Matrix[0](2,9) = 0.;
1747 chi2Matrix[0](3,0) = 0.;
1748 chi2Matrix[0](3,1) = 0.;
1749 chi2Matrix[0](3,2) = 0.;
1750 chi2Matrix[0](3,3) = 0.;
1751 chi2Matrix[0](3,4) = 0.;
1752 chi2Matrix[0](3,5) = 0.;
1753 chi2Matrix[0](3,6) = 0.;
1754 chi2Matrix[0](3,7) = 0.;
1755 chi2Matrix[0](3,8) = 0.;
1756 chi2Matrix[0](3,9) = 0.;
1757 chi2Matrix[0](4,0) = 0.;
1758 chi2Matrix[0](4,1) = 0.;
1759 chi2Matrix[0](4,2) = 0.;
1760 chi2Matrix[0](4,3) = 0.;
1761 chi2Matrix[0](4,4) = 0.8027116;
1762 chi2Matrix[0](4,5) = -0.2517103;
1763 chi2Matrix[0](4,6) = -0.2232882;
1764 chi2Matrix[0](4,7) = -0.1716192;
1765 chi2Matrix[0](4,8) = -0.1239006;
1766 chi2Matrix[0](4,9) = 0.;
1767 chi2Matrix[0](5,0) = 0.;
1768 chi2Matrix[0](5,1) = 0.;
1769 chi2Matrix[0](5,2) = 0.;
1770 chi2Matrix[0](5,3) = 0.;
1771 chi2Matrix[0](5,4) = -0.2517103;
1772 chi2Matrix[0](5,5) = 0.6528964;
1773 chi2Matrix[0](5,6) = -0.2972839;
1774 chi2Matrix[0](5,7) = -0.2067162;
1775 chi2Matrix[0](5,8) = -0.1230729;
1776 chi2Matrix[0](5,9) = 0.;
1777 chi2Matrix[0](6,0) = 0.;
1778 chi2Matrix[0](6,1) = 0.;
1779 chi2Matrix[0](6,2) = 0.;
1780 chi2Matrix[0](6,3) = 0.;
1781 chi2Matrix[0](6,4) = -0.2232882;
1782 chi2Matrix[0](6,5) = -0.2972839;
1783 chi2Matrix[0](6,6) = 0.7413607;
1784 chi2Matrix[0](6,7) = -0.1883866;
1785 chi2Matrix[0](6,8) = -0.1235052;
1786 chi2Matrix[0](6,9) = 0.;
1787 chi2Matrix[0](7,0) = 0.;
1788 chi2Matrix[0](7,1) = 0.;
1789 chi2Matrix[0](7,2) = 0.;
1790 chi2Matrix[0](7,3) = 0.;
1791 chi2Matrix[0](7,4) = -0.1716192;
1792 chi2Matrix[0](7,5) = -0.2067162;
1793 chi2Matrix[0](7,6) = -0.1883866;
1794 chi2Matrix[0](7,7) = 0.844935;
1795 chi2Matrix[0](7,8) = -0.124291;
1796 chi2Matrix[0](7,9) = 0.;
1797 chi2Matrix[0](8,0) = 0.;
1798 chi2Matrix[0](8,1) = 0.;
1799 chi2Matrix[0](8,2) = 0.;
1800 chi2Matrix[0](8,3) = 0.;
1801 chi2Matrix[0](8,4) = -0.1239006;
1802 chi2Matrix[0](8,5) = -0.1230729;
1803 chi2Matrix[0](8,6) = -0.1235052;
1804 chi2Matrix[0](8,7) = -0.124291;
1805 chi2Matrix[0](8,8) = 0.8749833;
1806 chi2Matrix[0](8,9) = 0.;
1807 chi2Matrix[0](9,0) = 0.;
1808 chi2Matrix[0](9,1) = 0.;
1809 chi2Matrix[0](9,2) = 0.;
1810 chi2Matrix[0](9,3) = 0.;
1811 chi2Matrix[0](9,4) = 0.;
1812 chi2Matrix[0](9,5) = 0.;
1813 chi2Matrix[0](9,6) = 0.;
1814 chi2Matrix[0](9,7) = 0.;
1815 chi2Matrix[0](9,8) = 0.;
1816 chi2Matrix[0](9,9) = 0.;
1818 else if (getWeightsFromFile_)
1822 std::ifstream chi2MatrixFile(
edm::FileInPath(chi2MatrixFile_).fullPath().c_str());
1824 while (!chi2MatrixFile.eof() && tdcBin < nTDCbins_)
1827 for(
int j = 0; j < 10; ++j) {
1828 for(
int l = 0;
l < 10; ++
l) {
1830 chi2MatrixFile >> ww;
1831 chi2Matrix[tdcBin](j,
l)=ww;
1836 assert (tdcBin == nTDCbins_);
1841 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1848 chi2Matrix_ = chi2Matrix;
1851 std::vector< EcalWeightSet::EcalChi2WeightMatrix > chi2MatrixAft(nTDCbins_);
1852 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1858 chi2MatrixAft[0](0,0) = 0.;
1859 chi2MatrixAft[0](0,1) = 0.;
1860 chi2MatrixAft[0](0,2) = 0.;
1861 chi2MatrixAft[0](0,3) = 0.;
1862 chi2MatrixAft[0](0,4) = 0.;
1863 chi2MatrixAft[0](0,5) = 0.;
1864 chi2MatrixAft[0](0,6) = 0.;
1865 chi2MatrixAft[0](0,7) = 0.;
1866 chi2MatrixAft[0](0,8) = 0.;
1867 chi2MatrixAft[0](0,9) = 0.;
1868 chi2MatrixAft[0](1,0) = 0.;
1869 chi2MatrixAft[0](1,1) = 0.;
1870 chi2MatrixAft[0](1,2) = 0.;
1871 chi2MatrixAft[0](1,3) = 0.;
1872 chi2MatrixAft[0](1,4) = 0.;
1873 chi2MatrixAft[0](1,5) = 0.;
1874 chi2MatrixAft[0](1,6) = 0.;
1875 chi2MatrixAft[0](1,7) = 0.;
1876 chi2MatrixAft[0](1,8) = 0.;
1877 chi2MatrixAft[0](1,9) = 0.;
1878 chi2MatrixAft[0](2,0) = 0.;
1879 chi2MatrixAft[0](2,1) = 0.;
1880 chi2MatrixAft[0](2,2) = 0.;
1881 chi2MatrixAft[0](2,3) = 0.;
1882 chi2MatrixAft[0](2,4) = 0.;
1883 chi2MatrixAft[0](2,5) = 0.;
1884 chi2MatrixAft[0](2,6) = 0.;
1885 chi2MatrixAft[0](2,7) = 0.;
1886 chi2MatrixAft[0](2,8) = 0.;
1887 chi2MatrixAft[0](2,9) = 0.;
1888 chi2MatrixAft[0](3,0) = 0.;
1889 chi2MatrixAft[0](3,1) = 0.;
1890 chi2MatrixAft[0](3,2) = 0.;
1891 chi2MatrixAft[0](3,3) = 0.;
1892 chi2MatrixAft[0](3,4) = 0.;
1893 chi2MatrixAft[0](3,5) = 0.;
1894 chi2MatrixAft[0](3,6) = 0.;
1895 chi2MatrixAft[0](3,7) = 0.;
1896 chi2MatrixAft[0](3,8) = 0.;
1897 chi2MatrixAft[0](3,9) = 0.;
1898 chi2MatrixAft[0](4,0) = 0.;
1899 chi2MatrixAft[0](4,1) = 0.;
1900 chi2MatrixAft[0](4,2) = 0.;
1901 chi2MatrixAft[0](4,3) = 0.;
1902 chi2MatrixAft[0](4,4) = 0.8030884;
1903 chi2MatrixAft[0](4,5) = -0.2543541;
1904 chi2MatrixAft[0](4,6) = -0.2243544;
1905 chi2MatrixAft[0](4,7) = -0.1698177;
1906 chi2MatrixAft[0](4,8) = -0.1194506;
1907 chi2MatrixAft[0](4,9) = 0.;
1908 chi2MatrixAft[0](5,0) = 0.;
1909 chi2MatrixAft[0](5,1) = 0.;
1910 chi2MatrixAft[0](5,2) = 0.;
1911 chi2MatrixAft[0](5,3) = 0.;
1912 chi2MatrixAft[0](5,4) = -0.2543541;
1913 chi2MatrixAft[0](5,5) = 0.6714465;
1914 chi2MatrixAft[0](5,6) = -0.2898025;
1915 chi2MatrixAft[0](5,7) = -0.2193564;
1916 chi2MatrixAft[0](5,8) = -0.1542964;
1917 chi2MatrixAft[0](5,9) = 0.;
1918 chi2MatrixAft[0](6,0) = 0.;
1919 chi2MatrixAft[0](6,1) = 0.;
1920 chi2MatrixAft[0](6,2) = 0.;
1921 chi2MatrixAft[0](6,3) = 0.;
1922 chi2MatrixAft[0](6,4) = -0.2243544;
1923 chi2MatrixAft[0](6,5) = -0.2898025;
1924 chi2MatrixAft[0](6,6) = 0.7443781;
1925 chi2MatrixAft[0](6,7) = -0.1934846;
1926 chi2MatrixAft[0](6,8) = -0.136098;
1927 chi2MatrixAft[0](6,9) = 0.;
1928 chi2MatrixAft[0](7,0) = 0.;
1929 chi2MatrixAft[0](7,1) = 0.;
1930 chi2MatrixAft[0](7,2) = 0.;
1931 chi2MatrixAft[0](7,3) = 0.;
1932 chi2MatrixAft[0](7,4) = -0.1698177;
1933 chi2MatrixAft[0](7,5) = -0.2193564;
1934 chi2MatrixAft[0](7,6) = -0.1934846;
1935 chi2MatrixAft[0](7,7) = 0.8535482;
1936 chi2MatrixAft[0](7,8) = -0.1030149;
1937 chi2MatrixAft[0](7,9) = 0.;
1938 chi2MatrixAft[0](8,0) = 0.;
1939 chi2MatrixAft[0](8,1) = 0.;
1940 chi2MatrixAft[0](8,2) = 0.;
1941 chi2MatrixAft[0](8,3) = 0.;
1942 chi2MatrixAft[0](8,4) = -0.1194506;
1943 chi2MatrixAft[0](8,5) = -0.1542964;
1944 chi2MatrixAft[0](8,6) = -0.136098;
1945 chi2MatrixAft[0](8,7) = -0.1030149;
1946 chi2MatrixAft[0](8,8) = 0.9275388;
1947 chi2MatrixAft[0](8,9) = 0.;
1948 chi2MatrixAft[0](9,0) = 0.;
1949 chi2MatrixAft[0](9,1) = 0.;
1950 chi2MatrixAft[0](9,2) = 0.;
1951 chi2MatrixAft[0](9,3) = 0.;
1952 chi2MatrixAft[0](9,4) = 0.;
1953 chi2MatrixAft[0](9,5) = 0.;
1954 chi2MatrixAft[0](9,6) = 0.;
1955 chi2MatrixAft[0](9,7) = 0.;
1956 chi2MatrixAft[0](9,8) = 0.;
1957 chi2MatrixAft[0](9,9) = 0.;
1959 else if (getWeightsFromFile_)
1963 std::ifstream chi2MatrixAftFile(
edm::FileInPath(chi2MatrixAftFile_).fullPath().c_str());
1965 while (!chi2MatrixAftFile.eof() && tdcBin < nTDCbins_)
1968 for(
int j = 0; j < 10; ++j) {
1969 for(
int l = 0;
l < 10; ++
l) {
1971 chi2MatrixAftFile >> ww;
1972 chi2MatrixAft[tdcBin](j,
l)=ww;
1977 assert (tdcBin == nTDCbins_);
1982 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1989 chi2MatrixAft_ = chi2MatrixAft;
1997 std::unique_ptr<EcalChannelStatus>
2000 auto ecalStatus = std::make_unique<EcalChannelStatus>();
2007 if(ieta==0)
continue;
2011 ecalStatus->setValue( ebid, 0 );
2021 ecalStatus->setValue( eedetidpos, 0 );
2025 ecalStatus->setValue( eedetidneg, 0 );
2035 std::ifstream statusFile(
edm::FileInPath(channelStatusFile_).fullPath().c_str());
2036 if ( !statusFile.good() ) {
2038 <<
"*** Problems opening file: " << channelStatusFile_ ;
2047 while (!statusFile.eof())
2049 statusFile >> EcalSubDet;
2052 std::getline(statusFile,str);
2057 statusFile>> hashIndex >>
status;
2064 ecalStatus->setValue( ebid, status );
2069 ecalStatus->setValue( eedetid, status );
2074 <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2087 std::unique_ptr<EcalChannelStatus>
2091 auto ical = std::make_unique<EcalChannelStatus>();
2094 if(ieta==0)
continue;
2098 ical->setValue( ebid, 0 );
2108 ical->setValue( eedetidpos, 0 );
2112 ical->setValue( eedetidneg, 0 );
2120 std::unique_ptr<EcalDQMChannelStatus>
2125 auto ical = std::make_unique<EcalDQMChannelStatus>();
2128 if(ieta==0)
continue;
2132 ical->setValue( ebid, sta );
2142 ical->setValue( eedetidpos, sta );
2146 ical->setValue( eedetidneg, sta );
2154 std::unique_ptr<EcalDQMTowerStatus>
2158 auto ical = std::make_unique<EcalDQMTowerStatus>();
2164 for(
int k=0 ;
k<2;
k++ ) {
2167 for(
int i=1 ;
i<73;
i++) {
2168 for(
int j=1 ; j<18; j++) {
2172 ical->setValue( ebid, sta );
2180 for(
int k=0 ;
k<2;
k++ ) {
2183 for(
int i=1 ;
i<21;
i++) {
2184 for(
int j=1 ; j<21; j++) {
2187 ical->setValue( eeid, sta );
2197 std::unique_ptr<EcalDCSTowerStatus>
2201 auto ical = std::make_unique<EcalDCSTowerStatus>();
2207 for(
int k=0 ;
k<2;
k++ ) {
2210 for(
int i=1 ;
i<73;
i++) {
2211 for(
int j=1 ; j<18; j++) {
2215 ical->setValue( ebid, status );
2223 for(
int k=0 ;
k<2;
k++ ) {
2226 for(
int i=1 ;
i<21;
i++) {
2227 for(
int j=1 ; j<21; j++) {
2230 ical->setValue( eeid, status );
2240 std::unique_ptr<EcalDAQTowerStatus>
2244 auto ical = std::make_unique<EcalDAQTowerStatus>();
2250 for(
int k=0 ;
k<2;
k++ ) {
2253 for(
int i=1 ;
i<73;
i++) {
2254 for(
int j=1 ; j<18; j++) {
2258 ical->setValue( ebid, status );
2266 for(
int k=0 ;
k<2;
k++ ) {
2269 for(
int i=1 ;
i<21;
i++) {
2270 for(
int j=1 ; j<21; j++) {
2273 ical->setValue( eeid, status );
2283 std::unique_ptr<EcalTPGCrystalStatus>
2286 auto ecalStatus = std::make_unique<EcalTPGCrystalStatus>();
2293 if(ieta==0)
continue;
2297 ecalStatus->setValue( ebid, 0 );
2307 ecalStatus->setValue( eedetidpos, 0 );
2311 ecalStatus->setValue( eedetidneg, 0 );
2321 std::ifstream statusFile(
edm::FileInPath(channelStatusFile_).fullPath().c_str());
2322 if ( !statusFile.good() ) {
2324 <<
"*** Problems opening file: " << channelStatusFile_ ;
2333 while (!statusFile.eof())
2335 statusFile >> EcalSubDet;
2338 std::getline(statusFile,str);
2343 statusFile>> hashIndex >>
status;
2350 ecalStatus->setValue( ebid, status );
2355 ecalStatus->setValue( eedetid, status );
2360 <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2373 std::unique_ptr<EcalTPGCrystalStatus>
2377 auto ical = std::make_unique<EcalTPGCrystalStatus>();
2380 if(ieta==0)
continue;
2384 ical->setValue( ebid, 0 );
2394 ical->setValue( eedetidpos, 0 );
2398 ical->setValue( eedetidneg, 0 );
2408 std::unique_ptr<EcalIntercalibConstants>
2412 std::unique_ptr<EcalIntercalibConstants> ical;
2418 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants from file " 2419 << intercalibConstantsFile_.c_str() ;
2421 if(intercalibConstantsFile_.find(
".xml")!= std::string::npos) {
2423 std::cout<<
"generating Intercalib from xml file"<<std::endl;
2430 if(totLumi_ !=0 || instLumi_!=0) {
2431 std::cout<<
"implementing ageing for intercalib"<<std::endl;
2435 if(intercalibConstantsMCFile_.find(
".xml")!= std::string::npos) {
2437 std::cout<<
"generating IntercalibMC from xml file"<<std::endl;
2443 std::cout<<
"please provide the xml file of the EcalIntercalibConstantsMC"<<std::endl;
2447 TRandom3 * gRandom =
new TRandom3();
2458 if(ieta==0)
continue;
2463 std::cout<<
"EB at eta="<<eta<<
" constant term is "<<constantTerm<<std::endl;
2472 if(idref!=mymap.
end())icalconstant=(*idref);
2476 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2478 double r = gRandom->Gaus(0,constantTerm);
2480 if(iphi==10)
std::cout<<
"EB at eta="<<eta<<
" IC="<<icalconstant<<
" ICMC="<<icalconstantMC<<
" smear="<<r<<
" ";
2482 icalconstant = icalconstant + r*1.29*icalconstantMC;
2485 if(iphi==10)
std::cout<<
"newIC="<<icalconstant<<std::endl;
2488 if(icalconstant !=icalconstant2)
std::cout<<
">>>> error in smearing intercalib"<<std::endl;
2500 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
2503 if(iX==50)
std::cout<<
"EE at eta="<<eta<<
" constant term is "<<constantTerm<<std::endl;
2510 if(idref!=mymap.
end())icalconstant=(*idref);
2514 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2516 double r = gRandom->Gaus(0,constantTerm);
2518 if(iX==10)
std::cout<<
"EE at eta="<<eta<<
" IC="<<icalconstant<<
" ICMC="<<icalconstantMC<<
" smear="<<r<<
" ";
2519 icalconstant = icalconstant + r*1.29*icalconstantMC;
2521 if(iX==10)
std::cout<<
"newIC="<<icalconstant<<std::endl;
2530 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
2538 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2540 double r = gRandom->Gaus(0,constantTerm);
2541 icalconstant = icalconstant + r*1.29*icalconstantMC;
2549 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2558 ical = std::make_unique<EcalIntercalibConstants>();
2561 inpFile = fopen (intercalibConstantsFile_.c_str (),
"r") ;
2565 <<
"*** Can not open file: " << intercalibConstantsFile_ ;
2566 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2570 std::ostringstream
str ;
2571 fgets (line,255,inpFile) ;
2572 int sm_number=atoi (line) ;
2573 str <<
"sm: " << sm_number ;
2575 fgets (line,255,inpFile) ;
2578 fgets (line,255,inpFile) ;
2580 str <<
"gen tag: " << gen_tag ;
2582 fgets (line,255,inpFile) ;
2584 str <<
"cali method: " << cali_method << std::endl ;
2586 fgets (line,255,inpFile) ;
2588 str <<
"cali version: " << cali_version << std::endl ;
2590 fgets (line,255,inpFile) ;
2592 str <<
"cali type: " << cali_type ;
2595 <<
"[PIETRO] Intercalibration file - " 2596 << str.str () << std::endl ;
2598 float calib[1700]={1} ;
2599 int calib_status[1700]={0} ;
2603 while (fgets (line,255,inpFile))
2607 float dmy_calib = 0. ;
2608 float dmy_RMS = 0. ;
2609 int dmy_events = 0 ;
2610 int dmy_status = 0 ;
2611 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2612 &dmy_RMS, &dmy_events,
2614 assert (dmy_num >= 1) ;
2615 assert (dmy_num <= 1700) ;
2616 calib[dmy_num-1] = dmy_calib ;
2617 calib_status[dmy_num-1] = dmy_status ;
2629 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " << ii <<
" xtals " ;
2631 <<
"Some crystals missing, set to 1" << std::endl ;
2639 for (
int i=0 ;
i<1700 ;
i++)
2650 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
2651 else ical->setValue (ebid.
rawId (), 1.) ;
2666 std::unique_ptr<EcalIntercalibConstantsMC>
2670 std::unique_ptr<EcalIntercalibConstantsMC> ical;
2676 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants MC from file " 2677 << intercalibConstantsMCFile_.c_str() ;
2679 if(intercalibConstantsMCFile_.find(
".xml")!= std::string::npos) {
2681 std::cout<<
"generating Intercalib MC from xml file"<<std::endl;
2687 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2691 std::cout <<
"ERROR>>> please provide a xml file"<<std::endl;
2700 std::unique_ptr<EcalIntercalibErrors>
2704 auto ical = std::make_unique<EcalIntercalibErrors>();
2709 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants from file " 2710 << intercalibErrorsFile_.c_str() ;
2713 inpFile = fopen (intercalibErrorsFile_.c_str (),
"r") ;
2717 <<
"*** Can not open file: " << intercalibErrorsFile_ ;
2718 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2722 std::ostringstream
str ;
2723 fgets (line,255,inpFile) ;
2724 int sm_number=atoi (line) ;
2725 str <<
"sm: " << sm_number ;
2727 fgets (line,255,inpFile) ;
2730 fgets (line,255,inpFile) ;
2732 str <<
"gen tag: " << gen_tag ;
2734 fgets (line,255,inpFile) ;
2736 str <<
"cali method: " << cali_method << std::endl ;
2738 fgets (line,255,inpFile) ;
2740 str <<
"cali version: " << cali_version << std::endl ;
2742 fgets (line,255,inpFile) ;
2744 str <<
"cali type: " << cali_type ;
2747 <<
"[PIETRO] Intercalibration file - " 2748 << str.str () << std::endl ;
2750 float calib[1700]={1} ;
2751 int calib_status[1700]={0} ;
2755 while (fgets (line,255,inpFile))
2759 float dmy_calib = 0. ;
2760 float dmy_RMS = 0. ;
2761 int dmy_events = 0 ;
2762 int dmy_status = 0 ;
2763 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2764 &dmy_RMS, &dmy_events,
2766 assert (dmy_num >= 1) ;
2767 assert (dmy_num <= 1700) ;
2768 calib[dmy_num-1] = dmy_calib ;
2769 calib_status[dmy_num-1] = dmy_status ;
2781 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " << ii <<
" xtals " ;
2783 <<
"Some crystals missing, set to 1" << std::endl ;
2791 for (
int i=0 ;
i<1700 ;
i++)
2802 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
2803 else ical->setValue (ebid.
rawId (), 1.) ;
2820 std::unique_ptr<EcalTimeCalibConstants>
2824 auto ical = std::make_unique<EcalTimeCalibConstants>();
2829 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading time calibration constants from file " 2830 << timeCalibConstantsFile_.c_str() ;
2833 inpFile = fopen (timeCalibConstantsFile_.c_str (),
"r") ;
2837 <<
"*** Can not open file: " << timeCalibConstantsFile_ ;
2838 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2842 std::ostringstream
str ;
2843 fgets (line,255,inpFile) ;
2844 int sm_number=atoi (line) ;
2845 str <<
"sm: " << sm_number ;
2847 fgets (line,255,inpFile) ;
2850 fgets (line,255,inpFile) ;
2852 str <<
"gen tag: " << gen_tag ;
2854 fgets (line,255,inpFile) ;
2856 str <<
"cali method: " << cali_method << std::endl ;
2858 fgets (line,255,inpFile) ;
2860 str <<
"cali version: " << cali_version << std::endl ;
2862 fgets (line,255,inpFile) ;
2864 str <<
"cali type: " << cali_type ;
2867 <<
"TimeCalibration file - " 2868 << str.str () << std::endl ;
2870 float calib[1700]={1} ;
2871 int calib_status[1700]={0} ;
2875 while (fgets (line,255,inpFile))
2879 float dmy_calib = 0. ;
2880 float dmy_RMS = 0. ;
2881 int dmy_events = 0 ;
2882 int dmy_status = 0 ;
2883 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2884 &dmy_RMS, &dmy_events,
2886 assert (dmy_num >= 1) ;
2887 assert (dmy_num <= 1700) ;
2888 calib[dmy_num-1] = dmy_calib ;
2889 calib_status[dmy_num-1] = dmy_status ;
2901 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read timeCalibrations for " << ii <<
" xtals " ;
2903 <<
"Some crystals missing, set to 1" << std::endl ;
2911 for (
int i=0 ;
i<1700 ;
i++)
2922 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
2923 else ical->setValue (ebid.
rawId (), 1.) ;
2933 std::unique_ptr<EcalTimeCalibErrors>
2937 auto ical = std::make_unique<EcalTimeCalibErrors>();
2942 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading timeCalibration constants from file " 2943 << timeCalibErrorsFile_.c_str() ;
2946 inpFile = fopen (timeCalibErrorsFile_.c_str (),
"r") ;
2950 <<
"*** Can not open file: " << timeCalibErrorsFile_ ;
2951 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2955 std::ostringstream
str ;
2956 fgets (line,255,inpFile) ;
2957 int sm_number=atoi (line) ;
2958 str <<
"sm: " << sm_number ;
2960 fgets (line,255,inpFile) ;
2963 fgets (line,255,inpFile) ;
2965 str <<
"gen tag: " << gen_tag ;
2967 fgets (line,255,inpFile) ;
2969 str <<
"cali method: " << cali_method << std::endl ;
2971 fgets (line,255,inpFile) ;
2973 str <<
"cali version: " << cali_version << std::endl ;
2975 fgets (line,255,inpFile) ;
2977 str <<
"cali type: " << cali_type ;
2980 <<
"TimeCalibration file - " 2981 << str.str () << std::endl ;
2983 float calib[1700]={1} ;
2984 int calib_status[1700]={0} ;
2988 while (fgets (line,255,inpFile))
2992 float dmy_calib = 0. ;
2993 float dmy_RMS = 0. ;
2994 int dmy_events = 0 ;
2995 int dmy_status = 0 ;
2996 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2997 &dmy_RMS, &dmy_events,
2999 assert (dmy_num >= 1) ;
3000 assert (dmy_num <= 1700) ;
3001 calib[dmy_num-1] = dmy_calib ;
3002 calib_status[dmy_num-1] = dmy_status ;
3014 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read time calibrations for " << ii <<
" xtals " ;
3016 <<
"Some crystals missing, set to 1" << std::endl ;
3024 for (
int i=0 ;
i<1700 ;
i++)
3035 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
3036 else ical->setValue (ebid.
rawId (), 1.) ;
3047 std::unique_ptr<EcalMappingElectronics>
3050 auto mapping = std::make_unique<EcalMappingElectronics>();
3056 edm::LogError(
"EcalTrivialConditionRetriever") <<
"File not found";
3065 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
3066 int tccid, tower, pseudostrip_in_TCC, pseudostrip_in_TT;
3071 f >> ix >> iy >> iz >> CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >> tower >>
3072 pseudostrip_in_TCC >> pseudostrip_in_TT ;
3079 EcalElectronicsId elecid(dccid,towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
3085 (*mapping).setValue(detid, aElement);
3094 std::unique_ptr<EcalMappingElectronics>
3098 auto ical = std::make_unique<EcalMappingElectronics>();
3104 std::unique_ptr<Alignments>
3106 double mytrans[3] = {0., 0., 0.};
3107 double myeuler[3] = {0., 0., 0.};
3109 if(getEBAlignmentFromFile_)
3111 std::vector<AlignTransform> my_align;
3114 for(
int SM = 1 ; SM < 37; SM++ ) {
3117 iphi = 1 + (SM - 19) * 20;
3123 if(getEBAlignmentFromFile_) {
3124 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3125 std::cout <<
" translation " << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3126 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2] << std::endl;
3128 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3129 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3131 my_align.push_back(transform);
3157 return std::make_unique<Alignments>(
a);
3160 std::unique_ptr<Alignments>
3162 double mytrans[3] = {0., 0., 0.};
3163 double myeuler[3] = {0., 0., 0.};
3165 if(getEEAlignmentFromFile_)
3167 std::vector<AlignTransform> my_align;
3171 for(
int Dee = 0 ; Dee < 4; Dee++ ) {
3173 if(Dee == 1 || Dee == 3)
3178 EEDetId eedetId(ix, iy, side);
3179 if(getEEAlignmentFromFile_) {
3180 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3181 std::cout <<
" translation " << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3182 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2] << std::endl;
3184 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3185 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3187 my_align.push_back(transform);
3191 return std::make_unique<Alignments>(
a);
3194 std::unique_ptr<Alignments>
3196 double mytrans[3] = {0., 0., 0.};
3197 double myeuler[3] = {0., 0., 0.};
3199 if(getESAlignmentFromFile_)
3201 std::vector<AlignTransform> my_align;
3203 int pl_vect[10] = {2, 2, 1, 1, 1, 1, 2, 2};
3207 for(
int layer = 0 ; layer < 8; layer++ ) {
3209 int ix = 10 + (layer%2) * 20;
3210 int plane = pl_vect[layer];
3211 if(layer > 3) side = 1;
3212 ESDetId esdetId(strip, ix, iy, plane, side);
3213 if(getESAlignmentFromFile_) {
3214 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3215 std::cout <<
" translation " << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3216 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2] << std::endl;
3218 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3219 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3221 my_align.push_back(transform);
3225 return std::make_unique<Alignments>(
a);
3228 std::unique_ptr<EcalSampleMask>
3231 return std::unique_ptr<EcalSampleMask>(
new EcalSampleMask(sampleMaskEB_, sampleMaskEE_) );
3234 std::unique_ptr<EcalTimeBiasCorrections>
3236 auto ipar = std::make_unique<EcalTimeBiasCorrections>();
3237 copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(),
3238 back_inserter(ipar->EBTimeCorrAmplitudeBins));
3239 copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(),
3240 back_inserter(ipar->EBTimeCorrShiftBins));
3241 copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(),
3242 back_inserter(ipar->EETimeCorrAmplitudeBins));
3243 copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(),
3244 back_inserter(ipar->EETimeCorrShiftBins));
3248 std::unique_ptr<EcalSamplesCorrelation>
3250 if(getSamplesCorrelationFromFile_) {
3254 for(
int j = 0; j < 10; ++j) {
3256 EBG12samplesCorrelation_.push_back(ww);
3258 for(
int j = 0; j < 10; ++j) {
3260 EBG6samplesCorrelation_.push_back(ww);
3262 for(
int j = 0; j < 10; ++j) {
3264 EBG1samplesCorrelation_.push_back(ww);
3266 for(
int j = 0; j < 10; ++j) {
3268 EEG12samplesCorrelation_.push_back(ww);
3270 for(
int j = 0; j < 10; ++j) {
3272 EEG6samplesCorrelation_.push_back(ww);
3274 for(
int j = 0; j < 10; ++j) {
3276 EEG1samplesCorrelation_.push_back(ww);
3280 auto ipar = std::make_unique<EcalSamplesCorrelation>();
3281 copy(EBG12samplesCorrelation_.begin(), EBG12samplesCorrelation_.end(),
3282 back_inserter(ipar->EBG12SamplesCorrelation));
3283 copy(EBG6samplesCorrelation_.begin(), EBG6samplesCorrelation_.end(),
3284 back_inserter(ipar->EBG6SamplesCorrelation));
3285 copy(EBG1samplesCorrelation_.begin(), EBG1samplesCorrelation_.end(),
3286 back_inserter(ipar->EBG1SamplesCorrelation));
3287 copy(EEG12samplesCorrelation_.begin(), EEG12samplesCorrelation_.end(),
3288 back_inserter(ipar->EEG12SamplesCorrelation));
3289 copy(EEG6samplesCorrelation_.begin(), EEG6samplesCorrelation_.end(),
3290 back_inserter(ipar->EEG6SamplesCorrelation));
3291 copy(EEG1samplesCorrelation_.begin(), EEG1samplesCorrelation_.end(),
3292 back_inserter(ipar->EEG1SamplesCorrelation));
3296 std::unique_ptr<EcalSimPulseShape>
3300 auto result = std::make_unique<EcalSimPulseShape>();
3303 result->time_interval = sim_pulse_shape_TI_;
3306 std::vector<double> EBshape;
3307 std::vector<double> EEshape;
3308 std::vector<double> APDshape;
3311 if (!EBSimPulseShapeFile_.empty() )
3313 std::ifstream shapeEBFile;
3314 shapeEBFile.open(EBSimPulseShapeFile_.c_str());
3316 while (shapeEBFile >> ww) EBshape.push_back(ww);
3317 shapeEBFile.close();
3319 if (!EESimPulseShapeFile_.empty() )
3321 std::ifstream shapeEEFile;
3322 shapeEEFile.open(EESimPulseShapeFile_.c_str());
3324 while (shapeEEFile >> ww) EEshape.push_back(ww);
3325 shapeEEFile.close();
3327 if (!APDSimPulseShapeFile_.empty()) {
3328 std::ifstream shapeAPDFile;
3329 shapeAPDFile.open(APDSimPulseShapeFile_.c_str());
3331 while (shapeAPDFile >> ww) APDshape.push_back(ww);
3332 shapeAPDFile.close();
3336 result->barrel_thresh = sim_pulse_shape_EB_thresh_;
3337 result->endcap_thresh = sim_pulse_shape_EE_thresh_;
3338 result->apd_thresh = sim_pulse_shape_APD_thresh_;
3341 copy(EBshape.begin(), EBshape.end(),
3342 back_inserter(
result->barrel_shape));
3343 copy(EEshape.begin(), EEshape.end(),
3344 back_inserter(
result->endcap_shape));
3345 copy(APDshape.begin(), APDshape.end(),
3346 back_inserter(
result->apd_shape));
EcalChi2WeightMatrix & getChi2WeightsBeforeGainSwitch()
static bool validDetId(int ix, int iy, int iz)
T getParameter(std::string const &) const
EcalIntercalibConstantMCMap EcalIntercalibConstantsMC
T getUntrackedParameter(std::string const &, T const &) const
static const int MIN_IPHI
static Timestamp endOfTime()
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
virtual std::unique_ptr< EcalDQMChannelStatus > produceEcalDQMChannelStatus(const EcalDQMChannelStatusRcd &)
virtual std::unique_ptr< EcalIntercalibConstants > produceEcalIntercalibConstants(const EcalIntercalibConstantsRcd &)
virtual std::unique_ptr< EcalIntercalibErrors > produceEcalIntercalibErrors(const EcalIntercalibErrorsRcd &)
virtual std::unique_ptr< EcalLaserAPDPNRatiosRef > produceEcalLaserAPDPNRatiosRef(const EcalLaserAPDPNRatiosRefRcd &)
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 &)
~EcalTrivialConditionRetriever() override
virtual std::unique_ptr< EcalMappingElectronics > getMappingFromConfiguration(const EcalMappingElectronicsRcd &)
static const IOVSyncValue & endOfTime()
constexpr uint32_t rawId() const
get the raw id
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 &)
virtual std::unique_ptr< Alignments > produceEcalAlignmentEB(const EBAlignmentRcd &)
void setValue(const uint32_t id, const Item &item)
virtual std::unique_ptr< EcalClusterEnergyCorrectionParameters > produceEcalClusterEnergyCorrectionParameters(const EcalClusterEnergyCorrectionParametersRcd &)
virtual std::unique_ptr< EcalIntercalibConstantsMC > getIntercalibConstantsMCFromConfiguration(const EcalIntercalibConstantsMCRcd &)
static const IOVSyncValue & beginOfTime()
double calcnoiseIncreaseADC(double eta)
virtual std::unique_ptr< EcalDQMTowerStatus > produceEcalDQMTowerStatus(const EcalDQMTowerStatusRcd &)
virtual std::unique_ptr< Alignments > produceEcalAlignmentEE(const EEAlignmentRcd &)
virtual std::unique_ptr< EcalLinearCorrections > produceEcalLinearCorrections(const EcalLinearCorrectionsRcd &)
virtual std::unique_ptr< EcalMappingElectronics > produceEcalMappingElectronics(const EcalMappingElectronicsRcd &)
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 &)
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 &)
virtual std::unique_ptr< EcalSimPulseShape > getEcalSimPulseShapeFromConfiguration(const EcalSimPulseShapeRcd &)
float EcalIntercalibConstant
virtual std::unique_ptr< EcalClusterCrackCorrParameters > produceEcalClusterCrackCorrParameters(const EcalClusterCrackCorrParametersRcd &)