CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
HLTLevel1Activity Class Reference
Inheritance diagram for HLTLevel1Activity:
edm::stream::EDFilter<> edm::stream::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &, edm::EventSetup const &) final
 
 HLTLevel1Activity (const edm::ParameterSet &)
 
 ~HLTLevel1Activity () override
 
- Public Member Functions inherited from edm::stream::EDFilter<>
 EDFilter ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
- Public Member Functions inherited from edm::stream::EDFilterBase
 EDFilterBase ()
 
 EDFilterBase (const EDFilterBase &)=delete
 
ModuleDescription const & moduleDescription () const
 
const EDFilterBaseoperator= (const EDFilterBase &)=delete
 
 ~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
 
std::vector< bool > const & recordProvenanceList () 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)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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)
 
- Static Public Member Functions inherited from edm::stream::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

std::vector< int > m_bunchCrossings
 
unsigned int m_daqPartitions
 
edm::InputTag m_gtReadoutRecordTag
 
edm::EDGetTokenT< L1GlobalTriggerReadoutRecordm_gtReadoutRecordToken
 
bool m_ignoreL1Mask
 
bool m_invert
 
std::vector< bool > m_maskedPhysics
 
std::vector< bool > m_maskedTechnical
 
std::vector< bool > m_selectPhysics
 
std::vector< bool > m_selectTechnical
 
edm::ESWatcher< L1GtTriggerMaskAlgoTrigRcdm_watchPhysicsMask
 
edm::ESWatcher< L1GtTriggerMaskTechTrigRcdm_watchTechnicalMask
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDFilter<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDFilterBase
typedef EDFilterAdaptorBase 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
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

This class is an EDFilter that checks if there was any L1 activity It can be configured to

Author
Andrea Bocci

Definition at line 39 of file HLTLevel1Activity.cc.

Constructor & Destructor Documentation

◆ HLTLevel1Activity()

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

Definition at line 70 of file HLTLevel1Activity.cc.

71  : m_gtReadoutRecordTag(config.getParameter<edm::InputTag>("L1GtReadoutRecordTag")),
72  m_gtReadoutRecordToken(consumes<L1GlobalTriggerReadoutRecord>(m_gtReadoutRecordTag)),
73  m_bunchCrossings(config.getParameter<std::vector<int>>("bunchCrossings")),
78  m_daqPartitions(config.getParameter<unsigned int>("daqPartitions")),
79  m_ignoreL1Mask(config.getParameter<bool>("ignoreL1Mask")),
80  m_invert(config.getParameter<bool>("invert")) {
81  unsigned long long low = config.getParameter<unsigned long long>("physicsLoBits");
82  unsigned long long high = config.getParameter<unsigned long long>("physicsHiBits");
83  unsigned long long tech = config.getParameter<unsigned long long>("technicalBits");
84  for (unsigned int i = 0; i < 64; i++) {
85  m_selectPhysics[i] = low & (0x01ULL << (unsigned long long)i);
86  m_maskedPhysics[i] = low & (0x01ULL << (unsigned long long)i);
87  }
88  for (unsigned int i = 0; i < 64; i++) {
89  m_selectPhysics[i + 64] = high & (0x01ULL << (unsigned long long)i);
90  m_maskedPhysics[i + 64] = high & (0x01ULL << (unsigned long long)i);
91  }
92  for (unsigned int i = 0; i < 64; i++) {
93  m_selectTechnical[i] = tech & (0x01ULL << (unsigned long long)i);
94  m_maskedTechnical[i] = tech & (0x01ULL << (unsigned long long)i);
95  }
96 }

References LaserClient_cfi::high, mps_fire::i, LaserClient_cfi::low, m_maskedPhysics, m_maskedTechnical, m_selectPhysics, and m_selectTechnical.

◆ ~HLTLevel1Activity()

HLTLevel1Activity::~HLTLevel1Activity ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 100 of file HLTLevel1Activity.cc.

100  {
102  desc.add<edm::InputTag>("L1GtReadoutRecordTag", edm::InputTag("hltGtDigis"));
103  desc.add<std::vector<int>>("bunchCrossings", {0, -1, 1});
104  desc.add<unsigned int>("daqPartitions", 1);
105  desc.add<bool>("ignoreL1Mask", false);
106  desc.add<bool>("invert", false);
107  desc.add<unsigned long long int>("physicsLoBits", 0x0000000000000001LL); // bit 0
108  desc.add<unsigned long long int>("physicsHiBits", 0x0000000000040000LL); // bit 64 + 18 = 82
109  desc.add<unsigned long long int>("technicalBits", 0x0000000000000001LL); // bit 0
110  descriptions.add("hltLevel1Activity", desc);
111 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and L1DTConfigBti_cff::LL.

◆ filter()

bool HLTLevel1Activity::filter ( edm::Event event,
edm::EventSetup const &  setup 
)
finalvirtual

Implements edm::stream::EDFilterBase.

Definition at line 118 of file HLTLevel1Activity.cc.

118  {
119  /*
120  // apply L1 mask to the physics bits
121  // - mask & partition == part. --> fully masked
122  // - mask & partition == 0x00 --> fully unmasked
123  // - mask & partition != part. --> unmasked in some partitions, consider as unmasked
124  if (not m_ignoreL1Mask and m_watchPhysicsMask.check(setup)) {
125  edm::ESHandle<L1GtTriggerMask> h_mask;
126  setup.get<L1GtTriggerMaskAlgoTrigRcd>().get(h_mask);
127  const std::vector<unsigned int> & mask = h_mask->gtTriggerMask();
128  for (unsigned int i = 0; i < PHYSICS_BITS_SIZE; ++i)
129  m_maskedPhysics[i] = m_selectPhysics[i] and ((mask[i] & m_daqPartitions) != m_daqPartitions);
130  }
131 
132  // apply L1 mask to the technical bits
133  // - mask & partition == part. --> fully masked
134  // - mask & partition == 0x00 --> fully unmasked
135  // - mask & partition != part. --> unmasked in some partitions, consider as unmasked
136  if (not m_ignoreL1Mask and m_watchTechnicalMask.check(setup)) {
137  edm::ESHandle<L1GtTriggerMask> h_mask;
138  setup.get<L1GtTriggerMaskTechTrigRcd>().get(h_mask);
139  const std::vector<unsigned int> & mask = h_mask->gtTriggerMask();
140  for (unsigned int i = 0; i < TECHNICAL_BITS_SIZE; ++i)
141  m_maskedTechnical[i] = m_selectTechnical[i] and ((mask[i] & m_daqPartitions) != m_daqPartitions);
142  }
143 
144  // access the L1 decisions
145  edm::Handle<L1GlobalTriggerReadoutRecord> h_gtReadoutRecord;
146  event.getByToken(m_gtReadoutRecordToken, h_gtReadoutRecord);
147 
148  // compare the results with the requested bits, and return true as soon as the first match is found
149  for (int bx : m_bunchCrossings) {
150  const std::vector<bool> & physics = h_gtReadoutRecord->decisionWord(bx);
151  if (physics.size() != PHYSICS_BITS_SIZE)
152  // error in L1 results
153  return m_invert;
154  for (unsigned int i = 0; i < PHYSICS_BITS_SIZE; ++i)
155  if (m_maskedPhysics[i] and physics[i])
156  return not m_invert;
157  const std::vector<bool> & technical = h_gtReadoutRecord->technicalTriggerWord(bx);
158  if (technical.size() != TECHNICAL_BITS_SIZE)
159  // error in L1 results
160  return m_invert;
161  for (unsigned int i = 0; i < TECHNICAL_BITS_SIZE; ++i)
162  if (m_maskedTechnical[i] and technical[i])
163  return not m_invert;
164  }
165 
166  return m_invert;
167  */
168  return false;
169 }

Member Data Documentation

◆ m_bunchCrossings

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

Definition at line 49 of file HLTLevel1Activity.cc.

◆ m_daqPartitions

unsigned int HLTLevel1Activity::m_daqPartitions
private

Definition at line 54 of file HLTLevel1Activity.cc.

◆ m_gtReadoutRecordTag

edm::InputTag HLTLevel1Activity::m_gtReadoutRecordTag
private

Definition at line 47 of file HLTLevel1Activity.cc.

◆ m_gtReadoutRecordToken

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

Definition at line 48 of file HLTLevel1Activity.cc.

◆ m_ignoreL1Mask

bool HLTLevel1Activity::m_ignoreL1Mask
private

Definition at line 55 of file HLTLevel1Activity.cc.

◆ m_invert

bool HLTLevel1Activity::m_invert
private

Definition at line 56 of file HLTLevel1Activity.cc.

◆ m_maskedPhysics

std::vector<bool> HLTLevel1Activity::m_maskedPhysics
private

Definition at line 52 of file HLTLevel1Activity.cc.

Referenced by HLTLevel1Activity().

◆ m_maskedTechnical

std::vector<bool> HLTLevel1Activity::m_maskedTechnical
private

Definition at line 53 of file HLTLevel1Activity.cc.

Referenced by HLTLevel1Activity().

◆ m_selectPhysics

std::vector<bool> HLTLevel1Activity::m_selectPhysics
private

Definition at line 50 of file HLTLevel1Activity.cc.

Referenced by HLTLevel1Activity().

◆ m_selectTechnical

std::vector<bool> HLTLevel1Activity::m_selectTechnical
private

Definition at line 51 of file HLTLevel1Activity.cc.

Referenced by HLTLevel1Activity().

◆ m_watchPhysicsMask

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

Definition at line 58 of file HLTLevel1Activity.cc.

◆ m_watchTechnicalMask

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

Definition at line 59 of file HLTLevel1Activity.cc.

mps_fire.i
i
Definition: mps_fire.py:428
HLTLevel1Activity::m_selectTechnical
std::vector< bool > m_selectTechnical
Definition: HLTLevel1Activity.cc:51
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89353
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTLevel1Activity::m_daqPartitions
unsigned int m_daqPartitions
Definition: HLTLevel1Activity.cc:54
PHYSICS_BITS_SIZE
#define PHYSICS_BITS_SIZE
Definition: HLTLevel1Activity.cc:32
HLTLevel1Activity::m_gtReadoutRecordTag
edm::InputTag m_gtReadoutRecordTag
Definition: HLTLevel1Activity.cc:47
HLTLevel1Activity::m_gtReadoutRecordToken
edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_gtReadoutRecordToken
Definition: HLTLevel1Activity.cc:48
config
Definition: config.py:1
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTLevel1Activity::m_maskedPhysics
std::vector< bool > m_maskedPhysics
Definition: HLTLevel1Activity.cc:52
HLTLevel1Activity::m_bunchCrossings
std::vector< int > m_bunchCrossings
Definition: HLTLevel1Activity.cc:49
HLTLevel1Activity::m_selectPhysics
std::vector< bool > m_selectPhysics
Definition: HLTLevel1Activity.cc:50
HLTLevel1Activity::m_invert
bool m_invert
Definition: HLTLevel1Activity.cc:56
HLTLevel1Activity::m_ignoreL1Mask
bool m_ignoreL1Mask
Definition: HLTLevel1Activity.cc:55
L1DTConfigBti_cff.LL
LL
Definition: L1DTConfigBti_cff.py:25
HLTLevel1Activity::m_maskedTechnical
std::vector< bool > m_maskedTechnical
Definition: HLTLevel1Activity.cc:53
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
LaserClient_cfi.high
high
Definition: LaserClient_cfi.py:50
TECHNICAL_BITS_SIZE
#define TECHNICAL_BITS_SIZE
Definition: HLTLevel1Activity.cc:33
LaserClient_cfi.low
low
Definition: LaserClient_cfi.py:52
edm::InputTag
Definition: InputTag.h:15