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
 
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
 
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
 
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)
 
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
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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

Definition at line 34 of file PhysDecl.h.

Constructor & Destructor Documentation

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

Definition at line 33 of file PhysDecl.cc.

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

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 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigis_
Definition: PhysDecl.h:47
bool applyfilter
Definition: PhysDecl.h:42
bool init_
Definition: PhysDecl.h:44
bool debugOn
Definition: PhysDecl.h:43
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResults_
Definition: PhysDecl.h:46
PhysDecl::~PhysDecl ( )
override

Definition at line 42 of file PhysDecl.cc.

42 {}

Member Function Documentation

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

Definition at line 44 of file PhysDecl.cc.

References edm::HLTGlobalStatus::accept(), cms::dd::accepted(), bsc_activity_cfg::applyfilter, edm::EventBase::bunchCrossing(), l1GtPatternGenerator_cfi::bx, gather_cfg::cout, GOODCOLL_filter_cfg::debugOn, DEFINE_FWK_MODULE, edm::EventID::event(), edm::Event::getByToken(), L1GlobalTriggerReadoutRecord::gtFdlWord(), mps_fire::i, edm::EventBase::id(), edm::HandleBase::isValid(), edm::EventBase::luminosityBlock(), dqmiodumpmetadata::n, L1GtFdlWord::physicsDeclared(), edm::Handle< T >::product(), edm::EventID::run(), L1TEGammaOffline_cfi::triggerNames, edm::TriggerNames::triggerNames(), and edm::Event::triggerNames().

Referenced by Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::filter(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::setDataAccessor(), and Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::switchCenterView().

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 }
RunNumber_t run() const
Definition: EventID.h:38
EventNumber_t event() const
Definition: EventID.h:40
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > gtDigis_
Definition: PhysDecl.h:47
std::vector< std::string > hlNames_
Definition: PhysDecl.h:45
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
bool applyfilter
Definition: PhysDecl.h:42
bool accept() const
Has at least one path accepted the event?
int bunchCrossing() const
Definition: EventBase.h:64
edm::LuminosityBlockNumber_t luminosityBlock() const
Definition: EventBase.h:61
Strings const & triggerNames() const
Definition: TriggerNames.cc:20
bool init_
Definition: PhysDecl.h:44
bool debugOn
Definition: PhysDecl.h:43
bool isValid() const
Definition: HandleBase.h:70
T const * product() const
Definition: Handle.h:69
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
bool accepted(std::vector< std::string_view > const &, std::string_view)
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
Definition: L1GtFdlWord.h:169
edm::EventID id() const
Definition: EventBase.h:59
edm::EDGetTokenT< edm::TriggerResults > hlTriggerResults_
Definition: PhysDecl.h:46
edm::TriggerNames const & triggerNames(edm::TriggerResults const &triggerResults) const override
Definition: Event.cc:265

Member Data Documentation

bool PhysDecl::applyfilter
private

Definition at line 42 of file PhysDecl.h.

bool PhysDecl::debugOn
private

Definition at line 43 of file PhysDecl.h.

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

Definition at line 47 of file PhysDecl.h.

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

Definition at line 45 of file PhysDecl.h.

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

Definition at line 46 of file PhysDecl.h.

bool PhysDecl::init_
private

Definition at line 44 of file PhysDecl.h.