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 Attributes
ScoutingTestAnalyzer Class Reference

#include <ScoutingTestAnalyzer.h>

Inheritance diagram for ScoutingTestAnalyzer:
ScoutingAnalyzerBase edm::EDAnalyzer edm::EDConsumerBase

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 ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

MonitorElementm_jetEtaPhi
 
MonitorElementm_jetPt
 
edm::InputTag m_pfJetsCollectionTag
 

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)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from ScoutingAnalyzerBase
void beginJob ()
 
MonitorElementbookH1 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1BinArray (const std::string &name, const std::string &title, int nchX, float *xbinsize, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH1withSumw2BinArray (const std::string &name, const std::string &title, int nchX, float *xbinsize, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
 
MonitorElementbookH2 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookH2andDivide (const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH2withSumw2 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
 
MonitorElementbookP1 (const std::string &name, const std::string &title, int nchX, double lowX, double highX, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="E1 P")
 
virtual void endJob ()
 
virtual void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
std::string newName (const std::string &name)
 
MonitorElementprofileX (MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
 ScoutingAnalyzerBase (const edm::ParameterSet &conf)
 
virtual ~ScoutingAnalyzerBase ()
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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 9 of file ScoutingTestAnalyzer.h.

Constructor & Destructor Documentation

ScoutingTestAnalyzer::ScoutingTestAnalyzer ( const edm::ParameterSet conf)
explicit

Definition at line 10 of file ScoutingTestAnalyzer.cc.

References edm::ParameterSet::getUntrackedParameter(), and m_pfJetsCollectionTag.

11  :ScoutingAnalyzerBase(conf){
12  m_pfJetsCollectionTag = conf.getUntrackedParameter<edm::InputTag>("pfJetsCollectionName");
13  }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag m_pfJetsCollectionTag
ScoutingAnalyzerBase(const edm::ParameterSet &conf)
ScoutingTestAnalyzer::~ScoutingTestAnalyzer ( )
virtual

Definition at line 17 of file ScoutingTestAnalyzer.cc.

17 {}

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.

21  {
22 
23 
24  edm::Handle<reco::CaloJetCollection> calojets_handle ;
25  iEvent.getByLabel(m_pfJetsCollectionTag,calojets_handle) ;
26  /* This is an example of how C++11 can simplify or lifes. The auto keyword
27  make the compiler figure out by itself which is the type of the pfjets object.
28  The qualifier const of course still apply.
29  Poor's man explaination: "compiler, make pfjets a const ref and figure out
30  for me the type"*/
31  auto const& calojets = *calojets_handle;
32 
33  // Again, C++11. A loop on a std::vector becomes as simple as this!
34  for (auto const & calojet: calojets){
35  m_jetPt->Fill(calojet.pt());
36  m_jetEtaPhi->Fill(calojet.eta(),calojet.phi());
37  }
38 
39 
40 }
MonitorElement * m_jetEtaPhi
edm::InputTag m_pfJetsCollectionTag
void Fill(long long x)
MonitorElement * m_jetPt
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
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, m_pfJetsCollectionTag, and AlCaHLTBitMon_QueryRunRegistry::string.

64  {
65  std::string collection_name = m_pfJetsCollectionTag.label();
66 
67  /* This method allows us to book an Histogram in one line in a completely
68  * transparent way. Take your time to put axis titles!!!!*/
69  m_jetPt = bookH1withSumw2(collection_name+"_pt",
70  collection_name+" Jet P_{T}",
71  50,0.,500.,
72  "Jet P_{T} [GeV]");
73 
74  m_jetEtaPhi = bookH2withSumw2(collection_name+"_etaphi",
75  collection_name+" #eta #phi",
76  50,-5,5,
77  50,-3.1415,+3.1415,
78  "#eta^{Jet}",
79  "#phi^{Jet}");
80 }
MonitorElement * bookH2withSumw2(const std::string &name, const std::string &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const std::string &titleX="", const std::string &titleY="", Option_t *option="COLZ")
MonitorElement * bookH1withSumw2(const std::string &name, const std::string &title, int nchX, double lowX, double highX, const std::string &titleX="", const std::string &titleY="Events", Option_t *option="E1 P")
MonitorElement * m_jetEtaPhi
edm::InputTag m_pfJetsCollectionTag
MonitorElement * m_jetPt
std::string const & label() const
Definition: InputTag.h:42
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(), ScoutingAnalyzerBase::profileY(), and AlCaHLTBitMon_QueryRunRegistry::string.

45  {
46 
47  std::string collection_name = m_pfJetsCollectionTag.label();
48  /* This function is specific of this class and allows us to make a
49  * projection in one line */
50 
52  collection_name+" Jets #eta (projection)",
53  "#eta^{Jet}");
54 
56  collection_name+" Jets phi (projection)",
57  "#phi^{Jet}");
58 
59 
60 }
MonitorElement * m_jetEtaPhi
edm::InputTag m_pfJetsCollectionTag
MonitorElement * profileY(MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
MonitorElement * profileX(MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
std::string const & label() const
Definition: InputTag.h:42

Member Data Documentation

MonitorElement* ScoutingTestAnalyzer::m_jetEtaPhi
private

Definition at line 28 of file ScoutingTestAnalyzer.h.

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

MonitorElement* ScoutingTestAnalyzer::m_jetPt
private

Definition at line 27 of file ScoutingTestAnalyzer.h.

Referenced by analyze(), and bookMEs().

edm::InputTag ScoutingTestAnalyzer::m_pfJetsCollectionTag
private

Definition at line 26 of file ScoutingTestAnalyzer.h.

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