7.4.1 PAT Examples: Electron Example
Complete:
Detailed Review status
Contents
Introduction
In this example you will find how to make a simple analysis (including some more physics contents) with pat::Electrons within a simple EDAnalyzer. You can find the EDAnalyzer and the configuration file in the
PatExamples
package. It will provide you with the following information:
- how to access information from the pat::Electron.
- how to determine an electron reconstruction efficiency from simulation.
- how to estimate an electronID efficiency applying a simple tag and probe method.
It is required that you have a clear picture of:
- how to write an EDAnalyzer (in principle).
- how to read in parameters from the configuration file.
- how to clone modules with different parameters in python.
- how to access a pat::Candidate collection from the event content with an EDAnalyzer.
Run the EDAnalyzer example
If you've done the setup for the [ggNtuplizer][https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookElectronAnalysis#Create_Ntuples_using_the_ggNtupl],
you should already have the necessary files to run an EDAnalyzer example.
cd CMSSW_9_4_4/src
cmsenv
The relevant files for this workbook are in =PhysicsTools/PatExamples and they have the following functionality:
- plugins/PatElectronAnalyzer.cc: the main module to book and fill histograms.
- python/PatElectronAnalyzer_cfi.py: initialising configuration file for the plugin.
- python/tagAndProbeAnalysis_cff.py: simple configuration example for a tag and probe analysis with CMSSW.
- test/analyzePatElectron_cfg.py: main configuration file for cmsRun
- test/patElectron_recoEfficiency.C: root macro to display the electron reconstruction efficiency from simulation.
- test/patElectron_eidEfficiency.C: root macro to display the electronID efficiency from the tag and probe method.
cmsRun PhysicsTools/PatExamples/test/analyzePatElectron_cfg.py
Compile and run the example as given below:
scram b
cmsRun PhysicsTools/PatExamples/test/analyzePatElectron_cfg.py
You can inspect the outcome using the two root macros which are provided with the example:
root -l
.x patElectron_recoEfficiency.C
.x patElectron_eidEfficiency.C
Review status
Responsible:
RogerWolf
Last reviewed by: most recent reviewer and date
--
RogerWolf - 11 Jun 2009