test
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 edm::EDConsumerBase

Public Member Functions

 PatZjetsElectronAnalyzer (const edm::ParameterSet &)
 
 ~PatZjetsElectronAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & 
itemsToGetFromEvent () 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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

std::map< std::string, TH1F * > histContainer_
 
edm::EDGetTokenT< edm::View
< pat::Electron > > 
srcToken_
 

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 &)
 
- 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 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
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
edm::EDGetTokenT< edm::View< pat::Electron > > srcToken_
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 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 47 of file PatZjetsElectronAnalyzer.cc.

References newFWLiteAna::bin, HcalObjRepresent::Fill(), edm::Event::getByToken(), histContainer_, and srcToken_.

48 {
49  // get electron collection
51  iEvent.getByToken(srcToken_,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 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
edm::EDGetTokenT< edm::View< pat::Electron > > srcToken_
std::map< std::string, TH1F * > histContainer_
boost::indirect_iterator< typename seq_t::const_iterator > const_iterator
Definition: View.h:81
void PatZjetsElectronAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 83 of file PatZjetsElectronAnalyzer.cc.

References fs, histContainer_, and TFileService::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 }
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
std::map< std::string, TH1F * > histContainer_
edm::Service< TFileService > fs
void PatZjetsElectronAnalyzer::endJob ( void  )
overrideprivatevirtual

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 30 of file PatZjetsElectronAnalyzer.cc.

Referenced by analyze(), and beginJob().

edm::EDGetTokenT<edm::View<pat::Electron> > PatZjetsElectronAnalyzer::srcToken_
private

Definition at line 33 of file PatZjetsElectronAnalyzer.cc.

Referenced by analyze().