CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
PFMETBenchmarkAnalyzer Class Reference

#include <PFMETBenchmarkAnalyzer.cc>

Inheritance diagram for PFMETBenchmarkAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 PFMETBenchmarkAnalyzer (const edm::ParameterSet &)
 
 ~PFMETBenchmarkAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation:

Definition at line 53 of file PFMETBenchmarkAnalyzer.cc.

Constructor & Destructor Documentation

PFMETBenchmarkAnalyzer::PFMETBenchmarkAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 90 of file PFMETBenchmarkAnalyzer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), cppFunctionSkipper::operator, OutputFileName, pfmBenchmarkDebug, PFMETBenchmark_, PFMETBenchmark::setup(), sInputCaloLabel, sInputRecoLabel, sInputTCLabel, sInputTruthLabel, xbenchmarkLabel_, xdbe_, and xplotAgainstReco.

92 {
93  //now do what ever initialization is needed
95  iConfig.getParameter<InputTag>("InputTruthLabel");
97  iConfig.getParameter<InputTag>("InputRecoLabel");
99  iConfig.getParameter<InputTag>("InputCaloLabel");
100  sInputTCLabel =
101  iConfig.getParameter<InputTag>("InputTCLabel");
102  OutputFileName =
103  iConfig.getUntrackedParameter<string>("OutputFile");
105  iConfig.getParameter<bool>("pfjBenchmarkDebug");
107  iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
109  iConfig.getParameter<string>("BenchmarkLabel");
111 
117  xdbe_);
118 }
string OutputFileName
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
InputTag sInputCaloLabel
InputTag sInputTruthLabel
PFMETBenchmark PFMETBenchmark_
PFJet Benchmark.
DQMStore * xdbe_
InputTag sInputRecoLabel
InputTag sInputTCLabel
string xbenchmarkLabel_
void setup(std::string Filename, bool debug, bool plotAgainstReco=0, std::string benchmarkLabel_="ParticleFlow", DQMStore *dbe_store=NULL)
bool xplotAgainstReco
bool pfmBenchmarkDebug
PFMETBenchmarkAnalyzer::~PFMETBenchmarkAnalyzer ( )

Definition at line 121 of file PFMETBenchmarkAnalyzer.cc.

122 {
123  // do anything here that needs to be done at desctruction time
124  // (e.g. close files, deallocate resources etc.)
125 }

Member Function Documentation

void PFMETBenchmarkAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 134 of file PFMETBenchmarkAnalyzer.cc.

References gather_cfg::cout, edm::Event::getByLabel(), PFMETBenchmark_, PFMETBenchmark::process(), sInputCaloLabel, sInputRecoLabel, sInputTCLabel, and sInputTruthLabel.

135 {
136  // get gen jet collection
137  Handle<GenParticleCollection> genparticles;
138  bool isGen = iEvent.getByLabel(sInputTruthLabel, genparticles);
139  if (!isGen) {
140  std::cout << "Warning : no Gen Particles in input !" << std::endl;
141  return;
142  }
143 
144  // get rec PFMet collection
146  bool isReco = iEvent.getByLabel(sInputRecoLabel, pfmets);
147  if (!isReco) {
148  std::cout << "Warning : no PF MET in input !" << std::endl;
149  return;
150  }
151 
152  // get rec TCMet collection
153  Handle<METCollection> tcmets;
154  bool isTC = iEvent.getByLabel(sInputTCLabel, tcmets);
155  if (!isTC) {
156  std::cout << "Warning : no TC MET in input !" << std::endl;
157  return;
158  }
159 
160  Handle<CaloMETCollection> calomets;
161  bool isCalo = iEvent.getByLabel(sInputCaloLabel, calomets);
162  if (!isCalo) {
163  std::cout << "Warning : no Calo MET in input !" << std::endl;
164  return;
165  }
166 
167  // Analyse (no "z" in "analyse" : we are in Europe, dammit!)
168  PFMETBenchmark_.process(*pfmets, *genparticles, *calomets, *tcmets);
169 }
InputTag sInputCaloLabel
InputTag sInputTruthLabel
PFMETBenchmark PFMETBenchmark_
PFJet Benchmark.
void process(const reco::PFMETCollection &, const reco::GenParticleCollection &, const reco::CaloMETCollection &, const reco::METCollection &)
InputTag sInputRecoLabel
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
InputTag sInputTCLabel
tuple cout
Definition: gather_cfg.py:121
void PFMETBenchmarkAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 174 of file PFMETBenchmarkAnalyzer.cc.

175 {
176 
177 }
void PFMETBenchmarkAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 181 of file PFMETBenchmarkAnalyzer.cc.

References PFMETBenchmark::analyse(), PFMETBenchmark_, and PFMETBenchmark::write().

181  {
182 // PFMETBenchmark_.save();
185 }
PFMETBenchmark PFMETBenchmark_
PFJet Benchmark.