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 ()
 
- 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
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
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

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::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 &)
 
- 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 52 of file PFJetBenchmarkAnalyzer.cc.

Constructor & Destructor Documentation

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

Definition at line 91 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().

93 {
94  //now do what ever initialization is needed
95  sGenJetAlgo_tok_ = consumes<reco::GenJetCollection> (iConfig.getParameter<edm::InputTag>("InputTruthLabel") );
96  sJetAlgo_tok_ = consumes<reco::PFJetCollection> (iConfig.getParameter<edm::InputTag>("InputRecoLabel") );
97  outjetfilename = iConfig.getUntrackedParameter<string>("OutputFile");
98  pfjBenchmarkDebug = iConfig.getParameter<bool>("pfjBenchmarkDebug");
99  plotAgainstReco = iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
100  onlyTwoJets = iConfig.getParameter<bool>("OnlyTwoJets");
101  deltaRMax = iConfig.getParameter<double>("deltaRMax");
102  benchmarkLabel_ = iConfig.getParameter<string>("BenchmarkLabel");
103  recPt = iConfig.getParameter<double>("recPt");
104  maxEta = iConfig.getParameter<double>("maxEta");
105 
107 
112  onlyTwoJets,
113  deltaRMax,
115  recPt,
116  maxEta,
117  dbe_);
118 }
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=0, bool onlyTwoJets=1, double deltaRMax=0.1, std::string benchmarkLabel_="ParticleFlow", double recPt=-1, double maxEta=-1, DQMStore *dbe_store=NULL)
string benchmarkLabel_
DQMStore * dbe_
bool plotAgainstReco
bool pfjBenchmarkDebug
double recPt
PFJetBenchmarkAnalyzer::~PFJetBenchmarkAnalyzer ( )

Definition at line 121 of file PFJetBenchmarkAnalyzer.cc.

122 {
123  // do anything here that needs to be done at desctruction time
124  // (e.g. close files, deallocate resources etc.)
125 }

Member Function Documentation

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

Definition at line 134 of file PFJetBenchmarkAnalyzer.cc.

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

136 {
137  // get gen jet collection
138  Handle<GenJetCollection> genjets;
139  bool isGen = iEvent.getByToken(sGenJetAlgo_tok_, genjets);
140  if (!isGen) {
141  std::cout << "Warning : no Gen jets in input !" << std::endl;
142  return;
143  }
144 
145  // get rec PFJet collection
147  bool isReco = iEvent.getByToken(sJetAlgo_tok_, pfjets);
148  if (!isReco) {
149  std::cout << "Warning : no PF jets in input !" << std::endl;
150  return;
151  }
152  // Analyse (no "z" in "analyse" : we are in Europe, dammit!)
153  PFJetBenchmark_.process(*pfjets, *genjets);
154 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
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 159 of file PFJetBenchmarkAnalyzer.cc.

160 {
161 
162 }
void PFJetBenchmarkAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 166 of file PFJetBenchmarkAnalyzer.cc.

References DEFINE_FWK_MODULE, and PFJetBenchmark::write().

166  {
167 // PFJetBenchmark_.save();
169 }
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.

Member Data Documentation

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

Definition at line 63 of file PFJetBenchmarkAnalyzer.cc.

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

Definition at line 64 of file PFJetBenchmarkAnalyzer.cc.