CMS 3D CMS Logo

PatAnalyzerKit Class Reference

PatAnalyzerKit is a generic ED analyzer with predefined physics histograms. More...

#include <PhysicsTools/StarterKit/plugins/PatAnalyzerKit.cc>

Inheritance diagram for PatAnalyzerKit:

edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 PatAnalyzerKit (const edm::ParameterSet &)
virtual ~PatAnalyzerKit ()

Protected Member Functions

virtual void beginJob (const edm::EventSetup &)
virtual void endJob ()
virtual void produce (edm::Event &, const edm::EventSetup &)

Protected Attributes

edm::Handle< std::vector
< pat::Electron > > 
electronHandle_
pat::PatKitHelper helper_
edm::Handle< std::vector
< pat::Jet > > 
jetHandle_
edm::Handle< std::vector
< pat::MET > > 
METHandle_
edm::Handle< std::vector
< pat::Muon > > 
muonHandle_
edm::Handle< std::vector
< pat::Photon > > 
photonHandle_
edm::Handle< std::vector
< pat::Tau > > 
tauHandle_
int verboseLevel_


Detailed Description

PatAnalyzerKit is a generic ED analyzer with predefined physics histograms.

This is an ED analyzer which creates and fills a bunch of histograms of various physics quantities. However, in order to make this also work in FWLite, most of the actual work is performed by another object called PhysicsHistograms, to which this ED analyzer delegates most of the work, except the interactions with EDM and Framework, like:

Definition at line 78 of file PatAnalyzerKit.h.


Constructor & Destructor Documentation

PatAnalyzerKit::PatAnalyzerKit ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 10 of file PatAnalyzerKit.cc.

References pat::PatKitHelper::bookHistos(), and helper_.

00011   :
00012   verboseLevel_(0),
00013   helper_(iConfig)
00014 {
00015   helper_.bookHistos(this);
00016 }

PatAnalyzerKit::~PatAnalyzerKit (  )  [virtual]

Definition at line 19 of file PatAnalyzerKit.cc.

00020 {
00021 }


Member Function Documentation

void PatAnalyzerKit::beginJob ( const edm::EventSetup  )  [protected, virtual]

Reimplemented from edm::EDProducer.

Definition at line 76 of file PatAnalyzerKit.cc.

00077 {
00078 }

void PatAnalyzerKit::endJob ( void   )  [protected, virtual]

Reimplemented from edm::EDProducer.

Definition at line 84 of file PatAnalyzerKit.cc.

00084                        {
00085 }

void PatAnalyzerKit::produce ( edm::Event evt,
const edm::EventSetup es 
) [protected, virtual]

Implements edm::EDProducer.

Definition at line 30 of file PatAnalyzerKit.cc.

References GenMuonPlsPt100GeV_cfg::cout, electronHandle_, lat::endl(), pat::PatKitHelper::fillHistograms(), pat::PatKitHelper::getHandles(), helper_, jetHandle_, METHandle_, muonHandle_, photonHandle_, std, tauHandle_, and verboseLevel_.

00031 {
00032   using namespace edm;
00033   using namespace std;
00034 
00035   if ( verboseLevel_ > 10 )
00036     std::cout << "PatAnalyzerKit:: in analyze()." << std::endl;
00037 
00038   // --------------------------------------------------
00039   //    Step 1: Retrieve objects from data stream
00040   // --------------------------------------------------
00041   helper_.getHandles( evt,
00042                       muonHandle_,
00043                       electronHandle_,
00044                       tauHandle_,
00045                       jetHandle_,
00046                       METHandle_,
00047                       photonHandle_);
00048 
00049 
00050 
00051   // --------------------------------------------------
00052   //    Step 2: invoke PhysicsHistograms to deal with all this.
00053   //
00054   //    Note that each handle will dereference into a vector<>,
00055   //    however the fillCollection() method takes a reference,
00056   //    so the collections are not copied...
00057   // --------------------------------------------------
00058   if ( verboseLevel_ > 10 )
00059     std::cout << "PatAnalyzerKit::analyze: calling fillCollection()." << std::endl;
00060   helper_.fillHistograms( evt,
00061                           muonHandle_,
00062                           electronHandle_,
00063                           tauHandle_,
00064                           jetHandle_,
00065                           METHandle_,
00066                           photonHandle_);
00067 }


Member Data Documentation

edm::Handle<std::vector<pat::Electron> > PatAnalyzerKit::electronHandle_ [protected]

Definition at line 101 of file PatAnalyzerKit.h.

Referenced by produce().

pat::PatKitHelper PatAnalyzerKit::helper_ [protected]

Definition at line 94 of file PatAnalyzerKit.h.

Referenced by PatAnalyzerKit(), and produce().

edm::Handle<std::vector<pat::Jet> > PatAnalyzerKit::jetHandle_ [protected]

Definition at line 103 of file PatAnalyzerKit.h.

Referenced by produce().

edm::Handle<std::vector<pat::MET> > PatAnalyzerKit::METHandle_ [protected]

Definition at line 104 of file PatAnalyzerKit.h.

Referenced by produce().

edm::Handle<std::vector<pat::Muon> > PatAnalyzerKit::muonHandle_ [protected]

Definition at line 100 of file PatAnalyzerKit.h.

Referenced by produce().

edm::Handle<std::vector<pat::Photon> > PatAnalyzerKit::photonHandle_ [protected]

Definition at line 105 of file PatAnalyzerKit.h.

Referenced by produce().

edm::Handle<std::vector<pat::Tau> > PatAnalyzerKit::tauHandle_ [protected]

Definition at line 102 of file PatAnalyzerKit.h.

Referenced by produce().

int PatAnalyzerKit::verboseLevel_ [protected]

Definition at line 97 of file PatAnalyzerKit.h.

Referenced by produce().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:28 2009 for CMSSW by  doxygen 1.5.4