CMS 3D CMS Logo

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

#include <PFJetBenchmarkAnalyzer.cc>

Inheritance diagram for PFJetBenchmarkAnalyzer:
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

 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 &&)=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::GenJetCollectionsGenJetAlgo_tok_
 
edm::EDGetTokenT< reco::PFJetCollectionsJetAlgo_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 49 of file PFJetBenchmarkAnalyzer.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 51 of file PFJetBenchmarkAnalyzer.cc.

◆ MonitorElement

Definition at line 52 of file PFJetBenchmarkAnalyzer.cc.

Constructor & Destructor Documentation

◆ PFJetBenchmarkAnalyzer()

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

Definition at line 89 of file PFJetBenchmarkAnalyzer.cc.

91 {
92  // now do what ever initialization is needed
93  sGenJetAlgo_tok_ = consumes<reco::GenJetCollection>(iConfig.getParameter<edm::InputTag>("InputTruthLabel"));
94  sJetAlgo_tok_ = consumes<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("InputRecoLabel"));
95  outjetfilename = iConfig.getUntrackedParameter<string>("OutputFile");
96  pfjBenchmarkDebug = iConfig.getParameter<bool>("pfjBenchmarkDebug");
97  plotAgainstReco = iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
98  onlyTwoJets = iConfig.getParameter<bool>("OnlyTwoJets");
99  deltaRMax = iConfig.getParameter<double>("deltaRMax");
100  benchmarkLabel_ = iConfig.getParameter<string>("BenchmarkLabel");
101  recPt = iConfig.getParameter<double>("recPt");
102  maxEta = iConfig.getParameter<double>("maxEta");
103 
104  dbe_ = edm::Service<DQMStore>().operator->();
105 
108 }

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

◆ ~PFJetBenchmarkAnalyzer()

PFJetBenchmarkAnalyzer::~PFJetBenchmarkAnalyzer ( )
override

Definition at line 110 of file PFJetBenchmarkAnalyzer.cc.

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

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 120 of file PFJetBenchmarkAnalyzer.cc.

120  {
121  // get gen jet collection
122  Handle<GenJetCollection> genjets;
123  bool isGen = iEvent.getByToken(sGenJetAlgo_tok_, genjets);
124  if (!isGen) {
125  std::cout << "Warning : no Gen jets in input !" << std::endl;
126  return;
127  }
128 
129  // get rec PFJet collection
131  bool isReco = iEvent.getByToken(sJetAlgo_tok_, pfjets);
132  if (!isReco) {
133  std::cout << "Warning : no PF jets in input !" << std::endl;
134  return;
135  }
136  // Analyse (no "z" in "analyse" : we are in Europe, dammit!)
137  PFJetBenchmark_.process(*pfjets, *genjets);
138 }

References gather_cfg::cout, iEvent, TauSpinner_cfi::isReco, PFJetBenchmark_, and PFJetBenchmark::process().

◆ beginJob()

void PFJetBenchmarkAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 142 of file PFJetBenchmarkAnalyzer.cc.

142 {}

◆ endJob()

void PFJetBenchmarkAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 146 of file PFJetBenchmarkAnalyzer.cc.

146  {
147  // PFJetBenchmark_.save();
149 }

References PFJetBenchmark_, and PFJetBenchmark::write().

Member Data Documentation

◆ sGenJetAlgo_tok_

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

Definition at line 62 of file PFJetBenchmarkAnalyzer.cc.

◆ sJetAlgo_tok_

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

Definition at line 63 of file PFJetBenchmarkAnalyzer.cc.

gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
PFJetBenchmark_
PFJetBenchmark PFJetBenchmark_
PFJet Benchmark.
Definition: PFJetBenchmarkAnalyzer.cc:68
edm::Handle
Definition: AssociativeIterator.h:50
onlyTwoJets
bool onlyTwoJets
Definition: PFJetBenchmarkAnalyzer.cc:72
recPt
double recPt
Definition: PFJetBenchmarkAnalyzer.cc:75
PFJetBenchmark::process
void process(const reco::PFJetCollection &, const reco::GenJetCollection &)
Definition: PFJetBenchmark.cc:232
deltaRMax
double deltaRMax
Definition: PFJetBenchmarkAnalyzer.cc:73
maxEta
double maxEta
Definition: PFJetBenchmarkAnalyzer.cc:76
dbe_
dqm::legacy::DQMStore * dbe_
Definition: PFJetBenchmarkAnalyzer.cc:77
PFJetBenchmark::write
void write()
Definition: PFJetBenchmark.cc:54
outjetfilename
string outjetfilename
Definition: PFJetBenchmarkAnalyzer.cc:69
edm::Service
Definition: Service.h:30
iEvent
int iEvent
Definition: GenABIO.cc:224
PFJetBenchmark::setup
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=nullptr)
Definition: PFJetBenchmark.cc:69
plotAgainstReco
bool plotAgainstReco
Definition: PFJetBenchmarkAnalyzer.cc:71
PFJetBenchmarkAnalyzer::sJetAlgo_tok_
edm::EDGetTokenT< reco::PFJetCollection > sJetAlgo_tok_
Definition: PFJetBenchmarkAnalyzer.cc:63
pfjBenchmarkDebug
bool pfjBenchmarkDebug
Definition: PFJetBenchmarkAnalyzer.cc:70
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
PFJetBenchmarkAnalyzer::sGenJetAlgo_tok_
edm::EDGetTokenT< reco::GenJetCollection > sGenJetAlgo_tok_
Definition: PFJetBenchmarkAnalyzer.cc:62
TauSpinner_cfi.isReco
isReco
Definition: TauSpinner_cfi.py:4
edm::InputTag
Definition: InputTag.h:15
benchmarkLabel_
string benchmarkLabel_
Definition: PFJetBenchmarkAnalyzer.cc:74