CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
PhysDecl Class Reference

#include <PhysDecl.h>

Inheritance diagram for PhysDecl:
edm::one::EDFilter< T > edm::one::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PhysDecl (const edm::ParameterSet &)
 
 ~PhysDecl () override
 
- Public Member Functions inherited from edm::one::EDFilter< T >
 EDFilter ()=default
 
 EDFilter (const EDFilter &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
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 EDFilteroperator= (const EDFilter &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDFilterBase () 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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

bool applyfilter
 
bool debugOn
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecordgtDigis_
 
std::vector< std::string > hlNames_
 
edm::EDGetTokenT< edm::TriggerResultshlTriggerResults_
 
bool init_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDFilterBase
typedef EDFilterBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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
 
- Static Public Member Functions inherited from edm::one::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
template<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 34 of file PhysDecl.h.

Constructor & Destructor Documentation

◆ PhysDecl()

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

Definition at line 32 of file PhysDecl.cc.

References DMR_cfg::applyfilter, DMR_cfg::debugOn, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), and ProducerED_cfi::InputTag.

32  {
33  applyfilter = iConfig.getUntrackedParameter<bool>("applyfilter", true);
34  debugOn = iConfig.getUntrackedParameter<bool>("debugOn", false);
35  hlTriggerResults_ = consumes<TriggerResults>(iConfig.getParameter<edm::InputTag>("HLTriggerResults"));
36  gtDigis_ = consumes<L1GlobalTriggerReadoutRecord>(
37  iConfig.getUntrackedParameter<edm::InputTag>("gtDigis", edm::InputTag("gtDigis")));
38  init_ = false;
39 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigis_
Definition: PhysDecl.h:47
bool applyfilter
Definition: PhysDecl.h:42
bool init_
Definition: PhysDecl.h:44
T getUntrackedParameter(std::string const &, T const &) const
bool debugOn
Definition: PhysDecl.h:43
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResults_
Definition: PhysDecl.h:46

◆ ~PhysDecl()

PhysDecl::~PhysDecl ( )
override

Definition at line 41 of file PhysDecl.cc.

41 {}

Member Function Documentation

◆ filter()

bool PhysDecl::filter ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDFilterBase.

Definition at line 43 of file PhysDecl.cc.

References edm::HLTGlobalStatus::accept(), DMR_cfg::applyfilter, nano_mu_digi_cff::bx, gather_cfg::cout, DMR_cfg::debugOn, L1GlobalTriggerReadoutRecord::gtFdlWord(), mps_fire::i, iEvent, edm::HandleBase::isValid(), dqmiodumpmetadata::n, L1GtFdlWord::physicsDeclared(), edm::Handle< T >::product(), and L1TEGammaOffline_cfi::triggerNames.

43  {
44  bool accepted = false;
45 
46  int ievt = iEvent.id().event();
47  int irun = iEvent.id().run();
48  int ils = iEvent.luminosityBlock();
49  int bx = iEvent.bunchCrossing();
50 
51  //hlt info
53  iEvent.getByToken(hlTriggerResults_, HLTR);
54 
55  if (HLTR.isValid()) {
56  if (!init_) {
57  init_ = true;
58  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*HLTR);
59  hlNames_ = triggerNames.triggerNames();
60  }
61  if (debugOn) {
62  std::cout << "HLT_debug: Run " << irun << " Ev " << ievt << " LB " << ils << " BX " << bx << " Acc: ";
63  const unsigned int n(hlNames_.size());
64  for (unsigned int i = 0; i != n; ++i) {
65  if (HLTR->accept(i)) {
66  std::cout << hlNames_[i] << ",";
67  }
68  }
69  std::cout << std::endl;
70  }
71  }
72 
73  // trigger info
74 
76  iEvent.getByToken(gtDigis_, gtrr_handle);
77  L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
78 
79  L1GtFdlWord fdlWord = gtrr->gtFdlWord();
80  // std::cout << "phys decl. bit=" << fdlWord.physicsDeclared() << std::endl;
81  if (fdlWord.physicsDeclared() == 1)
82  accepted = true;
83 
84  if (debugOn) {
85  std::cout << "PhysDecl_debug: Run " << irun << " Event " << ievt << " Lumi Block " << ils << " Bunch Crossing "
86  << bx << " Accepted " << accepted << std::endl;
87  }
88 
89  if (applyfilter)
90  return accepted;
91  else
92  return true;
93 }
bool accept() const
Has at least one path accepted the event?
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
Definition: L1GtFdlWord.h:169
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigis_
Definition: PhysDecl.h:47
std::vector< std::string > hlNames_
Definition: PhysDecl.h:45
bool applyfilter
Definition: PhysDecl.h:42
T const * product() const
Definition: Handle.h:70
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
bool init_
Definition: PhysDecl.h:44
int iEvent
Definition: GenABIO.cc:224
bool debugOn
Definition: PhysDecl.h:43
bool isValid() const
Definition: HandleBase.h:70
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResults_
Definition: PhysDecl.h:46

Member Data Documentation

◆ applyfilter

bool PhysDecl::applyfilter
private

Definition at line 42 of file PhysDecl.h.

◆ debugOn

bool PhysDecl::debugOn
private

Definition at line 43 of file PhysDecl.h.

◆ gtDigis_

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> PhysDecl::gtDigis_
private

Definition at line 47 of file PhysDecl.h.

◆ hlNames_

std::vector<std::string> PhysDecl::hlNames_
private

Definition at line 45 of file PhysDecl.h.

◆ hlTriggerResults_

edm::EDGetTokenT<edm::TriggerResults> PhysDecl::hlTriggerResults_
private

Definition at line 46 of file PhysDecl.h.

◆ init_

bool PhysDecl::init_
private

Definition at line 44 of file PhysDecl.h.