CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::GenJetCollection
sGenJetAlgo_tok_
 
edm::EDGetTokenT
< reco::PFJetCollection
sJetAlgo_tok_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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, cppFunctionSkipper::operator, outjetfilename, pfjBenchmarkDebug, PFJetBenchmark_, 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

Implements edm::EDAnalyzer.

Definition at line 134 of file PFJetBenchmarkAnalyzer.cc.

References gather_cfg::cout, edm::Event::getByToken(), PFJetBenchmark_, 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:446
edm::EDGetTokenT< reco::PFJetCollection > sJetAlgo_tok_
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
edm::EDGetTokenT< reco::GenJetCollection > sGenJetAlgo_tok_
void process(const reco::PFJetCollection &, const reco::GenJetCollection &)
tuple cout
Definition: gather_cfg.py:121
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 PFJetBenchmark_, 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.