diff --git a/[refs] b/[refs] index c3c74ae27a644..1132318f639bb 100644 --- a/[refs] +++ b/[refs] @@ -2,4 +2,4 @@ "refs/heads/hi_d20131223": d7335b053d7fe03e98f9f59af6a20004362628e8 refs/heads/gh-pages: a3d9046c56a3ca3dc64ad63f7295276c81ac876a "refs/heads/analysis_53X_01": 3019419e9784b2b092fc6b5c503b2e0177cbe926 -"refs/heads/CMSSW_7_0_X": 8354481795ad9142173424c2e4484f8e083b7d8d +"refs/heads/CMSSW_7_0_X": 1da4238ea57a54411f804a977236446f5bcf6ffc diff --git a/trunk/CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h b/trunk/CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h index 36639cd76466d..45af5bab9ff8e 100644 --- a/trunk/CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h +++ b/trunk/CalibCalorimetry/CaloMiscalibTools/interface/HcalRecHitRecalib.h @@ -15,8 +15,8 @@ */ // // Original Author: Luca Malgeri -// Created: $Date: 2006/11/21 16:47:46 $ -// $Id: HcalRecHitRecalib.h,v 1.3 2006/11/21 16:47:46 malgeri Exp $ +// Created: $Date: 2007/09/11 13:46:29 $ +// $Id: HcalRecHitRecalib.h,v 1.4 2007/09/11 13:46:29 malgeri Exp $ // // @@ -35,40 +35,28 @@ #include "FWCore/ParameterSet/interface/ParameterSet.h" #include "CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibMapHcal.h" -// -// class decleration -// - -class HcalRecHitRecalib : public edm::EDProducer { - public: - explicit HcalRecHitRecalib(const edm::ParameterSet&); - ~HcalRecHitRecalib(); - - - virtual void produce(edm::Event &, const edm::EventSetup&); - - private: - // ----------member data --------------------------- - - // edm::InputTag hbheLabel_,hoLabel_,hfLabel_; - // std::string HBHEHitsProducer_; - // std::string HFHitsProducer_; - // std::string HOHitsProducer_; - // std::string HBHEHits_; - // std::string HFHits_; - // std::string HOHits_; - - edm::InputTag hbheLabel_,hoLabel_,hfLabel_; - std::string RecalibHBHEHits_; - std::string RecalibHFHits_; - std::string RecalibHOHits_; - - std::string hcalfile_; - std::string hcalfileinpath_; - - CaloMiscalibMapHcal mapHcal_; - double refactor_; - double refactor_mean_; - +class HcalRecHitRecalib : public edm::EDProducer +{ +public: + explicit HcalRecHitRecalib(const edm::ParameterSet&); + ~HcalRecHitRecalib(); + + virtual void beginRun(edm::Run&, edm::EventSetup const&); + virtual void produce(edm::Event &, const edm::EventSetup&); + +private: + edm::InputTag hbheLabel_; + edm::InputTag hoLabel_; + edm::InputTag hfLabel_; + std::string RecalibHBHEHits_; + std::string RecalibHFHits_; + std::string RecalibHOHits_; + + std::string hcalfile_; + std::string hcalfileinpath_; + + CaloMiscalibMapHcal mapHcal_; + double refactor_; + double refactor_mean_; }; #endif diff --git a/trunk/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc b/trunk/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc index 81d189ce2fa6c..d87c044dd57a5 100644 --- a/trunk/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc +++ b/trunk/CalibCalorimetry/CaloMiscalibTools/plugins/HcalRecHitRecalib.cc @@ -3,6 +3,7 @@ #include "DataFormats/Common/interface/Handle.h" #include "FWCore/ParameterSet/interface/FileInPath.h" +#include "FWCore/Framework/interface/ESHandle.h" #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" @@ -15,18 +16,6 @@ HcalRecHitRecalib::HcalRecHitRecalib(const edm::ParameterSet& iConfig) hoLabel_ = iConfig.getParameter("hoInput"); hfLabel_ = iConfig.getParameter("hfInput"); - HcalTopologyMode::Mode mode = HcalTopologyMode::LHC; - int maxDepthHB = 2; - int maxDepthHE = 3; - if( iConfig.exists( "hcalTopologyConstants" )) - { - const edm::ParameterSet hcalTopoConsts = iConfig.getParameter( "hcalTopologyConstants" ); - StringToEnumParser parser; - mode = (HcalTopologyMode::Mode) parser.parseString(hcalTopoConsts.getParameter("mode")); - maxDepthHB = hcalTopoConsts.getParameter("maxDepthHB"); - maxDepthHE = hcalTopoConsts.getParameter("maxDepthHE"); - } - // HBHEHitsProducer_ = iConfig.getParameter< std::string > ("HBHERecHitsProducer"); // HOHitsProducer_ = iConfig.getParameter< std::string > ("HERecHitsProducer"); // HFHitsProducer_ = iConfig.getParameter< std::string > ("HERecHitsProducer"); @@ -47,20 +36,11 @@ HcalRecHitRecalib::HcalRecHitRecalib(const edm::ParameterSet& iConfig) produces< HORecHitCollection >(RecalibHOHits_); // here read them from xml (particular to HCAL) - HcalTopology topology( mode, maxDepthHB, maxDepthHE ); - - mapHcal_.prefillMap(topology); hcalfileinpath_=iConfig.getUntrackedParameter ("fileNameHcal",""); edm::FileInPath hcalfiletmp("CalibCalorimetry/CaloMiscalibTools/data/"+hcalfileinpath_); hcalfile_=hcalfiletmp.fullPath(); - - - MiscalibReaderFromXMLHcal hcalreader_(mapHcal_); - if(!hcalfile_.empty()) hcalreader_.parseXMLMiscalibFile(hcalfile_); - mapHcal_.print(); - } @@ -70,6 +50,18 @@ HcalRecHitRecalib::~HcalRecHitRecalib() } +void +HcalRecHitRecalib::beginRun(edm::Run&, edm::EventSetup const& iSetup) +{ + edm::ESHandle topology; + iSetup.get().get( topology ); + + mapHcal_.prefillMap(*topology); + + MiscalibReaderFromXMLHcal hcalreader_(mapHcal_); + if(!hcalfile_.empty()) hcalreader_.parseXMLMiscalibFile(hcalfile_); + mapHcal_.print(); +} // ------------ method called to produce the data ------------ void