CMS 3D CMS Logo

Public Member Functions | Private Attributes

ScoutingTestAnalyzer Class Reference

#include <ScoutingTestAnalyzer.h>

Inheritance diagram for ScoutingTestAnalyzer:
ScoutingAnalyzerBase edm::EDAnalyzer

List of all members.

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

MonitorElementm_jetEtaPhi
MonitorElementm_jetPt
edm::InputTag m_pfJetsCollectionTag

Detailed Description

Definition at line 9 of file ScoutingTestAnalyzer.h.


Constructor & Destructor Documentation

ScoutingTestAnalyzer::ScoutingTestAnalyzer ( const edm::ParameterSet conf) [explicit]
ScoutingTestAnalyzer::~ScoutingTestAnalyzer ( ) [virtual]

Definition at line 17 of file ScoutingTestAnalyzer.cc.

{}

Member Function Documentation

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}");

    
}

Member Data Documentation

Definition at line 28 of file ScoutingTestAnalyzer.h.

Referenced by analyze(), bookMEs(), and endRun().

Definition at line 27 of file ScoutingTestAnalyzer.h.

Referenced by analyze(), and bookMEs().

Definition at line 26 of file ScoutingTestAnalyzer.h.

Referenced by analyze(), bookMEs(), endRun(), and ScoutingTestAnalyzer().