CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
ScoutingTestAnalyzer Class Reference

#include <ScoutingTestAnalyzer.h>

Inheritance diagram for ScoutingTestAnalyzer:
ScoutingAnalyzerBase DQMEDAnalyzer edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
 
void endRun (edm::Run const &, edm::EventSetup const &) override
 
 ScoutingTestAnalyzer (const edm::ParameterSet &)
 
 ~ScoutingTestAnalyzer () override
 
- Public Member Functions inherited from DQMEDAnalyzer
void accumulate (edm::Event const &ev, edm::EventSetup const &es) final
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginRun (edm::Run const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
 DQMEDAnalyzer (DQMEDAnalyzer const &)=delete
 
 DQMEDAnalyzer (DQMEDAnalyzer &&)=delete
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &run, edm::EventSetup const &setup) override
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) override
 
 ~DQMEDAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDProducer< edm::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

MonitorElementm_jetEtaPhi
 
MonitorElementm_jetPt
 
edm::InputTag m_pfJetsCollectionTag
 
edm::EDGetTokenT< reco::CaloJetCollectionm_pfJetsCollectionTagToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from ScoutingAnalyzerBase
void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
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")
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
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 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)
 
- Protected Attributes inherited from DQMEDAnalyzer
edm::EDPutTokenT< DQMTokenlumiToken_
 
edm::EDPutTokenT< DQMTokenrunToken_
 

Detailed Description

Definition at line 8 of file ScoutingTestAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 7 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)
11  m_pfJetsCollectionTagToken_ = consumes<reco::CaloJetCollection>(conf.getUntrackedParameter<edm::InputTag>("pfJetsCollectionName"));
12 }
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 14 of file ScoutingTestAnalyzer.cc.

14 {}

Member Function Documentation

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

Definition at line 41 of file ScoutingTestAnalyzer.cc.

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

41  {
42  edm::Handle<reco::CaloJetCollection> calojets_handle ;
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 object.
46  The qualifier const of course still apply.
47  Poor's man explaination: "compiler, make pfjets a const ref and figure out
48  for me the type"*/
49  auto const& calojets = *calojets_handle;
50 
51  // Again, C++11. A loop on a std::vector becomes as simple as this!
52  for (auto const & calojet: calojets){
53  m_jetPt->Fill(calojet.pt());
54  m_jetEtaPhi->Fill(calojet.eta(),calojet.phi());
55  }
56 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
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 17 of file ScoutingTestAnalyzer.cc.

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

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

Definition at line 60 of file ScoutingTestAnalyzer.cc.

References edm::InputTag::label(), m_pfJetsCollectionTag, and AlCaHLTBitMon_QueryRunRegistry::string.

60  {
61  std::string collection_name = m_pfJetsCollectionTag.label();
62  /* This function is specific of this class and allows us to make a
63  * projection in one line
64  * The following code form the original TestAnalyser tried to book histograms
65  * in the endRun step. This is not allowed anymore.
66  * Since this is just a test class, there is no point in trying to fix the impossible.
67  * The profileX and profileY methods are only used in this test class anyway.
68  * */
75 }
edm::InputTag m_pfJetsCollectionTag
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(), endRun(), and ScoutingTestAnalyzer().

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

Definition at line 21 of file ScoutingTestAnalyzer.h.

Referenced by analyze(), and ScoutingTestAnalyzer().