CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
ScoutingTestAnalyzer Class Reference

#include <ScoutingTestAnalyzer.h>

Inheritance diagram for ScoutingTestAnalyzer:
ScoutingAnalyzerBase DQMEDAnalyzer edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
 ScoutingTestAnalyzer (const edm::ParameterSet &)
 
 ~ScoutingTestAnalyzer () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &event, edm::EventSetup const &setup) final
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
void beginStream (edm::StreamID id) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
void endLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Private Attributes

MonitorElementm_jetEtaPhi
 
MonitorElementm_jetPt
 
edm::InputTag m_pfJetsCollectionTag
 
edm::EDGetTokenT
< reco::CaloJetCollection
m_pfJetsCollectionTagToken_
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- Public Types inherited from edm::stream::EDProducer< edm::GlobalCache< DQMEDAnalyzerGlobalCache >, edm::EndRunProducer, edm::EndLuminosityBlockProducer, edm::Accumulator >
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static void globalEndJob (DQMEDAnalyzerGlobalCache const *)
 
static void globalEndLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup, LuminosityBlockContext const *context)
 
static void globalEndRunProduce (edm::Run &run, edm::EventSetup const &setup, RunContext const *context)
 
static std::unique_ptr
< DQMEDAnalyzerGlobalCache
initializeGlobalCache (edm::ParameterSet const &)
 
- Protected Member Functions inherited from ScoutingAnalyzerBase
MonitorElementbookH1 (DQMStore::IBooker &, 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 (DQMStore::IBooker &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH1BinArray (DQMStore::IBooker &, 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 (DQMStore::IBooker &, 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 (DQMStore::IBooker &, 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 (DQMStore::IBooker &, 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 (DQMStore::IBooker &, const std::string &name, MonitorElement *num, MonitorElement *denom, const std::string &titleX, const std::string &titleY, const std::string &title="")
 
MonitorElementbookH2withSumw2 (DQMStore::IBooker &, 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 (DQMStore::IBooker &, 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")
 
std::string newName (const std::string &name)
 
void prepareBooking (DQMStore::IBooker &)
 
MonitorElementprofileX (DQMStore::IBooker &, MonitorElement *me2d, const std::string &title="", const std::string &titleX="", const std::string &titleY="", Double_t minimum=-1111, Double_t maximum=-1111)
 
MonitorElementprofileY (DQMStore::IBooker &, 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)
 
 ~ScoutingAnalyzerBase () override
 
- Protected Member Functions inherited from DQMEDAnalyzer
uint64_t meId () const
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 
unsigned int streamId_
 

Detailed Description

Definition at line 8 of file ScoutingTestAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 8 of file ScoutingTestAnalyzer.cc.

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

8  : ScoutingAnalyzerBase(conf) {
9  m_pfJetsCollectionTag = conf.getUntrackedParameter<edm::InputTag>("pfJetsCollectionName");
10  // set Token(-s)
12  consumes<reco::CaloJetCollection>(conf.getUntrackedParameter<edm::InputTag>("pfJetsCollectionName"));
13 }
T getUntrackedParameter(std::string const &, T const &) const
edm::InputTag m_pfJetsCollectionTag
edm::EDGetTokenT< reco::CaloJetCollection > m_pfJetsCollectionTagToken_
ScoutingAnalyzerBase(const edm::ParameterSet &conf)
ScoutingTestAnalyzer::~ScoutingTestAnalyzer ( )
override

Definition at line 15 of file ScoutingTestAnalyzer.cc.

15 {}

Member Function Documentation

void ScoutingTestAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup c 
)
overridevirtual

Reimplemented from ScoutingAnalyzerBase.

Definition at line 41 of file ScoutingTestAnalyzer.cc.

References dqm::impl::MonitorElement::Fill(), edm::Event::getByToken(), m_jetEtaPhi, m_jetPt, and m_pfJetsCollectionTagToken_.

41  {
43  iEvent.getByToken(m_pfJetsCollectionTagToken_, calojets_handle);
44  /* This is an example of how C++11 can simplify or lifes. The auto keyword
45  make the compiler figure out by itself which is the type of the pfjets
46  object. The qualifier const of course still apply. Poor's man explaination:
47  "compiler, make pfjets a const ref and figure out for me the type"*/
48  auto const &calojets = *calojets_handle;
49 
50  // Again, C++11. A loop on a std::vector becomes as simple as this!
51  for (auto const &calojet : calojets) {
52  m_jetPt->Fill(calojet.pt());
53  m_jetEtaPhi->Fill(calojet.eta(), calojet.phi());
54  }
55 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
MonitorElement * m_jetEtaPhi
void Fill(long long x)
edm::EDGetTokenT< reco::CaloJetCollection > m_pfJetsCollectionTagToken_
MonitorElement * m_jetPt
void ScoutingTestAnalyzer::bookHistograms ( DQMStore::IBooker iBooker,
edm::Run const &  ,
edm::EventSetup const &   
)
overridevirtual

Implements DQMEDAnalyzer.

Definition at line 18 of file ScoutingTestAnalyzer.cc.

References ScoutingAnalyzerBase::bookH1withSumw2(), ScoutingAnalyzerBase::bookH2withSumw2(), edm::InputTag::label(), m_jetEtaPhi, m_jetPt, m_pfJetsCollectionTag, ScoutingAnalyzerBase::prepareBooking(), and AlCaHLTBitMon_QueryRunRegistry::string.

18  {
20  std::string collection_name = m_pfJetsCollectionTag.label();
21 
22  /* This method allows us to book an Histogram in one line in a completely
23  * transparent way. Take your time to put axis titles!!!!*/
25  iBooker, collection_name + "_pt", collection_name + " Jet P_{T}", 50, 0., 500., "Jet P_{T} [GeV]");
26 
27  m_jetEtaPhi = bookH2withSumw2(iBooker,
28  collection_name + "_etaphi",
29  collection_name + " #eta #phi",
30  50,
31  -5,
32  5,
33  50,
34  -3.1415,
35  +3.1415,
36  "#eta^{Jet}",
37  "#phi^{Jet}");
38 }
void prepareBooking(DQMStore::IBooker &)
MonitorElement * m_jetEtaPhi
MonitorElement * bookH1withSumw2(DQMStore::IBooker &, 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")
edm::InputTag m_pfJetsCollectionTag
MonitorElement * bookH2withSumw2(DQMStore::IBooker &, 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 * m_jetPt
std::string const & label() const
Definition: InputTag.h:36

Member Data Documentation

MonitorElement* ScoutingTestAnalyzer::m_jetEtaPhi
private

Definition at line 19 of file ScoutingTestAnalyzer.h.

Referenced by analyze(), and bookHistograms().

MonitorElement* ScoutingTestAnalyzer::m_jetPt
private

Definition at line 18 of file ScoutingTestAnalyzer.h.

Referenced by analyze(), and bookHistograms().

edm::InputTag ScoutingTestAnalyzer::m_pfJetsCollectionTag
private

Definition at line 17 of file ScoutingTestAnalyzer.h.

Referenced by bookHistograms(), and ScoutingTestAnalyzer().

edm::EDGetTokenT<reco::CaloJetCollection> ScoutingTestAnalyzer::m_pfJetsCollectionTagToken_
private

Definition at line 21 of file ScoutingTestAnalyzer.h.

Referenced by analyze(), and ScoutingTestAnalyzer().