CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TopTauAnalyzer.cc
Go to the documentation of this file.
2 
3 
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 }
15 
17 {
18 }
19 
20 void
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 }
36 
38 {
39 }
40 
42 {
43 }
44 
tuple cfg
Definition: looper.py:293
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
virtual void endJob()
edm::EDGetTokenT< std::vector< pat::Tau > > inputToken_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
TopTauAnalyzer(const edm::ParameterSet &)
virtual void beginJob()