CP3-llbb Framework
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Framework::Producer Class Referenceabstract

Base class for Framework producers. More...

#include <Producer.h>

Inheritance diagram for Framework::Producer:
Inheritance graph
[legend]

Public Member Functions

 Producer (const std::string &name, const ROOT::TreeGroup &tree_, const edm::ParameterSet &config)
 Base constructor. More...
 
virtual void produce (edm::Event &event, const edm::EventSetup &setup)=0
 Main method of the producer, called for each event. More...
 
virtual void doConsumes (const edm::ParameterSet &pset, edm::ConsumesCollector &&collector)
 Hook for the CMSSW consumes interface. More...
 
virtual void beginJob (MetadataManager &manager)
 Called once at the beginning of the job. More...
 
virtual void endJob (MetadataManager &manager)
 Called once at the end of the job. More...
 
virtual void beginRun (const edm::Run &run, const edm::EventSetup &setup)
 Called at the beginning of a new run. More...
 
virtual void endRun (const edm::Run &run, const edm::EventSetup &setup)
 Called at the end of a run. More...
 
virtual void beginLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
 Called at the beginning of a new luminosity section. More...
 
virtual void endLuminosityBlock (const edm::LuminosityBlock &lumi, const edm::EventSetup &setup)
 Called at the end of a luminosity section. More...
 
 Producer (const Producer &)=delete
 
Produceroperator= (const Producer &)=delete
 

Protected Member Functions

bool doingSystematics () const
 

Protected Attributes

std::string m_name
 
ROOT::TreeGroup tree
 Access point to output tree. More...
 

Friends

class ::ExTreeMaker
 

Detailed Description

Base class for Framework producers.

A producer is a simple module producing quantities from an event. A lot of producers are included in the framework, one for each high-level object (jets, muons, electrons, ...). These producers usually only convert CMS PAT objet into a plain ROOT tree representation.

Machinery for IDs and scale-factors is also included.

When creating a new producer, you must inherit from this pure-virtual class, and implement the produce method. You'll also need to register your producer into the plugin factory. See content of the file Producers.cc for an example of how to do so.

Constructor & Destructor Documentation

◆ Producer()

Framework::Producer::Producer ( const std::string &  name,
const ROOT::TreeGroup &  tree_,
const edm::ParameterSet &  config 
)
inline

Base constructor.

Parameters
nameThe name of the producer
tree_Abstraction of the output tree. Use this to create new branches
configA link to the python configuration
See also
ROOT::TreeGroup / ROOT::TreeWrapper documentation: http://blinkseb.github.io/TreeWrapper/#ROOT::TreeWrapper/ROOT::TreeWrapper
tree

Member Function Documentation

◆ beginJob()

virtual void Framework::Producer::beginJob ( MetadataManager manager)
inlinevirtual

Called once at the beginning of the job.

Parameters
managerThe MetadataManager of the framework. Use this to store metadata to the output file

◆ beginLuminosityBlock()

virtual void Framework::Producer::beginLuminosityBlock ( const edm::LuminosityBlock &  lumi,
const edm::EventSetup &  setup 
)
inlinevirtual

Called at the beginning of a new luminosity section.

You have direct access to the luminosity block via the CMSSW interface with the lumi and setup parameters.

Parameters
runThe CMSSW luminosity block
setupThe CMSSW event setup

◆ beginRun()

virtual void Framework::Producer::beginRun ( const edm::Run &  run,
const edm::EventSetup &  setup 
)
inlinevirtual

Called at the beginning of a new run.

You have direct access to the run via the CMSSW interface with the run and setup parameters.

Parameters
runThe CMSSW run
setupThe CMSSW event setup

◆ doConsumes()

virtual void Framework::Producer::doConsumes ( const edm::ParameterSet &  pset,
edm::ConsumesCollector &&  collector 
)
inlinevirtual

Hook for the CMSSW consumes interface.

Override this method to register your tokens into the CMSSW framework via the collector interface

Parameters
psetA link to the python configuration
collectorThe consumes collector. Use it to register your tokens.
See also
https://twiki.cern.ch/twiki/bin/view/CMSPublic/SWGuideEDMGetDataFromEvent

Reimplemented in JetsProducer, FatJetsProducer, EventProducer, TausProducer, HLTProducer, LeptonsProducer< T >, MuonsProducer, LeptonsProducer< pat::Muon >, LeptonsProducer< pat::Electron >, ElectronsProducer, GenParticlesProducer, METProducer, and VerticesProducer.

◆ endJob()

virtual void Framework::Producer::endJob ( MetadataManager manager)
inlinevirtual

Called once at the end of the job.

Parameters
managerThe MetadataManager of the framework. Use this to store metadata to the output file

◆ endLuminosityBlock()

virtual void Framework::Producer::endLuminosityBlock ( const edm::LuminosityBlock &  lumi,
const edm::EventSetup &  setup 
)
inlinevirtual

Called at the end of a luminosity section.

You have direct access to the luminosity block via the CMSSW interface with the lumi and setup parameters.

Parameters
runThe CMSSW luminosity block
setupThe CMSSW event setup

◆ endRun()

virtual void Framework::Producer::endRun ( const edm::Run &  run,
const edm::EventSetup &  setup 
)
inlinevirtual

Called at the end of a run.

You have direct access to the run via the CMSSW interface with the run and setup parameters.

Parameters
runThe CMSSW run
setupThe CMSSW event setup

◆ produce()

virtual void Framework::Producer::produce ( edm::Event &  event,
const edm::EventSetup &  setup 
)
pure virtual

Main method of the producer, called for each event.

You have direct access to the event via the CMSSW interface with the event and setup parameters.

Parameters
eventThe CMSSW event
setupThe CMSSW event setup
See also
https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookCMSSWFramework#EdM
CMSSW reference manual: https://cmssdt.cern.ch/SDT/doxygen/

Implemented in JetsProducer, FatJetsProducer, EventProducer, HLTProducer, TausProducer, ElectronsProducer, MuonsProducer, GenParticlesProducer, METProducer, and VerticesProducer.

Member Data Documentation

◆ tree

ROOT::TreeGroup Framework::Producer::tree
protected

Access point to output tree.

Use this variable to create new branches.

See also
http://blinkseb.github.io/TreeWrapper/#ROOT::TreeWrapper/ROOT::TreeWrapper

The documentation for this class was generated from the following file: