CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.cc

Go to the documentation of this file.
00001 #include "RecoParticleFlow/PFClusterProducer/plugins/PFRecHitProducer.h"
00002 
00003 #include <memory>
00004 
00005 #include "DataFormats/ParticleFlowReco/interface/PFRecHit.h"
00006 
00007 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00008 #include "FWCore/Framework/interface/ESHandle.h"
00009 #include "FWCore/Framework/interface/EventSetup.h"
00010 
00011 // For RecHits calibration wrt 50 GeV pions.
00012 // #include "CondFormats/DataRecord/interface/HcalRespCorrsRcd.h"
00013 #include "CondFormats/DataRecord/interface/HcalPFCorrsRcd.h"
00014 #include "CondFormats/DataRecord/interface/HcalChannelQualityRcd.h"
00015 #include "CondFormats/DataRecord/interface/EcalChannelStatusRcd.h"
00016 #include "Geometry/Records/interface/IdealGeometryRecord.h"
00017 using namespace std;
00018 using namespace edm;
00019 
00020 
00021 PFRecHitProducer::PFRecHitProducer(const edm::ParameterSet& iConfig)
00022 {
00023 
00024     
00025   verbose_ = 
00026     iConfig.getUntrackedParameter<bool>("verbose",false);
00027 
00028   thresh_Barrel_ = 
00029     iConfig.getParameter<double>("thresh_Barrel");
00030   thresh_Endcap_ = 
00031     iConfig.getParameter<double>("thresh_Endcap");
00032     
00033     
00034   
00035   //register products
00036   produces<reco::PFRecHitCollection>();
00037   produces<reco::PFRecHitCollection>("Cleaned");
00038   
00039 }
00040 
00041 
00042 void PFRecHitProducer::produce(edm::Event& iEvent, 
00043                                const edm::EventSetup& iSetup) {
00044 
00045 
00046   auto_ptr< vector<reco::PFRecHit> > recHits( new vector<reco::PFRecHit> ); 
00047   auto_ptr< vector<reco::PFRecHit> > recHitsCleaned( new vector<reco::PFRecHit> ); 
00048   
00049   // fill the collection of rechits (see child classes)
00050   createRecHits( *recHits, *recHitsCleaned, iEvent, iSetup);
00051 
00052   iEvent.put( recHits );
00053   iEvent.put( recHitsCleaned, "Cleaned" );
00054 
00055 }
00056 
00057 
00058 PFRecHitProducer::~PFRecHitProducer() {}
00059 
00060 // ------------ method called once each job just before starting event loop  ------------
00061 void 
00062 PFRecHitProducer::beginRun(edm::Run& run,
00063                            const EventSetup& es) {
00064 
00065   // get the HCAL RecHits correction factors
00066   // edm::ESHandle<HcalRespCorrs> rchandle;
00067   // es.get<HcalRespCorrsRcd>().get(rchandle);
00068   // myRespCorr= rchandle.product();
00069   // And the PF-specific ones
00070   edm::ESHandle<HcalPFCorrs> pfrchandle;
00071   es.get<HcalPFCorrsRcd>().get(pfrchandle);
00072   myPFCorr= pfrchandle.product();
00073 
00074   // Get cleaned channels in the HCAL and HF 
00075   // HCAL channel status map ****************************************
00076   edm::ESHandle<HcalChannelQuality> hcalChStatus;    
00077   es.get<HcalChannelQualityRcd>().get( hcalChStatus );
00078   theHcalChStatus = hcalChStatus.product();
00079 
00080   // Retrieve the good/bad ECAL channels from the DB
00081   edm::ESHandle<EcalChannelStatus> ecalChStatus;
00082   es.get<EcalChannelStatusRcd>().get(ecalChStatus);
00083   theEcalChStatus = ecalChStatus.product();
00084 
00085   edm::ESHandle<CaloTowerConstituentsMap> cttopo;
00086   es.get<IdealGeometryRecord>().get(cttopo);
00087   theTowerConstituentsMap = cttopo.product();
00088 }
00089 
00090 // ------------ method called once each job just after ending the event loop  ------------
00091 void 
00092 PFRecHitProducer::endRun() {}
00093 
00094 
00095 
00096 //define this as a plug-in
00097 // DEFINE_FWK_MODULE(PFRecHitProducer);
00098