CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

HLTPhysicsDeclared Class Reference

Inheritance diagram for HLTPhysicsDeclared:
edm::EDFilter edm::ProducerBase edm::ProductRegistryHelper

List of all members.

Public Member Functions

 HLTPhysicsDeclared (const edm::ParameterSet &)
 ~HLTPhysicsDeclared ()

Private Member Functions

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

Private Attributes

edm::InputTag m_gtDigis
bool m_invert

Detailed Description

Definition at line 20 of file HLTPhysicsDeclared.cc.


Constructor & Destructor Documentation

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

Definition at line 48 of file HLTPhysicsDeclared.cc.

                                                                     :
  m_invert(  config.getParameter<bool>("invert") ),
  m_gtDigis( config.getParameter<edm::InputTag>("L1GtReadoutRecordTag") )
{
}
HLTPhysicsDeclared::~HLTPhysicsDeclared ( )

Definition at line 54 of file HLTPhysicsDeclared.cc.

{
}

Member Function Documentation

bool HLTPhysicsDeclared::filter ( edm::Event event,
const edm::EventSetup setup 
) [private, virtual]

Implements edm::EDFilter.

Definition at line 58 of file HLTPhysicsDeclared.cc.

References accept(), edm::Event::getByLabel(), edm::EventBase::isRealData(), m_gtDigis, m_invert, L1GtFdlWord::physicsDeclared(), and edm::HandleBase::whyFailed().

{
  bool accept = false;

  if (event.isRealData()) {
    // for real data, access the "physics enabled" bit in the L1 GT data
    edm::Handle<L1GlobalTriggerReadoutRecord> h_gtDigis;
    if (not event.getByLabel(m_gtDigis, h_gtDigis)) {
      edm::LogWarning(h_gtDigis.whyFailed()->category()) << h_gtDigis.whyFailed()->what();
      // not enough informations to make a decision - reject the event
      return false;
    } else {
      L1GtFdlWord fdlWord = h_gtDigis->gtFdlWord();
      if (fdlWord.physicsDeclared() == 1) 
        accept = true;
    }
  } else {
    // for MC, assume the "physics enabled" bit to be always set
    accept = true;
  }

  // if requested, invert the filter decision
  if (m_invert)
    accept = not accept;

  return accept;
}

Member Data Documentation

Definition at line 29 of file HLTPhysicsDeclared.cc.

Referenced by filter().

Definition at line 28 of file HLTPhysicsDeclared.cc.

Referenced by filter().