CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
PatZjetsElectronAnalyzer Class Reference
Inheritance diagram for PatZjetsElectronAnalyzer:
edm::EDAnalyzer

Public Member Functions

 PatZjetsElectronAnalyzer (const edm::ParameterSet &)
 
 ~PatZjetsElectronAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

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

Private Attributes

std::map< std::string, TH1F * > histContainer_
 
edm::InputTag src_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 13 of file PatZjetsElectronAnalyzer.cc.

Constructor & Destructor Documentation

PatZjetsElectronAnalyzer::PatZjetsElectronAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 36 of file PatZjetsElectronAnalyzer.cc.

36  :
39 {
40 }
T getUntrackedParameter(std::string const &, T const &) const
std::map< std::string, TH1F * > histContainer_
PatZjetsElectronAnalyzer::~PatZjetsElectronAnalyzer ( )

Definition at line 42 of file PatZjetsElectronAnalyzer.cc.

43 {
44 }

Member Function Documentation

void PatZjetsElectronAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 47 of file PatZjetsElectronAnalyzer.cc.

References newFWLiteAna::bin, edm::Event::getByLabel(), histContainer_, and src_.

48 {
49  // get electron collection
51  iEvent.getByLabel(src_,elecs);
52 
53  // loop electrons
54  for(edm::View<pat::Electron>::const_iterator elec=elecs->begin(); elec!=elecs->end(); ++elec){
55  // fill simple histograms
56  histContainer_["pt" ]->Fill( elec->pt () );
57  histContainer_["eta" ]->Fill( elec->eta() );
58  histContainer_["phi" ]->Fill( elec->phi() );
59  histContainer_["iso" ]->Fill((elec->trackIso()+elec->caloIso())/elec->pt() );
60  histContainer_["eop" ]->Fill( elec->eSeedClusterOverP() );
61  histContainer_["clus"]->Fill( elec->e1x5()/elec->e5x5() );
62  // fill enegry flow histogram for isolation
63  for(int bin=1; bin<=histContainer_["dr"]->GetNbinsX(); ++bin){
64  double lowerEdge = histContainer_["dr"]->GetBinLowEdge(bin);
65  double upperEdge = histContainer_["dr"]->GetBinLowEdge(bin)+histContainer_["dr"]->GetBinWidth(bin);
66  histContainer_["dr"]->Fill(histContainer_["dr"]->GetBinCenter(bin), elec->trackIsoDeposit()->depositWithin(upperEdge) - elec->trackIsoDeposit()->depositWithin(lowerEdge));
67  }
68  // fill electron id histograms
69  if( elec->electronID("eidRobustLoose") > 0.5 )
70  histContainer_["eIDs" ]->Fill(0);
71  if( elec->electronID("eidRobustTight") > 0.5 )
72  histContainer_["eIDs" ]->Fill(1);
73  if( elec->electronID("eidLoose" ) > 0.5 )
74  histContainer_["eIDs" ]->Fill(2);
75  if( elec->electronID("eidTight" ) > 0.5 )
76  histContainer_["eIDs" ]->Fill(3);
77  if( elec->electronID("eidRobustHighEnergy") > 0.5 )
78  histContainer_["eIDs" ]->Fill(4);
79  }
80 }
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:86
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:359
std::map< std::string, TH1F * > histContainer_
void PatZjetsElectronAnalyzer::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file PatZjetsElectronAnalyzer.cc.

References histContainer_, and TFileDirectory::make().

84 {
85  // register to the TFileService
87 
88  // book histograms:
89  histContainer_["pt" ]=fs->make<TH1F>("pt" , "pt" , 150, 0., 150.);
90  histContainer_["eta" ]=fs->make<TH1F>("eta" , "eta" , 50, 0., 5.);
91  histContainer_["phi" ]=fs->make<TH1F>("phi" , "phi" , 60, 3.14, 3.14);
92  histContainer_["iso" ]=fs->make<TH1F>("iso" , "iso" , 30, 0., 10.);
93  histContainer_["dr" ]=fs->make<TH1F>("dr" , "dr" , 40, 0., 1.);
94  histContainer_["eop" ]=fs->make<TH1F>("eop" , "eop" , 40, 0., 1.);
95  histContainer_["clus"]=fs->make<TH1F>("clus" , "clus" , 40, 0., 1.);
96  histContainer_["eIDs"]=fs->make<TH1F>("eIDs" , "eIDS" , 5, 0., 5.);
97 }
std::map< std::string, TH1F * > histContainer_
T * make() const
make new ROOT object
void PatZjetsElectronAnalyzer::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 100 of file PatZjetsElectronAnalyzer.cc.

101 {
102 }

Member Data Documentation

std::map<std::string,TH1F*> PatZjetsElectronAnalyzer::histContainer_
private

Definition at line 28 of file PatZjetsElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

edm::InputTag PatZjetsElectronAnalyzer::src_
private

Definition at line 31 of file PatZjetsElectronAnalyzer.cc.

Referenced by analyze().