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::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Types

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

Public Member Functions

 PFMETBenchmarkAnalyzer (const edm::ParameterSet &)
 PFJet Benchmark. More...
 
 ~PFMETBenchmarkAnalyzer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices 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

string OutputFileName
 
bool pfmBenchmarkDebug
 
PFMETBenchmark PFMETBenchmark_
 
edm::EDGetTokenT< reco::CaloMETCollectionsInputCaloLabel_tok_
 
edm::EDGetTokenT< reco::PFMETCollectionsInputRecoLabel_tok_
 
edm::EDGetTokenT< reco::METCollectionsInputTCLabel_tok_
 
edm::EDGetTokenT< reco::GenParticleCollectionsInputTruthLabel_tok_
 
string xbenchmarkLabel_
 
dqm::legacy::DQMStorexdbe_
 
bool xplotAgainstReco
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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

PFJet Benchmark.

Definition at line 90 of file PFMETBenchmarkAnalyzer.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), Utilities::operator, and AlcaBeamMonitor_cfi::OutputFileName.

92 {
93  // now do what ever initialization is needed
94  sInputTruthLabel_tok_ = consumes<reco::GenParticleCollection>(iConfig.getParameter<InputTag>("InputTruthLabel"));
95  sInputRecoLabel_tok_ = consumes<reco::PFMETCollection>(iConfig.getParameter<InputTag>("InputRecoLabel"));
96  sInputCaloLabel_tok_ = consumes<reco::CaloMETCollection>(iConfig.getParameter<InputTag>("InputCaloLabel"));
97  sInputTCLabel_tok_ = consumes<reco::METCollection>(iConfig.getParameter<InputTag>("InputTCLabel"));
98  OutputFileName = iConfig.getUntrackedParameter<string>("OutputFile");
99  pfmBenchmarkDebug = iConfig.getParameter<bool>("pfjBenchmarkDebug");
100  xplotAgainstReco = iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
101  xbenchmarkLabel_ = iConfig.getParameter<string>("BenchmarkLabel");
103 
105 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
T getUntrackedParameter(std::string const &, T const &) const
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 setup(std::string Filename, bool debug, bool plotAgainstReco=false, std::string benchmarkLabel_="ParticleFlow", DQMStore *dbe_store=nullptr)
dqm::legacy::DQMStore * xdbe_

◆ ~PFMETBenchmarkAnalyzer()

PFMETBenchmarkAnalyzer::~PFMETBenchmarkAnalyzer ( )
override

Definition at line 107 of file PFMETBenchmarkAnalyzer.cc.

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 117 of file PFMETBenchmarkAnalyzer.cc.

References gather_cfg::cout, electrons_cff::genparticles, iEvent, and TauSpinner_cfi::isReco.

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

◆ beginJob()

void PFMETBenchmarkAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 155 of file PFMETBenchmarkAnalyzer.cc.

155 {}

◆ endJob()

void PFMETBenchmarkAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 159 of file PFMETBenchmarkAnalyzer.cc.

159  {
160  // PFMETBenchmark_.save();
163 }

Member Data Documentation

◆ OutputFileName

string PFMETBenchmarkAnalyzer::OutputFileName
private

Definition at line 71 of file PFMETBenchmarkAnalyzer.cc.

◆ pfmBenchmarkDebug

bool PFMETBenchmarkAnalyzer::pfmBenchmarkDebug
private

Definition at line 72 of file PFMETBenchmarkAnalyzer.cc.

◆ PFMETBenchmark_

PFMETBenchmark PFMETBenchmarkAnalyzer::PFMETBenchmark_
private

Definition at line 70 of file PFMETBenchmarkAnalyzer.cc.

◆ 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.

◆ xbenchmarkLabel_

string PFMETBenchmarkAnalyzer::xbenchmarkLabel_
private

Definition at line 74 of file PFMETBenchmarkAnalyzer.cc.

◆ xdbe_

dqm::legacy::DQMStore* PFMETBenchmarkAnalyzer::xdbe_
private

Definition at line 75 of file PFMETBenchmarkAnalyzer.cc.

◆ xplotAgainstReco

bool PFMETBenchmarkAnalyzer::xplotAgainstReco
private

Definition at line 73 of file PFMETBenchmarkAnalyzer.cc.