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
L1GTPrescaler Class Reference
Inheritance diagram for L1GTPrescaler:
edm::one::EDFilter<> edm::one::EDFilterBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

bool filter (edm::Event &event, edm::EventSetup const &setup) override
 
 L1GTPrescaler (edm::ParameterSet const &config)
 
- Public Member Functions inherited from edm::one::EDFilter<>
 EDFilter ()=default
 
 EDFilter (const EDFilter &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDFilteroperator= (const EDFilter &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDFilterBase
 EDFilterBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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
 
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::one::EDFilterBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

std::array< unsigned int, 128 > m_algoCounters
 
const std::array< double, 128 > m_algoPrescales
 
const edm::EDGetTokenT
< L1GlobalTriggerReadoutRecord
m_l1ResultsToken
 
std::array< unsigned int, 64 > m_techCounters
 
const std::array< double, 64 > m_techPrescales
 

Additional Inherited Members

- Public Types inherited from edm::one::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::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

Definition at line 13 of file L1GTPrescaler.cc.

Constructor & Destructor Documentation

L1GTPrescaler::L1GTPrescaler ( edm::ParameterSet const &  config)

Definition at line 29 of file L1GTPrescaler.cc.

References m_algoCounters, and m_techCounters.

30  : m_l1ResultsToken(consumes<L1GlobalTriggerReadoutRecord>(config.getParameter<edm::InputTag>("l1Results"))),
31  m_algoPrescales(config.getParameter<std::array<double, 128>>("l1AlgoPrescales")),
32  m_techPrescales(config.getParameter<std::array<double, 64>>("l1TechPrescales")) {
33  m_algoCounters.fill(0);
34  m_techCounters.fill(0);
35  produces<L1GlobalTriggerReadoutRecord>();
36 }
const std::array< double, 64 > m_techPrescales
std::array< unsigned int, 64 > m_techCounters
const std::array< double, 128 > m_algoPrescales
std::array< unsigned int, 128 > m_algoCounters
tuple config
parse the configuration file
const edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1ResultsToken

Member Function Documentation

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

Definition at line 85 of file L1GTPrescaler.cc.

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

85  {
87  desc.add<edm::InputTag>("l1Results", edm::InputTag("gtDigis"));
88  desc.add<std::vector<double>>("l1AlgoPrescales", std::vector<double>(128, 1));
89  desc.add<std::vector<double>>("l1TechPrescales", std::vector<double>(64, 1));
90  descriptions.add("l1GTPrescaler", desc);
91 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
bool L1GTPrescaler::filter ( edm::Event event,
edm::EventSetup const &  setup 
)
overridevirtual

Implements edm::one::EDFilterBase.

Definition at line 38 of file L1GTPrescaler.cc.

References patZpeak::handle, mps_fire::i, m_algoCounters, m_algoPrescales, m_l1ResultsToken, m_techCounters, m_techPrescales, eostools::move(), and mps_fire::result.

38  {
40  event.getByToken(m_l1ResultsToken, handle);
41  auto algoWord = handle->decisionWord(); // make a copy of the L1 algo results
42  auto techWord = handle->technicalTriggerWord(); // make a copy of the L1 tech results
43  bool finalOr = false;
44 
45  for (unsigned int i = 0; i < 128; ++i) {
46  if (m_algoPrescales[i] == 0) {
47  // mask this trigger: reset the bit
48  algoWord[i] = false;
49  } else if (algoWord[i]) {
50  // prescale this trigger
51  ++m_algoCounters[i];
52  if (std::fmod(m_algoCounters[i], m_algoPrescales[i]) < 1)
53  // the prescale is successful, keep the bit set
54  finalOr = true;
55  else
56  // the prescale failed, reset the bit
57  algoWord[i] = false;
58  }
59  }
60  for (unsigned int i = 0; i < 64; ++i) {
61  if (m_techPrescales[i] == 0) {
62  // mask this trigger: reset the bit
63  techWord[i] = false;
64  } else if (techWord[i]) {
65  ++m_techCounters[i];
66  if (std::fmod(m_techCounters[i], m_techPrescales[i]) < 1)
67  // the prescale is successful, keep the bit set
68  finalOr = true;
69  else
70  // the prescale failed, reset the bit
71  techWord[i] = false;
72  }
73  }
74 
75  // make a copy of the L1GlobalTriggerReadoutRecord, and set the new decisions
76  std::unique_ptr<L1GlobalTriggerReadoutRecord> result(new L1GlobalTriggerReadoutRecord(*handle));
77  result->setDecisionWord(algoWord);
78  result->setTechnicalTriggerWord(techWord);
79  result->setDecision(finalOr);
80  event.put(std::move(result));
81 
82  return finalOr;
83 }
const std::array< double, 64 > m_techPrescales
std::array< unsigned int, 64 > m_techCounters
tuple result
Definition: mps_fire.py:311
const std::array< double, 128 > m_algoPrescales
def move
Definition: eostools.py:511
tuple handle
Definition: patZpeak.py:23
std::array< unsigned int, 128 > m_algoCounters
const edm::EDGetTokenT< L1GlobalTriggerReadoutRecord > m_l1ResultsToken

Member Data Documentation

std::array<unsigned int, 128> L1GTPrescaler::m_algoCounters
private

Definition at line 25 of file L1GTPrescaler.cc.

Referenced by filter(), and L1GTPrescaler().

const std::array<double, 128> L1GTPrescaler::m_algoPrescales
private

Definition at line 23 of file L1GTPrescaler.cc.

Referenced by filter().

const edm::EDGetTokenT<L1GlobalTriggerReadoutRecord> L1GTPrescaler::m_l1ResultsToken
private

Definition at line 22 of file L1GTPrescaler.cc.

Referenced by filter().

std::array<unsigned int, 64> L1GTPrescaler::m_techCounters
private

Definition at line 26 of file L1GTPrescaler.cc.

Referenced by filter(), and L1GTPrescaler().

const std::array<double, 64> L1GTPrescaler::m_techPrescales
private

Definition at line 24 of file L1GTPrescaler.cc.

Referenced by filter().