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::Accumulator, edm::EndLuminosityBlockProducer, edm::EndRunProducer, edm::one::WatchLuminosityBlocks, edm::one::WatchRuns > 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 &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
 
 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 () 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
 
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)
 

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

Description: [one line class summary]

Implementation: [Notes on implementation]

Description: DQM source for FSQ triggers

Implementation:

Definition at line 59 of file FSQDiJetAve.h.

Constructor & Destructor Documentation

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

Definition at line 737 of file FSQDiJetAve.cc.

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

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

807 {
808  using namespace edm;
809  if (not m_eventCache.setEvent(iEvent, iSetup)){
810  edm::LogError("FSQDiJetAve") << "Could not setup the filter";
811  }
812 
813  //---------- triggerResults ----------
815  if(!m_triggerResults.isValid()) {
817  if(!m_triggerResults.isValid()) {
818  edm::LogError("FSQDiJetAve") << "TriggerResults not valid, skippng event";
819  return;
820  }
821  }
822 
823  //---------- triggerResults ----------
824  if(m_triggerResults.isValid()) {
826  } else {
827  edm::LogError("FSQDiJetAve") << "TriggerResults not found";
828  return;
829  }
830 
831  //---------- triggerSummary ----------
833  if(!m_trgEvent.isValid()) {
835  if(!m_trgEvent.isValid()) {
836  edm::LogInfo("FSQDiJetAve") << "TriggerEvent not found, ";
837  return;
838  }
839  }
840 
841  float weight = 1.;
842  if (m_useGenWeight){
844  iEvent.getByToken(m_genEvInfoToken, hGW);
845  weight = hGW->weight();
846  }
847 
848  for (auto & m_handler : m_handlers) {
849  m_handler->analyze(iEvent, iSetup, m_hltConfig, *m_trgEvent.product(), *m_triggerResults.product(), m_triggerNames, weight);
850  }
851 
852 }
edm::Handle< edm::TriggerResults > m_triggerResults
Definition: FSQDiJetAve.h:92
triggerExpression::Data m_eventCache
Definition: FSQDiJetAve.h:77
edm::Handle< trigger::TriggerEvent > m_trgEvent
Definition: FSQDiJetAve.h:93
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDGetTokenT< edm::TriggerResults > triggerResultsToken
Definition: FSQDiJetAve.h:85
Definition: weight.py:1
edm::EDGetTokenT< GenEventInfoProduct > m_genEvInfoToken
Definition: FSQDiJetAve.h:89
double weight() const
edm::EDGetTokenT< edm::TriggerResults > triggerResultsFUToken
Definition: FSQDiJetAve.h:86
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
Definition: FSQDiJetAve.h:88
bool isValid() const
Definition: HandleBase.h:74
bool setEvent(const edm::Event &event, const edm::EventSetup &setup)
T const * product() const
Definition: Handle.h:81
HLTConfigProvider m_hltConfig
Definition: FSQDiJetAve.h:79
HLT enums.
std::vector< std::shared_ptr< FSQ::BaseHandler > > m_handlers
Definition: FSQDiJetAve.h:99
bool m_useGenWeight
Definition: FSQDiJetAve.h:78
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryToken
Definition: FSQDiJetAve.h:87
edm::TriggerNames m_triggerNames
Definition: FSQDiJetAve.h:91
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:301
void FSQDiJetAve::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 865 of file FSQDiJetAve.cc.

References m_handlers.

865  {
866  for (auto & m_handler : m_handlers) {
867  m_handler->book(booker);
868  }
869 }
std::vector< std::shared_ptr< FSQ::BaseHandler > > m_handlers
Definition: FSQDiJetAve.h:99
void FSQDiJetAve::dqmBeginRun ( edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Reimplemented from DQMEDAnalyzer.

Definition at line 856 of file FSQDiJetAve.cc.

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

857 {
858  bool changed(true);
860  if (m_hltConfig.init(run, c, processName, changed)) {
861  LogDebug("FSQDiJetAve") << "HLTConfigProvider failed to initialize.";
862  }
863 
864 }
#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:79
std::string const & process() const
Definition: InputTag.h:40
edm::InputTag triggerResultsLabel_
Definition: FSQDiJetAve.h:95
void FSQDiJetAve::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 896 of file FSQDiJetAve.cc.

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

896  {
897  //The following says we do not know what parameters are allowed so do no validation
898  // Please change this to state exactly what you do use, even if it is no parameters
900  desc.setUnknown();
901  descriptions.addDefault(desc);
902 }
void addDefault(ParameterSetDescription const &psetDescription)

Member Data Documentation

std::string FSQDiJetAve::m_dirname
private

Definition at line 82 of file FSQDiJetAve.h.

triggerExpression::Data FSQDiJetAve::m_eventCache
private

Definition at line 77 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

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

Definition at line 89 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

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

Definition at line 99 of file FSQDiJetAve.h.

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

HLTConfigProvider FSQDiJetAve::m_hltConfig
private

Definition at line 79 of file FSQDiJetAve.h.

Referenced by analyze(), and dqmBeginRun().

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

Definition at line 83 of file FSQDiJetAve.h.

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

Definition at line 93 of file FSQDiJetAve.h.

Referenced by analyze().

edm::TriggerNames FSQDiJetAve::m_triggerNames
private

Definition at line 91 of file FSQDiJetAve.h.

Referenced by analyze().

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

Definition at line 92 of file FSQDiJetAve.h.

Referenced by analyze().

bool FSQDiJetAve::m_useGenWeight
private

Definition at line 78 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

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

Definition at line 86 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

edm::InputTag FSQDiJetAve::triggerResultsLabel_
private

Definition at line 95 of file FSQDiJetAve.h.

Referenced by dqmBeginRun(), and FSQDiJetAve().

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

Definition at line 85 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

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

Definition at line 88 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().

edm::InputTag FSQDiJetAve::triggerSummaryLabel_
private

Definition at line 94 of file FSQDiJetAve.h.

Referenced by FSQDiJetAve().

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

Definition at line 87 of file FSQDiJetAve.h.

Referenced by analyze(), and FSQDiJetAve().