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 | Static Public Member Functions | Private Member Functions | Private Attributes
FSQDiJetAve Class Reference

#include <DQMOffline/FSQDiJetAve/plugins/FSQDiJetAve.cc>

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

Public Member Functions

 FSQDiJetAve (const edm::ParameterSet &)
 
 ~FSQDiJetAve () 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
 
 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
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- 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 &)
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void bookHistograms (DQMStore::IBooker &, edm::Run const &run, edm::EventSetup const &c) override
 
void dqmBeginRun (edm::Run const &run, edm::EventSetup const &c) override
 

Private Attributes

std::string m_dirname
 
triggerExpression::Data m_eventCache
 
edm::EDGetTokenT
< GenEventInfoProduct
m_genEvInfoToken
 
std::vector< std::shared_ptr
< FSQ::BaseHandler > > 
m_handlers
 
HLTConfigProvider m_hltConfig
 
std::map< std::string,
MonitorElement * > 
m_me
 
edm::Handle
< trigger::TriggerEvent
m_trgEvent
 
edm::TriggerNames m_triggerNames
 
edm::Handle< edm::TriggerResultsm_triggerResults
 
bool m_useGenWeight
 
edm::EDGetTokenT
< edm::TriggerResults
triggerResultsFUToken
 
edm::InputTag triggerResultsLabel_
 
edm::EDGetTokenT
< edm::TriggerResults
triggerResultsToken
 
edm::EDGetTokenT
< trigger::TriggerEvent
triggerSummaryFUToken
 
edm::InputTag triggerSummaryLabel_
 
edm::EDGetTokenT
< trigger::TriggerEvent
triggerSummaryToken
 

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
 
- 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

Description: [one line class summary]

Implementation: [Notes on implementation]

Description: DQM source for FSQ triggers

Implementation:

Definition at line 57 of file FSQDiJetAve.h.

Constructor & Destructor Documentation

FSQDiJetAve::FSQDiJetAve ( const edm::ParameterSet iConfig)
explicit

Definition at line 745 of file FSQDiJetAve.cc.

References Exception, edm::ParameterSet::getParameter(), HLT_FULL_cff::InputTag, edm::InputTag::instance(), edm::InputTag::label(), m_eventCache, m_genEvInfoToken, m_handlers, m_useGenWeight, TrackValidation_cff::pset, AlCaHLTBitMon_QueryRunRegistry::string, triggerResultsFUToken, triggerResultsLabel_, triggerResultsToken, triggerSummaryFUToken, triggerSummaryLabel_, and triggerSummaryToken.

746  : m_eventCache(iConfig.getParameterSet("triggerConfiguration"), consumesCollector()) {
747  m_useGenWeight = iConfig.getParameter<bool>("useGenWeight");
748  if (m_useGenWeight) {
749  m_genEvInfoToken = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
750  }
751 
752  triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
753  triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
754  triggerSummaryToken = consumes<trigger::TriggerEvent>(triggerSummaryLabel_);
755  triggerResultsToken = consumes<edm::TriggerResults>(triggerResultsLabel_);
756 
757  triggerSummaryFUToken = consumes<trigger::TriggerEvent>(
759  triggerResultsFUToken = consumes<edm::TriggerResults>(
760  edm::InputTag(triggerResultsLabel_.label(), triggerResultsLabel_.instance(), std::string("FU")));
761 
762  std::vector<edm::ParameterSet> todo = iConfig.getParameter<std::vector<edm::ParameterSet> >("todo");
763  for (const auto& pset : todo) {
764  std::string type = pset.getParameter<std::string>("handlerType");
765  if (type == "FromHLT") {
766  m_handlers.push_back(std::make_shared<FSQ::HLTHandler>(pset, m_eventCache));
767  } else if (type == "RecoCandidateCounter") {
768  m_handlers.push_back(std::make_shared<FSQ::RecoCandidateCounter>(pset, m_eventCache));
769  } else if (type == "RecoTrackCounter") {
770  m_handlers.push_back(std::make_shared<FSQ::RecoTrackCounter>(pset, m_eventCache));
771  } else if (type == "RecoTrackCounterWithVertexConstraint") {
772  m_handlers.push_back(std::make_shared<FSQ::RecoTrackCounterWithVertexConstraint>(pset, m_eventCache));
773  } else if (type == "FromRecoCandidate") {
774  m_handlers.push_back(std::make_shared<FSQ::RecoCandidateHandler>(pset, m_eventCache));
775  } else if (type == "RecoPFJet") {
776  m_handlers.push_back(std::make_shared<FSQ::RecoPFJetHandler>(pset, m_eventCache));
777  } else if (type == "RecoPFJetWithJEC") {
778  m_handlers.push_back(std::make_shared<FSQ::RecoPFJetWithJECHandler>(pset, m_eventCache));
779  } else if (type == "RecoTrack") {
780  m_handlers.push_back(std::make_shared<FSQ::RecoTrackHandler>(pset, m_eventCache));
781  } else if (type == "RecoPhoton") {
782  m_handlers.push_back(std::make_shared<FSQ::RecoPhotonHandler>(pset, m_eventCache));
783  } else if (type == "RecoMuon") {
784  m_handlers.push_back(std::make_shared<FSQ::RecoMuonHandler>(pset, m_eventCache));
785  } else if (type == "RecoGenParticleCounter") {
786  m_handlers.push_back(std::make_shared<FSQ::RecoGenParticleCounter>(pset, m_eventCache));
787  } else if (type == "RecoGenParticleHandler") {
788  m_handlers.push_back(std::make_shared<FSQ::RecoGenParticleHandler>(pset, m_eventCache));
789  } else {
790  throw cms::Exception("FSQ DQM handler not know: " + type);
791  }
792  }
793  for (auto& m_handler : m_handlers) {
794  m_handler->getAndStoreTokens(consumesCollector());
795  }
796 }
triggerExpression::Data m_eventCache
Definition: FSQDiJetAve.h:74
std::vector< std::shared_ptr< FSQ::BaseHandler > > m_handlers
Definition: FSQDiJetAve.h:94
edm::EDGetTokenT< GenEventInfoProduct > m_genEvInfoToken
Definition: FSQDiJetAve.h:85
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
Definition: FSQDiJetAve.h:81
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken
Definition: FSQDiJetAve.h:82
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
Definition: FSQDiJetAve.h:84
ParameterSet const & getParameterSet(std::string const &) const
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag triggerSummaryLabel_
Definition: FSQDiJetAve.h:90
std::string const & label() const
Definition: InputTag.h:36
bool m_useGenWeight
Definition: FSQDiJetAve.h:75
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
Definition: FSQDiJetAve.h:83
edm::InputTag triggerResultsLabel_
Definition: FSQDiJetAve.h:91
std::string const & instance() const
Definition: InputTag.h:37
FSQDiJetAve::~FSQDiJetAve ( )
overridedefault

Member Function Documentation

void FSQDiJetAve::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 800 of file FSQDiJetAve.cc.

References edm::Event::getByToken(), edm::HandleBase::isValid(), m_eventCache, m_genEvInfoToken, m_handlers, m_hltConfig, m_trgEvent, m_triggerNames, m_triggerResults, m_useGenWeight, edm::Handle< T >::product(), triggerExpression::Data::setEvent(), edm::Event::triggerNames(), triggerResultsFUToken, triggerResultsToken, triggerSummaryFUToken, triggerSummaryToken, and histoStyle::weight.

800  {
801  using namespace edm;
802  if (not m_eventCache.setEvent(iEvent, iSetup)) {
803  edm::LogError("FSQDiJetAve") << "Could not setup the filter";
804  }
805 
806  //---------- triggerResults ----------
808  if (!m_triggerResults.isValid()) {
810  if (!m_triggerResults.isValid()) {
811  edm::LogError("FSQDiJetAve") << "TriggerResults not valid, skippng event";
812  return;
813  }
814  }
815 
816  //---------- triggerResults ----------
817  if (m_triggerResults.isValid()) {
819  } else {
820  edm::LogError("FSQDiJetAve") << "TriggerResults not found";
821  return;
822  }
823 
824  //---------- triggerSummary ----------
826  if (!m_trgEvent.isValid()) {
828  if (!m_trgEvent.isValid()) {
829  edm::LogInfo("FSQDiJetAve") << "TriggerEvent not found, ";
830  return;
831  }
832  }
833 
834  float weight = 1.;
835  if (m_useGenWeight) {
837  iEvent.getByToken(m_genEvInfoToken, hGW);
838  weight = hGW->weight();
839  }
840 
841  for (auto& m_handler : m_handlers) {
842  m_handler->analyze(
844  }
845 }
edm::Handle< edm::TriggerResults > m_triggerResults
Definition: FSQDiJetAve.h:88
triggerExpression::Data m_eventCache
Definition: FSQDiJetAve.h:74
std::vector< std::shared_ptr< FSQ::BaseHandler > > m_handlers
Definition: FSQDiJetAve.h:94
edm::Handle< trigger::TriggerEvent > m_trgEvent
Definition: FSQDiJetAve.h:89
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
edm::EDGetTokenT< GenEventInfoProduct > m_genEvInfoToken
Definition: FSQDiJetAve.h:85
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
Definition: FSQDiJetAve.h:81
Log< level::Error, false > LogError
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:275
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken
Definition: FSQDiJetAve.h:82
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
Definition: FSQDiJetAve.h:84
bool isValid() const
Definition: HandleBase.h:70
bool setEvent(const edm::Event &event, const edm::EventSetup &setup)
Log< level::Info, false > LogInfo
T const * product() const
Definition: Handle.h:70
HLTConfigProvider m_hltConfig
Definition: FSQDiJetAve.h:76
bool m_useGenWeight
Definition: FSQDiJetAve.h:75
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
Definition: FSQDiJetAve.h:83
int weight
Definition: histoStyle.py:51
edm::TriggerNames m_triggerNames
Definition: FSQDiJetAve.h:87
void FSQDiJetAve::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 855 of file FSQDiJetAve.cc.

References m_handlers.

855  {
856  for (auto& m_handler : m_handlers) {
857  m_handler->book(booker);
858  }
859 }
std::vector< std::shared_ptr< FSQ::BaseHandler > > m_handlers
Definition: FSQDiJetAve.h:94
void FSQDiJetAve::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 848 of file FSQDiJetAve.cc.

References HLTConfigProvider::init(), LogDebug, m_hltConfig, edm::InputTag::process(), FSQHLTOfflineSource_cfi::processName, AlCaHLTBitMon_QueryRunRegistry::string, and triggerResultsLabel_.

848  {
849  bool changed(true);
851  if (m_hltConfig.init(run, c, processName, changed)) {
852  LogDebug("FSQDiJetAve") << "HLTConfigProvider failed to initialize.";
853  }
854 }
const edm::EventSetup & c
bool init(const edm::Run &iRun, const edm::EventSetup &iSetup, const std::string &processName, bool &changed)
d&#39;tor
HLTConfigProvider m_hltConfig
Definition: FSQDiJetAve.h:76
std::string const & process() const
Definition: InputTag.h:40
edm::InputTag triggerResultsLabel_
Definition: FSQDiJetAve.h:91
#define LogDebug(id)
void FSQDiJetAve::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 885 of file FSQDiJetAve.cc.

References edm::ConfigurationDescriptions::addDefault(), submitPVResolutionJobs::desc, and edm::ParameterSetDescription::setUnknown().

885  {
886  //The following says we do not know what parameters are allowed so do no validation
887  // Please change this to state exactly what you do use, even if it is no parameters
889  desc.setUnknown();
890  descriptions.addDefault(desc);
891 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

std::string FSQDiJetAve::m_dirname
private

Definition at line 78 of file FSQDiJetAve.h.

triggerExpression::Data FSQDiJetAve::m_eventCache
private

Definition at line 74 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

edm::EDGetTokenT<GenEventInfoProduct> FSQDiJetAve::m_genEvInfoToken
private

Definition at line 85 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

std::vector<std::shared_ptr<FSQ::BaseHandler> > FSQDiJetAve::m_handlers
private

Definition at line 94 of file FSQDiJetAve.h.

Referenced by analyze(), bookHistograms(), and FSQDiJetAve().

HLTConfigProvider FSQDiJetAve::m_hltConfig
private

Definition at line 76 of file FSQDiJetAve.h.

Referenced by analyze(), and dqmBeginRun().

std::map<std::string, MonitorElement*> FSQDiJetAve::m_me
private

Definition at line 79 of file FSQDiJetAve.h.

edm::Handle<trigger::TriggerEvent> FSQDiJetAve::m_trgEvent
private

Definition at line 89 of file FSQDiJetAve.h.

Referenced by analyze().

edm::TriggerNames FSQDiJetAve::m_triggerNames
private

Definition at line 87 of file FSQDiJetAve.h.

Referenced by analyze().

edm::Handle<edm::TriggerResults> FSQDiJetAve::m_triggerResults
private

Definition at line 88 of file FSQDiJetAve.h.

Referenced by analyze().

bool FSQDiJetAve::m_useGenWeight
private

Definition at line 75 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

edm::EDGetTokenT<edm::TriggerResults> FSQDiJetAve::triggerResultsFUToken
private

Definition at line 82 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

edm::InputTag FSQDiJetAve::triggerResultsLabel_
private

Definition at line 91 of file FSQDiJetAve.h.

Referenced by dqmBeginRun(), and FSQDiJetAve().

edm::EDGetTokenT<edm::TriggerResults> FSQDiJetAve::triggerResultsToken
private

Definition at line 81 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

edm::EDGetTokenT<trigger::TriggerEvent> FSQDiJetAve::triggerSummaryFUToken
private

Definition at line 84 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

edm::InputTag FSQDiJetAve::triggerSummaryLabel_
private

Definition at line 90 of file FSQDiJetAve.h.

Referenced by FSQDiJetAve().

edm::EDGetTokenT<trigger::TriggerEvent> FSQDiJetAve::triggerSummaryToken
private

Definition at line 83 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().