diff --git a/Validation/EcalDigis/interface/EcalMixingModuleValidation.h b/Validation/EcalDigis/interface/EcalMixingModuleValidation.h index 2f47e0dbbfaa0..ccb218ea55d58 100644 --- a/Validation/EcalDigis/interface/EcalMixingModuleValidation.h +++ b/Validation/EcalDigis/interface/EcalMixingModuleValidation.h @@ -149,16 +149,16 @@ class EcalMixingModuleValidation : public DQMOneEDAnalyzer<> { MonitorElement* meEEShapeRatio_; MonitorElement* meESShapeRatio_; - const EcalSimParameterMap* theParameterMap; + std::unique_ptr theParameterMap; //const CaloVShape * theEcalShape; - ESShape* theESShape; - EBShape* theEBShape; - EEShape* theEEShape; + std::unique_ptr theESShape; + std::unique_ptr theEBShape; + std::unique_ptr theEEShape; //CaloHitResponse * theEcalResponse; - CaloHitResponse* theESResponse; - CaloHitResponse* theEBResponse; - CaloHitResponse* theEEResponse; + std::unique_ptr theESResponse; + std::unique_ptr theEBResponse; + std::unique_ptr theEEResponse; void computeSDBunchDigi(const edm::EventSetup& eventSetup, const MixCollection& theHits, diff --git a/Validation/EcalDigis/src/EcalMixingModuleValidation.cc b/Validation/EcalDigis/src/EcalMixingModuleValidation.cc index 64265c8e0a57e..64712da5c6dae 100644 --- a/Validation/EcalDigis/src/EcalMixingModuleValidation.cc +++ b/Validation/EcalDigis/src/EcalMixingModuleValidation.cc @@ -49,16 +49,16 @@ EcalMixingModuleValidation::EcalMixingModuleValidation(const edm::ParameterSet& doPhotostatistics = false; - theParameterMap = new EcalSimParameterMap(simHitToPhotoelectronsBarrel, - simHitToPhotoelectronsEndcap, - photoelectronsToAnalogBarrel, - photoelectronsToAnalogEndcap, - samplingFactor, - timePhase, - readoutFrameSize, - binOfMaximum, - doPhotostatistics, - syncPhase); + theParameterMap = std::make_unique(simHitToPhotoelectronsBarrel, + simHitToPhotoelectronsEndcap, + photoelectronsToAnalogBarrel, + photoelectronsToAnalogEndcap, + samplingFactor, + timePhase, + readoutFrameSize, + binOfMaximum, + doPhotostatistics, + syncPhase); //theEcalShape = new EcalShape(timePhase); //theEcalResponse = new CaloHitResponse(theParameterMap, theEcalShape); @@ -71,13 +71,13 @@ EcalMixingModuleValidation::EcalMixingModuleValidation(const edm::ParameterSet& double ESMIPkeV = ps.getParameter("ESMIPkeV"); */ - theESShape = new ESShape(); - theEBShape = new EBShape(consumesCollector()); - theEEShape = new EEShape(consumesCollector()); + theESShape = std::make_unique(); + theEBShape = std::make_unique(consumesCollector()); + theEEShape = std::make_unique(consumesCollector()); - theESResponse = new CaloHitResponse(theParameterMap, theESShape); - theEBResponse = new CaloHitResponse(theParameterMap, theEBShape); - theEEResponse = new CaloHitResponse(theParameterMap, theEEShape); + theESResponse = std::make_unique(theParameterMap.get(), theESShape.get()); + theEBResponse = std::make_unique(theParameterMap.get(), theEBShape.get()); + theEEResponse = std::make_unique(theParameterMap.get(), theEEShape.get()); // double effwei = 1.; @@ -614,12 +614,12 @@ void EcalMixingModuleValidation::checkCalibrations(edm::EventSetup const& eventS // ADC -> GeV Scale const EcalADCToGeVConstant* agc = &eventSetup.getData(pAgc); - EcalMGPAGainRatio* defaultRatios = new EcalMGPAGainRatio(); + EcalMGPAGainRatio defaultRatios; gainConv_[1] = 1.; - gainConv_[2] = defaultRatios->gain12Over6(); - gainConv_[3] = gainConv_[2] * (defaultRatios->gain6Over1()); - gainConv_[0] = gainConv_[2] * (defaultRatios->gain6Over1()); + gainConv_[2] = defaultRatios.gain12Over6(); + gainConv_[3] = gainConv_[2] * (defaultRatios.gain6Over1()); + gainConv_[0] = gainConv_[2] * (defaultRatios.gain6Over1()); LogDebug("EcalDigi") << " Gains conversions: " << "\n" @@ -627,8 +627,6 @@ void EcalMixingModuleValidation::checkCalibrations(edm::EventSetup const& eventS << " g2 = " << gainConv_[2] << "\n" << " g3 = " << gainConv_[3]; - delete defaultRatios; - const double barrelADCtoGeV_ = agc->getEBValue(); LogDebug("EcalDigi") << " Barrel GeV/ADC = " << barrelADCtoGeV_; const double endcapADCtoGeV_ = agc->getEEValue();