CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFRecHitProducer.cc
Go to the documentation of this file.
2 
3 #include <memory>
4 
6 
10 
11 // For RecHits calibration wrt 50 GeV pions.
12 // #include "CondFormats/DataRecord/interface/HcalRespCorrsRcd.h"
17 using namespace std;
18 using namespace edm;
19 
20 
22 {
23 
24 
25  verbose_ =
26  iConfig.getUntrackedParameter<bool>("verbose",false);
27 
28  thresh_Barrel_ =
29  iConfig.getParameter<double>("thresh_Barrel");
30  thresh_Endcap_ =
31  iConfig.getParameter<double>("thresh_Endcap");
32 
33 
34 
35  //register products
36  produces<reco::PFRecHitCollection>();
37  produces<reco::PFRecHitCollection>("Cleaned");
38 
39 }
40 
41 
43  const edm::EventSetup& iSetup) {
44 
45 
46  auto_ptr< vector<reco::PFRecHit> > recHits( new vector<reco::PFRecHit> );
47  auto_ptr< vector<reco::PFRecHit> > recHitsCleaned( new vector<reco::PFRecHit> );
48 
49  // fill the collection of rechits (see child classes)
50  createRecHits( *recHits, *recHitsCleaned, iEvent, iSetup);
51 
52  iEvent.put( recHits );
53  iEvent.put( recHitsCleaned, "Cleaned" );
54 
55 }
56 
57 
59 
60 // ------------ method called once each job just before starting event loop ------------
61 void
63  const EventSetup& es) {
64 
65  // get the HCAL RecHits correction factors
66  // edm::ESHandle<HcalRespCorrs> rchandle;
67  // es.get<HcalRespCorrsRcd>().get(rchandle);
68  // myRespCorr= rchandle.product();
69  // And the PF-specific ones
70  edm::ESHandle<HcalPFCorrs> pfrchandle;
71  es.get<HcalPFCorrsRcd>().get(pfrchandle);
72  myPFCorr= pfrchandle.product();
73 
74  // Get cleaned channels in the HCAL and HF
75  // HCAL channel status map ****************************************
77  es.get<HcalChannelQualityRcd>().get( hcalChStatus );
78  theHcalChStatus = hcalChStatus.product();
79 
80  // Retrieve the good/bad ECAL channels from the DB
82  es.get<EcalChannelStatusRcd>().get(ecalChStatus);
83  theEcalChStatus = ecalChStatus.product();
84 
86  es.get<IdealGeometryRecord>().get(cttopo);
87  theTowerConstituentsMap = cttopo.product();
88 }
89 
90 // ------------ method called once each job just after ending the event loop ------------
91 void
93 
94 
95 
96 //define this as a plug-in
97 // DEFINE_FWK_MODULE(PFRecHitProducer);
98 
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
virtual void endRun()
PFRecHitProducer(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:243
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
virtual void beginRun(edm::Run &run, const edm::EventSetup &es)
Definition: Run.h:33