CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTLevel1Pattern Class Reference
Inheritance diagram for HLTLevel1Pattern:
edm::EDFilter edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &, const edm::EventSetup &) override
 
 HLTLevel1Pattern (const edm::ParameterSet &)
 
 ~HLTLevel1Pattern () 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
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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)
 
- 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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 

Private Attributes

std::vector< int > m_bunchCrossings
 
unsigned int m_daqPartitions
 
edm::InputTag m_gtReadoutRecord
 
edm::EDGetTokenT
< L1GlobalTriggerReadoutRecord
m_gtReadoutRecordToken
 
bool m_ignoreL1Mask
 
bool m_invert
 
edm::ESGetToken
< L1GtTriggerMask,
L1GtTriggerMaskAlgoTrigRcd >
const 
m_l1GtTriggerMaskAlgoTrigRcdToken
 
edm::ESGetToken
< L1GtTriggerMask,
L1GtTriggerMaskTechTrigRcd >
const 
m_l1GtTriggerMaskTechTrigRcdToken
 
edm::ESGetToken
< L1GtTriggerMenu,
L1GtTriggerMenuRcd > const 
m_l1GtTriggerMenuToken
 
bool m_throw
 
bool m_triggerAlgo
 
std::string m_triggerBit
 
bool m_triggerMasked
 
unsigned int m_triggerNumber
 
std::vector< int > m_triggerPattern
 
edm::ESWatcher
< L1GtTriggerMenuRcd
m_watchL1Menu
 
edm::ESWatcher
< L1GtTriggerMaskAlgoTrigRcd
m_watchPhysicsMask
 
edm::ESWatcher
< L1GtTriggerMaskTechTrigRcd
m_watchTechnicalMask
 

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
 
- 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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

This class is an EDFilter that checks for a specific pattern of L1 accept/reject in 5 BX's for a given L1 bit It can be configured to use or ignore the L1 trigger mask

Author
Andrea Bocci

Definition at line 36 of file HLTLevel1Pattern.cc.

Constructor & Destructor Documentation

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

Definition at line 74 of file HLTLevel1Pattern.cc.

References edm::ParameterSet::getParameter(), mps_fire::i, m_bunchCrossings, m_gtReadoutRecord, m_gtReadoutRecordToken, and m_triggerPattern.

75  : m_gtReadoutRecord(config.getParameter<edm::InputTag>("L1GtReadoutRecordTag")),
76  m_triggerBit(config.getParameter<std::string>("triggerBit")),
77  m_bunchCrossings(config.getParameter<std::vector<int> >("bunchCrossings")),
78  m_triggerPattern(m_bunchCrossings.size(), false),
79  m_daqPartitions(config.getParameter<unsigned int>("daqPartitions")),
80  m_triggerNumber(0),
81  m_triggerAlgo(true),
82  m_triggerMasked(false),
83  m_ignoreL1Mask(config.getParameter<bool>("ignoreL1Mask")),
84  m_invert(config.getParameter<bool>("invert")),
85  m_throw(config.getParameter<bool>("throw")),
89  m_gtReadoutRecordToken = consumes<L1GlobalTriggerReadoutRecord>(m_gtReadoutRecord);
90  std::vector<int> pattern(config.getParameter<std::vector<int> >("triggerPattern"));
91  if (pattern.size() != m_bunchCrossings.size())
92  throw cms::Exception("Configuration") << "\"bunchCrossings\" and \"triggerPattern\" parameters do not match";
93 
94  for (unsigned int i = 0; i < pattern.size(); ++i)
95  m_triggerPattern[i] = (bool)pattern[i];
96 }
std::string m_triggerBit
edm::InputTag m_gtReadoutRecord
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd > const m_l1GtTriggerMaskAlgoTrigRcdToken
std::vector< int > m_bunchCrossings
unsigned int m_triggerNumber
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_gtReadoutRecordToken
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > const m_l1GtTriggerMenuToken
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unsigned int m_daqPartitions
std::vector< int > m_triggerPattern
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd > const m_l1GtTriggerMaskTechTrigRcdToken
HLTLevel1Pattern::~HLTLevel1Pattern ( )
overridedefault

Member Function Documentation

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

Definition at line 100 of file HLTLevel1Pattern.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and AlCaHLTBitMon_QueryRunRegistry::string.

100  {
102  desc.add<edm::InputTag>("L1GtReadoutRecordTag", edm::InputTag("hltGtDigis"));
103  desc.add<std::string>("triggerBit", "L1Tech_RPC_TTU_pointing_Cosmics.v0");
104  {
105  std::vector<int> temp1;
106  temp1.reserve(5);
107  temp1.push_back(-2);
108  temp1.push_back(-1);
109  temp1.push_back(0);
110  temp1.push_back(1);
111  temp1.push_back(2);
112  desc.add<std::vector<int> >("bunchCrossings", temp1);
113  }
114  desc.add<unsigned int>("daqPartitions", 1);
115  desc.add<bool>("ignoreL1Mask", false);
116  desc.add<bool>("invert", false);
117  desc.add<bool>("throw", true);
118  {
119  std::vector<int> temp1;
120  temp1.reserve(5);
121  temp1.push_back(1);
122  temp1.push_back(1);
123  temp1.push_back(1);
124  temp1.push_back(0);
125  temp1.push_back(0);
126  desc.add<std::vector<int> >("triggerPattern", temp1);
127  }
128  descriptions.add("hltLevel1Pattern", desc);
129 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool HLTLevel1Pattern::filter ( edm::Event event,
const edm::EventSetup setup 
)
overridevirtual

Implements edm::EDFilter.

Definition at line 136 of file HLTLevel1Pattern.cc.

References makePileupJSON::bx, edm::ESWatcher< T >::check(), mps_splice::entry, Exception, edm::EventSetup::getHandle(), mps_fire::i, m_bunchCrossings, m_daqPartitions, m_gtReadoutRecordToken, m_ignoreL1Mask, m_invert, m_l1GtTriggerMaskAlgoTrigRcdToken, m_l1GtTriggerMaskTechTrigRcdToken, m_l1GtTriggerMenuToken, m_throw, m_triggerAlgo, m_triggerBit, m_triggerMasked, m_triggerNumber, m_triggerPattern, m_watchL1Menu, m_watchPhysicsMask, m_watchTechnicalMask, or, and mps_fire::result.

136  {
137  // determine the L1 algo or tech bit to use
138  if (m_watchL1Menu.check(setup)) {
139  auto const& h_menu = setup.getHandle(m_l1GtTriggerMenuToken);
140  // look for an Algo L1 bit
141  const AlgorithmMap& algoMap = h_menu->gtAlgorithmAliasMap();
142  const AlgorithmMap& techMap = h_menu->gtTechnicalTriggerMap();
143  AlgorithmMap::const_iterator entry;
144  if ((entry = algoMap.find(m_triggerBit)) != algoMap.end()) {
145  m_triggerAlgo = true;
146  m_triggerNumber = entry->second.algoBitNumber();
147  } else if ((entry = techMap.find(m_triggerBit)) != techMap.end()) {
148  m_triggerAlgo = false;
149  m_triggerNumber = entry->second.algoBitNumber();
150  } else {
151  if (m_throw) {
152  throw cms::Exception("Configuration")
153  << "requested L1 trigger \"" << m_triggerBit << "\" does not exist in the current L1 menu";
154  } else {
155  return m_invert;
156  }
157  }
158  }
159 
160  if (m_triggerAlgo) {
161  // check the L1 algorithms mask
162  // - mask & partition == part. --> fully masked
163  // - mask & partition == 0x00 --> fully unmasked
164  // - mask & partition != part. --> unmasked in some partitions, consider as unmasked
165  if (m_watchPhysicsMask.check(setup)) {
166  auto const& h_mask = setup.getHandle(m_l1GtTriggerMaskAlgoTrigRcdToken);
167  m_triggerMasked = ((h_mask->gtTriggerMask()[m_triggerNumber] & m_daqPartitions) == m_daqPartitions);
168  }
169  } else {
170  // check the L1 technical triggers mask
171  // - mask & partition == part. --> fully masked
172  // - mask & partition == 0x00 --> fully unmasked
173  // - mask & partition != part. --> unmasked in some partitions, consider as unmasked
174  if (m_watchTechnicalMask.check(setup)) {
175  auto const& h_mask = setup.getHandle(m_l1GtTriggerMaskTechTrigRcdToken);
176  m_triggerMasked = ((h_mask->gtTriggerMask()[m_triggerNumber] & m_daqPartitions) == m_daqPartitions);
177  }
178  }
179 
180  // is the L1 trigger masked ?
181  if (not m_ignoreL1Mask and m_triggerMasked)
182  return m_invert;
183 
184  // access the L1 decisions
186  event.getByToken(m_gtReadoutRecordToken, h_gtReadoutRecord);
187 
188  // check the L1 algorithms results
189  for (unsigned int i = 0; i < m_bunchCrossings.size(); ++i) {
190  int bx = m_bunchCrossings[i];
191  const std::vector<bool>& word =
192  (m_triggerAlgo) ? h_gtReadoutRecord->decisionWord(bx) : h_gtReadoutRecord->technicalTriggerWord(bx);
193  if (word.empty() or m_triggerNumber >= word.size())
194  // L1 results not available, bail out
195  return m_invert;
196  bool result = word[m_triggerNumber];
197  if (result != m_triggerPattern[i])
198  // comparison failed, bail out
199  return m_invert;
200  }
201 
202  // comparison successful
203  return not m_invert;
204 }
std::string m_triggerBit
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventIDconst &, edm::Timestampconst & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd > const m_l1GtTriggerMaskAlgoTrigRcdToken
std::map< std::string, L1GtAlgorithm > AlgorithmMap
map containing the algorithms
edm::ESWatcher< L1GtTriggerMaskTechTrigRcd > m_watchTechnicalMask
tuple result
Definition: mps_fire.py:311
std::vector< int > m_bunchCrossings
uint64_t word
unsigned int m_triggerNumber
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_gtReadoutRecordToken
edm::ESGetToken< L1GtTriggerMenu, L1GtTriggerMenuRcd > const m_l1GtTriggerMenuToken
edm::ESWatcher< L1GtTriggerMenuRcd > m_watchL1Menu
unsigned int m_daqPartitions
std::vector< int > m_triggerPattern
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
list entry
Definition: mps_splice.py:68
edm::ESWatcher< L1GtTriggerMaskAlgoTrigRcd > m_watchPhysicsMask
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:157
edm::ESGetToken< L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd > const m_l1GtTriggerMaskTechTrigRcdToken

Member Data Documentation

std::vector<int> HLTLevel1Pattern::m_bunchCrossings
private

Definition at line 47 of file HLTLevel1Pattern.cc.

Referenced by filter(), and HLTLevel1Pattern().

unsigned int HLTLevel1Pattern::m_daqPartitions
private

Definition at line 49 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::InputTag HLTLevel1Pattern::m_gtReadoutRecord
private

Definition at line 44 of file HLTLevel1Pattern.cc.

Referenced by HLTLevel1Pattern().

edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> HLTLevel1Pattern::m_gtReadoutRecordToken
private

Definition at line 45 of file HLTLevel1Pattern.cc.

Referenced by filter(), and HLTLevel1Pattern().

bool HLTLevel1Pattern::m_ignoreL1Mask
private

Definition at line 53 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_invert
private

Definition at line 54 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskAlgoTrigRcd> const HLTLevel1Pattern::m_l1GtTriggerMaskAlgoTrigRcdToken
private

Definition at line 58 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::ESGetToken<L1GtTriggerMask, L1GtTriggerMaskTechTrigRcd> const HLTLevel1Pattern::m_l1GtTriggerMaskTechTrigRcdToken
private

Definition at line 59 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::ESGetToken<L1GtTriggerMenu, L1GtTriggerMenuRcd> const HLTLevel1Pattern::m_l1GtTriggerMenuToken
private

Definition at line 57 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_throw
private

Definition at line 55 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_triggerAlgo
private

Definition at line 51 of file HLTLevel1Pattern.cc.

Referenced by filter().

std::string HLTLevel1Pattern::m_triggerBit
private

Definition at line 46 of file HLTLevel1Pattern.cc.

Referenced by filter().

bool HLTLevel1Pattern::m_triggerMasked
private

Definition at line 52 of file HLTLevel1Pattern.cc.

Referenced by filter().

unsigned int HLTLevel1Pattern::m_triggerNumber
private

Definition at line 50 of file HLTLevel1Pattern.cc.

Referenced by filter().

std::vector<int> HLTLevel1Pattern::m_triggerPattern
private

Definition at line 48 of file HLTLevel1Pattern.cc.

Referenced by filter(), and HLTLevel1Pattern().

edm::ESWatcher<L1GtTriggerMenuRcd> HLTLevel1Pattern::m_watchL1Menu
private

Definition at line 61 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::ESWatcher<L1GtTriggerMaskAlgoTrigRcd> HLTLevel1Pattern::m_watchPhysicsMask
private

Definition at line 62 of file HLTLevel1Pattern.cc.

Referenced by filter().

edm::ESWatcher<L1GtTriggerMaskTechTrigRcd> HLTLevel1Pattern::m_watchTechnicalMask
private

Definition at line 63 of file HLTLevel1Pattern.cc.

Referenced by filter().