#include <ScoutingTestAnalyzer.h>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | bookMEs () |
virtual void | endRun (edm::Run const &, edm::EventSetup const &) |
ScoutingTestAnalyzer (const edm::ParameterSet &) | |
virtual | ~ScoutingTestAnalyzer () |
Private Attributes | |
MonitorElement * | m_jetEtaPhi |
MonitorElement * | m_jetPt |
edm::InputTag | m_pfJetsCollectionTag |
Definition at line 9 of file ScoutingTestAnalyzer.h.
ScoutingTestAnalyzer::ScoutingTestAnalyzer | ( | const edm::ParameterSet & | conf | ) | [explicit] |
Definition at line 10 of file ScoutingTestAnalyzer.cc.
References edm::ParameterSet::getUntrackedParameter(), and m_pfJetsCollectionTag.
:ScoutingAnalyzerBase(conf){ m_pfJetsCollectionTag = conf.getUntrackedParameter<edm::InputTag>("pfJetsCollectionName"); }
ScoutingTestAnalyzer::~ScoutingTestAnalyzer | ( | ) | [virtual] |
Definition at line 17 of file ScoutingTestAnalyzer.cc.
{}
void ScoutingTestAnalyzer::analyze | ( | const edm::Event & | iEvent, |
const edm::EventSetup & | c | ||
) | [virtual] |
Reimplemented from ScoutingAnalyzerBase.
Definition at line 21 of file ScoutingTestAnalyzer.cc.
References MonitorElement::Fill(), edm::Event::getByLabel(), m_jetEtaPhi, m_jetPt, and m_pfJetsCollectionTag.
{ edm::Handle<reco::CaloJetCollection> calojets_handle ; iEvent.getByLabel(m_pfJetsCollectionTag,calojets_handle) ; /* This is an example of how C++11 can simplify or lifes. The auto keyword make the compiler figure out by itself which is the type of the pfjets object. The qualifier const of course still apply. Poor's man explaination: "compiler, make pfjets a const ref and figure out for me the type"*/ auto const& calojets = *calojets_handle; // Again, C++11. A loop on a std::vector becomes as simple as this! for (auto const & calojet: calojets){ m_jetPt->Fill(calojet.pt()); m_jetEtaPhi->Fill(calojet.eta(),calojet.phi()); } }
void ScoutingTestAnalyzer::bookMEs | ( | ) | [virtual] |
Reimplemented from ScoutingAnalyzerBase.
Definition at line 64 of file ScoutingTestAnalyzer.cc.
References ScoutingAnalyzerBase::bookH1withSumw2(), ScoutingAnalyzerBase::bookH2withSumw2(), edm::InputTag::label(), m_jetEtaPhi, m_jetPt, and m_pfJetsCollectionTag.
{ std::string collection_name = m_pfJetsCollectionTag.label(); /* This method allows us to book an Histogram in one line in a completely * transparent way. Take your time to put axis titles!!!!*/ m_jetPt = bookH1withSumw2(collection_name+"_pt", collection_name+" Jet P_{T}", 50,0.,500., "Jet P_{T} [GeV]"); m_jetEtaPhi = bookH2withSumw2(collection_name+"_etaphi", collection_name+" #eta #phi", 50,-5,5, 50,-3.1415,+3.1415, "#eta^{Jet}", "#phi^{Jet}"); }
void ScoutingTestAnalyzer::endRun | ( | edm::Run const & | , |
edm::EventSetup const & | |||
) | [virtual] |
Reimplemented from ScoutingAnalyzerBase.
Definition at line 45 of file ScoutingTestAnalyzer.cc.
References edm::InputTag::label(), m_jetEtaPhi, m_pfJetsCollectionTag, ScoutingAnalyzerBase::profileX(), and ScoutingAnalyzerBase::profileY().
{ std::string collection_name = m_pfJetsCollectionTag.label(); /* This function is specific of this class and allows us to make a * projection in one line */ profileX(m_jetEtaPhi, collection_name+" Jets #eta (projection)", "#eta^{Jet}"); profileY(m_jetEtaPhi, collection_name+" Jets phi (projection)", "#phi^{Jet}"); }
MonitorElement* ScoutingTestAnalyzer::m_jetEtaPhi [private] |
Definition at line 28 of file ScoutingTestAnalyzer.h.
MonitorElement* ScoutingTestAnalyzer::m_jetPt [private] |
Definition at line 27 of file ScoutingTestAnalyzer.h.
Definition at line 26 of file ScoutingTestAnalyzer.h.
Referenced by analyze(), bookMEs(), endRun(), and ScoutingTestAnalyzer().