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 | Private Attributes
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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

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

Private Attributes

edm::EDGetTokenT
< reco::CaloMETCollection
sInputCaloLabel_tok_
 
edm::EDGetTokenT
< reco::PFMETCollection
sInputRecoLabel_tok_
 
edm::EDGetTokenT
< reco::METCollection
sInputTCLabel_tok_
 
edm::EDGetTokenT
< reco::GenParticleCollection
sInputTruthLabel_tok_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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::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 54 of file PFMETBenchmarkAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 91 of file PFMETBenchmarkAnalyzer.cc.

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

93 {
94  //now do what ever initialization is needed
95  sInputTruthLabel_tok_ = consumes<reco::GenParticleCollection>(iConfig.getParameter<InputTag>("InputTruthLabel"));
96  sInputRecoLabel_tok_ = consumes<reco::PFMETCollection>(iConfig.getParameter<InputTag>("InputRecoLabel"));
97  sInputCaloLabel_tok_ = consumes<reco::CaloMETCollection>(iConfig.getParameter<InputTag>("InputCaloLabel"));
98  sInputTCLabel_tok_ = consumes<reco::METCollection>(iConfig.getParameter<InputTag>("InputTCLabel"));
99  OutputFileName = iConfig.getUntrackedParameter<string>("OutputFile");
100  pfmBenchmarkDebug = iConfig.getParameter<bool>("pfjBenchmarkDebug");
101  xplotAgainstReco = iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
102  xbenchmarkLabel_ = iConfig.getParameter<string>("BenchmarkLabel");
104 
110  xdbe_);
111 }
string OutputFileName
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
PFMETBenchmark PFMETBenchmark_
PFJet Benchmark.
edm::EDGetTokenT< reco::METCollection > sInputTCLabel_tok_
DQMStore * xdbe_
edm::EDGetTokenT< reco::PFMETCollection > sInputRecoLabel_tok_
edm::EDGetTokenT< reco::CaloMETCollection > sInputCaloLabel_tok_
edm::EDGetTokenT< reco::GenParticleCollection > sInputTruthLabel_tok_
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 114 of file PFMETBenchmarkAnalyzer.cc.

115 {
116  // do anything here that needs to be done at desctruction time
117  // (e.g. close files, deallocate resources etc.)
118 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 127 of file PFMETBenchmarkAnalyzer.cc.

References gather_cfg::cout, edm::Event::getByToken(), PFMETBenchmark_, and PFMETBenchmark::process().

128 {
129  // get gen jet collection
130  Handle<GenParticleCollection> genparticles;
131  bool isGen = iEvent.getByToken(sInputTruthLabel_tok_, genparticles);
132  if (!isGen) {
133  std::cout << "Warning : no Gen Particles in input !" << std::endl;
134  return;
135  }
136 
137  // get rec PFMet collection
139  bool isReco = iEvent.getByToken(sInputRecoLabel_tok_, pfmets);
140  if (!isReco) {
141  std::cout << "Warning : no PF MET in input !" << std::endl;
142  return;
143  }
144 
145  // get rec TCMet collection
146  Handle<METCollection> tcmets;
147  bool isTC = iEvent.getByToken(sInputTCLabel_tok_, tcmets);
148  if (!isTC) {
149  std::cout << "Warning : no TC MET in input !" << std::endl;
150  return;
151  }
152 
153  Handle<CaloMETCollection> calomets;
154  bool isCalo = iEvent.getByToken(sInputCaloLabel_tok_, calomets);
155  if (!isCalo) {
156  std::cout << "Warning : no Calo MET in input !" << std::endl;
157  return;
158  }
159 
160  // Analyse (no "z" in "analyse" : we are in Europe, dammit!)
161  PFMETBenchmark_.process(*pfmets, *genparticles, *calomets, *tcmets);
162 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
PFMETBenchmark PFMETBenchmark_
PFJet Benchmark.
void process(const reco::PFMETCollection &, const reco::GenParticleCollection &, const reco::CaloMETCollection &, const reco::METCollection &)
edm::EDGetTokenT< reco::METCollection > sInputTCLabel_tok_
edm::EDGetTokenT< reco::PFMETCollection > sInputRecoLabel_tok_
edm::EDGetTokenT< reco::CaloMETCollection > sInputCaloLabel_tok_
edm::EDGetTokenT< reco::GenParticleCollection > sInputTruthLabel_tok_
tuple cout
Definition: gather_cfg.py:121
void PFMETBenchmarkAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 167 of file PFMETBenchmarkAnalyzer.cc.

168 {
169 
170 }
void PFMETBenchmarkAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 174 of file PFMETBenchmarkAnalyzer.cc.

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

174  {
175 // PFMETBenchmark_.save();
178 }
PFMETBenchmark PFMETBenchmark_
PFJet Benchmark.

Member Data Documentation

edm::EDGetTokenT<reco::CaloMETCollection> PFMETBenchmarkAnalyzer::sInputCaloLabel_tok_
private

Definition at line 67 of file PFMETBenchmarkAnalyzer.cc.

edm::EDGetTokenT<reco::PFMETCollection> PFMETBenchmarkAnalyzer::sInputRecoLabel_tok_
private

Definition at line 66 of file PFMETBenchmarkAnalyzer.cc.

edm::EDGetTokenT<reco::METCollection> PFMETBenchmarkAnalyzer::sInputTCLabel_tok_
private

Definition at line 68 of file PFMETBenchmarkAnalyzer.cc.

edm::EDGetTokenT<reco::GenParticleCollection> PFMETBenchmarkAnalyzer::sInputTruthLabel_tok_
private

Definition at line 65 of file PFMETBenchmarkAnalyzer.cc.