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::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

 PFJetBenchmarkAnalyzer (const edm::ParameterSet &)
 PFJet Benchmark. More...
 
 ~PFJetBenchmarkAnalyzer () 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 benchmarkLabel_
 
dqm::legacy::DQMStoredbe_
 
double deltaRMax = 0.1
 
double maxEta
 
bool onlyTwoJets
 
string outjetfilename
 
bool pfjBenchmarkDebug
 
PFJetBenchmark PFJetBenchmark_
 
bool plotAgainstReco
 
double recPt
 
edm::EDGetTokenT< reco::GenJetCollectionsGenJetAlgo_tok_
 
edm::EDGetTokenT< reco::PFJetCollectionsJetAlgo_tok_
 

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

PFJet Benchmark.

Definition at line 90 of file PFJetBenchmarkAnalyzer.cc.

References PFElectronDQMAnalyzer_cfi::deltaRMax, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), razorScouting_cff::maxEta, PFJetDQMAnalyzer_cfi::onlyTwoJets, Utilities::operator, pfJetBenchmark_cfi::pfjBenchmarkDebug, and caloJetBenchmarkGeneric_cfi::recPt.

92 {
93  // now do what ever initialization is needed
94  sGenJetAlgo_tok_ = consumes<reco::GenJetCollection>(iConfig.getParameter<edm::InputTag>("InputTruthLabel"));
95  sJetAlgo_tok_ = consumes<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("InputRecoLabel"));
96  outjetfilename = iConfig.getUntrackedParameter<string>("OutputFile");
97  pfjBenchmarkDebug = iConfig.getParameter<bool>("pfjBenchmarkDebug");
98  plotAgainstReco = iConfig.getParameter<bool>("PlotAgainstRecoQuantities");
99  onlyTwoJets = iConfig.getParameter<bool>("OnlyTwoJets");
100  deltaRMax = iConfig.getParameter<double>("deltaRMax");
101  benchmarkLabel_ = iConfig.getParameter<string>("BenchmarkLabel");
102  recPt = iConfig.getParameter<double>("recPt");
103  maxEta = iConfig.getParameter<double>("maxEta");
104 
106 
109 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
dqm::legacy::DQMStore * dbe_
edm::EDGetTokenT< reco::PFJetCollection > sJetAlgo_tok_
edm::EDGetTokenT< reco::GenJetCollection > sGenJetAlgo_tok_
T getUntrackedParameter(std::string const &, T const &) const
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)

◆ ~PFJetBenchmarkAnalyzer()

PFJetBenchmarkAnalyzer::~PFJetBenchmarkAnalyzer ( )
override

Definition at line 111 of file PFJetBenchmarkAnalyzer.cc.

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 121 of file PFJetBenchmarkAnalyzer.cc.

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

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

◆ beginJob()

void PFJetBenchmarkAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 143 of file PFJetBenchmarkAnalyzer.cc.

143 {}

◆ endJob()

void PFJetBenchmarkAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 147 of file PFJetBenchmarkAnalyzer.cc.

147  {
148  // PFJetBenchmark_.save();
150 }

Member Data Documentation

◆ benchmarkLabel_

string PFJetBenchmarkAnalyzer::benchmarkLabel_
private

Definition at line 72 of file PFJetBenchmarkAnalyzer.cc.

◆ dbe_

dqm::legacy::DQMStore* PFJetBenchmarkAnalyzer::dbe_
private

Definition at line 75 of file PFJetBenchmarkAnalyzer.cc.

◆ deltaRMax

double PFJetBenchmarkAnalyzer::deltaRMax = 0.1
private

Definition at line 71 of file PFJetBenchmarkAnalyzer.cc.

◆ maxEta

double PFJetBenchmarkAnalyzer::maxEta
private

Definition at line 74 of file PFJetBenchmarkAnalyzer.cc.

◆ onlyTwoJets

bool PFJetBenchmarkAnalyzer::onlyTwoJets
private

Definition at line 70 of file PFJetBenchmarkAnalyzer.cc.

◆ outjetfilename

string PFJetBenchmarkAnalyzer::outjetfilename
private

Definition at line 67 of file PFJetBenchmarkAnalyzer.cc.

◆ pfjBenchmarkDebug

bool PFJetBenchmarkAnalyzer::pfjBenchmarkDebug
private

Definition at line 68 of file PFJetBenchmarkAnalyzer.cc.

◆ PFJetBenchmark_

PFJetBenchmark PFJetBenchmarkAnalyzer::PFJetBenchmark_
private

Definition at line 66 of file PFJetBenchmarkAnalyzer.cc.

◆ plotAgainstReco

bool PFJetBenchmarkAnalyzer::plotAgainstReco
private

Definition at line 69 of file PFJetBenchmarkAnalyzer.cc.

◆ recPt

double PFJetBenchmarkAnalyzer::recPt
private

Definition at line 73 of file PFJetBenchmarkAnalyzer.cc.

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