CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TagProbeMassEDMFilter.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: TagProbeEdmFilter
4 // Class: TagProbeEdmFilter
5 //
13 //
14 // Original Author: Nadia Adam
15 // Created: Fri Jun 6 09:10:41 CDT 2008
16 // $Id: TagProbeMassEDMFilter.cc,v 1.2 2010/08/07 14:55:55 wmtan Exp $
17 //
18 //
19 
20 // system include files
21 
22 // Include files
24 
25 
26 //
27 // constants, enums and typedefs
28 //
29 
30 //
31 // static data member definitions
32 //
33 
34 //
35 // constructors and destructor
36 //
38 {
39  //now do what ever initialization is needed
40  tpMapName = iConfig.getParameter<std::string>("tpMapName");
41 
42 }
43 
44 
46 {
47 
48  // do anything here that needs to be done at desctruction time
49  // (e.g. close files, deallocate resources etc.)
50 
51 }
52 
53 
54 //
55 // member functions
56 //
57 
58 // ------------ method called on each new Event ------------
59 bool
61 {
62  using namespace edm;
63  using namespace std;
64 
65  // Pass the event if there are some TP pairs ...
67 
68  iEvent.getByLabel(tpMapName,"TPmass",tp_mass);
69  if (!tp_mass.isValid())
70  {
71  LogWarning("TagAndProbeFilter") << "Could not extract TP pairs ";
72  return false;
73  }
74 
75  int nrTP = tp_mass->size();
76 
77  if( nrTP > 0 ) return true;
78  else return false;
79 }
80 
81 // ------------ method called once each job just before starting event loop ------------
82 void
84 {
85 }
86 
87 // ------------ method called once each job just after ending the event loop ------------
88 void
90 }
91 
92 //define this as a plug-in
T getParameter(std::string const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
int iEvent
Definition: GenABIO.cc:230
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
TagProbeMassEDMFilter(const edm::ParameterSet &)
virtual bool filter(edm::Event &, const edm::EventSetup &) override