CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTBeamModeFilter Class Reference

#include <HLTBeamModeFilter.h>

Inheritance diagram for HLTBeamModeFilter:
HLTFilter edm::global::EDFilter<> edm::global::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTBeamModeFilter (const edm::ParameterSet &)
 constructor More...
 
bool hltFilter (edm::Event &, const edm::EventSetup &, trigger::TriggerFilterObjectWithRefs &filterproduct) const override
 filter the event More...
 
 ~HLTBeamModeFilter () override
 destructor More...
 
- Public Member Functions inherited from HLTFilter
 HLTFilter (const edm::ParameterSet &config)
 
int module (edm::Event const &) const
 
const std::string * moduleLabel () const
 
int path (edm::Event const &) const
 
const std::string * pathName (edm::Event const &) const
 
std::pair< int, int > pmid (edm::Event const &) const
 
bool saveTags () const
 
 ~HLTFilter () override
 
- Public Member Functions inherited from edm::global::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDFilterBase () 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)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 parameter description More...
 
- Static Public Member Functions inherited from HLTFilter
static void makeHLTFilterDescription (edm::ParameterSetDescription &desc)
 
- Static Public Member Functions inherited from edm::global::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

std::vector< unsigned int > m_allowedBeamMode
 vector of beam modes (coded as integer numbers) More...
 
bool m_isDebugEnabled
 cache edm::isDebugEnabled() More...
 
edm::InputTag m_l1GtEvmReadoutRecordTag
 InputTag for the L1 Global Trigger EVM readout record. More...
 
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecordm_l1GtEvmReadoutRecordToken
 

Additional Inherited Members

- Public Types inherited from edm::global::EDFilterBase
typedef EDFilterBase 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
 
- 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

Description: see class header.

Author
: Vasile Mihai Ghete - HEPHY Vienna

Description: filter according to the beam mode using the BST information received by L1 GT.

Implementation: This class is an HLTFilter (-> EDFilter). It implements:

Author
: Vasile Mihai Ghete - HEPHY Vienna

Definition at line 40 of file HLTBeamModeFilter.h.

Constructor & Destructor Documentation

HLTBeamModeFilter::HLTBeamModeFilter ( const edm::ParameterSet parSet)
explicit

constructor

Definition at line 39 of file HLTBeamModeFilter.cc.

References LogDebug, LogTrace, m_allowedBeamMode, m_isDebugEnabled, and m_l1GtEvmReadoutRecordTag.

39  : HLTFilter(parSet),
40 
42  "L1GtEvmReadoutRecordTag")),
43  m_l1GtEvmReadoutRecordToken(consumes<L1GlobalTriggerEvmReadoutRecord>(m_l1GtEvmReadoutRecordTag)),
44  m_allowedBeamMode(parSet.getParameter<std::vector<unsigned int> >(
45  "AllowedBeamMode")),
47 
48  if (m_isDebugEnabled) {
49 
50  LogDebug("HLTBeamModeFilter") << std::endl;
51 
52  LogTrace("HLTBeamModeFilter") << "Input tag for L1 GT EVM record: "
53  << m_l1GtEvmReadoutRecordTag << "\nAllowed beam modes:"
54  << std::endl;
55 
56  for (std::vector<unsigned int>::const_iterator itMode =
57  m_allowedBeamMode.begin(); itMode != m_allowedBeamMode.end(); ++itMode) {
58 
59  LogTrace("HLTBeamModeFilter") << " " << (*itMode) << std::endl;
60 
61  }
62 
63  LogTrace("HLTBeamModeFilter") << std::endl;
64 
65  }
66 }
#define LogDebug(id)
T getParameter(std::string const &) const
bool isDebugEnabled()
std::vector< unsigned int > m_allowedBeamMode
vector of beam modes (coded as integer numbers)
#define LogTrace(id)
HLTFilter(const edm::ParameterSet &config)
Definition: HLTFilter.cc:20
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmReadoutRecordToken
edm::InputTag m_l1GtEvmReadoutRecordTag
InputTag for the L1 Global Trigger EVM readout record.
bool m_isDebugEnabled
cache edm::isDebugEnabled()
HLTBeamModeFilter::~HLTBeamModeFilter ( )
override

destructor

Definition at line 70 of file HLTBeamModeFilter.cc.

70  {
71  // empty now
72 }

Member Function Documentation

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

parameter description

Definition at line 75 of file HLTBeamModeFilter.cc.

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

75  {
78  // #
79  // # InputTag for the L1 Global Trigger EVM readout record
80  // # gtDigis GT Emulator
81  // # l1GtEvmUnpack GT EVM Unpacker (default module name)
82  // # gtEvmDigis GT EVM Unpacker in RawToDigi standard sequence
83  // #
84  // # cloned GT unpacker in HLT = gtEvmDigis
85  desc.add<edm::InputTag>("L1GtEvmReadoutRecordTag",edm::InputTag("gtEvmDigis"));
86  // #
87  // # vector of allowed beam modes
88  // # default value: 11 (STABLE)
89  std::vector<unsigned int> allowedBeamMode(1,11);
90  desc.add<std::vector<unsigned int> >("AllowedBeamMode",allowedBeamMode);
91  descriptions.add("hltBeamModeFilter", desc);
92 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void makeHLTFilterDescription(edm::ParameterSetDescription &desc)
Definition: HLTFilter.cc:29
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTBeamModeFilter::hltFilter ( edm::Event iEvent,
const edm::EventSetup evSetup,
trigger::TriggerFilterObjectWithRefs filterproduct 
) const
overridevirtual

filter the event

Implements HLTFilter.

Definition at line 94 of file HLTBeamModeFilter.cc.

References DEFINE_FWK_MODULE, edm::Event::getByToken(), L1GlobalTriggerEvmReadoutRecord::gtfeWord(), edm::EventBase::isRealData(), edm::HandleBase::isValid(), m_allowedBeamMode, m_l1GtEvmReadoutRecordTag, and m_l1GtEvmReadoutRecordToken.

94  {
95 
96  // for MC samples, return always true (not even checking validity of L1GlobalTriggerEvmReadoutRecord)
97  // eventually, the BST information will be filled also in MC simulation to spare this check
98 
99  if (!(iEvent.isRealData())) {
100  //LogDebug("HLTBeamModeFilter") << "\nRunning on MC sample."
101  // << "\nAll events are automatically selected, without testing the beam mode"
102  // << "\n" << std::endl;
103  return true;
104  }
105 
106  // data
107 
108  // initialize filter result
109  bool filterResult = false;
110 
111  // get L1GlobalTriggerEvmReadoutRecord and beam mode
113  iEvent.getByToken(m_l1GtEvmReadoutRecordToken, gtEvmReadoutRecord);
114 
115  if (!gtEvmReadoutRecord.isValid()) {
116  edm::LogWarning("HLTBeamModeFilter")
117  << "\nWarning: L1GlobalTriggerEvmReadoutRecord with input tag "
119  << "\nrequested in configuration, but not found in the event."
120  << std::endl;
121 
122  return false;
123  }
124 
125  const boost::uint16_t beamModeValue =
126  (gtEvmReadoutRecord->gtfeWord()).beamMode();
127 
128  edm::LogInfo("HLTBeamModeFilter") << "Beam mode: " << beamModeValue;
129 
130  for (unsigned int itMode : m_allowedBeamMode) {
131 
132  if (beamModeValue == itMode) {
133  filterResult = true;
134 
135  //LogTrace("HLTBeamModeFilter") << "Event selected - beam mode: "
136  // << beamModeValue << "\n" << std::endl;
137 
138  break;
139 
140  }
141  }
142 
143  //
144  return filterResult;
145 
146 }
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
const L1GtfeExtWord gtfeWord() const
get / set GTFE word (record) in the GT readout record
bool isRealData() const
Definition: EventBase.h:62
std::vector< unsigned int > m_allowedBeamMode
vector of beam modes (coded as integer numbers)
bool isValid() const
Definition: HandleBase.h:74
edm::EDGetTokenT< L1GlobalTriggerEvmReadoutRecord > m_l1GtEvmReadoutRecordToken
edm::InputTag m_l1GtEvmReadoutRecordTag
InputTag for the L1 Global Trigger EVM readout record.

Member Data Documentation

std::vector<unsigned int> HLTBeamModeFilter::m_allowedBeamMode
private

vector of beam modes (coded as integer numbers)

Definition at line 61 of file HLTBeamModeFilter.h.

Referenced by HLTBeamModeFilter(), and hltFilter().

bool HLTBeamModeFilter::m_isDebugEnabled
private

cache edm::isDebugEnabled()

Definition at line 64 of file HLTBeamModeFilter.h.

Referenced by HLTBeamModeFilter().

edm::InputTag HLTBeamModeFilter::m_l1GtEvmReadoutRecordTag
private

InputTag for the L1 Global Trigger EVM readout record.

Definition at line 58 of file HLTBeamModeFilter.h.

Referenced by HLTBeamModeFilter(), and hltFilter().

edm::EDGetTokenT<L1GlobalTriggerEvmReadoutRecord> HLTBeamModeFilter::m_l1GtEvmReadoutRecordToken
private

Definition at line 59 of file HLTBeamModeFilter.h.

Referenced by hltFilter().