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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > > edm::stream::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 FSQDiJetAve (const edm::ParameterSet &)
 
 ~FSQDiJetAve ()
 
- Public Member Functions inherited from DQMEDAnalyzer
virtual void beginRun (edm::Run const &, edm::EventSetup const &) final
 
virtual void beginStream (edm::StreamID id) final
 
 DQMEDAnalyzer (void)
 
virtual void endLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
virtual void endRunSummary (edm::Run const &, edm::EventSetup const &, dqmDetails::NoCache *) const final
 
uint32_t streamId () const
 
- Public Member Functions inherited from edm::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
 EDAnalyzer ()=default
 
- Public Member Functions inherited from edm::stream::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDAnalyzerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
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 DQMEDAnalyzer
static std::shared_ptr< dqmDetails::NoCacheglobalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr< dqmDetails::NoCacheglobalBeginRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *)
 
static void globalEndLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *, dqmDetails::NoCache *)
 
static void globalEndRunSummary (edm::Run const &, edm::EventSetup const &, RunContext const *, dqmDetails::NoCache *)
 
- Static Public Member Functions inherited from edm::stream::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
virtual void bookHistograms (DQMStore::IBooker &, edm::Run const &run, edm::EventSetup const &c) override
 
virtual 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::stream::EDAnalyzer< edm::RunSummaryCache< dqmDetails::NoCache >, edm::LuminosityBlockSummaryCache< dqmDetails::NoCache > >
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDAnalyzerBase
typedef EDAnalyzerAdaptorBase ModuleType
 
- 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)
 

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(), mps_fire::i, 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_, and triggerSummaryToken.

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 (size_t i = 0; i < todo.size(); ++i) {
755  edm::ParameterSet pset = todo.at(i);
756  std::string type = pset.getParameter<std::string>("handlerType");
757  if (type == "FromHLT") {
758  m_handlers.push_back(std::shared_ptr<FSQ::HLTHandler>(new FSQ::HLTHandler(pset, m_eventCache)));
759  }
760  else if (type == "RecoCandidateCounter") {
761  m_handlers.push_back(std::shared_ptr<FSQ::RecoCandidateCounter>(new FSQ::RecoCandidateCounter(pset, m_eventCache)));
762  }
763  else if (type == "RecoTrackCounter") {
764  m_handlers.push_back(std::shared_ptr<FSQ::RecoTrackCounter>(new FSQ::RecoTrackCounter(pset, m_eventCache)));
765  }
766  else if (type == "RecoTrackCounterWithVertexConstraint") {
767  m_handlers.push_back(std::shared_ptr<FSQ::RecoTrackCounterWithVertexConstraint>
769  }
770  else if (type == "FromRecoCandidate") {
771  m_handlers.push_back(std::shared_ptr<FSQ::RecoCandidateHandler>(new FSQ::RecoCandidateHandler(pset, m_eventCache)));
772  }
773  else if (type == "RecoPFJet") {
774  m_handlers.push_back(std::shared_ptr<FSQ::RecoPFJetHandler>(new FSQ::RecoPFJetHandler(pset, m_eventCache)));
775  }
776  else if (type == "RecoPFJetWithJEC") {
777  m_handlers.push_back(std::shared_ptr<FSQ::RecoPFJetWithJECHandler>(new FSQ::RecoPFJetWithJECHandler(pset, m_eventCache)));
778  }
779  else if (type == "RecoTrack") {
780  m_handlers.push_back(std::shared_ptr<FSQ::RecoTrackHandler>(new FSQ::RecoTrackHandler(pset, m_eventCache)));
781  }
782  else if (type == "RecoPhoton") {
783  m_handlers.push_back(std::shared_ptr<FSQ::RecoPhotonHandler>(new FSQ::RecoPhotonHandler(pset, m_eventCache)));
784  }
785  else if (type == "RecoMuon") {
786  m_handlers.push_back(std::shared_ptr<FSQ::RecoMuonHandler>(new FSQ::RecoMuonHandler(pset, m_eventCache)));
787  }
788  else if (type == "RecoGenParticleCounter") {
789  m_handlers.push_back(std::shared_ptr<FSQ::RecoGenParticleCounter>(new FSQ::RecoGenParticleCounter(pset, m_eventCache)));
790  }
791  else if (type == "RecoGenParticleHandler") {
792  m_handlers.push_back(std::shared_ptr<FSQ::RecoGenParticleHandler>(new FSQ::RecoGenParticleHandler(pset, m_eventCache)));
793  }
794  else {
795  throw cms::Exception("FSQ DQM handler not know: "+ type);
796  }
797  }
798  for (size_t i = 0; i < m_handlers.size(); ++i) {
799  m_handlers.at(i)->getAndStoreTokens(consumesCollector());
800  }
801 
802 }
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 ( )

Definition at line 804 of file FSQDiJetAve.cc.

805 {}

Member Function Documentation

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

Definition at line 808 of file FSQDiJetAve.cc.

References edm::Event::getByToken(), mps_fire::i, 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.

809 {
810  using namespace edm;
811  if (not m_eventCache.setEvent(iEvent, iSetup)){
812  edm::LogError("FSQDiJetAve") << "Could not setup the filter";
813  }
814 
815  //---------- triggerResults ----------
817  if(!m_triggerResults.isValid()) {
819  if(!m_triggerResults.isValid()) {
820  edm::LogError("FSQDiJetAve") << "TriggerResults not valid, skippng event";
821  return;
822  }
823  }
824 
825  //---------- triggerResults ----------
826  if(m_triggerResults.isValid()) {
828  } else {
829  edm::LogError("FSQDiJetAve") << "TriggerResults not found";
830  return;
831  }
832 
833  //---------- triggerSummary ----------
835  if(!m_trgEvent.isValid()) {
837  if(!m_trgEvent.isValid()) {
838  edm::LogInfo("FSQDiJetAve") << "TriggerEvent not found, ";
839  return;
840  }
841  }
842 
843  float weight = 1.;
844  if (m_useGenWeight){
846  iEvent.getByToken(m_genEvInfoToken, hGW);
847  weight = hGW->weight();
848  }
849 
850  for (size_t i = 0; i < m_handlers.size(); ++i) {
851  m_handlers.at(i)->analyze(iEvent, iSetup, m_hltConfig, *m_trgEvent.product(), *m_triggerResults.product(), m_triggerNames, weight);
852  }
853 
854 }
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:460
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
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:239
void FSQDiJetAve::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 867 of file FSQDiJetAve.cc.

References mps_fire::i, and m_handlers.

867  {
868  for (size_t i = 0; i < m_handlers.size(); ++i) {
869  m_handlers.at(i)->book(booker);
870  }
871 }
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 858 of file FSQDiJetAve.cc.

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

859 {
860  bool changed(true);
862  if (m_hltConfig.init(run, c, processName, changed)) {
863  LogDebug("FSQDiJetAve") << "HLTConfigProvider failed to initialize.";
864  }
865 
866 }
#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 898 of file FSQDiJetAve.cc.

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

898  {
899  //The following says we do not know what parameters are allowed so do no validation
900  // Please change this to state exactly what you do use, even if it is no parameters
902  desc.setUnknown();
903  descriptions.addDefault(desc);
904 }
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().