CMS 3D CMS Logo

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 () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

edm::EDGetTokenT< reco::CaloMETCollectionsInputCaloLabel_tok_
 
edm::EDGetTokenT< reco::PFMETCollectionsInputRecoLabel_tok_
 
edm::EDGetTokenT< reco::METCollectionsInputTCLabel_tok_
 
edm::EDGetTokenT< reco::GenParticleCollectionsInputTruthLabel_tok_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 52 of file PFMETBenchmarkAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 87 of file PFMETBenchmarkAnalyzer.cc.

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

89 {
90  // now do what ever initialization is needed
91  sInputTruthLabel_tok_ = consumes<reco::GenParticleCollection>(iConfig.getParameter<InputTag>("InputTruthLabel"));
92  sInputRecoLabel_tok_ = consumes<reco::PFMETCollection>(iConfig.getParameter<InputTag>("InputRecoLabel"));
93  sInputCaloLabel_tok_ = consumes<reco::CaloMETCollection>(iConfig.getParameter<InputTag>("InputCaloLabel"));
94  sInputTCLabel_tok_ = consumes<reco::METCollection>(iConfig.getParameter<InputTag>("InputTCLabel"));
95  OutputFileName = iConfig.getUntrackedParameter<string>("OutputFile");
96  pfmBenchmarkDebug = iConfig.getParameter<bool>("pfjBenchmarkDebug");
97  xplotAgainstReco = iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
98  xbenchmarkLabel_ = iConfig.getParameter<string>("BenchmarkLabel");
100 
102 }
string OutputFileName
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setup(std::string Filename, bool debug, bool plotAgainstReco=false, std::string benchmarkLabel_="ParticleFlow", DQMStore *dbe_store=0)
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_
bool xplotAgainstReco
bool pfmBenchmarkDebug
PFMETBenchmarkAnalyzer::~PFMETBenchmarkAnalyzer ( )
override

Definition at line 104 of file PFMETBenchmarkAnalyzer.cc.

104  {
105  // do anything here that needs to be done at desctruction time
106  // (e.g. close files, deallocate resources etc.)
107 }

Member Function Documentation

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

Definition at line 114 of file PFMETBenchmarkAnalyzer.cc.

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

114  {
115  // get gen jet collection
116  Handle<GenParticleCollection> genparticles;
117  bool isGen = iEvent.getByToken(sInputTruthLabel_tok_, genparticles);
118  if (!isGen) {
119  std::cout << "Warning : no Gen Particles in input !" << std::endl;
120  return;
121  }
122 
123  // get rec PFMet collection
125  bool isReco = iEvent.getByToken(sInputRecoLabel_tok_, pfmets);
126  if (!isReco) {
127  std::cout << "Warning : no PF MET in input !" << std::endl;
128  return;
129  }
130 
131  // get rec TCMet collection
132  Handle<METCollection> tcmets;
133  bool isTC = iEvent.getByToken(sInputTCLabel_tok_, tcmets);
134  if (!isTC) {
135  std::cout << "Warning : no TC MET in input !" << std::endl;
136  return;
137  }
138 
139  Handle<CaloMETCollection> calomets;
140  bool isCalo = iEvent.getByToken(sInputCaloLabel_tok_, calomets);
141  if (!isCalo) {
142  std::cout << "Warning : no Calo MET in input !" << std::endl;
143  return;
144  }
145 
146  // Analyse (no "z" in "analyse" : we are in Europe, dammit!)
147  PFMETBenchmark_.process(*pfmets, *genparticles, *calomets, *tcmets);
148 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
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_
void PFMETBenchmarkAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 152 of file PFMETBenchmarkAnalyzer.cc.

152 {}
void PFMETBenchmarkAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 156 of file PFMETBenchmarkAnalyzer.cc.

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

156  {
157  // PFMETBenchmark_.save();
160 }
PFMETBenchmark PFMETBenchmark_
PFJet Benchmark.

Member Data Documentation

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

Definition at line 64 of file PFMETBenchmarkAnalyzer.cc.

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

Definition at line 63 of file PFMETBenchmarkAnalyzer.cc.

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

Definition at line 65 of file PFMETBenchmarkAnalyzer.cc.

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

Definition at line 62 of file PFMETBenchmarkAnalyzer.cc.