CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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::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 ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from DQMEDAnalyzer
static std::shared_ptr
< dqmDetails::NoCache
globalBeginLuminosityBlockSummary (edm::LuminosityBlock const &, edm::EventSetup const &, LuminosityBlockContext const *)
 
static std::shared_ptr
< dqmDetails::NoCache
globalBeginRunSummary (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
< 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 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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
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 738 of file FSQDiJetAve.cc.

References edm::EDConsumerBase::consumesCollector(), Exception, edm::ParameterSet::getParameter(), i, HLT_25ns10e33_v2_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.

738  :
739  m_eventCache(iConfig.getParameterSet("triggerConfiguration") , consumesCollector())
740 {
741  m_useGenWeight = iConfig.getParameter<bool>("useGenWeight");
742  if (m_useGenWeight) {
743  m_genEvInfoToken = consumes <GenEventInfoProduct> (edm::InputTag("generator"));
744  }
745 
746  triggerSummaryLabel_ = iConfig.getParameter<edm::InputTag>("triggerSummaryLabel");
747  triggerResultsLabel_ = iConfig.getParameter<edm::InputTag>("triggerResultsLabel");
748  triggerSummaryToken = consumes <trigger::TriggerEvent> (triggerSummaryLabel_);
749  triggerResultsToken = consumes <edm::TriggerResults> (triggerResultsLabel_);
750 
752  triggerResultsFUToken= consumes <edm::TriggerResults> (edm::InputTag(triggerResultsLabel_.label(),triggerResultsLabel_.instance(),std::string("FU")));
753 
754  std::vector< edm::ParameterSet > todo = iConfig.getParameter< std::vector< edm::ParameterSet > >("todo");
755  for (size_t i = 0; i < todo.size(); ++i) {
756  edm::ParameterSet pset = todo.at(i);
757  std::string type = pset.getParameter<std::string>("handlerType");
758  if (type == "FromHLT") {
759  m_handlers.push_back(std::shared_ptr<FSQ::HLTHandler>(new FSQ::HLTHandler(pset, m_eventCache)));
760  }
761  else if (type == "RecoCandidateCounter") {
762  m_handlers.push_back(std::shared_ptr<FSQ::RecoCandidateCounter>(new FSQ::RecoCandidateCounter(pset, m_eventCache)));
763  }
764  else if (type == "RecoTrackCounter") {
765  m_handlers.push_back(std::shared_ptr<FSQ::RecoTrackCounter>(new FSQ::RecoTrackCounter(pset, m_eventCache)));
766  }
767  else if (type == "RecoTrackCounterWithVertexConstraint") {
768  m_handlers.push_back(std::shared_ptr<FSQ::RecoTrackCounterWithVertexConstraint>
770  }
771  else if (type == "FromRecoCandidate") {
772  m_handlers.push_back(std::shared_ptr<FSQ::RecoCandidateHandler>(new FSQ::RecoCandidateHandler(pset, m_eventCache)));
773  }
774  else if (type == "RecoPFJet") {
775  m_handlers.push_back(std::shared_ptr<FSQ::RecoPFJetHandler>(new FSQ::RecoPFJetHandler(pset, m_eventCache)));
776  }
777  else if (type == "RecoPFJetWithJEC") {
778  m_handlers.push_back(std::shared_ptr<FSQ::RecoPFJetWithJECHandler>(new FSQ::RecoPFJetWithJECHandler(pset, m_eventCache)));
779  }
780  else if (type == "RecoTrack") {
781  m_handlers.push_back(std::shared_ptr<FSQ::RecoTrackHandler>(new FSQ::RecoTrackHandler(pset, m_eventCache)));
782  }
783  else if (type == "RecoPhoton") {
784  m_handlers.push_back(std::shared_ptr<FSQ::RecoPhotonHandler>(new FSQ::RecoPhotonHandler(pset, m_eventCache)));
785  }
786  else if (type == "RecoMuon") {
787  m_handlers.push_back(std::shared_ptr<FSQ::RecoMuonHandler>(new FSQ::RecoMuonHandler(pset, m_eventCache)));
788  }
789  else if (type == "RecoGenParticleCounter") {
790  m_handlers.push_back(std::shared_ptr<FSQ::RecoGenParticleCounter>(new FSQ::RecoGenParticleCounter(pset, m_eventCache)));
791  }
792  else if (type == "RecoGenParticleHandler") {
793  m_handlers.push_back(std::shared_ptr<FSQ::RecoGenParticleHandler>(new FSQ::RecoGenParticleHandler(pset, m_eventCache)));
794  }
795  else {
796  throw cms::Exception("FSQ DQM handler not know: "+ type);
797  }
798  }
799  for (size_t i = 0; i < m_handlers.size(); ++i) {
800  m_handlers.at(i)->getAndStoreTokens(consumesCollector());
801  }
802 
803 }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
int i
Definition: DBlmapReader.cc:9
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 805 of file FSQDiJetAve.cc.

806 {}

Member Function Documentation

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

Implements edm::stream::EDAnalyzerBase.

Definition at line 809 of file FSQDiJetAve.cc.

References edm::Event::getByToken(), 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, and puppiForMET_cff::weight.

810 {
811  using namespace edm;
812  if (not m_eventCache.setEvent(iEvent, iSetup)){
813  edm::LogError("FSQDiJetAve") << "Could not setup the filter";
814  }
815 
816  //---------- triggerResults ----------
818  if(!m_triggerResults.isValid()) {
820  if(!m_triggerResults.isValid()) {
821  edm::LogError("FSQDiJetAve") << "TriggerResults not valid, skippng event";
822  return;
823  }
824  }
825 
826  //---------- triggerResults ----------
827  if(m_triggerResults.isValid()) {
829  } else {
830  edm::LogError("FSQDiJetAve") << "TriggerResults not found";
831  return;
832  }
833 
834  //---------- triggerSummary ----------
836  if(!m_trgEvent.isValid()) {
838  if(!m_trgEvent.isValid()) {
839  edm::LogInfo("FSQDiJetAve") << "TriggerEvent not found, ";
840  return;
841  }
842  }
843 
844  float weight = 1.;
845  if (m_useGenWeight){
847  iEvent.getByToken(m_genEvInfoToken, hGW);
848  weight = hGW->weight();
849  }
850 
851  for (size_t i = 0; i < m_handlers.size(); ++i) {
852  m_handlers.at(i)->analyze(iEvent, iSetup, m_hltConfig, *m_trgEvent.product(), *m_triggerResults.product(), m_triggerNames, weight);
853  }
854 
855 }
edm::Handle< edm::TriggerResults > m_triggerResults
Definition: FSQDiJetAve.h:92
int i
Definition: DBlmapReader.cc:9
virtual edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const
Definition: Event.cc:215
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:462
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
edm::EDGetTokenT< trigger::TriggerEvent > triggerSummaryFUToken
Definition: FSQDiJetAve.h:88
bool isValid() const
Definition: HandleBase.h:75
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
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
void FSQDiJetAve::bookHistograms ( DQMStore::IBooker booker,
edm::Run const &  run,
edm::EventSetup const &  c 
)
overrideprivatevirtual

Implements DQMEDAnalyzer.

Definition at line 868 of file FSQDiJetAve.cc.

References i, and m_handlers.

868  {
869  for (size_t i = 0; i < m_handlers.size(); ++i) {
870  m_handlers.at(i)->book(booker);
871  }
872 }
int i
Definition: DBlmapReader.cc:9
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 859 of file FSQDiJetAve.cc.

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

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

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

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