diff --git a/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc b/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc index 0acd861756061..bd138cc4c4bc2 100644 --- a/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc +++ b/CalibCalorimetry/CaloTPG/plugins/CaloTPGTranscoderULUTs.cc @@ -150,9 +150,14 @@ CaloTPGTranscoderULUTs::produce(const CaloTPGRecord& iRecord) edm::ESHandle theTrigTowerGeometry; iRecord.getRecord().get(theTrigTowerGeometry); + edm::ESHandle htopo; + iRecord.getRecord().getRecord().get(htopo); + + HcalLutMetadata fullLut{ *lutMetadata }; + fullLut.setTopo(htopo.product()); std::auto_ptr pTCoder(new CaloTPGTranscoderULUT(file1, file2)); - pTCoder->setup(*lutMetadata, *theTrigTowerGeometry); + pTCoder->setup(fullLut, *theTrigTowerGeometry); return std::auto_ptr( pTCoder ); } diff --git a/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc b/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc index db929073c271a..ec9795cac8345 100644 --- a/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc +++ b/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.cc @@ -1,5 +1,6 @@ #include "CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h" #include "FWCore/Utilities/interface/Exception.h" +#include "FWCore/Framework/interface/ESTransientHandle.h" #include "Geometry/HcalTowerAlgo/interface/HcalTrigTowerGeometry.h" #include "Geometry/Records/interface/CaloGeometryRecord.h" #include "FWCore/Utilities/interface/Exception.h" diff --git a/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h b/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h index e3aa4eefebcc0..e5b22b1648446 100644 --- a/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h +++ b/CalibCalorimetry/CaloTPG/src/CaloTPGTranscoderULUT.h @@ -1,6 +1,7 @@ #ifndef CALOTPGTRANSCODERULUT_H #define CALOTPGTRANSCODERULUT_H 1 +#include #include #include "CalibFormats/CaloTPG/interface/CaloTPGTranscoder.h" diff --git a/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h b/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h index 8d3c1fbfe999a..17f8cb27e3cb5 100644 --- a/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h +++ b/CalibCalorimetry/HcalAlgos/interface/HcalPulseShapes.h @@ -45,9 +45,9 @@ class HcalPulseShapes { Shape hpdShape_v2, hpdShapeMC_v2; Shape hpdShape_v3, hpdShapeMC_v3; Shape hpdBV30Shape_v2, hpdBV30ShapeMC_v2; - const HcalMCParams * theMCParams; + HcalMCParams * theMCParams; const HcalTopology * theTopology; - const HcalRecoParams * theRecoParams; + HcalRecoParams * theRecoParams; typedef std::map ShapeMap; ShapeMap theShapes; diff --git a/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.cc b/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.cc index 2ecbfe3cda5f2..5b11339b92d86 100644 --- a/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.cc +++ b/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.cc @@ -22,9 +22,9 @@ #include #include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ESTransientHandle.h" #include "CalibCalorimetry/HcalAlgos/interface/HcalDbASCIIIO.h" -#include "CalibFormats/HcalObjects/interface/HcalDbService.h" #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" @@ -62,7 +62,8 @@ HcalDbProducer::HcalDbProducer( const edm::ParameterSet& fConfig) &HcalDbProducer::lutMetadataCallback ) ); - + + setWhatProduced(this, &HcalDbProducer::produceChannelQualityWithTopo, edm::es::Label("withTopo")); //now do what ever other initialization is needed mDumpRequest = fConfig.getUntrackedParameter > ("dump", std::vector()); @@ -93,220 +94,230 @@ boost::shared_ptr HcalDbProducer::produce( const HcalDbRecord&) } void HcalDbProducer::pedestalsCallback (const HcalPedestalsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mPedestals.reset( new HcalPedestals(*item) ); + + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mPedestals->setTopo(topo); + - mService->setData (item.product ()); + mService->setData (mPedestals.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end()) { *mDumpStream << "New HCAL Pedestals set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mPedestals)); } } +boost::shared_ptr HcalDbProducer::produceChannelQualityWithTopo(const HcalChannelQualityRcd& fRecord) +{ + edm::ESHandle item; + fRecord.get (item); + + boost::shared_ptr channelQuality( new HcalChannelQuality(*item) ); + + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + channelQuality->setTopo(topo); + + return channelQuality; +} + void HcalDbProducer::pedestalWidthsCallback (const HcalPedestalWidthsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mPedestalWidths.reset( new HcalPedestalWidths(*item)); - mService->setData (item.product ()); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mPedestalWidths->setTopo(topo); + + mService->setData (mPedestalWidths.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end()) { *mDumpStream << "New HCAL PedestalWidths set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mPedestalWidths)); } } void HcalDbProducer::gainsCallback (const HcalGainsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mGains.reset( new HcalGains(*item) ); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mGains->setTopo(topo); - mService->setData (item.product ()); + + mService->setData (mGains.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end()) { *mDumpStream << "New HCAL Gains set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mGains)); } } void HcalDbProducer::gainWidthsCallback (const HcalGainWidthsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mGainWidths.reset( new HcalGainWidths(*item)); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mGainWidths->setTopo(topo); - mService->setData (item.product ()); + + mService->setData (mGainWidths.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end()) { *mDumpStream << "New HCAL GainWidths set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mGainWidths)); } } void HcalDbProducer::QIEDataCallback (const HcalQIEDataRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mQIEData.reset( new HcalQIEData(*item)); - mService->setData (item.product ()); + + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mQIEData->setTopo(topo); + + mService->setData (mQIEData.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end()) { *mDumpStream << "New HCAL QIEData set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mQIEData)); } } void HcalDbProducer::channelQualityCallback (const HcalChannelQualityRcd& fRecord) { edm::ESHandle item; - fRecord.get (item); + fRecord.get ("withTopo", item ); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } - - mService->setData (item.product ()); + mService->setData (item.product()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end()) { *mDumpStream << "New HCAL ChannelQuality set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(item)); } } void HcalDbProducer::respCorrsCallback (const HcalRespCorrsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mRespCorrs.reset( new HcalRespCorrs(*item) ); - mService->setData (item.product ()); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mRespCorrs->setTopo(topo); + + mService->setData (mRespCorrs.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RespCorrs")) != mDumpRequest.end()) { *mDumpStream << "New HCAL RespCorrs set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mRespCorrs)); } } void HcalDbProducer::LUTCorrsCallback (const HcalLUTCorrsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mLUTCorrs.reset( new HcalLUTCorrs(*item) ); - mService->setData (item.product ()); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mLUTCorrs->setTopo(topo); + + mService->setData (mLUTCorrs.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LUTCorrs")) != mDumpRequest.end()) { *mDumpStream << "New HCAL LUTCorrs set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mLUTCorrs)); } } void HcalDbProducer::PFCorrsCallback (const HcalPFCorrsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mPFCorrs.reset( new HcalPFCorrs(*item) ); - mService->setData (item.product ()); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mPFCorrs->setTopo(topo); + + mService->setData (mPFCorrs.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PFCorrs")) != mDumpRequest.end()) { *mDumpStream << "New HCAL PFCorrs set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mPFCorrs)); } } void HcalDbProducer::timeCorrsCallback (const HcalTimeCorrsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mTimeCorrs.reset( new HcalTimeCorrs(*item) ); - mService->setData (item.product ()); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mTimeCorrs->setTopo(topo); + + mService->setData (mTimeCorrs.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TimeCorrs")) != mDumpRequest.end()) { *mDumpStream << "New HCAL TimeCorrs set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mTimeCorrs)); } } void HcalDbProducer::zsThresholdsCallback (const HcalZSThresholdsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mZSThresholds.reset( new HcalZSThresholds(*item) ); - mService->setData (item.product ()); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mZSThresholds->setTopo(topo); + + mService->setData (mZSThresholds.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ZSThresholds")) != mDumpRequest.end()) { *mDumpStream << "New HCAL ZSThresholds set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mZSThresholds)); } } void HcalDbProducer::L1triggerObjectsCallback (const HcalL1TriggerObjectsRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mL1TriggerObjects.reset( new HcalL1TriggerObjects(*item) ); - mService->setData (item.product ()); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mL1TriggerObjects->setTopo(topo); + + mService->setData (mL1TriggerObjects.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("L1TriggerObjects")) != mDumpRequest.end()) { *mDumpStream << "New HCAL L1TriggerObjects set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mL1TriggerObjects)); } } @@ -321,20 +332,20 @@ void HcalDbProducer::electronicsMapCallback (const HcalElectronicsMapRcd& fRecor } void HcalDbProducer::lutMetadataCallback (const HcalLutMetadataRcd& fRecord) { - edm::ESHandle item; + edm::ESTransientHandle item; fRecord.get (item); - if (item->topo()==0) { - edm::ESHandle htopo; - fRecord.getRecord().get(htopo); - const HcalTopology* topo=&(*htopo); - item->setTopo(topo); - } + mLutMetadata.reset( new HcalLutMetadata(*item) ); - mService->setData (item.product ()); + edm::ESHandle htopo; + fRecord.getRecord().get(htopo); + const HcalTopology* topo=&(*htopo); + mLutMetadata->setTopo(topo); + + mService->setData (mLutMetadata.get()); if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LutMetadata")) != mDumpRequest.end()) { *mDumpStream << "New HCAL LUT Metadata set" << std::endl; - HcalDbASCIIIO::dumpObject (*mDumpStream, *(item.product ())); + HcalDbASCIIIO::dumpObject (*mDumpStream, *(mLutMetadata)); } } diff --git a/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.h b/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.h index 890e0f959fcbc..1fb94c7970ebd 100644 --- a/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.h +++ b/CalibCalorimetry/HcalPlugins/src/HcalDbProducer.h @@ -29,6 +29,7 @@ class HcalDbService; class HcalDbRecord; #include "CondFormats/DataRecord/interface/HcalAllRcds.h" +#include "CalibFormats/HcalObjects/interface/HcalDbService.h" class HcalDbProducer : public edm::ESProducer { @@ -38,6 +39,8 @@ class HcalDbProducer : public edm::ESProducer { boost::shared_ptr produce( const HcalDbRecord& ); + boost::shared_ptr produceChannelQualityWithTopo( const HcalChannelQualityRcd&); + // callbacks void pedestalsCallback (const HcalPedestalsRcd& fRecord); void pedestalWidthsCallback (const HcalPedestalWidthsRcd& fRecord); @@ -59,4 +62,18 @@ class HcalDbProducer : public edm::ESProducer { boost::shared_ptr mService; std::vector mDumpRequest; std::ostream* mDumpStream; + + std::unique_ptr mPedestals; + std::unique_ptr mPedestalWidths; + std::unique_ptr mGains; + std::unique_ptr mGainWidths; + std::unique_ptr mQIEData; + std::unique_ptr mRespCorrs; + std::unique_ptr mLUTCorrs; + std::unique_ptr mPFCorrs; + std::unique_ptr mTimeCorrs; + std::unique_ptr mZSThresholds; + std::unique_ptr mL1TriggerObjects; + std::unique_ptr mLutMetadata; + }; diff --git a/CaloOnlineTools/HcalOnlineDb/src/HcalLutGenerator.cc b/CaloOnlineTools/HcalOnlineDb/src/HcalLutGenerator.cc index a94c5a55db0e9..bfbf37c9014c1 100644 --- a/CaloOnlineTools/HcalOnlineDb/src/HcalLutGenerator.cc +++ b/CaloOnlineTools/HcalOnlineDb/src/HcalLutGenerator.cc @@ -58,7 +58,7 @@ void HcalLutGenerator::analyze(const edm::Event& iEvent, const edm::EventSetup& //_____ get Channel Quality conditions from Event Setup (example)______ // edm::ESHandle hCQ; - iSetup.get().get(hCQ); + iSetup.get().get("withTopo",hCQ); const HcalChannelQuality * _cq = &(*hCQ); // /* diff --git a/CondFormats/HcalObjects/interface/HcalCondObjectContainer.h b/CondFormats/HcalObjects/interface/HcalCondObjectContainer.h index b45dfb547fa32..7d55a013b567e 100644 --- a/CondFormats/HcalObjects/interface/HcalCondObjectContainer.h +++ b/CondFormats/HcalObjects/interface/HcalCondObjectContainer.h @@ -9,9 +9,6 @@ #include "DataFormats/HcalDetId/interface/HcalCastorDetId.h" #include "DataFormats/HcalDetId/interface/HcalZDCDetId.h" #include "FWCore/Utilities/interface/Exception.h" -#ifndef __GCCXML__ -#include -#endif class HcalTopology; @@ -21,7 +18,7 @@ class HcalCondObjectContainerBase { public: const HcalTopology* topo() const { return topo_; } int getCreatorPackedIndexVersion() const { return packedIndexVersion_; } - void setTopo(const HcalTopology* topo) const; + void setTopo(const HcalTopology* topo) ; protected: HcalCondObjectContainerBase(HcalCondObjectContainerBase const & o) : packedIndexVersion_(o.packedIndexVersion_), topo_(o.topo()) {} HcalCondObjectContainerBase & operator = (HcalCondObjectContainerBase const & o) { topo_=o.topo(); packedIndexVersion_=o.packedIndexVersion_; return *this;} @@ -37,11 +34,7 @@ class HcalCondObjectContainerBase { inline HcalOtherSubdetector extractOther(const DetId& id) const { return HcalOtherSubdetector((id.rawId()>>20)&0x1F); } std::string textForId(const DetId& id) const; private: -#ifndef __GCCXML__ - mutable std::atomic topo_ COND_TRANSIENT; -#else - mutable const HcalTopology* topo_ COND_TRANSIENT; -#endif + const HcalTopology* topo_ COND_TRANSIENT; COND_SERIALIZABLE; }; diff --git a/CondFormats/HcalObjects/src/HcalCondObjectContainerBase.cc b/CondFormats/HcalObjects/src/HcalCondObjectContainerBase.cc index 746ba1a3d79e0..e14111019d900 100755 --- a/CondFormats/HcalObjects/src/HcalCondObjectContainerBase.cc +++ b/CondFormats/HcalObjects/src/HcalCondObjectContainerBase.cc @@ -12,7 +12,7 @@ HcalCondObjectContainerBase::HcalCondObjectContainerBase(const HcalTopology* top if (topo) packedIndexVersion_=topo->topoVersion(); } -void HcalCondObjectContainerBase::setTopo(const HcalTopology* topo) const { +void HcalCondObjectContainerBase::setTopo(const HcalTopology* topo) { if (topo && !topo->denseIdConsistent(packedIndexVersion_)) { edm::LogError("HCAL") << std::string("Inconsistent dense packing between current topology (") << topo->topoVersion() << ") and calibration object (" << packedIndexVersion_ << ")"; } diff --git a/CondTools/Hcal/plugins/HcalChannelQualityPopConAnalyzer.cc b/CondTools/Hcal/plugins/HcalChannelQualityPopConAnalyzer.cc index 8a07126da88d1..a1786af2fc233 100644 --- a/CondTools/Hcal/plugins/HcalChannelQualityPopConAnalyzer.cc +++ b/CondTools/Hcal/plugins/HcalChannelQualityPopConAnalyzer.cc @@ -26,7 +26,7 @@ class HcalChannelQualityPopConAnalyzer: public popcon::PopConAnalyzer objecthandle; - esetup.get().get(objecthandle); + esetup.get().get("withTopo",objecthandle); myDBObject = new HcalChannelQuality(*objecthandle.product() ); } diff --git a/DQM/HcalMonitorClient/interface/HcalMonitorClient.h b/DQM/HcalMonitorClient/interface/HcalMonitorClient.h index 63d02dfce51bd..41864c48b35cf 100644 --- a/DQM/HcalMonitorClient/interface/HcalMonitorClient.h +++ b/DQM/HcalMonitorClient/interface/HcalMonitorClient.h @@ -117,7 +117,7 @@ class HcalMonitorClient: public edm::EDAnalyzer std::vector clients_; DQMStore* dqmStore_; - HcalChannelQuality* chanquality_; + const HcalChannelQuality* chanquality_; HcalSummaryClient* summaryClient_; EtaPhiHists* ChannelStatus; diff --git a/DQM/HcalMonitorClient/src/HcalMonitorClient.cc b/DQM/HcalMonitorClient/src/HcalMonitorClient.cc index 7c8fc3062e005..631488411efee 100644 --- a/DQM/HcalMonitorClient/src/HcalMonitorClient.cc +++ b/DQM/HcalMonitorClient/src/HcalMonitorClient.cc @@ -193,9 +193,8 @@ void HcalMonitorClient::beginRun(const edm::Run& r, const edm::EventSetup& c) c.get().get(topo); edm::ESHandle p; - c.get().get(p); - chanquality_= new HcalChannelQuality(*p.product()); - if (!chanquality_->topo()) chanquality_->setTopo(topo.product()); + c.get().get("withTopo",p); + chanquality_= p.product(); if (dqmStore_ && ChannelStatus==0) { diff --git a/DQM/HcalMonitorTasks/src/HcalBeamMonitor.cc b/DQM/HcalMonitorTasks/src/HcalBeamMonitor.cc index 0c24259d637e6..11db928f5fb87 100644 --- a/DQM/HcalMonitorTasks/src/HcalBeamMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalBeamMonitor.cc @@ -432,8 +432,8 @@ void HcalBeamMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c) // Get Channel quality info for the run // Exclude bad channels from overall calculation edm::ESHandle p; - c.get().get(p); - HcalChannelQuality* chanquality = new HcalChannelQuality(*p.product()); + c.get().get("withTopo",p); + const HcalChannelQuality* chanquality = p.product(); std::vector mydetids = chanquality->getAllChannels(); for (unsigned int i=0;igetValues(id); - HcalChannelStatus* mystatus=new HcalChannelStatus(origstatus->rawId(),origstatus->getValue()); - if (mystatus->isBitSet(HcalChannelStatus::HcalCellHot)) + HcalChannelStatus mystatus(origstatus->rawId(),origstatus->getValue()); + if (mystatus.isBitSet(HcalChannelStatus::HcalCellHot)) BadCells_[id]=HcalChannelStatus::HcalCellHot; - else if (mystatus->isBitSet(HcalChannelStatus::HcalCellDead)) + else if (mystatus.isBitSet(HcalChannelStatus::HcalCellDead)) BadCells_[id]=HcalChannelStatus::HcalCellDead; - if (mystatus->isBitSet(HcalChannelStatus::HcalCellHot) || - mystatus->isBitSet(HcalChannelStatus::HcalCellDead)) + if (mystatus.isBitSet(HcalChannelStatus::HcalCellHot) || + mystatus.isBitSet(HcalChannelStatus::HcalCellDead)) { if (id.depth()==1) --ring1totalchannels_; else if (id.depth()==2) --ring2totalchannels_; } - delete mystatus; } // if ((id.depth()==1) ... } // for (unsigned int i=0;...) diff --git a/DQM/HcalMonitorTasks/src/HcalDeadCellMonitor.cc b/DQM/HcalMonitorTasks/src/HcalDeadCellMonitor.cc index 510e90d56551a..f23dc7a00c15e 100644 --- a/DQM/HcalMonitorTasks/src/HcalDeadCellMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalDeadCellMonitor.cc @@ -407,8 +407,8 @@ void HcalDeadCellMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c if (badChannelStatusMask_>0) { edm::ESHandle p; - c.get().get(p); - HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product()); + c.get().get("withTopo",p); + const HcalChannelQuality* chanquality= p.product(); std::vector mydetids = chanquality->getAllChannels(); for (std::vector::const_iterator i = mydetids.begin(); i!=mydetids.end(); @@ -420,7 +420,6 @@ void HcalDeadCellMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c if ((status & badChannelStatusMask_)) KnownBadCells_[id.rawId()]=status; } - delete chanquality; } // if (badChannelStatusMask_>0) return; } //void HcalDeadCellMonitor::beginRun(...) diff --git a/DQM/HcalMonitorTasks/src/HcalDetDiagLEDMonitor.cc b/DQM/HcalMonitorTasks/src/HcalDetDiagLEDMonitor.cc index 77ad694320acc..8e0497a7a9022 100644 --- a/DQM/HcalMonitorTasks/src/HcalDetDiagLEDMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalDetDiagLEDMonitor.cc @@ -305,8 +305,8 @@ void HcalDetDiagLEDMonitor::beginRun(const edm::Run& run, const edm::EventSetup& if (mergeRuns_==false) this->reset(); edm::ESHandle p; - c.get().get(p); - HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product()); + c.get().get("withTopo",p); + const HcalChannelQuality* chanquality= p.product(); std::vector mydetids = chanquality->getAllChannels(); KnownBadCells_.clear(); diff --git a/DQM/HcalMonitorTasks/src/HcalDetDiagLaserMonitor.cc b/DQM/HcalMonitorTasks/src/HcalDetDiagLaserMonitor.cc index 81a23b72d2244..2e17fcd0212d6 100644 --- a/DQM/HcalMonitorTasks/src/HcalDetDiagLaserMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalDetDiagLaserMonitor.cc @@ -425,8 +425,8 @@ HcalDetDiagLaserMonitor::HcalDetDiagLaserMonitor(const edm::ParameterSet& iConfi } void HcalDetDiagLaserMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c){ edm::ESHandle p; - c.get().get(p); - HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product()); + c.get().get("withTopo",p); + const HcalChannelQuality* chanquality= p.product(); std::vector mydetids = chanquality->getAllChannels(); KnownBadCells_.clear(); diff --git a/DQM/HcalMonitorTasks/src/HcalDetDiagPedestalMonitor.cc b/DQM/HcalMonitorTasks/src/HcalDetDiagPedestalMonitor.cc index ec119b7bfd949..11a0724b528b2 100644 --- a/DQM/HcalMonitorTasks/src/HcalDetDiagPedestalMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalDetDiagPedestalMonitor.cc @@ -296,8 +296,8 @@ void HcalDetDiagPedestalMonitor::beginRun(const edm::Run& run, const edm::EventS emap=conditions_->getHcalMapping(); edm::ESHandle p; - c.get().get(p); - HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product()); + c.get().get("withTopo",p); + const HcalChannelQuality* chanquality= p.product(); std::vector mydetids = chanquality->getAllChannels(); KnownBadCells_.clear(); diff --git a/DQM/HcalMonitorTasks/src/HcalDigiMonitor.cc b/DQM/HcalMonitorTasks/src/HcalDigiMonitor.cc index 8029d7dd0b9e3..299e95fdb4b56 100644 --- a/DQM/HcalMonitorTasks/src/HcalDigiMonitor.cc +++ b/DQM/HcalMonitorTasks/src/HcalDigiMonitor.cc @@ -350,8 +350,8 @@ void HcalDigiMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c) // Get all pedestals by Cap ID edm::ESHandle p; - c.get().get(p); - HcalChannelQuality *chanquality= new HcalChannelQuality(*p.product()); + c.get().get("withTopo",p); + const HcalChannelQuality *chanquality= p.product(); std::vector mydetids = chanquality->getAllChannels(); PedestalsByCapId_.clear(); @@ -377,15 +377,14 @@ void HcalDigiMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c) if (tevt_==0) this->setup(); // create all histograms; not necessary if merging runs together if (mergeRuns_==false) this->reset(); // call reset at start of all runs - delete chanquality; // Get known dead cells for this run KnownBadCells_.clear(); if (badChannelStatusMask_>0) { edm::ESHandle p; - c.get().get(p); - HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product()); + c.get().get("withTopo",p); + const HcalChannelQuality* chanquality= p.product(); std::vector mydetids = chanquality->getAllChannels(); for (std::vector::const_iterator i = mydetids.begin(); i!=mydetids.end(); @@ -399,7 +398,6 @@ void HcalDigiMonitor::beginRun(const edm::Run& run, const edm::EventSetup& c) KnownBadCells_[id.rawId()]=status; } } - delete chanquality; } // if (badChannelStatusMask_>0) } // void HcalDigiMonitor::beginRun() diff --git a/DQMOffline/Hcal/src/HcalRecHitsAnalyzer.cc b/DQMOffline/Hcal/src/HcalRecHitsAnalyzer.cc index 5dd4b79e58e17..9f24a4d3d64ec 100644 --- a/DQMOffline/Hcal/src/HcalRecHitsAnalyzer.cc +++ b/DQMOffline/Hcal/src/HcalRecHitsAnalyzer.cc @@ -659,11 +659,8 @@ void HcalRecHitsAnalyzer::analyze(edm::Event const& ev, edm::EventSetup const& c // HCAL channel status map **************************************** edm::ESHandle hcalChStatus; - c.get().get( hcalChStatus ); + c.get().get( "withTopo", hcalChStatus ); theHcalChStatus = hcalChStatus.product(); - edm::ESHandle topo; - c.get().get(topo); - if (!theHcalChStatus->topo()) theHcalChStatus->setTopo(topo.product()); // Assignment of severity levels ********************************** edm::ESHandle hcalSevLvlComputerHndl; diff --git a/RecoEgamma/EgammaHLTProducers/interface/EgammaHLTHcalIsolationProducersRegional.h b/RecoEgamma/EgammaHLTProducers/interface/EgammaHLTHcalIsolationProducersRegional.h index a8c053fbee604..cec8b695790b6 100644 --- a/RecoEgamma/EgammaHLTProducers/interface/EgammaHLTHcalIsolationProducersRegional.h +++ b/RecoEgamma/EgammaHLTProducers/interface/EgammaHLTHcalIsolationProducersRegional.h @@ -20,7 +20,7 @@ #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDProducer.h" #include "FWCore/Framework/interface/Event.h" - #include "FWCore/Framework/interface/ESHandle.h" +#include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/MakerMacros.h" #include "FWCore/ParameterSet/interface/ParameterSet.h" diff --git a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationProducersRegional.cc b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationProducersRegional.cc index 9d77ecea92f1c..0bb8ce2744572 100644 --- a/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationProducersRegional.cc +++ b/RecoEgamma/EgammaHLTProducers/src/EgammaHLTHcalIsolationProducersRegional.cc @@ -14,8 +14,9 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h" -#include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" #include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" +#include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" + #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h" #include "Geometry/CaloGeometry/interface/CaloGeometry.h" @@ -88,9 +89,10 @@ void EgammaHLTHcalIsolationProducersRegional::produce(edm::Event& iEvent, const iEvent.getByToken(hbheRecHitProducer_, hbheRecHitHandle); const HBHERecHitCollection* hbheRecHitCollection = hbheRecHitHandle.product(); - edm::ESHandle hcalChStatus; - iSetup.get().get(hcalChStatus); - + edm::ESHandle hcalChStatusHandle; + iSetup.get().get( "withTopo", hcalChStatusHandle ); + const HcalChannelQuality* hcalChStatus = hcalChStatusHandle.product(); + edm::ESHandle hcalSevLvlComp; iSetup.get().get(hcalSevLvlComp); @@ -121,7 +123,7 @@ void EgammaHLTHcalIsolationProducersRegional::produce(edm::Event& iEvent, const if(doEtSum_) { isol = isolAlgo_->getEtSum(recoEcalCandRef->superCluster()->eta(), recoEcalCandRef->superCluster()->phi(),hbheRecHitCollection,caloGeom, - hcalSevLvlComp.product(),hcalChStatus.product()); + hcalSevLvlComp.product(),hcalChStatus); if (doRhoCorrection_) { if (fabs(recoEcalCandRef->superCluster()->eta()) < 1.442) @@ -132,7 +134,7 @@ void EgammaHLTHcalIsolationProducersRegional::produce(edm::Event& iEvent, const } else { isol = isolAlgo_->getESum(recoEcalCandRef->superCluster()->eta(),recoEcalCandRef->superCluster()->phi(), hbheRecHitCollection,caloGeom, - hcalSevLvlComp.product(),hcalChStatus.product()); + hcalSevLvlComp.product(),hcalChStatus); } isoMap.insert(recoEcalCandRef, isol); diff --git a/RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.cc b/RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.cc index 7e6ed2a806094..16a51dbe8546d 100644 --- a/RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.cc +++ b/RecoLocalCalo/CaloTowersCreator/src/CaloTowersCreator.cc @@ -144,11 +144,10 @@ void CaloTowersCreator::produce(edm::Event& e, const edm::EventSetup& c) { // HCAL channel status map **************************************** edm::ESHandle hcalChStatus; - c.get().get( hcalChStatus ); + c.get().get( "withTopo", hcalChStatus ); + const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product(); - - if (!dbHcalChStatus->topo()) dbHcalChStatus->setTopo(htopo.product()); - + // Assignment of severity levels ********************************** edm::ESHandle hcalSevLvlComputerHndl; c.get().get(hcalSevLvlComputerHndl); diff --git a/RecoLocalCalo/HcalRecAlgos/test/HcalRecHitReflagger.cc b/RecoLocalCalo/HcalRecAlgos/test/HcalRecHitReflagger.cc index dc52fabb672ef..576936b59c878 100644 --- a/RecoLocalCalo/HcalRecAlgos/test/HcalRecHitReflagger.cc +++ b/RecoLocalCalo/HcalRecAlgos/test/HcalRecHitReflagger.cc @@ -168,7 +168,7 @@ HcalRecHitReflagger::~HcalRecHitReflagger() void HcalRecHitReflagger::beginRun(const Run& r, const EventSetup& c) { edm::ESHandle p; - c.get().get(p); + c.get().get("withTopo",p); const HcalChannelQuality& chanquality_(*p.product()); std::vector mydetids = chanquality_.getAllChannels(); diff --git a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc index 1a6380585e868..5f5e9f7e99199 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.cc @@ -12,13 +12,14 @@ Original Author: John Paul Chou (Brown University) #include "Geometry/Records/interface/IdealGeometryRecord.h" #include "DataFormats/JetReco/interface/TrackExtrapolation.h" #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h" -#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalCaloFlagLabels.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgoRcd.h" #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" #include "RecoMET/METAlgorithms/interface/HcalHPDRBXMap.h" +#include "CondFormats/HcalObjects/interface/HcalChannelQuality.h" +#include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h" HBHEIsolatedNoiseReflagger::HBHEIsolatedNoiseReflagger(const edm::ParameterSet& iConfig) : @@ -78,8 +79,9 @@ HBHEIsolatedNoiseReflagger::produce(edm::Event& iEvent, const edm::EventSetup& e const EcalChannelStatus* dbEcalChStatus = ecalChStatus.product(); // get the HCAL channel status map + edm::ESHandle hcalChStatus; - evSetup.get().get( hcalChStatus ); + evSetup.get().get( "withTopo", hcalChStatus ); const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product(); // get the severity level computers diff --git a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.h b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.h index 0bd6250d79bd1..5a9d5fcc57679 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.h +++ b/RecoLocalCalo/HcalRecProducers/src/HBHEIsolatedNoiseReflagger.h @@ -7,6 +7,7 @@ Description: "Reflags" HB/HE hits based on their ECAL, HCAL, and tracking isolat Original Author: John Paul Chou (Brown University) Thursday, September 2, 2010 */ +#include #include "FWCore/Framework/interface/Frameworkfwd.h" #include "FWCore/Framework/interface/EDProducer.h" @@ -22,7 +23,7 @@ class HBHEIsolatedNoiseReflagger : public edm::EDProducer { private: - virtual void produce(edm::Event&, const edm::EventSetup&); + virtual void produce(edm::Event&, const edm::EventSetup&) override; void DumpHBHEHitMap(std::vector& i) const; diff --git a/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc b/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc index 2205e1ab509c4..7a5f3b9046060 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.cc @@ -5,7 +5,6 @@ #include "FWCore/Framework/interface/ESHandle.h" #include "FWCore/Framework/interface/EventSetup.h" #include "CalibFormats/HcalObjects/interface/HcalCoderDb.h" -#include "CalibFormats/HcalObjects/interface/HcalDbService.h" #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputer.h" #include "RecoLocalCalo/HcalRecAlgos/interface/HcalSeverityLevelComputerRcd.h" @@ -46,8 +45,7 @@ HcalHitReconstructor::HcalHitReconstructor(edm::ParameterSet const& conf): mcOOTCorrectionCategory_("MC"), setPileupCorrection_(0), setPileupCorrectionForNegative_(0), - paramTS(0), - theTopology(0) + paramTS(0) { // register for data access tok_hbhe_ = consumes(inputLabel_); @@ -260,22 +258,21 @@ HcalHitReconstructor::~HcalHitReconstructor() { delete hbhePulseShapeFlagSetter_; delete hfS9S1_; delete hfPET_; - delete theTopology; delete paramTS; } void HcalHitReconstructor::beginRun(edm::Run const&r, edm::EventSetup const & es){ + edm::ESHandle htopo; + es.get().get(htopo); + if ( tsFromDB_== true || recoParamsFromDB_ == true ) { edm::ESHandle p; es.get().get(p); paramTS = new HcalRecoParams(*p.product()); + paramTS->setTopo(htopo.product()); - edm::ESHandle htopo; - es.get().get(htopo); - theTopology=new HcalTopology(*htopo); - paramTS->setTopo(theTopology); @@ -288,16 +285,14 @@ void HcalHitReconstructor::beginRun(edm::Run const&r, edm::EventSetup const & es { edm::ESHandle p; es.get().get(p); - HFDigiTimeParams = p.product(); + HFDigiTimeParams.reset( new HcalFlagHFDigiTimeParams( *p ) ); - if (theTopology==0) { - edm::ESHandle htopo; - es.get().get(htopo); - theTopology=new HcalTopology(*htopo); - } - HFDigiTimeParams->setTopo(theTopology); + edm::ESHandle htopo; + es.get().get(htopo); + HFDigiTimeParams->setTopo(htopo.product()); } + reco_.beginRun(es); } @@ -329,11 +324,8 @@ void HcalHitReconstructor::produce(edm::Event& e, const edm::EventSetup& eventSe if (useLeakCorrection_) reco_.setLeakCorrection(); edm::ESHandle p; - eventSetup.get().get(p); - //DLHcalChannelQuality* myqual = new HcalChannelQuality(*p.product()); + eventSetup.get().get("withTopo",p); const HcalChannelQuality* myqual = p.product(); - if (!myqual->topo()) myqual->setTopo(topo.product()); - edm::ESHandle mycomputer; eventSetup.get().get(mycomputer); diff --git a/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.h b/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.h index c1a326910e4ec..06f633db3c3ae 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.h +++ b/RecoLocalCalo/HcalRecProducers/src/HcalHitReconstructor.h @@ -1,6 +1,8 @@ #ifndef HCALHITRECONSTRUCTOR_H #define HCALHITRECONSTRUCTOR_H 1 +#include + #include "FWCore/Framework/interface/stream/EDProducer.h" #include "FWCore/Framework/interface/Event.h" #include "DataFormats/Common/interface/Handle.h" @@ -31,6 +33,7 @@ #include "RecoLocalCalo/HcalRecAlgos/interface/HcalHF_PETalgorithm.h" #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h" #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h" +#include "CalibFormats/HcalObjects/interface/HcalDbService.h" /** \class HcalHitReconstructor @@ -47,7 +50,7 @@ class HcalTopology; virtual void beginRun(edm::Run const&r, edm::EventSetup const & es) override final; virtual void endRun(edm::Run const&r, edm::EventSetup const & es) override final; - virtual void produce(edm::Event& e, const edm::EventSetup& c); + virtual void produce(edm::Event& e, const edm::EventSetup& c) override; private: typedef void (HcalSimpleRecAlgo::*SetCorrectionFcn)(boost::shared_ptr); @@ -106,9 +109,7 @@ class HcalTopology; SetCorrectionFcnForNegative setPileupCorrectionForNegative_; HcalRecoParams* paramTS; // firstSample & sampleToAdd from DB - const HcalFlagHFDigiTimeParams* HFDigiTimeParams; // HF DigiTime parameters - - HcalTopology *theTopology; + std::unique_ptr HFDigiTimeParams; // HF DigiTime parameters }; #endif diff --git a/RecoLocalCalo/HcalRecProducers/src/HcalHitSelection.cc b/RecoLocalCalo/HcalRecProducers/src/HcalHitSelection.cc index bb02e01792092..35f929845e01f 100644 --- a/RecoLocalCalo/HcalRecProducers/src/HcalHitSelection.cc +++ b/RecoLocalCalo/HcalRecProducers/src/HcalHitSelection.cc @@ -148,7 +148,7 @@ HcalHitSelection::~HcalHitSelection() void HcalHitSelection::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { - iSetup.get().get(theHcalChStatus); + iSetup.get().get("withTopo", theHcalChStatus); iSetup.get().get(theHcalSevLvlComputer); edm::Handle hbhe; diff --git a/RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc b/RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc index b3112866ed602..ac8281011d114 100644 --- a/RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc +++ b/RecoLocalCalo/HcalRecProducers/src/ZdcHitReconstructor.cc @@ -84,8 +84,8 @@ void ZdcHitReconstructor::produce(edm::Event& e, const edm::EventSetup& eventSet eventSetup.get().get(conditions); edm::ESHandle p; - eventSetup.get().get(p); - HcalChannelQuality* myqual = new HcalChannelQuality(*p.product()); + eventSetup.get().get("withTopo", p); + const HcalChannelQuality* myqual = p.product(); edm::ESHandle mycomputer; eventSetup.get().get(mycomputer); @@ -146,5 +146,4 @@ void ZdcHitReconstructor::produce(edm::Event& e, const edm::EventSetup& eventSet e.put(rec); } // else if (det_==DetId::Calo...) - delete myqual; } // void HcalHitReconstructor::produce(...) diff --git a/RecoMET/METFilters/plugins/EcalDeadCellDeltaRFilter.cc b/RecoMET/METFilters/plugins/EcalDeadCellDeltaRFilter.cc index d9046c3eaef35..6177d5c521f3d 100644 --- a/RecoMET/METFilters/plugins/EcalDeadCellDeltaRFilter.cc +++ b/RecoMET/METFilters/plugins/EcalDeadCellDeltaRFilter.cc @@ -268,7 +268,7 @@ void EcalDeadCellDeltaRFilter::envSet(const edm::EventSetup& iSetup) { iSetup.get().get(ttMap_); iSetup.get ().get(ecalStatus); - iSetup.get().get(hcalStatus); + iSetup.get().get("withTopo",hcalStatus); iSetup.get ().get(geometry); if( !ecalStatus.isValid() ) throw "Failed to get ECAL channel status!"; diff --git a/RecoMET/METProducers/src/HcalNoiseInfoProducer.cc b/RecoMET/METProducers/src/HcalNoiseInfoProducer.cc index 511398a3ab246..c95d956243d41 100644 --- a/RecoMET/METProducers/src/HcalNoiseInfoProducer.cc +++ b/RecoMET/METProducers/src/HcalNoiseInfoProducer.cc @@ -324,7 +324,7 @@ HcalNoiseInfoProducer::filldigis(edm::Event& iEvent, const edm::EventSetup& iSet edm::ESHandle conditions; iSetup.get().get(conditions); edm::ESHandle qualhandle; - iSetup.get().get(qualhandle); + iSetup.get().get("withTopo",qualhandle); const HcalChannelQuality* myqual = qualhandle.product(); edm::ESHandle mycomputer; iSetup.get().get(mycomputer); @@ -501,7 +501,7 @@ HcalNoiseInfoProducer::fillrechits(edm::Event& iEvent, const edm::EventSetup& iS { // get the HCAL channel status map edm::ESHandle hcalChStatus; - iSetup.get().get( hcalChStatus ); + iSetup.get().get( "withTopo", hcalChStatus ); const HcalChannelQuality* dbHcalChStatus = hcalChStatus.product(); // get the severity level computer diff --git a/RecoMuon/MuonIdentification/src/MuonHOAcceptance.cc b/RecoMuon/MuonIdentification/src/MuonHOAcceptance.cc index 5e553982b80f4..2717b7dd71617 100644 --- a/RecoMuon/MuonIdentification/src/MuonHOAcceptance.cc +++ b/RecoMuon/MuonIdentification/src/MuonHOAcceptance.cc @@ -166,8 +166,8 @@ void MuonHOAcceptance::initIds(edm::EventSetup const& eSetup) { deadIds.clear(); edm::ESHandle p; - eSetup.get().get(p); - HcalChannelQuality *myqual = new HcalChannelQuality(*p.product()); + eSetup.get().get("withTopo",p); + const HcalChannelQuality *myqual = p.product(); edm::ESHandle mycomputer; eSetup.get().get(mycomputer); @@ -212,7 +212,6 @@ void MuonHOAcceptance::initIds(edm::EventSetup const& eSetup) { buildDeadAreas(); buildSiPMAreas(); inited = true; - delete myqual; } void MuonHOAcceptance::buildDeadAreas() { diff --git a/RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h b/RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h index d569728445cb5..2327385d4d757 100644 --- a/RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h +++ b/RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTests.h @@ -1,6 +1,7 @@ #ifndef RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h #define RecoParticleFlow_PFClusterProducer_PFEcalRecHitQTests_h +#include #include "RecoParticleFlow/PFClusterProducer/interface/PFRecHitQTestBase.h" @@ -111,9 +112,8 @@ class PFRecHitQTestHCALChannel : public PFRecHitQTestBase { edm::ESHandle topo; iSetup.get().get(topo); edm::ESHandle hcalChStatus; - iSetup.get().get( hcalChStatus ); + iSetup.get().get( "withTopo", hcalChStatus ); theHcalChStatus_ = hcalChStatus.product(); - if (!theHcalChStatus_->topo()) theHcalChStatus_->setTopo(topo.product()); edm::ESHandle hcalSevLvlComputerHndl; iSetup.get().get(hcalSevLvlComputerHndl); hcalSevLvlComputer_ = hcalSevLvlComputerHndl.product(); diff --git a/RecoParticleFlow/PFClusterProducer/plugins/PFCTRecHitProducer.cc b/RecoParticleFlow/PFClusterProducer/plugins/PFCTRecHitProducer.cc index 63c7a9ab247df..347cfaf179c6e 100644 --- a/RecoParticleFlow/PFClusterProducer/plugins/PFCTRecHitProducer.cc +++ b/RecoParticleFlow/PFClusterProducer/plugins/PFCTRecHitProducer.cc @@ -829,7 +829,7 @@ PFCTRecHitProducer::beginLuminosityBlock(const edm::LuminosityBlock& lumi, // Get cleaned channels in the HCAL and HF // HCAL channel status map **************************************** edm::ESHandle hcalChStatus; - es.get().get( hcalChStatus ); + es.get().get( "withTopo", hcalChStatus ); theHcalChStatus = hcalChStatus.product(); // Retrieve the good/bad ECAL channels from the DB diff --git a/SimCalorimetry/HcalSimAlgos/interface/HcalShapes.h b/SimCalorimetry/HcalSimAlgos/interface/HcalShapes.h index b3ee416a9222f..f34d79e7ce6fd 100644 --- a/SimCalorimetry/HcalSimAlgos/interface/HcalShapes.h +++ b/SimCalorimetry/HcalSimAlgos/interface/HcalShapes.h @@ -32,7 +32,7 @@ class HcalShapes : public CaloShapes private: // hardcoded, if we can't figure it out form the DB const CaloVShape * defaultShape(const DetId & detId) const; - const HcalMCParams * theMCParams; + HcalMCParams * theMCParams; const HcalTopology * theTopology; typedef std::map ShapeMap; ShapeMap theShapes; diff --git a/Validation/HcalRecHits/src/HcalRecHitsValidation.cc b/Validation/HcalRecHits/src/HcalRecHitsValidation.cc index aea210684fccd..b4154a03ef8f6 100644 --- a/Validation/HcalRecHits/src/HcalRecHitsValidation.cc +++ b/Validation/HcalRecHits/src/HcalRecHitsValidation.cc @@ -784,15 +784,10 @@ void HcalRecHitsValidation::analyze(edm::Event const& ev, edm::EventSetup const& // HCAL channel status map **************************************** edm::ESHandle hcalChStatus; - c.get().get( hcalChStatus ); - - edm::ESHandle topo; - c.get().get(topo); + c.get().get( "withTopo", hcalChStatus ); theHcalChStatus = hcalChStatus.product(); - if( !theHcalChStatus->topo() ) theHcalChStatus->setTopo(topo.product()); - // Assignment of severity levels ********************************** edm::ESHandle hcalSevLvlComputerHndl; c.get().get(hcalSevLvlComputerHndl);