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::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 PhysDecl (const edm::ParameterSet &)
 
 ~PhysDecl () override
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilter () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 

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::EDFilter
typedef EDFilter 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
 
- Static Public Member Functions inherited from edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
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)
 
template<Transition B>
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 (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 34 of file PhysDecl.h.

Constructor & Destructor Documentation

◆ PhysDecl()

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

Definition at line 33 of file PhysDecl.cc.

33  {
34  applyfilter = iConfig.getUntrackedParameter<bool>("applyfilter", true);
35  debugOn = iConfig.getUntrackedParameter<bool>("debugOn", false);
36  hlTriggerResults_ = consumes<TriggerResults>(iConfig.getParameter<edm::InputTag>("HLTriggerResults"));
37  gtDigis_ = consumes<L1GlobalTriggerReadoutRecord>(
38  iConfig.getUntrackedParameter<edm::InputTag>("gtDigis", edm::InputTag("gtDigis")));
39  init_ = false;
40 }

References bsc_activity_cfg::applyfilter, GOODCOLL_filter_cfg::debugOn, edm::ParameterSet::getParameter(), and edm::ParameterSet::getUntrackedParameter().

◆ ~PhysDecl()

PhysDecl::~PhysDecl ( )
override

Definition at line 42 of file PhysDecl.cc.

42 {}

Member Function Documentation

◆ filter()

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

Implements edm::EDFilter.

Definition at line 44 of file PhysDecl.cc.

44  {
45  bool accepted = false;
46 
47  int ievt = iEvent.id().event();
48  int irun = iEvent.id().run();
49  int ils = iEvent.luminosityBlock();
50  int bx = iEvent.bunchCrossing();
51 
52  //hlt info
54  iEvent.getByToken(hlTriggerResults_, HLTR);
55 
56  if (HLTR.isValid()) {
57  if (!init_) {
58  init_ = true;
59  const edm::TriggerNames& triggerNames = iEvent.triggerNames(*HLTR);
60  hlNames_ = triggerNames.triggerNames();
61  }
62  if (debugOn) {
63  std::cout << "HLT_debug: Run " << irun << " Ev " << ievt << " LB " << ils << " BX " << bx << " Acc: ";
64  const unsigned int n(hlNames_.size());
65  for (unsigned int i = 0; i != n; ++i) {
66  if (HLTR->accept(i)) {
67  std::cout << hlNames_[i] << ",";
68  }
69  }
70  std::cout << std::endl;
71  }
72  }
73 
74  // trigger info
75 
77  iEvent.getByToken(gtDigis_, gtrr_handle);
78  L1GlobalTriggerReadoutRecord const* gtrr = gtrr_handle.product();
79 
80  L1GtFdlWord fdlWord = gtrr->gtFdlWord();
81  // std::cout << "phys decl. bit=" << fdlWord.physicsDeclared() << std::endl;
82  if (fdlWord.physicsDeclared() == 1)
83  accepted = true;
84 
85  if (debugOn) {
86  std::cout << "PhysDecl_debug: Run " << irun << " Event " << ievt << " Lumi Block " << ils << " Bunch Crossing "
87  << bx << " Accepted " << accepted << std::endl;
88  }
89 
90  if (applyfilter)
91  return accepted;
92  else
93  return true;
94 }

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

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.

mps_fire.i
i
Definition: mps_fire.py:355
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
PhysDecl::hlNames_
std::vector< std::string > hlNames_
Definition: PhysDecl.h:45
edm::Handle::product
T const * product() const
Definition: Handle.h:70
L1GtFdlWord::physicsDeclared
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
Definition: L1GtFdlWord.h:169
PhysDecl::applyfilter
bool applyfilter
Definition: PhysDecl.h:42
gather_cfg.cout
cout
Definition: gather_cfg.py:144
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
L1GlobalTriggerReadoutRecord
Definition: L1GlobalTriggerReadoutRecord.h:46
L1TEGammaOffline_cfi.triggerNames
triggerNames
Definition: L1TEGammaOffline_cfi.py:40
PhysDecl::debugOn
bool debugOn
Definition: PhysDecl.h:43
cms::dd::accepted
bool accepted(std::vector< std::regex > const &, std::string_view)
PhysDecl::gtDigis_
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigis_
Definition: PhysDecl.h:47
L1GtFdlWord
Definition: L1GtFdlWord.h:29
iEvent
int iEvent
Definition: GenABIO.cc:224
PhysDecl::init_
bool init_
Definition: PhysDecl.h:44
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::TriggerNames
Definition: TriggerNames.h:55
PhysDecl::hlTriggerResults_
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResults_
Definition: PhysDecl.h:46
edm::HLTGlobalStatus::accept
bool accept() const
Has at least one path accepted the event?
Definition: HLTGlobalStatus.h:49
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
L1GlobalTriggerReadoutRecord::gtFdlWord
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
Definition: L1GlobalTriggerReadoutRecord.cc:372
edm::InputTag
Definition: InputTag.h:15