CMS 3D CMS Logo

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

#include <TopTauAnalyzer.h>

Inheritance diagram for TopTauAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 TopTauAnalyzer (const edm::ParameterSet &)
 
 ~TopTauAnalyzer () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

TH1F * en_
 
TH1F * eta_
 
edm::EDGetTokenT< std::vector< pat::Tau > > inputToken_
 
TH1F * mult_
 
TH1F * phi_
 
TH1F * pt_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

Definition at line 15 of file TopTauAnalyzer.h.

Constructor & Destructor Documentation

TopTauAnalyzer::TopTauAnalyzer ( const edm::ParameterSet cfg)
explicit

Definition at line 4 of file TopTauAnalyzer.cc.

References en_, eta_, TFileService::make(), mult_, phi_, and pt_.

4  :
5  inputToken_(consumes<std::vector<pat::Tau> >(cfg.getParameter<edm::InputTag>("input")))
6 {
8 
9  mult_ = fs->make<TH1F>("mult", "multiplicity (taus)", 30, 0 , 30);
10  en_ = fs->make<TH1F>("en" , "energy (taus)", 60, 0., 300.);
11  pt_ = fs->make<TH1F>("pt" , "pt (taus}", 60, 0., 300.);
12  eta_ = fs->make<TH1F>("eta" , "eta (taus)", 30, -3., 3.);
13  phi_ = fs->make<TH1F>("phi" , "phi (taus)", 40, -4., 4.);
14 }
T getParameter(std::string const &) const
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< std::vector< pat::Tau > > inputToken_
TopTauAnalyzer::~TopTauAnalyzer ( )
override

Definition at line 16 of file TopTauAnalyzer.cc.

17 {
18 }

Member Function Documentation

void TopTauAnalyzer::analyze ( const edm::Event evt,
const edm::EventSetup setup 
)
overrideprivate

Definition at line 21 of file TopTauAnalyzer.cc.

References en_, eta_, edm::Event::getByToken(), inputToken_, mult_, phi_, pt_, metsig::tau, and nano_cff::taus.

22 {
24  evt.getByToken(inputToken_, taus);
25 
26  // fill histograms
27 
28  mult_->Fill( taus->size() );
29  for(std::vector<pat::Tau>::const_iterator tau=taus->begin(); tau!=taus->end(); ++tau){
30  en_ ->Fill( tau->energy() );
31  pt_ ->Fill( tau->pt() );
32  eta_->Fill( tau->eta() );
33  phi_->Fill( tau->phi() );
34  }
35 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
edm::EDGetTokenT< std::vector< pat::Tau > > inputToken_
void TopTauAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 37 of file TopTauAnalyzer.cc.

38 {
39 }
void TopTauAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file TopTauAnalyzer.cc.

42 {
43 }

Member Data Documentation

TH1F* TopTauAnalyzer::en_
private

Definition at line 31 of file TopTauAnalyzer.h.

Referenced by analyze(), and TopTauAnalyzer().

TH1F* TopTauAnalyzer::eta_
private

Definition at line 33 of file TopTauAnalyzer.h.

Referenced by analyze(), and TopTauAnalyzer().

edm::EDGetTokenT<std::vector<pat::Tau> > TopTauAnalyzer::inputToken_
private

Definition at line 28 of file TopTauAnalyzer.h.

Referenced by analyze().

TH1F* TopTauAnalyzer::mult_
private

Definition at line 30 of file TopTauAnalyzer.h.

Referenced by analyze(), and TopTauAnalyzer().

TH1F* TopTauAnalyzer::phi_
private

Definition at line 34 of file TopTauAnalyzer.h.

Referenced by analyze(), and TopTauAnalyzer().

TH1F* TopTauAnalyzer::pt_
private

Definition at line 32 of file TopTauAnalyzer.h.

Referenced by analyze(), and TopTauAnalyzer().