CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
PFJetBenchmarkAnalyzer.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package:
4 // Class: PFJetBenchmarkAnalyzer.cc
5 //
14 //
15 // Original Author: Michel Della Negra
16 // Created: Wed Jan 23 10:11:13 CET 2008
17 // $Id: PFJetBenchmarkAnalyzer.cc,v 1.2 2009/05/05 13:50:28 pjanot Exp $
18 // Extensions by Joanna Weng
19 //
20 
21 
22 // system include files
23 #include <memory>
24 
25 // user include files
28 
31 
43 using namespace edm;
44 using namespace reco;
45 using namespace std;
46 
47 //
48 // class decleration
49 
50 
52 public:
55 
56 
57 private:
58  virtual void beginJob() ;
59  virtual void analyze(const edm::Event&, const edm::EventSetup&);
60  virtual void endJob() ;
61  // ----------member data ---------------------------
62 
63 };
65 
66 //neuhaus - comment
74 double deltaRMax=0.1;
76 double recPt;
77 double maxEta;
79 //
80 // constants, enums and typedefs
81 //
82 
83 //
84 // static data member definitions
85 //
86 
87 //
88 // constructors and destructor
89 //
91 
92 {
93  //now do what ever initialization is needed
94  sGenJetAlgo =
95  iConfig.getParameter<InputTag>("InputTruthLabel");
96  sJetAlgo =
97  iConfig.getParameter<InputTag>("InputRecoLabel");
99  iConfig.getUntrackedParameter<string>("OutputFile");
101  iConfig.getParameter<bool>("pfjBenchmarkDebug");
102  plotAgainstReco =
103  iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
104  onlyTwoJets =
105  iConfig.getParameter<bool>("OnlyTwoJets");
106  deltaRMax =
107  iConfig.getParameter<double>("deltaRMax");
108  benchmarkLabel_ =
109  iConfig.getParameter<string>("BenchmarkLabel");
110  recPt =
111  iConfig.getParameter<double>("recPt");
112  maxEta =
113  iConfig.getParameter<double>("maxEta");
114 
116 
118  outjetfilename,
119  pfjBenchmarkDebug,
120  plotAgainstReco,
121  onlyTwoJets,
122  deltaRMax,
123  benchmarkLabel_,
124  recPt,
125  maxEta,
126  dbe_);
127 }
128 
129 
131 {
132  // do anything here that needs to be done at desctruction time
133  // (e.g. close files, deallocate resources etc.)
134 }
135 
136 
137 //
138 // member functions
139 //
140 
141 // ------------ method called to for each event ------------
142 void
144  const edm::EventSetup& iSetup)
145 {
146  // get gen jet collection
147  Handle<GenJetCollection> genjets;
148  bool isGen = iEvent.getByLabel(sGenJetAlgo, genjets);
149  if (!isGen) {
150  std::cout << "Warning : no Gen jets in input !" << std::endl;
151  return;
152  }
153 
154  // get rec PFJet collection
156  bool isReco = iEvent.getByLabel(sJetAlgo, pfjets);
157  if (!isReco) {
158  std::cout << "Warning : no PF jets in input !" << std::endl;
159  return;
160  }
161  // Analyse (no "z" in "analyse" : we are in Europe, dammit!)
162  PFJetBenchmark_.process(*pfjets, *genjets);
163 }
164 
165 
166 // ------------ method called once each job just before starting event loop ------------
167 void
169 {
170 
171 }
172 
173 // ------------ method called once each job just after ending the event loop ------------
174 void
176 // PFJetBenchmark_.save();
178 }
179 
180 //define this as a plug-in
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool onlyTwoJets
double deltaRMax
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
double maxEta
DEFINE_FWK_MODULE(HiMixingModule)
string outjetfilename
void beginJob()
Definition: Breakpoints.cc:15
int iEvent
Definition: GenABIO.cc:243
void setup(std::string Filename, bool debug, bool plotAgainstReco=0, bool onlyTwoJets=1, double deltaRMax=0.1, std::string benchmarkLabel_="ParticleFlow", double recPt=-1, double maxEta=-1, DQMStore *dbe_store=NULL)
string benchmarkLabel_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
DQMStore * dbe_
void process(const reco::PFJetCollection &, const reco::GenJetCollection &)
PFJetBenchmarkAnalyzer(const edm::ParameterSet &)
bool plotAgainstReco
InputTag sJetAlgo
bool pfjBenchmarkDebug
InputTag sGenJetAlgo
tuple cout
Definition: gather_cfg.py:41
double recPt