diff --git a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducer.cc b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducer.cc index 6a217c12cb910..67b1f6734daa7 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducer.cc +++ b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitProducer.cc @@ -390,6 +390,7 @@ void EcalRecHitProducer::fillDescriptions(edm::ConfigurationDescriptions& descri desc.add("EELaserMAX",8.0); desc.add("logWarningEtThreshold_EB_FE",50); desc.add("recoverEEIsolatedChannels",false); + desc.add("skipTimeCalib",false); descriptions.add("ecalRecHit",desc); } diff --git a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.cc b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.cc index 4ba3e8bda756d..7a802f911e6ec 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.cc +++ b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.cc @@ -25,7 +25,8 @@ EcalRecHitWorkerSimple::EcalRecHitWorkerSimple(const edm::ParameterSet&ps, edm:: EBLaserMAX_ = ps.getParameter("EBLaserMAX"); EELaserMAX_ = ps.getParameter("EELaserMAX"); - + skipTimeCalib_=ps.getParameter("skipTimeCalib"); + // Traslate string representation of flagsMapDBReco into enum values const edm::ParameterSet & p=ps.getParameter< edm::ParameterSet >("flagsMapDBReco"); std::vector recoflagbitsStrings = p.getParameterNames(); @@ -59,8 +60,12 @@ EcalRecHitWorkerSimple::EcalRecHitWorkerSimple(const edm::ParameterSet&ps, edm:: void EcalRecHitWorkerSimple::set(const edm::EventSetup& es) { es.get().get(ical); - es.get().get(itime); - es.get().get(offtime); + + if (!skipTimeCalib_){ + es.get().get(itime); + es.get().get(offtime); + } + es.get().get(agc); es.get().get(chStatus); if ( laserCorrection_ ) es.get().get(laser); @@ -92,10 +97,10 @@ EcalRecHitWorkerSimple::run( const edm::Event & evt, const EcalIntercalibConstantMap& icalMap = ical->getMap(); if ( detid.subdetId() == EcalEndcap ) { rechitMaker_->setADCToGeVConstant( float(agc->getEEValue()) ); - offsetTime = offtime->getEEValue(); + if (!skipTimeCalib_) offsetTime = offtime->getEEValue(); } else { rechitMaker_->setADCToGeVConstant( float(agc->getEBValue()) ); - offsetTime = offtime->getEBValue(); + if (!skipTimeCalib_) offsetTime = offtime->getEBValue(); } // first intercalibration constants @@ -115,18 +120,22 @@ EcalRecHitWorkerSimple::run( const edm::Event & evt, // get time calibration coefficient - const EcalTimeCalibConstantMap & itimeMap = itime->getMap(); - EcalTimeCalibConstantMap::const_iterator itime = itimeMap.find(detid); EcalTimeCalibConstant itimeconst = 0; - if( itime!=itimeMap.end() ) { - itimeconst = (*itime); - } else { - edm::LogError("EcalRecHitError") << "No time calib const found for xtal " - << detid.rawId() - << "! something wrong with EcalTimeCalibConstants in your DB? "; + + if (!skipTimeCalib_){ + const EcalTimeCalibConstantMap & itimeMap = itime->getMap(); + EcalTimeCalibConstantMap::const_iterator itime = itimeMap.find(detid); + + if( itime!=itimeMap.end() ) { + itimeconst = (*itime); + } else { + edm::LogError("EcalRecHitError") << "No time calib const found for xtal " + << detid.rawId() + << "! something wrong with EcalTimeCalibConstants in your DB? "; } - + } + // make the rechit and put in the output collection, unless recovery has to take care of it if (! (flagmask_ & flagBits ) || !killDeadChannels_) { EcalRecHit myrechit( rechitMaker_->makeRecHit(uncalibRH, diff --git a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.h b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.h index b1e736235cfdb..a7e3a7f64df75 100644 --- a/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.h +++ b/RecoLocalCalo/EcalRecProducers/plugins/EcalRecHitWorkerSimple.h @@ -57,7 +57,8 @@ class EcalRecHitWorkerSimple : public EcalRecHitWorkerBaseClass { bool killDeadChannels_; bool laserCorrection_; - + bool skipTimeCalib_; + EcalRecHitSimpleAlgo * rechitMaker_; }; diff --git a/RecoLocalCalo/EcalRecProducers/python/ecalRecHit_cfi.py b/RecoLocalCalo/EcalRecProducers/python/ecalRecHit_cfi.py index 1c7f0b180341f..428436d26d3bb 100644 --- a/RecoLocalCalo/EcalRecProducers/python/ecalRecHit_cfi.py +++ b/RecoLocalCalo/EcalRecProducers/python/ecalRecHit_cfi.py @@ -30,6 +30,8 @@ EBLaserMAX = cms.double(3.0), EELaserMAX = cms.double(8.0), + # useful if time is not calculated, as at HLT + skipTimeCalib = cms.bool(False), # apply laser corrections laserCorrection = cms.bool(True),