CMS 3D CMS Logo

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::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator > edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

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
 
virtual void analyze (edm::Event const &, edm::EventSetup const &)
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumi, edm::EventSetup const &setup) final
 
void beginRun (edm::Run const &run, edm::EventSetup const &setup) final
 
virtual void dqmBeginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
 DQMEDAnalyzer ()
 
virtual void dqmEndLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &)
 
virtual void dqmEndRun (edm::Run const &, edm::EventSetup const &)
 
void endLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) final
 
void endLuminosityBlockProduce (edm::LuminosityBlock &lumi, edm::EventSetup const &setup) final
 
void endRun (edm::Run const &, edm::EventSetup const &) final
 
void endRunProduce (edm::Run &run, edm::EventSetup const &setup) final
 
virtual bool getCanSaveByLumi ()
 
- Public Member Functions inherited from edm::one::EDProducer< edm::EndRunProducer, edm::one::WatchRuns, edm::EndLuminosityBlockProducer, edm::one::WatchLuminosityBlocks, edm::Accumulator >
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () 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 () noexcept(false) 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

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< GenEventInfoProductm_genEvInfoToken
 
std::vector< std::shared_ptr< FSQ::BaseHandler > > m_handlers
 
HLTConfigProvider m_hltConfig
 
std::map< std::string, MonitorElement * > m_me
 
edm::Handle< trigger::TriggerEventm_trgEvent
 
edm::TriggerNames m_triggerNames
 
edm::Handle< edm::TriggerResultsm_triggerResults
 
bool m_useGenWeight
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsFUToken
 
edm::InputTag triggerResultsLabel_
 
edm::EDGetTokenT< edm::TriggerResultstriggerResultsToken
 
edm::EDGetTokenT< trigger::TriggerEventtriggerSummaryFUToken
 
edm::InputTag triggerSummaryLabel_
 
edm::EDGetTokenT< trigger::TriggerEventtriggerSummaryToken
 

Additional Inherited Members

- Public Types inherited from DQMEDAnalyzer
typedef dqm::reco::DQMStore DQMStore
 
typedef dqm::reco::MonitorElement MonitorElement
 
- 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
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

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 744 of file FSQDiJetAve.cc.

References edm::EDConsumerBase::consumesCollector(), Exception, edm::ParameterSet::getParameter(), HLT_2018_cff::InputTag, edm::InputTag::instance(), edm::InputTag::label(), m_eventCache, m_genEvInfoToken, m_handlers, m_useGenWeight, muonDTDigis_cfi::pset, AlCaHLTBitMon_QueryRunRegistry::string, DQMOfflineHeavyIons_cff::todo, triggerResultsFUToken, triggerResultsLabel_, triggerResultsToken, triggerSummaryFUToken, triggerSummaryLabel_, triggerSummaryToken, and ~FSQDiJetAve().

745  : m_eventCache(iConfig.getParameterSet("triggerConfiguration"), consumesCollector()) {
746  m_useGenWeight = iConfig.getParameter<bool>("useGenWeight");
747  if (m_useGenWeight) {
748  m_genEvInfoToken = consumes<GenEventInfoProduct>(edm::InputTag("generator"));
749  }
750 
751  triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
752  triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
753  triggerSummaryToken = consumes<trigger::TriggerEvent>(triggerSummaryLabel_);
754  triggerResultsToken = consumes<edm::TriggerResults>(triggerResultsLabel_);
755 
756  triggerSummaryFUToken = consumes<trigger::TriggerEvent>(
757  edm::InputTag(triggerSummaryLabel_.label(), triggerSummaryLabel_.instance(), std::string("FU")));
758  triggerResultsFUToken = consumes<edm::TriggerResults>(
759  edm::InputTag(triggerResultsLabel_.label(), triggerResultsLabel_.instance(), std::string("FU")));
760 
761  std::vector<edm::ParameterSet> todo = iConfig.getParameter<std::vector<edm::ParameterSet> >("todo");
762  for (auto pset : todo) {
763  std::string type = pset.getParameter<std::string>("handlerType");
764  if (type == "FromHLT") {
765  m_handlers.push_back(std::make_shared<FSQ::HLTHandler>(pset, m_eventCache));
766  } else if (type == "RecoCandidateCounter") {
767  m_handlers.push_back(std::make_shared<FSQ::RecoCandidateCounter>(pset, m_eventCache));
768  } else if (type == "RecoTrackCounter") {
769  m_handlers.push_back(std::make_shared<FSQ::RecoTrackCounter>(pset, m_eventCache));
770  } else if (type == "RecoTrackCounterWithVertexConstraint") {
771  m_handlers.push_back(std::make_shared<FSQ::RecoTrackCounterWithVertexConstraint>(pset, m_eventCache));
772  } else if (type == "FromRecoCandidate") {
773  m_handlers.push_back(std::make_shared<FSQ::RecoCandidateHandler>(pset, m_eventCache));
774  } else if (type == "RecoPFJet") {
775  m_handlers.push_back(std::make_shared<FSQ::RecoPFJetHandler>(pset, m_eventCache));
776  } else if (type == "RecoPFJetWithJEC") {
777  m_handlers.push_back(std::make_shared<FSQ::RecoPFJetWithJECHandler>(pset, m_eventCache));
778  } else if (type == "RecoTrack") {
779  m_handlers.push_back(std::make_shared<FSQ::RecoTrackHandler>(pset, m_eventCache));
780  } else if (type == "RecoPhoton") {
781  m_handlers.push_back(std::make_shared<FSQ::RecoPhotonHandler>(pset, m_eventCache));
782  } else if (type == "RecoMuon") {
783  m_handlers.push_back(std::make_shared<FSQ::RecoMuonHandler>(pset, m_eventCache));
784  } else if (type == "RecoGenParticleCounter") {
785  m_handlers.push_back(std::make_shared<FSQ::RecoGenParticleCounter>(pset, m_eventCache));
786  } else if (type == "RecoGenParticleHandler") {
787  m_handlers.push_back(std::make_shared<FSQ::RecoGenParticleHandler>(pset, m_eventCache));
788  } else {
789  throw cms::Exception("FSQ DQM handler not know: " + type);
790  }
791  }
792  for (auto& m_handler : m_handlers) {
793  m_handler->getAndStoreTokens(consumesCollector());
794  }
795 }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
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
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
Definition: FSQDiJetAve.h:84
ParameterSet const & getParameterSet(std::string const &) const
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

Referenced by FSQDiJetAve().

Member Function Documentation

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

Definition at line 799 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, GenEventInfoProduct::weight(), and mps_merge::weight.

799  {
800  using namespace edm;
801  if (not m_eventCache.setEvent(iEvent, iSetup)) {
802  edm::LogError("FSQDiJetAve") << "Could not setup the filter";
803  }
804 
805  //---------- triggerResults ----------
807  if (!m_triggerResults.isValid()) {
809  if (!m_triggerResults.isValid()) {
810  edm::LogError("FSQDiJetAve") << "TriggerResults not valid, skippng event";
811  return;
812  }
813  }
814 
815  //---------- triggerResults ----------
816  if (m_triggerResults.isValid()) {
818  } else {
819  edm::LogError("FSQDiJetAve") << "TriggerResults not found";
820  return;
821  }
822 
823  //---------- triggerSummary ----------
825  if (!m_trgEvent.isValid()) {
827  if (!m_trgEvent.isValid()) {
828  edm::LogInfo("FSQDiJetAve") << "TriggerEvent not found, ";
829  return;
830  }
831  }
832 
833  float weight = 1.;
834  if (m_useGenWeight) {
836  iEvent.getByToken(m_genEvInfoToken, hGW);
837  weight = hGW->weight();
838  }
839 
840  for (auto& m_handler : m_handlers) {
841  m_handler->analyze(
843  }
844 }
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:525
edm::EDGetTokenT< GenEventInfoProduct > m_genEvInfoToken
Definition: FSQDiJetAve.h:85
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
Definition: FSQDiJetAve.h:81
Definition: weight.py:1
double weight() const
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)
T const * product() const
Definition: Handle.h:69
HLTConfigProvider m_hltConfig
Definition: FSQDiJetAve.h:76
HLT enums.
bool m_useGenWeight
Definition: FSQDiJetAve.h:75
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
Definition: FSQDiJetAve.h:83
edm::TriggerNames m_triggerNames
Definition: FSQDiJetAve.h:87
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:265
void FSQDiJetAve::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 854 of file FSQDiJetAve.cc.

References m_handlers.

854  {
855  for (auto& m_handler : m_handlers) {
856  m_handler->book(booker);
857  }
858 }
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 847 of file FSQDiJetAve.cc.

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

847  {
848  bool changed(true);
850  if (m_hltConfig.init(run, c, processName, changed)) {
851  LogDebug("FSQDiJetAve") << "HLTConfigProvider failed to initialize.";
852  }
853 }
#define LogDebug(id)
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
void FSQDiJetAve::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 884 of file FSQDiJetAve.cc.

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

884  {
885  //The following says we do not know what parameters are allowed so do no validation
886  // Please change this to state exactly what you do use, even if it is no parameters
888  desc.setUnknown();
889  descriptions.addDefault(desc);
890 }
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().