CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
PFMETBenchmarkAnalyzer Class Reference

#include <PFMETBenchmarkAnalyzer.cc>

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

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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

- 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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

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

Implementation:

Definition at line 51 of file PFMETBenchmarkAnalyzer.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 53 of file PFMETBenchmarkAnalyzer.cc.

◆ MonitorElement

Definition at line 54 of file PFMETBenchmarkAnalyzer.cc.

Constructor & Destructor Documentation

◆ PFMETBenchmarkAnalyzer()

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

Definition at line 89 of file PFMETBenchmarkAnalyzer.cc.

91 {
92  // now do what ever initialization is needed
93  sInputTruthLabel_tok_ = consumes<reco::GenParticleCollection>(iConfig.getParameter<InputTag>("InputTruthLabel"));
94  sInputRecoLabel_tok_ = consumes<reco::PFMETCollection>(iConfig.getParameter<InputTag>("InputRecoLabel"));
95  sInputCaloLabel_tok_ = consumes<reco::CaloMETCollection>(iConfig.getParameter<InputTag>("InputCaloLabel"));
96  sInputTCLabel_tok_ = consumes<reco::METCollection>(iConfig.getParameter<InputTag>("InputTCLabel"));
97  OutputFileName = iConfig.getUntrackedParameter<string>("OutputFile");
98  pfmBenchmarkDebug = iConfig.getParameter<bool>("pfjBenchmarkDebug");
99  xplotAgainstReco = iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
100  xbenchmarkLabel_ = iConfig.getParameter<string>("BenchmarkLabel");
101  xdbe_ = edm::Service<DQMStore>().operator->();
102 
104 }

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

◆ ~PFMETBenchmarkAnalyzer()

PFMETBenchmarkAnalyzer::~PFMETBenchmarkAnalyzer ( )
override

Definition at line 106 of file PFMETBenchmarkAnalyzer.cc.

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

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 116 of file PFMETBenchmarkAnalyzer.cc.

116  {
117  // get gen jet collection
118  Handle<GenParticleCollection> genparticles;
119  bool isGen = iEvent.getByToken(sInputTruthLabel_tok_, genparticles);
120  if (!isGen) {
121  std::cout << "Warning : no Gen Particles in input !" << std::endl;
122  return;
123  }
124 
125  // get rec PFMet collection
127  bool isReco = iEvent.getByToken(sInputRecoLabel_tok_, pfmets);
128  if (!isReco) {
129  std::cout << "Warning : no PF MET in input !" << std::endl;
130  return;
131  }
132 
133  // get rec TCMet collection
134  Handle<METCollection> tcmets;
135  bool isTC = iEvent.getByToken(sInputTCLabel_tok_, tcmets);
136  if (!isTC) {
137  std::cout << "Warning : no TC MET in input !" << std::endl;
138  return;
139  }
140 
141  Handle<CaloMETCollection> calomets;
142  bool isCalo = iEvent.getByToken(sInputCaloLabel_tok_, calomets);
143  if (!isCalo) {
144  std::cout << "Warning : no Calo MET in input !" << std::endl;
145  return;
146  }
147 
148  // Analyse (no "z" in "analyse" : we are in Europe, dammit!)
149  PFMETBenchmark_.process(*pfmets, *genparticles, *calomets, *tcmets);
150 }

References gather_cfg::cout, iEvent, TauSpinner_cfi::isReco, PFMETBenchmark_, and PFMETBenchmark::process().

◆ beginJob()

void PFMETBenchmarkAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 154 of file PFMETBenchmarkAnalyzer.cc.

154 {}

◆ endJob()

void PFMETBenchmarkAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 158 of file PFMETBenchmarkAnalyzer.cc.

158  {
159  // PFMETBenchmark_.save();
162 }

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

Member Data Documentation

◆ sInputCaloLabel_tok_

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

Definition at line 66 of file PFMETBenchmarkAnalyzer.cc.

◆ sInputRecoLabel_tok_

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

Definition at line 65 of file PFMETBenchmarkAnalyzer.cc.

◆ sInputTCLabel_tok_

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

Definition at line 67 of file PFMETBenchmarkAnalyzer.cc.

◆ sInputTruthLabel_tok_

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

Definition at line 64 of file PFMETBenchmarkAnalyzer.cc.

PFMETBenchmarkAnalyzer::sInputTruthLabel_tok_
edm::EDGetTokenT< reco::GenParticleCollection > sInputTruthLabel_tok_
Definition: PFMETBenchmarkAnalyzer.cc:64
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
OutputFileName
string OutputFileName
Definition: PFMETBenchmarkAnalyzer.cc:73
PFMETBenchmark::process
void process(const reco::PFMETCollection &, const reco::GenParticleCollection &, const reco::CaloMETCollection &, const reco::METCollection &)
Definition: PFMETBenchmark.cc:187
PFMETBenchmark::analyse
void analyse()
Definition: PFMETBenchmark.cc:427
PFMETBenchmark::setup
void setup(std::string Filename, bool debug, bool plotAgainstReco=false, std::string benchmarkLabel_="ParticleFlow", DQMStore *dbe_store=nullptr)
Definition: PFMETBenchmark.cc:50
PFMETBenchmark_
PFMETBenchmark PFMETBenchmark_
PFJet Benchmark.
Definition: PFMETBenchmarkAnalyzer.cc:72
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
xbenchmarkLabel_
string xbenchmarkLabel_
Definition: PFMETBenchmarkAnalyzer.cc:76
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
xplotAgainstReco
bool xplotAgainstReco
Definition: PFMETBenchmarkAnalyzer.cc:75
pfmBenchmarkDebug
bool pfmBenchmarkDebug
Definition: PFMETBenchmarkAnalyzer.cc:74
PFMETBenchmarkAnalyzer::sInputRecoLabel_tok_
edm::EDGetTokenT< reco::PFMETCollection > sInputRecoLabel_tok_
Definition: PFMETBenchmarkAnalyzer.cc:65
xdbe_
dqm::legacy::DQMStore * xdbe_
Definition: PFMETBenchmarkAnalyzer.cc:77
PFMETBenchmark::write
void write()
Definition: PFMETBenchmark.cc:35
PFMETBenchmarkAnalyzer::sInputTCLabel_tok_
edm::EDGetTokenT< reco::METCollection > sInputTCLabel_tok_
Definition: PFMETBenchmarkAnalyzer.cc:67
TauSpinner_cfi.isReco
isReco
Definition: TauSpinner_cfi.py:4
edm::InputTag
Definition: InputTag.h:15
PFMETBenchmarkAnalyzer::sInputCaloLabel_tok_
edm::EDGetTokenT< reco::CaloMETCollection > sInputCaloLabel_tok_
Definition: PFMETBenchmarkAnalyzer.cc:66