CMS 3D CMS Logo

PFMET.cc
Go to the documentation of this file.
2 
4 
8 
10 
14 
15 
16 using namespace std;
17 using namespace edm;
18 using namespace reco;
19 using namespace math;
20 
21 PFMET::PFMET(const edm::ParameterSet& iConfig) : pfMETAlgo_(iConfig) {
22 
23 
24 
25  inputTagPFCandidates_
26  = iConfig.getParameter<InputTag>("PFCandidates");
27  tokenPFCandidates_ = consumes<PFCandidateCollection>(inputTagPFCandidates_);
28 
29  produces<METCollection>();
30 
31  LogDebug("PFMET")
32  <<" input collection : "<<inputTagPFCandidates_ ;
33 
34 }
35 
36 
37 
38 PFMET::~PFMET() { }
39 
40 
41 
42 void PFMET::beginJob() { }
43 
44 
46  const EventSetup& iSetup) {
47 
48  LogDebug("PFMET")<<"START event: "<<iEvent.id().event()
49  <<" in run "<<iEvent.id().run()<<endl;
50 
51 
52 
53  // get PFCandidates
54 
56  iEvent.getByToken( tokenPFCandidates_, pfCandidates);
57 
58  unique_ptr< METCollection >
59  pOutput( new METCollection() );
60 
61 
62 
63  pOutput->push_back( pfMETAlgo_.produce( *pfCandidates ) );
64  iEvent.put(std::move(pOutput));
65 
66  LogDebug("PFMET")<<"STOP event: "<<iEvent.id().event()
67  <<" in run "<<iEvent.id().run()<<endl;
68 }
69 
70 
#define LogDebug(id)
RunNumber_t run() const
Definition: EventID.h:39
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:41
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
~PFMET() override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
std::vector< reco::MET > METCollection
collection of MET objects
Definition: METCollection.h:23
int iEvent
Definition: GenABIO.cc:224
PFMET(const edm::ParameterSet &)
Definition: Error.h:16
void produce(edm::Event &, const edm::EventSetup &) override
Definition: PFMET.cc:45
edm::EventID id() const
Definition: EventBase.h:59
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:511
void beginJob() override
Definition: PFMET.cc:42