CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
HLTPhysicsDeclared Class Reference
Inheritance diagram for HLTPhysicsDeclared:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTPhysicsDeclared (const edm::ParameterSet &)
 
 ~HLTPhysicsDeclared ()
 
- Public Member Functions inherited from edm::EDFilter
 EDFilter ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDFilter ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- 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 & itemsToGetFromEvent () 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 edm::EDFilter
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 

Private Member Functions

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

Private Attributes

edm::InputTag m_gtDigis
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecordm_gtDigisToken
 
bool m_invert
 

Additional Inherited Members

- Public Types inherited from edm::EDFilter
typedef EDFilter ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- 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

Definition at line 24 of file HLTPhysicsDeclared.cc.

Constructor & Destructor Documentation

HLTPhysicsDeclared::HLTPhysicsDeclared ( const edm::ParameterSet config)
explicit

Definition at line 47 of file HLTPhysicsDeclared.cc.

References m_gtDigis, and m_gtDigisToken.

47  :
48  m_invert( config.getParameter<bool>("invert") ),
49  m_gtDigis( config.getParameter<edm::InputTag>("L1GtReadoutRecordTag") )
50 {
51  m_gtDigisToken = consumes<L1GlobalTriggerReadoutRecord>(m_gtDigis);
52 }
T getParameter(std::string const &) const
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_gtDigisToken
HLTPhysicsDeclared::~HLTPhysicsDeclared ( )

Definition at line 54 of file HLTPhysicsDeclared.cc.

55 {
56 }

Member Function Documentation

void HLTPhysicsDeclared::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 59 of file HLTPhysicsDeclared.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

59  {
61  desc.add<edm::InputTag>("L1GtReadoutRecordTag",edm::InputTag("hltGtDigis"));
62  desc.add<bool>("invert",false);
63  descriptions.add("hltPhysicsDeclared",desc);
64 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTPhysicsDeclared::filter ( edm::Event event,
const edm::EventSetup setup 
)
overrideprivatevirtual

Definition at line 66 of file HLTPhysicsDeclared.cc.

References accept(), DEFINE_FWK_MODULE, edm::Event::getByToken(), L1GlobalTriggerReadoutRecord::gtFdlWord(), edm::EventBase::isRealData(), m_gtDigisToken, m_invert, L1GtFdlWord::physicsDeclared(), and edm::HandleBase::whyFailed().

67 {
68  bool accept = false;
69 
70  if (event.isRealData()) {
71  // for real data, access the "physics enabled" bit in the L1 GT data
73  if (not event.getByToken(m_gtDigisToken, h_gtDigis)) {
74  edm::LogWarning(h_gtDigis.whyFailed()->category()) << h_gtDigis.whyFailed()->what();
75  // not enough informations to make a decision - reject the event
76  return false;
77  } else {
78  L1GtFdlWord fdlWord = h_gtDigis->gtFdlWord();
79  if (fdlWord.physicsDeclared() == 1)
80  accept = true;
81  }
82  } else {
83  // for MC, assume the "physics enabled" bit to be always set
84  accept = true;
85  }
86 
87  // if requested, invert the filter decision
88  if (m_invert)
89  accept = not accept;
90 
91  return accept;
92 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
bool isRealData() const
Definition: EventBase.h:62
const L1GtFdlWord gtFdlWord(int bxInEventValue) const
get / set FDL word (record) in the GT readout record
const cms_uint16_t physicsDeclared() const
get/set "physics declared" bit
Definition: L1GtFdlWord.h:227
std::shared_ptr< cms::Exception > whyFailed() const
Definition: HandleBase.h:110
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_gtDigisToken

Member Data Documentation

edm::InputTag HLTPhysicsDeclared::m_gtDigis
private

Definition at line 34 of file HLTPhysicsDeclared.cc.

Referenced by HLTPhysicsDeclared().

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> HLTPhysicsDeclared::m_gtDigisToken
private

Definition at line 35 of file HLTPhysicsDeclared.cc.

Referenced by filter(), and HLTPhysicsDeclared().

bool HLTPhysicsDeclared::m_invert
private

Definition at line 33 of file HLTPhysicsDeclared.cc.

Referenced by filter().