76 pfRecHitThresholdsNSigmasHEta_ = ps.
getUntrackedParameter<
double>(
"EcalPFRecHitThresholdNSigmasHEta", 1.0 );
81 localContCorrParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"localContCorrParameters", std::vector<double>(0) );
82 crackCorrParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"crackCorrParameters", std::vector<double>(0) );
83 energyCorrectionParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"energyCorrectionParameters", std::vector<double>(0) );
84 energyUncertaintyParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"energyUncertaintyParameters", std::vector<double>(0) );
85 energyCorrectionObjectSpecificParameters_ = ps.
getUntrackedParameter< std::vector<double> >(
"energyCorrectionObjectSpecificParameters", std::vector<double>(0) );
109 EBtimeCorrAmplitudeBins_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBtimeCorrAmplitudeBins", std::vector<double>() );
110 EBtimeCorrShiftBins_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBtimeCorrShiftBins", std::vector<double>() );
111 EEtimeCorrAmplitudeBins_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEtimeCorrAmplitudeBins", std::vector<double>() );
112 EEtimeCorrShiftBins_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEtimeCorrShiftBins", std::vector<double>() );
114 EBG12samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBG12samplesCorrelation", std::vector<double>() );
115 EBG6samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBG6samplesCorrelation", std::vector<double>() );
116 EBG1samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EBG1samplesCorrelation", std::vector<double>() );
117 EEG12samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEG12samplesCorrelation", std::vector<double>() );
118 EEG6samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEG6samplesCorrelation", std::vector<double>() );
119 EEG1samplesCorrelation_ = ps.
getUntrackedParameter< std::vector<double> >(
"EEG1samplesCorrelation", std::vector<double>() );
122 sim_pulse_shape_EB_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_EB_thresh" );
123 sim_pulse_shape_EE_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_EE_thresh" );
124 sim_pulse_shape_APD_thresh_ = ps.
getParameter<
double>(
"sim_pulse_shape_APD_thresh");
138 edm::LogInfo(
" EcalTrivialConditionRetriever going to create conditions based on the damage deu to ")<<totLumi_<<
139 " fb-1 integrated luminosity";
143 if (weightsForAsynchronousRunning_)
145 getWeightsFromFile_ =
true;
152 std::ostringstream
str;
154 if (!weightsForAsynchronousRunning_)
159 weightType = str.str();
170 amplWeights_.resize(nTDCbins_);
171 amplWeightsAft_.resize(nTDCbins_);
172 pedWeights_.resize(nTDCbins_);
173 pedWeightsAft_.resize(nTDCbins_);
174 jittWeights_.resize(nTDCbins_);
175 jittWeightsAft_.resize(nTDCbins_);
176 chi2Matrix_.resize(nTDCbins_);
177 chi2MatrixAft_.resize(nTDCbins_);
180 getWeightsFromConfiguration(ps);
188 producedEcalMappingElectronics_ = ps.
getUntrackedParameter<
bool>(
"producedEcalMappingElectronics",
true);
191 if ( producedEcalMappingElectronics_ ) {
192 if ( !mappingFile_.empty() ) {
197 findingRecord<EcalMappingElectronicsRcd>();
201 if(getEBAlignmentFromFile_) {
206 if(getEEAlignmentFromFile_) {
211 if(getESAlignmentFromFile_)
218 if (producedEcalPedestals_)
221 if (producedEcalWeights_) {
226 if (producedEcalGainRatios_)
229 if (producedEcalADCToGeVConstant_)
233 producedEcalTimeOffsetConstant_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeOffsetConstant",
true);
235 if (producedEcalTimeOffsetConstant_) {
237 findingRecord<EcalTimeOffsetConstantRcd>();
241 producedEcalLinearCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalLinearCorrections",
true);
244 if (producedEcalLinearCorrections_) {
245 if(!linearCorrectionsFile_.empty()) {
250 findingRecord<EcalLinearCorrectionsRcd> () ;
256 producedEcalIntercalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstants",
true);
261 if (producedEcalIntercalibConstants_) {
262 if(!intercalibConstantsFile_.empty()) {
267 findingRecord<EcalIntercalibConstantsRcd> () ;
270 producedEcalIntercalibConstantsMC_ = ps.
getUntrackedParameter<
bool>(
"producedEcalIntercalibConstantsMC",
true);
272 if (producedEcalIntercalibConstantsMC_) {
273 if(!intercalibConstantsMCFile_.empty()) {
278 findingRecord<EcalIntercalibConstantsMCRcd> () ;
285 if (producedEcalIntercalibErrors_) {
286 if(!intercalibErrorsFile_.empty()) {
291 findingRecord<EcalIntercalibErrorsRcd> () ;
295 producedEcalTimeCalibConstants_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeCalibConstants",
true);
298 if (producedEcalTimeCalibConstants_) {
299 if(!timeCalibConstantsFile_.empty()) {
304 findingRecord<EcalTimeCalibConstantsRcd> () ;
311 if (producedEcalTimeCalibErrors_) {
312 if(!timeCalibErrorsFile_.empty()) {
317 findingRecord<EcalTimeCalibErrorsRcd> () ;
327 if (producedEcalSimPulseShape_) {
329 findingRecord<EcalSimPulseShapeRcd> () ;
332 producedEcalPFRecHitThresholds_ = ps.
getUntrackedParameter<
bool>(
"producedEcalPFRecHitThresholds",
false);
339 if (producedEcalPFRecHitThresholds_) {
340 if(!pfRecHitFile_.empty()) {
345 findingRecord<EcalPFRecHitThresholdsRcd> () ;
350 producedEcalClusterLocalContCorrParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterLocalContCorrParameters",
false);
351 producedEcalClusterCrackCorrParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterCrackCorrParameters",
false);
352 producedEcalClusterEnergyCorrectionParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionParameters",
false);
353 producedEcalClusterEnergyUncertaintyParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyUncertaintyParameters",
false);
354 producedEcalClusterEnergyCorrectionObjectSpecificParameters_ = ps.
getUntrackedParameter<
bool>(
"producedEcalClusterEnergyCorrectionObjectSpecificParameters",
false);
355 if ( producedEcalClusterLocalContCorrParameters_ ) {
357 findingRecord<EcalClusterLocalContCorrParametersRcd>();
359 if ( producedEcalClusterCrackCorrParameters_ ) {
361 findingRecord<EcalClusterCrackCorrParametersRcd>();
363 if ( producedEcalClusterEnergyCorrectionParameters_ ) {
365 findingRecord<EcalClusterEnergyCorrectionParametersRcd>();
367 if ( producedEcalClusterEnergyUncertaintyParameters_ ) {
369 findingRecord<EcalClusterEnergyUncertaintyParametersRcd>();
371 if ( producedEcalClusterEnergyCorrectionObjectSpecificParameters_ ) {
373 findingRecord<EcalClusterEnergyCorrectionObjectSpecificParametersRcd>();
378 if (producedEcalLaserCorrection_) {
381 findingRecord<EcalLaserAlphasRcd> () ;
386 edm::LogInfo(
" getLaserAlphaFromFileEB_ ") << getLaserAlphaFromFileEB_;
387 edm::LogInfo(
" getLaserAlphaFromFileEE_ ") << getLaserAlphaFromFileEE_;
388 edm::LogInfo(
" getLaserAlphaFromTypeEB_ ") << getLaserAlphaFromTypeEB_;
389 edm::LogInfo(
" getLaserAlphaFromTypeEE_ ") << getLaserAlphaFromTypeEE_;
390 if(getLaserAlphaFromFileEB_) {
393 if(getLaserAlphaFromFileEE_) {
396 if(getLaserAlphaFromTypeEB_) {
401 if(getLaserAlphaFromTypeEE_) {
410 findingRecord<EcalLaserAPDPNRatiosRefRcd> () ;
412 findingRecord<EcalLaserAPDPNRatiosRcd> () ;
419 if ( producedEcalChannelStatus_ ) {
420 if ( !channelStatusFile_.empty() ) {
425 findingRecord<EcalChannelStatusRcd>();
429 if ( producedEcalDQMChannelStatus_ ) {
431 findingRecord<EcalDQMChannelStatusRcd>();
435 if ( producedEcalDCSTowerStatus_ ) {
437 findingRecord<EcalDCSTowerStatusRcd>();
441 if ( producedEcalDAQTowerStatus_ ) {
443 findingRecord<EcalDAQTowerStatusRcd>();
447 if ( producedEcalDQMTowerStatus_ ) {
449 findingRecord<EcalDQMTowerStatusRcd>();
456 if ( producedEcalTrgChannelStatus_ ) {
457 if ( !trgChannelStatusFile_.empty() ) {
462 findingRecord<EcalTPGCrystalStatusRcd>();
467 if ( producedEcalAlignmentEB_ ) {
469 findingRecord<EBAlignmentRcd>();
472 if ( producedEcalAlignmentEE_ ) {
474 findingRecord<EEAlignmentRcd>();
477 if ( producedEcalAlignmentES_ ) {
479 findingRecord<ESAlignmentRcd>();
482 if (producedEcalPedestals_) findingRecord<EcalPedestalsRcd>();
484 if (producedEcalWeights_) {
485 findingRecord<EcalWeightXtalGroupsRcd>();
486 findingRecord<EcalTBWeightsRcd>();
489 if (producedEcalGainRatios_) findingRecord<EcalGainRatiosRcd>();
491 if (producedEcalADCToGeVConstant_) findingRecord<EcalADCToGeVConstantRcd>();
494 if (producedEcalSampleMask_) {
496 findingRecord<EcalSampleMaskRcd>();
498 producedEcalTimeBiasCorrections_ = ps.
getUntrackedParameter<
bool>(
"producedEcalTimeBiasCorrections",
false);
499 if (producedEcalTimeBiasCorrections_) {
501 findingRecord<EcalTimeBiasCorrectionsRcd>();
503 producedEcalSamplesCorrelation_ = ps.
getUntrackedParameter<
bool>(
"producedEcalSamplesCorrelation",
false);
504 if (producedEcalSamplesCorrelation_) {
506 findingRecord<EcalSamplesCorrelationRcd>();
507 getSamplesCorrelationFromFile_ = ps.
getUntrackedParameter<
bool>(
"getSamplesCorrelationFromFile",
false);
508 if(getSamplesCorrelationFromFile_) {
526 if(verbose_>=1)
edm::LogInfo(
"EcalTrivialConditionRetriever::setIntervalFor(): record key = ") << rk.
name() <<
"\ttime: " << iTime.
time().
value();
532 std::unique_ptr<EcalPedestals>
534 auto peds = std::make_unique<EcalPedestals>();
539 EBitem.rms_x1 = EBpedRMSX1_;
540 EBitem.mean_x6 = EBpedMeanX6_;
541 EBitem.rms_x6 = EBpedRMSX6_;
542 EBitem.mean_x12 = EBpedMeanX12_;
543 EBitem.rms_x12 = EBpedRMSX12_;
546 EEitem.
rms_x1 = EEpedRMSX1_;
548 EEitem.
rms_x6 = EEpedRMSX6_;
557 if(iEta==0)
continue;
569 EBitem.rms_x1 = EBpedRMSX1_*noisefactor;
570 EBitem.rms_x6 = EBpedRMSX6_*noisefactor;
571 EBitem.rms_x12 = EBpedRMSX12_*noisefactor;
572 edm::LogInfo(
"rms ped at eta:")<< eta<<
" ="<< EBitem.rms_x12;
582 peds->insert(std::make_pair(ebdetid.
rawId(),EBitem));
593 peds->insert(std::make_pair(eedetidpos.
rawId(),EEitem));
598 peds->insert(std::make_pair(eedetidneg.
rawId(),EEitem));
609 std::unique_ptr<EcalWeightXtalGroups>
612 auto xtalGroups = std::make_unique<EcalWeightXtalGroups>();
615 if(ieta==0)
continue;
622 xtalGroups->setValue(ebid.
rawId(), defaultGroupId );
633 xtalGroups->setValue(eedetidpos.
rawId(), defaultGroupId );
638 xtalGroups->setValue(eedetidneg.
rawId(), defaultGroupId );
646 std::unique_ptr<EcalLinearCorrections>
649 auto ical = std::make_unique<EcalLinearCorrections>();
652 if(ieta==0)
continue;
656 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
659 pairAPDPN.
p1 = linCorrMean_ + r*linCorrSigma_;
660 pairAPDPN.
p2 = linCorrMean_ + r*linCorrSigma_;
661 pairAPDPN.
p3 = linCorrMean_ + r*linCorrSigma_;
662 ical->setValue( ebid, pairAPDPN );
671 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
675 pairAPDPN.
p1 = linCorrMean_ + r*linCorrSigma_;
676 pairAPDPN.
p2 = linCorrMean_ + r*linCorrSigma_;
677 pairAPDPN.
p3 = linCorrMean_ + r*linCorrSigma_;
679 ical->setValue( eedetidpos, pairAPDPN );
683 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
687 pairAPDPN.
p1 = linCorrMean_ + r1*linCorrSigma_;
688 pairAPDPN.
p2 = linCorrMean_ + r1*linCorrSigma_;
689 pairAPDPN.
p3 = linCorrMean_ + r1*linCorrSigma_;
691 ical->setValue( eedetidneg, pairAPDPN );
698 for(
int i=0;
i<92;
i++){
700 if(linearTime2_ == 0 ){
705 if(linearTime3_ == 0 ){
711 ical->setTime(
i, TimeStamp );
720 std::unique_ptr<EcalPFRecHitThresholds>
723 auto ical = std::make_unique<EcalPFRecHitThresholds>();
726 if(ieta==0)
continue;
732 ical->setValue( ebid.
rawId(), pfRecHitThresholdsEB_ );
743 ical->setValue( eedetidpos.
rawId(), pfRecHitThresholdsEE_ );
748 ical->setValue( eedetidneg.
rawId(), pfRecHitThresholdsEE_ );
761 std::unique_ptr<EcalIntercalibConstants>
764 auto ical = std::make_unique<EcalIntercalibConstants>();
767 if(ieta==0)
continue;
773 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
774 ical->setValue( ebid.
rawId(), intercalibConstantMean_ + r*intercalibConstantSigma_ );
784 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
786 ical->setValue( eedetidpos.
rawId(), intercalibConstantMean_ + r*intercalibConstantSigma_ );
790 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
792 ical->setValue( eedetidneg.
rawId(), intercalibConstantMean_ + r1*intercalibConstantSigma_ );
800 std::unique_ptr<EcalIntercalibConstantsMC>
803 auto ical = std::make_unique<EcalIntercalibConstantsMC>();
806 if(ieta==0)
continue;
812 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
813 ical->setValue( ebid.
rawId(), intercalibConstantMeanMC_ + r*intercalibConstantSigmaMC_ );
823 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
825 ical->setValue( eedetidpos.
rawId(), intercalibConstantMeanMC_ + r*intercalibConstantSigmaMC_ );
829 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
831 ical->setValue( eedetidneg.
rawId(), intercalibConstantMeanMC_ + r1*intercalibConstantSigmaMC_ );
839 std::unique_ptr<EcalIntercalibErrors>
842 auto ical = std::make_unique<EcalIntercalibErrors>();
845 if(ieta==0)
continue;
851 ical->setValue( ebid.
rawId(), intercalibErrorMean_);
862 ical->setValue( eedetidpos.
rawId(), intercalibErrorMean_ );
867 ical->setValue( eedetidneg.
rawId(), intercalibErrorMean_ );
875 std::unique_ptr<EcalTimeCalibConstants>
878 auto ical = std::make_unique<EcalTimeCalibConstants>();
881 if(ieta==0)
continue;
887 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
888 ical->setValue( ebid.
rawId(), timeCalibConstantMean_ + r*timeCalibConstantSigma_ );
898 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
900 ical->setValue( eedetidpos.
rawId(), timeCalibConstantMean_ + r*timeCalibConstantSigma_ );
904 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
906 ical->setValue( eedetidneg.
rawId(), timeCalibConstantMean_ + r1*timeCalibConstantSigma_ );
914 std::unique_ptr<EcalTimeCalibErrors>
917 auto ical = std::make_unique<EcalTimeCalibErrors>();
920 if(ieta==0)
continue;
926 ical->setValue( ebid.
rawId(), timeCalibErrorMean_);
937 ical->setValue( eedetidpos.
rawId(), timeCalibErrorMean_ );
942 ical->setValue( eedetidneg.
rawId(), timeCalibErrorMean_ );
950 std::unique_ptr<EcalTimeOffsetConstant>
954 edm::LogInfo(
" EB ") << timeOffsetEBConstant_ <<
" EE " << timeOffsetEEConstant_;
955 return std::make_unique<EcalTimeOffsetConstant>(timeOffsetEBConstant_,timeOffsetEEConstant_);
958 std::unique_ptr<EcalGainRatios>
961 auto gratio = std::make_unique<EcalGainRatios>();
964 gr.setGain6Over1( gainRatio6over1_ );
967 if(ieta==0)
continue;
972 gratio->setValue( ebid.
rawId(), gr );
983 gratio->setValue( eedetidpos.
rawId(), gr );
988 gratio->setValue( eedetidneg.
rawId(), gr );
996 std::unique_ptr<EcalADCToGeVConstant>
999 return std::make_unique<EcalADCToGeVConstant>(adcToGeVEBConstant_,adcToGeVEEConstant_);
1002 std::unique_ptr<EcalTBWeights>
1006 auto tbwgt = std::make_unique<EcalTBWeights>();
1013 for(
int itdc=1; itdc<=nTDCbins_; ++itdc) {
1044 mat1.Place_in_row(amplWeights_[itdc-1],0,0);
1045 mat1.Place_in_row(pedWeights_[itdc-1],1,0);
1046 mat1.Place_in_row(jittWeights_[itdc-1],2,0);
1049 mat2.Place_in_row(amplWeightsAft_[itdc-1],0,0);
1050 mat2.Place_in_row(pedWeightsAft_[itdc-1],1,0);
1051 mat2.Place_in_row(jittWeightsAft_[itdc-1],2,0);
1057 mat3=chi2Matrix_[itdc-1];
1058 mat4=chi2MatrixAft_[itdc-1];
1083 tbwgt->setValue(std::make_pair(igrp,itdc), wgt);
1092 std::unique_ptr<EcalClusterLocalContCorrParameters>
1095 auto ipar = std::make_unique<EcalClusterLocalContCorrParameters>();
1096 for (
size_t i = 0;
i < localContCorrParameters_.size(); ++
i ) {
1097 ipar->params().push_back( localContCorrParameters_[
i] );
1101 std::unique_ptr<EcalClusterCrackCorrParameters>
1104 auto ipar = std::make_unique<EcalClusterCrackCorrParameters>();
1105 for (
size_t i = 0;
i < crackCorrParameters_.size(); ++
i ) {
1106 ipar->params().push_back( crackCorrParameters_[
i] );
1110 std::unique_ptr<EcalClusterEnergyCorrectionParameters>
1113 auto ipar = std::make_unique<EcalClusterEnergyCorrectionParameters>();
1114 for (
size_t i = 0;
i < energyCorrectionParameters_.size(); ++
i ) {
1115 ipar->params().push_back( energyCorrectionParameters_[
i] );
1119 std::unique_ptr<EcalClusterEnergyUncertaintyParameters>
1122 auto ipar = std::make_unique<EcalClusterEnergyUncertaintyParameters>();
1123 for (
size_t i = 0;
i < energyUncertaintyParameters_.size(); ++
i ) {
1124 ipar->params().push_back( energyUncertaintyParameters_[
i] );
1128 std::unique_ptr<EcalClusterEnergyCorrectionObjectSpecificParameters>
1131 auto ipar = std::make_unique<EcalClusterEnergyCorrectionObjectSpecificParameters>();
1132 for (
size_t i = 0;
i < energyCorrectionObjectSpecificParameters_.size(); ++
i ) {
1133 ipar->params().push_back( energyCorrectionObjectSpecificParameters_[
i] );
1317 std::unique_ptr<EcalLaserAlphas>
1322 auto ical = std::make_unique<EcalLaserAlphas>();
1325 if(getLaserAlphaFromTypeEB_) {
1326 std::ifstream fEB(
edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1327 int SMpos[36] = {-10, 4, -7, -16, 6, -9, 11, -17, 5, 18, 3, -8, 1, -3, -13, 14, -6, 2,
1328 15, -18, 8, 17, -2, 9, -1, 10, -5, 7, -12, -11, 16, -4, -15, -14, 12, 13};
1330 int SMCal[36] = {12,17,10, 1, 8, 4,27,20,23,25, 6,34,35,15,18,30,21, 9,
1331 24,22,13,31,26,16, 2,11, 5, 0,29,28,14,33,32, 3, 7,19};
1333 for(
int SMcons = 0; SMcons < 36; SMcons++) {
1334 int SM = SMpos[SMcons];
1335 if(SM < 0) SM = 17 +
abs(SM);
1337 if(SMCal[SM] != SMcons)
1338 edm::LogInfo(
" SM pb : read SM ") << SMcons<<
" SMpos " << SM
1339 <<
" SMCal " << SMCal[SM];
1343 int readSM,
pos, bar, bar2;
1345 for(
int SMcons = 0; SMcons < 36; SMcons++) {
1346 int SM = SMpos[SMcons];
1347 for(
int ic = 0; ic < 1700; ic++) {
1348 fEB >> readSM >> pos >> bar >> bar2 >> type >>
batch;
1350 if(readSM != SMcons || pos != ic + 1)
1351 edm::LogInfo(
" barrel read pb read SM ") << readSM <<
" const SM " << SMcons
1352 <<
" read pos " << pos <<
" ic " << ic ;
1353 if(SM < 0) SM = 18 +
abs(SM);
1355 if(bar == 33101 || bar == 30301 )
1356 alpha = laserAlphaMeanEBR_;
1357 else if(bar == 33106) {
1359 alpha = laserAlphaMeanEBC_;
1361 edm::LogInfo(
" problem with barcode first ") << bar <<
" last " << bar2
1362 <<
" read SM " << readSM <<
" read pos " << pos ;
1363 alpha = laserAlphaMeanEBR_;
1366 ical->setValue( ebdetid, alpha );
1376 }
else if(getLaserAlphaFromFileEB_) {
1378 edm::LogInfo(
"Laser alpha for EB will be taken from File");
1381 std::ifstream fEB(
edm::FileInPath(EBLaserAlphaFile_).fullPath().c_str());
1383 for(
int ic = 0; ic < 61200; ic++) {
1384 fEB >> ieta>> iphi>>
alpha;
1388 ical->setValue( ebid, alpha );
1392 edm::LogInfo(
"I will print some alphas from the file... ieta/iphi/alpha ")<<ieta<<
"/"<<iphi<<
"/"<<
alpha;
1402 if(ieta==0)
continue;
1406 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1407 ical->setValue( ebid, laserAlphaMean_ + r*laserAlphaSigma_ );
1416 int itype, iring, iyear;
1418 float las[2][140][6];
1420 if(getLaserAlphaFromTypeEE_) {
1423 std::ifstream fRing(
edm::FileInPath(EELaserAlphaFile2_).fullPath().c_str());
1424 for(
int i = 0;
i<1681;
i++){
1426 fRing >> itype>> iring>> iyear>> laser;
1427 edm::LogInfo(
" ") <<itype<<
" "<<iring<<
" "<<iyear<<
" "<<laser<<std::endl;
1428 las[itype][iring][iyear]=laser;
1433 std::ifstream fEE(
edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1435 for(
int crystal = 0; crystal < 14648; crystal++) {
1436 int x, y ,z, bid, bar, bar2;
1437 float LY,
alpha = 0;
1438 fEE >> z >> x >> y >> LY >> bid >> bar >> bar2;
1439 if(x < 1 || x > 100 || y < 1 || y > 100)
1441 <<
" x " << x <<
" y " << y <<
" z " << z;
1444 int iring = (
int)(
sqrt( ((
float)x-50.5)*((
float)x-50.5)
1445 +((
float)y-50.5)*((
float)y-50.5))+85);
1455 if(bar == 33201 || (bar == 30399 && bar2 < 568)){
1457 alpha = laserAlphaMeanEER_;
1459 double raggio=50.5-
sqrt(((
float)x-50.5)*((
float)x-50.5)+
1460 ((
float)y-50.5)*((
float)y-50.5));
1479 if(x==50)
edm::LogInfo(
"R=")<<raggio<<
" x " << x <<
" y " << y <<
" z " << z <<
"eta="<<eta<<
" alpha="<<alpha<<
" R";
1481 }
else if((bar == 33106 && bar2 > 2000 && bar2 < 4669)
1482 || (bar == 30399 && bar2 > 567)) {
1485 alpha = laserAlphaMeanEEC_;
1488 double raggio=50.5-
sqrt(((
float)x-50.5)*((
float)x-50.5)+
1489 ((
float)y-50.5)*((
float)y-50.5));
1496 float r=
sqrt((x-50.5)*(x-50.5)+(y-50.5)*(y-50.5));
1501 if(las[itype][iring][iyear]!=999){
1502 alpha=0.7312+0.2688*las[itype][iring][iyear];
1506 if(x==50)
edm::LogInfo(
"R=")<<raggio<<
" x " << x <<
" y " << y <<
" z " << z <<
"eta="<<eta<<
" alpha="<<alpha<<
" C";
1510 edm::LogInfo(
" problem with barcode ") << bar <<
" " << bar2
1511 <<
" x " << x <<
" y " << y <<
" z " << z;
1512 alpha = laserAlphaMeanEER_;
1521 ical->setValue( eedetidpos, alpha );
1525 edm::LogInfo(
" problem with EEDetId ") <<
" x " << x <<
" y " << y <<
" z " << z ;
1528 edm::LogInfo(
"Number of inner SIC crystals with different alpha= ")<<nxt;
1531 }
else if (getLaserAlphaFromFileEE_) {
1534 std::ifstream fEE(
edm::FileInPath(EELaserAlphaFile_).fullPath().c_str());
1536 for(
int crystal = 0; crystal < 14648; crystal++) {
1539 fEE >> z >> x >> y >>
alpha;
1540 if(x < 1 || x > 100 || y < 1 || y > 100 || z==0 || z>1 || z<-1 ) {
1542 <<
" x " << x <<
" y " << y <<
" z " << z ;
1543 edm::LogInfo(
" the format of the file should be z x y alpha ");
1547 ical->setValue( eedetidpos, alpha );
1550 edm::LogInfo(
" problem with EEDetId ") <<
" x " << x <<
" y " << y <<
" z " << z ;
1563 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1565 ical->setValue( eedetidpos, laserAlphaMean_ + r*laserAlphaSigma_ );
1568 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1570 ical->setValue( eedetidneg, laserAlphaMean_ + r1*laserAlphaSigma_ );
1583 std::unique_ptr<EcalLaserAPDPNRatiosRef>
1586 auto ical = std::make_unique<EcalLaserAPDPNRatiosRef>();
1588 if(ieta==0)
continue;
1592 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1593 ical->setValue( ebid, laserAPDPNRefMean_ + r*laserAPDPNRefSigma_ );
1602 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1604 ical->setValue( eedetidpos, laserAPDPNRefMean_ + r*laserAPDPNRefSigma_ );
1608 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1610 ical->setValue( eedetidneg, laserAPDPNRefMean_ + r1*laserAPDPNRefSigma_ );
1619 std::unique_ptr<EcalLaserAPDPNRatios>
1627 auto ical = std::make_unique<EcalLaserAPDPNRatios>();
1629 if(ieta==0)
continue;
1642 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1645 pairAPDPN.
p1 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1646 pairAPDPN.
p2 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1647 pairAPDPN.
p3 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1648 ical->setValue( ebid, pairAPDPN );
1662 double r = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1676 pairAPDPN.
p1 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1677 pairAPDPN.
p2 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1678 pairAPDPN.
p3 = laserAPDPNMean_*drop + r*laserAPDPNSigma_;
1679 ical->setValue( eedetidpos, pairAPDPN );
1683 double r1 = (double)
std::rand()/( double(RAND_MAX)+double(1) );
1686 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
1693 pairAPDPN.
p1 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1694 pairAPDPN.
p2 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1695 pairAPDPN.
p3 = laserAPDPNMean_*drop + r1*laserAPDPNSigma_;
1696 ical->setValue( eedetidneg, pairAPDPN );
1703 for(
int i=0;
i<92;
i++){
1705 if(laserAPDPNTime2_ == 0 ){
1710 if(laserAPDPNTime3_ == 0 ){
1716 ical->setTime(
i, TimeStamp );
1727 std::vector < std::vector<double> > amplwgtv(nTDCbins_);
1729 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1731 std::vector<double> vampl;
1733 vampl.push_back( -0.33333 );
1734 vampl.push_back( -0.33333 );
1735 vampl.push_back( -0.33333 );
1736 vampl.push_back( 0. );
1737 vampl.push_back( 0. );
1738 vampl.push_back( 1. );
1739 vampl.push_back( 0. );
1740 vampl.push_back( 0. );
1741 vampl.push_back( 0. );
1742 vampl.push_back( 0. );
1745 else if (getWeightsFromFile_)
1748 std::ifstream amplFile(
edm::FileInPath(amplWeightsFile_).fullPath().c_str());
1750 while (!amplFile.eof() && tdcBin < nTDCbins_)
1752 for(
int j = 0; j < 10; ++j) {
1755 amplwgtv[tdcBin].push_back(ww);
1759 assert (tdcBin == nTDCbins_);
1765 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1770 for (
int i=0;
i<nTDCbins_;
i++)
1772 assert(amplwgtv[
i].
size() == 10);
1774 for(std::vector<double>::const_iterator it = amplwgtv[
i].
begin(); it != amplwgtv[
i].end(); ++it)
1776 (amplWeights_[
i])[j]=*it;
1782 std::vector < std::vector<double> > amplwgtvAftGain(nTDCbins_);
1784 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1786 std::vector<double> vamplAftGain;
1787 vamplAftGain.push_back( 0. );
1788 vamplAftGain.push_back( 0. );
1789 vamplAftGain.push_back( 0. );
1790 vamplAftGain.push_back( 0. );
1791 vamplAftGain.push_back( 0. );
1792 vamplAftGain.push_back( 1. );
1793 vamplAftGain.push_back( 0. );
1794 vamplAftGain.push_back( 0. );
1795 vamplAftGain.push_back( 0. );
1796 vamplAftGain.push_back( 0. );
1797 amplwgtvAftGain[0] = ps.
getUntrackedParameter< std::vector<double> >(
"amplWeightsAftGain", vamplAftGain);
1799 else if (getWeightsFromFile_)
1803 std::ifstream amplFile(
edm::FileInPath(amplWeightsAftFile_).fullPath().c_str());
1805 while (!amplFile.eof() && tdcBin < nTDCbins_)
1807 for(
int j = 0; j < 10; ++j) {
1810 amplwgtvAftGain[tdcBin].push_back(ww);
1814 assert (tdcBin == nTDCbins_);
1819 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1823 for (
int i=0;
i<nTDCbins_;
i++)
1825 assert(amplwgtvAftGain[
i].
size() == 10);
1827 for(std::vector<double>::const_iterator it = amplwgtvAftGain[
i].
begin(); it != amplwgtvAftGain[
i].end(); ++it) {
1828 (amplWeightsAft_[
i])[j]=*it;
1835 std::vector< std::vector<double> > pedwgtv(nTDCbins_);
1837 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1839 std::vector<double> vped;
1840 vped.push_back( 0.33333 );
1841 vped.push_back( 0.33333 );
1842 vped.push_back( 0.33333 );
1843 vped.push_back( 0. );
1844 vped.push_back( 0. );
1845 vped.push_back( 0. );
1846 vped.push_back( 0. );
1847 vped.push_back( 0. );
1848 vped.push_back( 0. );
1849 vped.push_back( 0. );
1852 else if (getWeightsFromFile_)
1856 std::ifstream pedFile(
edm::FileInPath(pedWeightsFile_).fullPath().c_str());
1858 while (!pedFile.eof() && tdcBin < nTDCbins_)
1860 for(
int j = 0; j < 10; ++j) {
1863 pedwgtv[tdcBin].push_back(ww);
1867 assert (tdcBin == nTDCbins_);
1872 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1876 for (
int i=0;
i<nTDCbins_;
i++)
1878 assert(pedwgtv[
i].
size() == 10);
1880 for(std::vector<double>::const_iterator it = pedwgtv[
i].
begin(); it != pedwgtv[
i].end(); ++it) {
1881 (pedWeights_[
i])[j] = *it;
1886 std::vector< std::vector<double> > pedwgtvaft(nTDCbins_);
1888 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1890 std::vector<double> vped;
1891 vped.push_back( 0. );
1892 vped.push_back( 0. );
1893 vped.push_back( 0. );
1894 vped.push_back( 0. );
1895 vped.push_back( 0. );
1896 vped.push_back( 0. );
1897 vped.push_back( 0. );
1898 vped.push_back( 0. );
1899 vped.push_back( 0. );
1900 vped.push_back( 0. );
1903 else if (getWeightsFromFile_)
1907 std::ifstream pedFile(
edm::FileInPath(pedWeightsAftFile_).fullPath().c_str());
1909 while (!pedFile.eof() && tdcBin < nTDCbins_)
1911 for(
int j = 0; j < 10; ++j) {
1914 pedwgtvaft[tdcBin].push_back(ww);
1918 assert (tdcBin == nTDCbins_);
1923 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1927 for (
int i=0;
i<nTDCbins_;
i++)
1929 assert(pedwgtvaft[
i].
size() == 10);
1931 for(std::vector<double>::const_iterator it = pedwgtvaft[
i].
begin(); it != pedwgtvaft[
i].end(); ++it) {
1932 (pedWeightsAft_[
i])[j]=*it;
1941 std::vector< std::vector<double> > jittwgtv(nTDCbins_);
1943 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
1945 std::vector<double> vjitt;
1946 vjitt.push_back( 0.04066309 );
1947 vjitt.push_back( 0.04066309 );
1948 vjitt.push_back( 0.04066309 );
1949 vjitt.push_back( 0.000 );
1950 vjitt.push_back( 1.325176 );
1951 vjitt.push_back( -0.04997078 );
1952 vjitt.push_back( -0.504338 );
1953 vjitt.push_back( -0.5024844 );
1954 vjitt.push_back( -0.3903718 );
1955 vjitt.push_back( 0.000 );
1958 else if (getWeightsFromFile_)
1962 std::ifstream jittFile(
edm::FileInPath(jittWeightsFile_).fullPath().c_str());
1964 while (!jittFile.eof() && tdcBin < nTDCbins_)
1966 for(
int j = 0; j < 10; ++j) {
1969 jittwgtv[tdcBin].push_back(ww);
1973 assert (tdcBin == nTDCbins_);
1978 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
1982 for (
int i=0;
i<nTDCbins_;
i++)
1984 assert(jittwgtv[
i].
size() == 10);
1986 for(std::vector<double>::const_iterator it = jittwgtv[
i].
begin(); it != jittwgtv[
i].end(); ++it) {
1987 (jittWeights_[
i])[j]= *it;
1992 std::vector< std::vector<double> > jittwgtvaft(nTDCbins_);
1994 if (!getWeightsFromFile_ && nTDCbins_ == 1)
1996 std::vector<double> vjitt;
1997 vjitt.push_back( 0. );
1998 vjitt.push_back( 0. );
1999 vjitt.push_back( 0. );
2000 vjitt.push_back( 0. );
2001 vjitt.push_back( 1.097871 );
2002 vjitt.push_back( -0.04551035 );
2003 vjitt.push_back( -0.4159156 );
2004 vjitt.push_back( -0.4185352 );
2005 vjitt.push_back( -0.3367127 );
2006 vjitt.push_back( 0. );
2009 else if (getWeightsFromFile_)
2013 std::ifstream jittFile(
edm::FileInPath(jittWeightsAftFile_).fullPath().c_str());
2015 while (!jittFile.eof() && tdcBin < nTDCbins_)
2017 for(
int j = 0; j < 10; ++j) {
2020 jittwgtvaft[tdcBin].push_back(ww);
2024 assert (tdcBin == nTDCbins_);
2029 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2033 for (
int i=0;
i<nTDCbins_;
i++)
2035 assert(jittwgtvaft[
i].
size() == 10);
2037 for(std::vector<double>::const_iterator it = jittwgtvaft[
i].
begin(); it != jittwgtvaft[
i].end(); ++it) {
2038 (jittWeightsAft_[
i])[j]= *it;
2044 std::vector< EcalWeightSet::EcalChi2WeightMatrix > chi2Matrix(nTDCbins_);
2045 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
2051 chi2Matrix[0](0,0) = 0.694371;
2052 chi2Matrix[0](0,1) = -0.305629;
2053 chi2Matrix[0](0,2) = -0.305629;
2054 chi2Matrix[0](0,3) = 0.;
2055 chi2Matrix[0](0,4) = 0.;
2056 chi2Matrix[0](0,5) = 0.;
2057 chi2Matrix[0](0,6) = 0.;
2058 chi2Matrix[0](0,7) = 0.;
2059 chi2Matrix[0](0,8) = 0.;
2060 chi2Matrix[0](0,9) = 0.;
2061 chi2Matrix[0](1,0) = -0.305629;
2062 chi2Matrix[0](1,1) = 0.694371;
2063 chi2Matrix[0](1,2) = -0.305629;
2064 chi2Matrix[0](1,3) = 0.;
2065 chi2Matrix[0](1,4) = 0.;
2066 chi2Matrix[0](1,5) = 0.;
2067 chi2Matrix[0](1,6) = 0.;
2068 chi2Matrix[0](1,7) = 0.;
2069 chi2Matrix[0](1,8) = 0.;
2070 chi2Matrix[0](1,9) = 0.;
2071 chi2Matrix[0](2,0) = -0.305629;
2072 chi2Matrix[0](2,1) = -0.305629;
2073 chi2Matrix[0](2,2) = 0.694371;
2074 chi2Matrix[0](2,3) = 0.;
2075 chi2Matrix[0](2,4) = 0.;
2076 chi2Matrix[0](2,5) = 0.;
2077 chi2Matrix[0](2,6) = 0.;
2078 chi2Matrix[0](2,7) = 0.;
2079 chi2Matrix[0](2,8) = 0.;
2080 chi2Matrix[0](2,9) = 0.;
2081 chi2Matrix[0](3,0) = 0.;
2082 chi2Matrix[0](3,1) = 0.;
2083 chi2Matrix[0](3,2) = 0.;
2084 chi2Matrix[0](3,3) = 0.;
2085 chi2Matrix[0](3,4) = 0.;
2086 chi2Matrix[0](3,5) = 0.;
2087 chi2Matrix[0](3,6) = 0.;
2088 chi2Matrix[0](3,7) = 0.;
2089 chi2Matrix[0](3,8) = 0.;
2090 chi2Matrix[0](3,9) = 0.;
2091 chi2Matrix[0](4,0) = 0.;
2092 chi2Matrix[0](4,1) = 0.;
2093 chi2Matrix[0](4,2) = 0.;
2094 chi2Matrix[0](4,3) = 0.;
2095 chi2Matrix[0](4,4) = 0.8027116;
2096 chi2Matrix[0](4,5) = -0.2517103;
2097 chi2Matrix[0](4,6) = -0.2232882;
2098 chi2Matrix[0](4,7) = -0.1716192;
2099 chi2Matrix[0](4,8) = -0.1239006;
2100 chi2Matrix[0](4,9) = 0.;
2101 chi2Matrix[0](5,0) = 0.;
2102 chi2Matrix[0](5,1) = 0.;
2103 chi2Matrix[0](5,2) = 0.;
2104 chi2Matrix[0](5,3) = 0.;
2105 chi2Matrix[0](5,4) = -0.2517103;
2106 chi2Matrix[0](5,5) = 0.6528964;
2107 chi2Matrix[0](5,6) = -0.2972839;
2108 chi2Matrix[0](5,7) = -0.2067162;
2109 chi2Matrix[0](5,8) = -0.1230729;
2110 chi2Matrix[0](5,9) = 0.;
2111 chi2Matrix[0](6,0) = 0.;
2112 chi2Matrix[0](6,1) = 0.;
2113 chi2Matrix[0](6,2) = 0.;
2114 chi2Matrix[0](6,3) = 0.;
2115 chi2Matrix[0](6,4) = -0.2232882;
2116 chi2Matrix[0](6,5) = -0.2972839;
2117 chi2Matrix[0](6,6) = 0.7413607;
2118 chi2Matrix[0](6,7) = -0.1883866;
2119 chi2Matrix[0](6,8) = -0.1235052;
2120 chi2Matrix[0](6,9) = 0.;
2121 chi2Matrix[0](7,0) = 0.;
2122 chi2Matrix[0](7,1) = 0.;
2123 chi2Matrix[0](7,2) = 0.;
2124 chi2Matrix[0](7,3) = 0.;
2125 chi2Matrix[0](7,4) = -0.1716192;
2126 chi2Matrix[0](7,5) = -0.2067162;
2127 chi2Matrix[0](7,6) = -0.1883866;
2128 chi2Matrix[0](7,7) = 0.844935;
2129 chi2Matrix[0](7,8) = -0.124291;
2130 chi2Matrix[0](7,9) = 0.;
2131 chi2Matrix[0](8,0) = 0.;
2132 chi2Matrix[0](8,1) = 0.;
2133 chi2Matrix[0](8,2) = 0.;
2134 chi2Matrix[0](8,3) = 0.;
2135 chi2Matrix[0](8,4) = -0.1239006;
2136 chi2Matrix[0](8,5) = -0.1230729;
2137 chi2Matrix[0](8,6) = -0.1235052;
2138 chi2Matrix[0](8,7) = -0.124291;
2139 chi2Matrix[0](8,8) = 0.8749833;
2140 chi2Matrix[0](8,9) = 0.;
2141 chi2Matrix[0](9,0) = 0.;
2142 chi2Matrix[0](9,1) = 0.;
2143 chi2Matrix[0](9,2) = 0.;
2144 chi2Matrix[0](9,3) = 0.;
2145 chi2Matrix[0](9,4) = 0.;
2146 chi2Matrix[0](9,5) = 0.;
2147 chi2Matrix[0](9,6) = 0.;
2148 chi2Matrix[0](9,7) = 0.;
2149 chi2Matrix[0](9,8) = 0.;
2150 chi2Matrix[0](9,9) = 0.;
2152 else if (getWeightsFromFile_)
2156 std::ifstream chi2MatrixFile(
edm::FileInPath(chi2MatrixFile_).fullPath().c_str());
2158 while (!chi2MatrixFile.eof() && tdcBin < nTDCbins_)
2161 for(
int j = 0; j < 10; ++j) {
2162 for(
int l = 0;
l < 10; ++
l) {
2164 chi2MatrixFile >> ww;
2165 chi2Matrix[tdcBin](j,
l)=ww;
2170 assert (tdcBin == nTDCbins_);
2175 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2182 chi2Matrix_ = chi2Matrix;
2185 std::vector< EcalWeightSet::EcalChi2WeightMatrix > chi2MatrixAft(nTDCbins_);
2186 if (!getWeightsFromFile_ && nTDCbins_ == 1 )
2192 chi2MatrixAft[0](0,0) = 0.;
2193 chi2MatrixAft[0](0,1) = 0.;
2194 chi2MatrixAft[0](0,2) = 0.;
2195 chi2MatrixAft[0](0,3) = 0.;
2196 chi2MatrixAft[0](0,4) = 0.;
2197 chi2MatrixAft[0](0,5) = 0.;
2198 chi2MatrixAft[0](0,6) = 0.;
2199 chi2MatrixAft[0](0,7) = 0.;
2200 chi2MatrixAft[0](0,8) = 0.;
2201 chi2MatrixAft[0](0,9) = 0.;
2202 chi2MatrixAft[0](1,0) = 0.;
2203 chi2MatrixAft[0](1,1) = 0.;
2204 chi2MatrixAft[0](1,2) = 0.;
2205 chi2MatrixAft[0](1,3) = 0.;
2206 chi2MatrixAft[0](1,4) = 0.;
2207 chi2MatrixAft[0](1,5) = 0.;
2208 chi2MatrixAft[0](1,6) = 0.;
2209 chi2MatrixAft[0](1,7) = 0.;
2210 chi2MatrixAft[0](1,8) = 0.;
2211 chi2MatrixAft[0](1,9) = 0.;
2212 chi2MatrixAft[0](2,0) = 0.;
2213 chi2MatrixAft[0](2,1) = 0.;
2214 chi2MatrixAft[0](2,2) = 0.;
2215 chi2MatrixAft[0](2,3) = 0.;
2216 chi2MatrixAft[0](2,4) = 0.;
2217 chi2MatrixAft[0](2,5) = 0.;
2218 chi2MatrixAft[0](2,6) = 0.;
2219 chi2MatrixAft[0](2,7) = 0.;
2220 chi2MatrixAft[0](2,8) = 0.;
2221 chi2MatrixAft[0](2,9) = 0.;
2222 chi2MatrixAft[0](3,0) = 0.;
2223 chi2MatrixAft[0](3,1) = 0.;
2224 chi2MatrixAft[0](3,2) = 0.;
2225 chi2MatrixAft[0](3,3) = 0.;
2226 chi2MatrixAft[0](3,4) = 0.;
2227 chi2MatrixAft[0](3,5) = 0.;
2228 chi2MatrixAft[0](3,6) = 0.;
2229 chi2MatrixAft[0](3,7) = 0.;
2230 chi2MatrixAft[0](3,8) = 0.;
2231 chi2MatrixAft[0](3,9) = 0.;
2232 chi2MatrixAft[0](4,0) = 0.;
2233 chi2MatrixAft[0](4,1) = 0.;
2234 chi2MatrixAft[0](4,2) = 0.;
2235 chi2MatrixAft[0](4,3) = 0.;
2236 chi2MatrixAft[0](4,4) = 0.8030884;
2237 chi2MatrixAft[0](4,5) = -0.2543541;
2238 chi2MatrixAft[0](4,6) = -0.2243544;
2239 chi2MatrixAft[0](4,7) = -0.1698177;
2240 chi2MatrixAft[0](4,8) = -0.1194506;
2241 chi2MatrixAft[0](4,9) = 0.;
2242 chi2MatrixAft[0](5,0) = 0.;
2243 chi2MatrixAft[0](5,1) = 0.;
2244 chi2MatrixAft[0](5,2) = 0.;
2245 chi2MatrixAft[0](5,3) = 0.;
2246 chi2MatrixAft[0](5,4) = -0.2543541;
2247 chi2MatrixAft[0](5,5) = 0.6714465;
2248 chi2MatrixAft[0](5,6) = -0.2898025;
2249 chi2MatrixAft[0](5,7) = -0.2193564;
2250 chi2MatrixAft[0](5,8) = -0.1542964;
2251 chi2MatrixAft[0](5,9) = 0.;
2252 chi2MatrixAft[0](6,0) = 0.;
2253 chi2MatrixAft[0](6,1) = 0.;
2254 chi2MatrixAft[0](6,2) = 0.;
2255 chi2MatrixAft[0](6,3) = 0.;
2256 chi2MatrixAft[0](6,4) = -0.2243544;
2257 chi2MatrixAft[0](6,5) = -0.2898025;
2258 chi2MatrixAft[0](6,6) = 0.7443781;
2259 chi2MatrixAft[0](6,7) = -0.1934846;
2260 chi2MatrixAft[0](6,8) = -0.136098;
2261 chi2MatrixAft[0](6,9) = 0.;
2262 chi2MatrixAft[0](7,0) = 0.;
2263 chi2MatrixAft[0](7,1) = 0.;
2264 chi2MatrixAft[0](7,2) = 0.;
2265 chi2MatrixAft[0](7,3) = 0.;
2266 chi2MatrixAft[0](7,4) = -0.1698177;
2267 chi2MatrixAft[0](7,5) = -0.2193564;
2268 chi2MatrixAft[0](7,6) = -0.1934846;
2269 chi2MatrixAft[0](7,7) = 0.8535482;
2270 chi2MatrixAft[0](7,8) = -0.1030149;
2271 chi2MatrixAft[0](7,9) = 0.;
2272 chi2MatrixAft[0](8,0) = 0.;
2273 chi2MatrixAft[0](8,1) = 0.;
2274 chi2MatrixAft[0](8,2) = 0.;
2275 chi2MatrixAft[0](8,3) = 0.;
2276 chi2MatrixAft[0](8,4) = -0.1194506;
2277 chi2MatrixAft[0](8,5) = -0.1542964;
2278 chi2MatrixAft[0](8,6) = -0.136098;
2279 chi2MatrixAft[0](8,7) = -0.1030149;
2280 chi2MatrixAft[0](8,8) = 0.9275388;
2281 chi2MatrixAft[0](8,9) = 0.;
2282 chi2MatrixAft[0](9,0) = 0.;
2283 chi2MatrixAft[0](9,1) = 0.;
2284 chi2MatrixAft[0](9,2) = 0.;
2285 chi2MatrixAft[0](9,3) = 0.;
2286 chi2MatrixAft[0](9,4) = 0.;
2287 chi2MatrixAft[0](9,5) = 0.;
2288 chi2MatrixAft[0](9,6) = 0.;
2289 chi2MatrixAft[0](9,7) = 0.;
2290 chi2MatrixAft[0](9,8) = 0.;
2291 chi2MatrixAft[0](9,9) = 0.;
2293 else if (getWeightsFromFile_)
2297 std::ifstream chi2MatrixAftFile(
edm::FileInPath(chi2MatrixAftFile_).fullPath().c_str());
2299 while (!chi2MatrixAftFile.eof() && tdcBin < nTDCbins_)
2302 for(
int j = 0; j < 10; ++j) {
2303 for(
int l = 0;
l < 10; ++
l) {
2305 chi2MatrixAftFile >> ww;
2306 chi2MatrixAft[tdcBin](j,
l)=ww;
2311 assert (tdcBin == nTDCbins_);
2316 edm::LogError(
"EcalTrivialConditionRetriever") <<
"Configuration not supported. Exception is raised ";
2323 chi2MatrixAft_ = chi2MatrixAft;
2331 std::unique_ptr<EcalChannelStatus>
2334 auto ecalStatus = std::make_unique<EcalChannelStatus>();
2341 if(ieta==0)
continue;
2345 ecalStatus->setValue( ebid, 0 );
2355 ecalStatus->setValue( eedetidpos, 0 );
2359 ecalStatus->setValue( eedetidneg, 0 );
2369 std::ifstream statusFile(
edm::FileInPath(channelStatusFile_).fullPath().c_str());
2370 if ( !statusFile.good() ) {
2372 <<
"*** Problems opening file: " << channelStatusFile_ ;
2381 while (!statusFile.eof())
2383 statusFile >> EcalSubDet;
2386 std::getline(statusFile,str);
2391 statusFile>> hashIndex >>
status;
2398 ecalStatus->setValue( ebid, status );
2403 ecalStatus->setValue( eedetid, status );
2408 <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2421 std::unique_ptr<EcalChannelStatus>
2425 auto ical = std::make_unique<EcalChannelStatus>();
2428 if(ieta==0)
continue;
2432 ical->setValue( ebid, 0 );
2442 ical->setValue( eedetidpos, 0 );
2446 ical->setValue( eedetidneg, 0 );
2454 std::unique_ptr<EcalDQMChannelStatus>
2459 auto ical = std::make_unique<EcalDQMChannelStatus>();
2462 if(ieta==0)
continue;
2466 ical->setValue( ebid, sta );
2476 ical->setValue( eedetidpos, sta );
2480 ical->setValue( eedetidneg, sta );
2488 std::unique_ptr<EcalDQMTowerStatus>
2492 auto ical = std::make_unique<EcalDQMTowerStatus>();
2498 for(
int k=0 ;
k<2;
k++ ) {
2501 for(
int i=1 ;
i<73;
i++) {
2502 for(
int j=1 ; j<18; j++) {
2506 ical->setValue( ebid, sta );
2514 for(
int k=0 ;
k<2;
k++ ) {
2517 for(
int i=1 ;
i<21;
i++) {
2518 for(
int j=1 ; j<21; j++) {
2521 ical->setValue( eeid, sta );
2531 std::unique_ptr<EcalDCSTowerStatus>
2535 auto ical = std::make_unique<EcalDCSTowerStatus>();
2541 for(
int k=0 ;
k<2;
k++ ) {
2544 for(
int i=1 ;
i<73;
i++) {
2545 for(
int j=1 ; j<18; j++) {
2549 ical->setValue( ebid, status );
2557 for(
int k=0 ;
k<2;
k++ ) {
2560 for(
int i=1 ;
i<21;
i++) {
2561 for(
int j=1 ; j<21; j++) {
2564 ical->setValue( eeid, status );
2574 std::unique_ptr<EcalDAQTowerStatus>
2578 auto ical = std::make_unique<EcalDAQTowerStatus>();
2584 for(
int k=0 ;
k<2;
k++ ) {
2587 for(
int i=1 ;
i<73;
i++) {
2588 for(
int j=1 ; j<18; j++) {
2592 ical->setValue( ebid, status );
2600 for(
int k=0 ;
k<2;
k++ ) {
2603 for(
int i=1 ;
i<21;
i++) {
2604 for(
int j=1 ; j<21; j++) {
2607 ical->setValue( eeid, status );
2617 std::unique_ptr<EcalTPGCrystalStatus>
2620 auto ecalStatus = std::make_unique<EcalTPGCrystalStatus>();
2627 if(ieta==0)
continue;
2631 ecalStatus->setValue( ebid, 0 );
2641 ecalStatus->setValue( eedetidpos, 0 );
2645 ecalStatus->setValue( eedetidneg, 0 );
2655 std::ifstream statusFile(
edm::FileInPath(channelStatusFile_).fullPath().c_str());
2656 if ( !statusFile.good() ) {
2658 <<
"*** Problems opening file: " << channelStatusFile_ ;
2667 while (!statusFile.eof())
2669 statusFile >> EcalSubDet;
2672 std::getline(statusFile,str);
2677 statusFile>> hashIndex >>
status;
2684 ecalStatus->setValue( ebid, status );
2689 ecalStatus->setValue( eedetid, status );
2694 <<
" *** " << EcalSubDet <<
" is neither EB nor EE ";
2707 std::unique_ptr<EcalTPGCrystalStatus>
2711 auto ical = std::make_unique<EcalTPGCrystalStatus>();
2714 if(ieta==0)
continue;
2718 ical->setValue( ebid, 0 );
2728 ical->setValue( eedetidpos, 0 );
2732 ical->setValue( eedetidneg, 0 );
2742 std::unique_ptr<EcalIntercalibConstants>
2746 std::unique_ptr<EcalIntercalibConstants> ical;
2752 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants from file " 2753 << intercalibConstantsFile_.c_str() ;
2755 if(intercalibConstantsFile_.find(
".xml")!= std::string::npos) {
2764 if(totLumi_ !=0 || instLumi_!=0) {
2769 if(intercalibConstantsMCFile_.find(
".xml")!= std::string::npos) {
2777 edm::LogInfo(
"please provide the xml file of the EcalIntercalibConstantsMC");
2781 TRandom3 * gRandom =
new TRandom3();
2792 if(ieta==0)
continue;
2806 if(idref!=mymap.
end())icalconstant=(*idref);
2810 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2812 double r = gRandom->Gaus(0,constantTerm);
2814 if(iphi==10)
edm::LogInfo (
"EB at eta=")<<eta<<
" IC="<<icalconstant<<
" ICMC="<<icalconstantMC<<
" smear="<<r<<
" ";
2816 icalconstant = icalconstant + r*1.29*icalconstantMC;
2822 if(icalconstant !=icalconstant2)
edm::LogInfo(
">>>> error in smearing intercalib");
2834 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
2844 if(idref!=mymap.
end())icalconstant=(*idref);
2848 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2850 double r = gRandom->Gaus(0,constantTerm);
2852 if(iX==10)
edm::LogInfo(
"EE at eta=")<<eta<<
" IC="<<icalconstant<<
" ICMC="<<icalconstantMC<<
" smear="<<r<<
" ";
2853 icalconstant = icalconstant + r*1.29*icalconstantMC;
2864 double eta= -
log(
tan(0.5*atan(
sqrt((iX-50.0)*(iX-50.0)+(iY-50.0)*(iY-50.0))*2.98/328.)));
2872 if(idrefMC!=mymapMC.
end())icalconstantMC=(*idrefMC);
2874 double r = gRandom->Gaus(0,constantTerm);
2875 icalconstant = icalconstant + r*1.29*icalconstantMC;
2883 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
2892 ical = std::make_unique<EcalIntercalibConstants>();
2895 inpFile = fopen (intercalibConstantsFile_.c_str (),
"r") ;
2899 <<
"*** Can not open file: " << intercalibConstantsFile_ ;
2900 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
2904 std::ostringstream
str ;
2905 fgets (line,255,inpFile) ;
2906 int sm_number=atoi (line) ;
2907 str <<
"sm: " << sm_number ;
2909 fgets (line,255,inpFile) ;
2912 fgets (line,255,inpFile) ;
2914 str <<
"gen tag: " << gen_tag ;
2916 fgets (line,255,inpFile) ;
2918 str <<
"cali method: " << cali_method << std::endl ;
2920 fgets (line,255,inpFile) ;
2922 str <<
"cali version: " << cali_version << std::endl ;
2924 fgets (line,255,inpFile) ;
2926 str <<
"cali type: " << cali_type ;
2929 <<
"[PIETRO] Intercalibration file - " 2932 float calib[1700]={1} ;
2933 int calib_status[1700]={0} ;
2937 while (fgets (line,255,inpFile))
2941 float dmy_calib = 0. ;
2942 float dmy_RMS = 0. ;
2943 int dmy_events = 0 ;
2944 int dmy_status = 0 ;
2945 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
2946 &dmy_RMS, &dmy_events,
2948 assert (dmy_num >= 1) ;
2949 assert (dmy_num <= 1700) ;
2950 calib[dmy_num-1] = dmy_calib ;
2951 calib_status[dmy_num-1] = dmy_status ;
2963 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " << ii <<
" xtals " ;
2965 <<
"Some crystals missing, set to 1" << std::endl ;
2973 for (
int i=0 ;
i<1700 ;
i++)
2984 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
2985 else ical->setValue (ebid.
rawId (), 1.) ;
3005 std::unique_ptr<EcalPFRecHitThresholds>
3009 std::unique_ptr<EcalPFRecHitThresholds> ical;
3014 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading PF RecHit Thresholds from file " 3015 << pfRecHitFile_.c_str() ;
3017 ical = std::make_unique<EcalPFRecHitThresholds>();
3022 inpFile = fopen(pfRecHitFile_.c_str(),
"r");
3025 edm::LogInfo (
"Going to multiply the sigmas by ")<<pfRecHitThresholdsNSigmas_;
3029 while (fgets(line,50,inpFile)) {
3034 sscanf(line,
"%d %d %d %f", &eta, &phi, &zeta, &thresh);
3036 thresh=thresh*pfRecHitThresholdsNSigmas_;
3042 ical->setValue( ebid, thresh );
3051 edm::LogInfo (
"We will multiply the sigma in EE by ")<<pfRecHitThresholdsNSigmas_;
3052 edm::LogInfo (
"We will multiply the sigma in EE at high eta by")<<pfRecHitThresholdsNSigmasHEta_;
3057 inpFileEE = fopen(pfRecHitFileEE_.c_str(),
"r");
3060 while (fgets(line,40,inpFileEE)) {
3065 sscanf(line,
"%d %d %d %f", &ix, &iy,&iz, &thresh);
3068 (iy-50.5)*(iy-50.5))*2.98/328.)));
3071 thresh=thresh*pfRecHitThresholdsNSigmasHEta_;
3073 thresh=thresh*pfRecHitThresholdsNSigmas_;
3079 ical->setValue( eeid, thresh );
3092 std::unique_ptr<EcalIntercalibConstantsMC>
3096 std::unique_ptr<EcalIntercalibConstantsMC> ical;
3102 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants MC from file " 3103 << intercalibConstantsMCFile_.c_str() ;
3105 if(intercalibConstantsMCFile_.find(
".xml")!= std::string::npos) {
3107 edm::LogInfo (
"generating Intercalib MC from xml file");
3113 ical = std::unique_ptr<EcalIntercalibConstants>(rcd);
3131 std::unique_ptr<EcalIntercalibErrors>
3135 auto ical = std::make_unique<EcalIntercalibErrors>();
3140 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading intercalibration constants from file " 3141 << intercalibErrorsFile_.c_str() ;
3144 inpFile = fopen (intercalibErrorsFile_.c_str (),
"r") ;
3148 <<
"*** Can not open file: " << intercalibErrorsFile_ ;
3149 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
3153 std::ostringstream
str ;
3154 fgets (line,255,inpFile) ;
3155 int sm_number=atoi (line) ;
3156 str <<
"sm: " << sm_number ;
3158 fgets (line,255,inpFile) ;
3161 fgets (line,255,inpFile) ;
3163 str <<
"gen tag: " << gen_tag ;
3165 fgets (line,255,inpFile) ;
3167 str <<
"cali method: " << cali_method << std::endl ;
3169 fgets (line,255,inpFile) ;
3171 str <<
"cali version: " << cali_version << std::endl ;
3173 fgets (line,255,inpFile) ;
3175 str <<
"cali type: " << cali_type ;
3178 <<
"[PIETRO] Intercalibration file - " 3179 << str.str () << std::endl ;
3181 float calib[1700]={1} ;
3182 int calib_status[1700]={0} ;
3186 while (fgets (line,255,inpFile))
3190 float dmy_calib = 0. ;
3191 float dmy_RMS = 0. ;
3192 int dmy_events = 0 ;
3193 int dmy_status = 0 ;
3194 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
3195 &dmy_RMS, &dmy_events,
3197 assert (dmy_num >= 1) ;
3198 assert (dmy_num <= 1700) ;
3199 calib[dmy_num-1] = dmy_calib ;
3200 calib_status[dmy_num-1] = dmy_status ;
3212 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read intercalibrations for " << ii <<
" xtals " ;
3214 <<
"Some crystals missing, set to 1" << std::endl ;
3222 for (
int i=0 ;
i<1700 ;
i++)
3233 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
3234 else ical->setValue (ebid.
rawId (), 1.) ;
3251 std::unique_ptr<EcalTimeCalibConstants>
3255 auto ical = std::make_unique<EcalTimeCalibConstants>();
3260 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading time calibration constants from file " 3261 << timeCalibConstantsFile_.c_str() ;
3264 inpFile = fopen (timeCalibConstantsFile_.c_str (),
"r") ;
3268 <<
"*** Can not open file: " << timeCalibConstantsFile_ ;
3269 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
3273 std::ostringstream
str ;
3274 fgets (line,255,inpFile) ;
3275 int sm_number=atoi (line) ;
3276 str <<
"sm: " << sm_number ;
3278 fgets (line,255,inpFile) ;
3281 fgets (line,255,inpFile) ;
3283 str <<
"gen tag: " << gen_tag ;
3285 fgets (line,255,inpFile) ;
3287 str <<
"cali method: " << cali_method << std::endl ;
3289 fgets (line,255,inpFile) ;
3291 str <<
"cali version: " << cali_version << std::endl ;
3293 fgets (line,255,inpFile) ;
3295 str <<
"cali type: " << cali_type ;
3298 <<
"TimeCalibration file - " 3299 << str.str () << std::endl ;
3301 float calib[1700]={1} ;
3302 int calib_status[1700]={0} ;
3306 while (fgets (line,255,inpFile))
3310 float dmy_calib = 0. ;
3311 float dmy_RMS = 0. ;
3312 int dmy_events = 0 ;
3313 int dmy_status = 0 ;
3314 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
3315 &dmy_RMS, &dmy_events,
3317 assert (dmy_num >= 1) ;
3318 assert (dmy_num <= 1700) ;
3319 calib[dmy_num-1] = dmy_calib ;
3320 calib_status[dmy_num-1] = dmy_status ;
3332 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read timeCalibrations for " << ii <<
" xtals " ;
3334 <<
"Some crystals missing, set to 1" << std::endl ;
3342 for (
int i=0 ;
i<1700 ;
i++)
3353 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
3354 else ical->setValue (ebid.
rawId (), 1.) ;
3364 std::unique_ptr<EcalTimeCalibErrors>
3368 auto ical = std::make_unique<EcalTimeCalibErrors>();
3373 edm::LogInfo(
"EcalTrivialConditionRetriever") <<
"Reading timeCalibration constants from file " 3374 << timeCalibErrorsFile_.c_str() ;
3377 inpFile = fopen (timeCalibErrorsFile_.c_str (),
"r") ;
3381 <<
"*** Can not open file: " << timeCalibErrorsFile_ ;
3382 throw cms::Exception (
"Cannot open inter-calibration coefficients txt file") ;
3386 std::ostringstream
str ;
3387 fgets (line,255,inpFile) ;
3388 int sm_number=atoi (line) ;
3389 str <<
"sm: " << sm_number ;
3391 fgets (line,255,inpFile) ;
3394 fgets (line,255,inpFile) ;
3396 str <<
"gen tag: " << gen_tag ;
3398 fgets (line,255,inpFile) ;
3400 str <<
"cali method: " << cali_method << std::endl ;
3402 fgets (line,255,inpFile) ;
3404 str <<
"cali version: " << cali_version << std::endl ;
3406 fgets (line,255,inpFile) ;
3408 str <<
"cali type: " << cali_type ;
3411 <<
"TimeCalibration file - " 3412 << str.str () << std::endl ;
3414 float calib[1700]={1} ;
3415 int calib_status[1700]={0} ;
3419 while (fgets (line,255,inpFile))
3423 float dmy_calib = 0. ;
3424 float dmy_RMS = 0. ;
3425 int dmy_events = 0 ;
3426 int dmy_status = 0 ;
3427 sscanf (line,
"%d %f %f %d %d", &dmy_num, &dmy_calib,
3428 &dmy_RMS, &dmy_events,
3430 assert (dmy_num >= 1) ;
3431 assert (dmy_num <= 1700) ;
3432 calib[dmy_num-1] = dmy_calib ;
3433 calib_status[dmy_num-1] = dmy_status ;
3445 edm::LogInfo (
"EcalTrivialConditionRetriever") <<
"Read time calibrations for " << ii <<
" xtals " ;
3447 <<
"Some crystals missing, set to 1" << std::endl ;
3455 for (
int i=0 ;
i<1700 ;
i++)
3466 if (calib_status[
i]) ical->setValue (ebid.
rawId (), calib[
i]) ;
3467 else ical->setValue (ebid.
rawId (), 1.) ;
3478 std::unique_ptr<EcalMappingElectronics>
3481 auto mapping = std::make_unique<EcalMappingElectronics>();
3487 edm::LogError(
"EcalTrivialConditionRetriever") <<
"File not found";
3496 int dccid, towerid, pseudostrip_in_SC, xtal_in_pseudostrip;
3497 int tccid, tower, pseudostrip_in_TCC, pseudostrip_in_TT;
3502 f >> ix >> iy >> iz >> CL >> dccid >> towerid >> pseudostrip_in_SC >> xtal_in_pseudostrip >> tccid >> tower >>
3503 pseudostrip_in_TCC >> pseudostrip_in_TT ;
3510 EcalElectronicsId elecid(dccid,towerid, pseudostrip_in_SC, xtal_in_pseudostrip);
3516 (*mapping).setValue(detid, aElement);
3525 std::unique_ptr<EcalMappingElectronics>
3529 auto ical = std::make_unique<EcalMappingElectronics>();
3535 std::unique_ptr<Alignments>
3537 double mytrans[3] = {0., 0., 0.};
3538 double myeuler[3] = {0., 0., 0.};
3540 if(getEBAlignmentFromFile_)
3542 std::vector<AlignTransform> my_align;
3545 for(
int SM = 1 ; SM < 37; SM++ ) {
3548 iphi = 1 + (SM - 19) * 20;
3554 if(getEBAlignmentFromFile_) {
3555 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3556 edm::LogInfo (
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3557 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2] ;
3559 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3560 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3562 my_align.push_back(transform);
3588 return std::make_unique<Alignments>(
a);
3591 std::unique_ptr<Alignments>
3593 double mytrans[3] = {0., 0., 0.};
3594 double myeuler[3] = {0., 0., 0.};
3596 if(getEEAlignmentFromFile_)
3598 std::vector<AlignTransform> my_align;
3602 for(
int Dee = 0 ; Dee < 4; Dee++ ) {
3604 if(Dee == 1 || Dee == 3)
3609 EEDetId eedetId(ix, iy, side);
3610 if(getEEAlignmentFromFile_) {
3611 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3612 edm::LogInfo (
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3613 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2] ;
3615 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3616 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3618 my_align.push_back(transform);
3622 return std::make_unique<Alignments>(
a);
3625 std::unique_ptr<Alignments>
3627 double mytrans[3] = {0., 0., 0.};
3628 double myeuler[3] = {0., 0., 0.};
3630 if(getESAlignmentFromFile_)
3632 std::vector<AlignTransform> my_align;
3634 int pl_vect[10] = {2, 2, 1, 1, 1, 1, 2, 2};
3638 for(
int layer = 0 ; layer < 8; layer++ ) {
3640 int ix = 10 + (layer%2) * 20;
3641 int plane = pl_vect[layer];
3642 if(layer > 3) side = 1;
3643 ESDetId esdetId(strip, ix, iy, plane, side);
3644 if(getESAlignmentFromFile_) {
3645 f >> myeuler[0] >> myeuler[1] >> myeuler[2] >> mytrans[0] >> mytrans[1] >> mytrans[2];
3646 edm::LogInfo (
" translation ") << mytrans[0] <<
" " << mytrans[1] <<
" " << mytrans[2] <<
"\n" 3647 <<
" euler " << myeuler[0] <<
" " << myeuler[1] <<
" " << myeuler[2];
3649 CLHEP::Hep3Vector translation( mytrans[0], mytrans[1], mytrans[2]);
3650 CLHEP::HepEulerAngles euler( myeuler[0], myeuler[1], myeuler[2]);
3652 my_align.push_back(transform);
3656 return std::make_unique<Alignments>(
a);
3659 std::unique_ptr<EcalSampleMask>
3662 return std::unique_ptr<EcalSampleMask>(
new EcalSampleMask(sampleMaskEB_, sampleMaskEE_) );
3665 std::unique_ptr<EcalTimeBiasCorrections>
3667 auto ipar = std::make_unique<EcalTimeBiasCorrections>();
3668 copy(EBtimeCorrAmplitudeBins_.begin(), EBtimeCorrAmplitudeBins_.end(),
3669 back_inserter(ipar->EBTimeCorrAmplitudeBins));
3670 copy(EBtimeCorrShiftBins_.begin(), EBtimeCorrShiftBins_.end(),
3671 back_inserter(ipar->EBTimeCorrShiftBins));
3672 copy(EEtimeCorrAmplitudeBins_.begin(), EEtimeCorrAmplitudeBins_.end(),
3673 back_inserter(ipar->EETimeCorrAmplitudeBins));
3674 copy(EEtimeCorrShiftBins_.begin(), EEtimeCorrShiftBins_.end(),
3675 back_inserter(ipar->EETimeCorrShiftBins));
3679 std::unique_ptr<EcalSamplesCorrelation>
3681 if(getSamplesCorrelationFromFile_) {
3685 for(
int j = 0; j < 10; ++j) {
3687 EBG12samplesCorrelation_.push_back(ww);
3689 for(
int j = 0; j < 10; ++j) {
3691 EBG6samplesCorrelation_.push_back(ww);
3693 for(
int j = 0; j < 10; ++j) {
3695 EBG1samplesCorrelation_.push_back(ww);
3697 for(
int j = 0; j < 10; ++j) {
3699 EEG12samplesCorrelation_.push_back(ww);
3701 for(
int j = 0; j < 10; ++j) {
3703 EEG6samplesCorrelation_.push_back(ww);
3705 for(
int j = 0; j < 10; ++j) {
3707 EEG1samplesCorrelation_.push_back(ww);
3711 auto ipar = std::make_unique<EcalSamplesCorrelation>();
3712 copy(EBG12samplesCorrelation_.begin(), EBG12samplesCorrelation_.end(),
3713 back_inserter(ipar->EBG12SamplesCorrelation));
3714 copy(EBG6samplesCorrelation_.begin(), EBG6samplesCorrelation_.end(),
3715 back_inserter(ipar->EBG6SamplesCorrelation));
3716 copy(EBG1samplesCorrelation_.begin(), EBG1samplesCorrelation_.end(),
3717 back_inserter(ipar->EBG1SamplesCorrelation));
3718 copy(EEG12samplesCorrelation_.begin(), EEG12samplesCorrelation_.end(),
3719 back_inserter(ipar->EEG12SamplesCorrelation));
3720 copy(EEG6samplesCorrelation_.begin(), EEG6samplesCorrelation_.end(),
3721 back_inserter(ipar->EEG6SamplesCorrelation));
3722 copy(EEG1samplesCorrelation_.begin(), EEG1samplesCorrelation_.end(),
3723 back_inserter(ipar->EEG1SamplesCorrelation));
3727 std::unique_ptr<EcalSimPulseShape>
3731 auto result = std::make_unique<EcalSimPulseShape>();
3734 result->time_interval = sim_pulse_shape_TI_;
3737 std::vector<double> EBshape;
3738 std::vector<double> EEshape;
3739 std::vector<double> APDshape;
3742 if (!EBSimPulseShapeFile_.empty() )
3744 std::ifstream shapeEBFile;
3745 shapeEBFile.open(EBSimPulseShapeFile_.c_str());
3747 while (shapeEBFile >> ww) EBshape.push_back(ww);
3748 shapeEBFile.close();
3750 if (!EESimPulseShapeFile_.empty() )
3752 std::ifstream shapeEEFile;
3753 shapeEEFile.open(EESimPulseShapeFile_.c_str());
3755 while (shapeEEFile >> ww) EEshape.push_back(ww);
3756 shapeEEFile.close();
3758 if (!APDSimPulseShapeFile_.empty()) {
3759 std::ifstream shapeAPDFile;
3760 shapeAPDFile.open(APDSimPulseShapeFile_.c_str());
3762 while (shapeAPDFile >> ww) APDshape.push_back(ww);
3763 shapeAPDFile.close();
3767 result->barrel_thresh = sim_pulse_shape_EB_thresh_;
3768 result->endcap_thresh = sim_pulse_shape_EE_thresh_;
3769 result->apd_thresh = sim_pulse_shape_APD_thresh_;
3772 copy(EBshape.begin(), EBshape.end(),
3773 back_inserter(
result->barrel_shape));
3774 copy(EEshape.begin(), EEshape.end(),
3775 back_inserter(
result->endcap_shape));
3776 copy(APDshape.begin(), APDshape.end(),
3777 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
virtual std::unique_ptr< EcalPFRecHitThresholds > getPFRecHitThresholdsFromConfiguration(const EcalPFRecHitThresholdsRcd &)
const Timestamp & time() const
virtual std::unique_ptr< EcalTimeCalibConstants > getTimeCalibConstantsFromConfiguration(const EcalTimeCalibConstantsRcd &)
const_iterator end() const
virtual std::unique_ptr< EcalTPGCrystalStatus > getTrgChannelStatusFromConfiguration(const EcalTPGCrystalStatusRcd &)
virtual std::unique_ptr< EcalPFRecHitThresholds > produceEcalPFRecHitThresholds(const EcalPFRecHitThresholdsRcd &)
float EcalIntercalibConstantMC
virtual std::unique_ptr< EcalSampleMask > produceEcalSampleMask(const EcalSampleMaskRcd &)
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 &)