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
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
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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 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
< L1GlobalTriggerReadoutRecord
m_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
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

Implements edm::EDFilter.

Definition at line 66 of file HLTPhysicsDeclared.cc.

References accept(), edm::Event::getByToken(), 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:434
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:26
bool isRealData() const
Definition: EventBase.h:60
const cms_uint16_t physicsDeclared() const
get/set &quot;physics declared&quot; bit
Definition: L1GtFdlWord.h:227
std::shared_ptr< cms::Exception > whyFailed() const
Definition: HandleBase.h:111
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().