Public Member Functions | |
PatZjetsJetAnalyzer (const edm::ParameterSet &) | |
~PatZjetsJetAnalyzer () | |
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_ |
Definition at line 13 of file PatZjetsJetAnalyzer.cc.
PatZjetsJetAnalyzer::PatZjetsJetAnalyzer | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 36 of file PatZjetsJetAnalyzer.cc.
: histContainer_(), src_(iConfig.getUntrackedParameter<edm::InputTag>("src")) { }
PatZjetsJetAnalyzer::~PatZjetsJetAnalyzer | ( | ) |
Definition at line 42 of file PatZjetsJetAnalyzer.cc.
{ }
void PatZjetsJetAnalyzer::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | iSetup | ||
) | [private, virtual] |
Implements edm::EDAnalyzer.
Definition at line 47 of file PatZjetsJetAnalyzer.cc.
References pat::Jet::emEnergyFraction(), reco::LeafCandidate::eta(), edm::Event::getByLabel(), pat::Jet::getCaloConstituent(), pat::Jet::getCaloConstituents(), histContainer_, i, metsig::jet, analyzePatCleaning_cfg::jets, reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), and src_.
{ // get electron collection edm::Handle<edm::View<pat::Jet> > jets; iEvent.getByLabel(src_,jets); // loop jets for(edm::View<pat::Jet>::const_iterator ijet=jets->begin(); ijet!=jets->end(); ++ijet){ // fill simple histograms pat::Jet jet = ijet->correctedJet("had", "uds"); histContainer_["pt" ]->Fill( jet.pt () ); histContainer_["eta" ]->Fill( jet.eta() ); histContainer_["phi" ]->Fill( jet.phi() ); histContainer_["emf" ]->Fill( jet.emEnergyFraction() ); for(unsigned int i=0; i<jet.getCaloConstituents().size(); ++i){ histContainer_["dEta"]->Fill( jet.getCaloConstituent(i)->eta()-jet.eta() ); } } }
void PatZjetsJetAnalyzer::beginJob | ( | void | ) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 68 of file PatZjetsJetAnalyzer.cc.
References histContainer_.
{ // register to the TFileService edm::Service<TFileService> fs; // book histograms: histContainer_["pt" ]=fs->make<TH1F>("pt" , "pt" , 150, 0., 150.); histContainer_["eta" ]=fs->make<TH1F>("eta" , "eta" , 50, 0., 5.); histContainer_["phi" ]=fs->make<TH1F>("phi" , "phi" , 60, 3.14, 3.14); histContainer_["emf" ]=fs->make<TH1F>("emf" , "emf" , 40, 0., 1.); histContainer_["dEta"]=fs->make<TH1F>("dEta" , "dEta" , 40, 0., 1.); }
void PatZjetsJetAnalyzer::endJob | ( | void | ) | [private, virtual] |
std::map<std::string,TH1F*> PatZjetsJetAnalyzer::histContainer_ [private] |
Definition at line 28 of file PatZjetsJetAnalyzer.cc.
Referenced by analyze(), and beginJob().
edm::InputTag PatZjetsJetAnalyzer::src_ [private] |
Definition at line 31 of file PatZjetsJetAnalyzer.cc.
Referenced by analyze().