CMS 3D CMS Logo

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

#include <PFJetBenchmarkAnalyzer.cc>

Inheritance diagram for PFJetBenchmarkAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 PFJetBenchmarkAnalyzer (const edm::ParameterSet &)
 
 ~PFJetBenchmarkAnalyzer () 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::GenJetCollectionsGenJetAlgo_tok_
 
edm::EDGetTokenT< reco::PFJetCollectionsJetAlgo_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 50 of file PFJetBenchmarkAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 87 of file PFJetBenchmarkAnalyzer.cc.

References benchmarkLabel_, dbe_, deltaRMax, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), maxEta, onlyTwoJets, Utilities::operator, outjetfilename, pfjBenchmarkDebug, plotAgainstReco, recPt, and PFJetBenchmark::setup().

89 {
90  // now do what ever initialization is needed
91  sGenJetAlgo_tok_ = consumes<reco::GenJetCollection>(iConfig.getParameter<edm::InputTag>("InputTruthLabel"));
92  sJetAlgo_tok_ = consumes<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("InputRecoLabel"));
93  outjetfilename = iConfig.getUntrackedParameter<string>("OutputFile");
94  pfjBenchmarkDebug = iConfig.getParameter<bool>("pfjBenchmarkDebug");
95  plotAgainstReco = iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
96  onlyTwoJets = iConfig.getParameter<bool>("OnlyTwoJets");
97  deltaRMax = iConfig.getParameter<double>("deltaRMax");
98  benchmarkLabel_ = iConfig.getParameter<string>("BenchmarkLabel");
99  recPt = iConfig.getParameter<double>("recPt");
100  maxEta = iConfig.getParameter<double>("maxEta");
101 
103 
106 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool onlyTwoJets
double deltaRMax
edm::EDGetTokenT< reco::PFJetCollection > sJetAlgo_tok_
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
double maxEta
edm::EDGetTokenT< reco::GenJetCollection > sGenJetAlgo_tok_
string outjetfilename
void setup(std::string Filename, bool debug, bool plotAgainstReco=false, bool onlyTwoJets=true, double deltaRMax=0.1, std::string benchmarkLabel_="ParticleFlow", double recPt=-1, double maxEta=-1, DQMStore *dbe_store=0)
string benchmarkLabel_
DQMStore * dbe_
bool plotAgainstReco
bool pfjBenchmarkDebug
double recPt
PFJetBenchmarkAnalyzer::~PFJetBenchmarkAnalyzer ( )
override

Definition at line 108 of file PFJetBenchmarkAnalyzer.cc.

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

Member Function Documentation

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

Definition at line 118 of file PFJetBenchmarkAnalyzer.cc.

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

118  {
119  // get gen jet collection
120  Handle<GenJetCollection> genjets;
121  bool isGen = iEvent.getByToken(sGenJetAlgo_tok_, genjets);
122  if (!isGen) {
123  std::cout << "Warning : no Gen jets in input !" << std::endl;
124  return;
125  }
126 
127  // get rec PFJet collection
129  bool isReco = iEvent.getByToken(sJetAlgo_tok_, pfjets);
130  if (!isReco) {
131  std::cout << "Warning : no PF jets in input !" << std::endl;
132  return;
133  }
134  // Analyse (no "z" in "analyse" : we are in Europe, dammit!)
135  PFJetBenchmark_.process(*pfjets, *genjets);
136 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< reco::PFJetCollection > sJetAlgo_tok_
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
edm::EDGetTokenT< reco::GenJetCollection > sGenJetAlgo_tok_
void process(const reco::PFJetCollection &, const reco::GenJetCollection &)
void PFJetBenchmarkAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 140 of file PFJetBenchmarkAnalyzer.cc.

140 {}
void PFJetBenchmarkAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 144 of file PFJetBenchmarkAnalyzer.cc.

References DEFINE_FWK_MODULE, and PFJetBenchmark::write().

144  {
145  // PFJetBenchmark_.save();
147 }
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.

Member Data Documentation

edm::EDGetTokenT<reco::GenJetCollection> PFJetBenchmarkAnalyzer::sGenJetAlgo_tok_
private

Definition at line 60 of file PFJetBenchmarkAnalyzer.cc.

edm::EDGetTokenT<reco::PFJetCollection> PFJetBenchmarkAnalyzer::sJetAlgo_tok_
private

Definition at line 61 of file PFJetBenchmarkAnalyzer.cc.