CMS 3D CMS Logo

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

#include <HLTL1TMuonSelector.h>

Inheritance diagram for HLTL1TMuonSelector:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTL1TMuonSelector (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~HLTL1TMuonSelector () override
 Destructor. More...
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept final
 
bool wantsStreamLuminosityBlocks () const noexcept final
 
bool wantsStreamRuns () const noexcept final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

bool centralBxOnly_
 use central bx only muons More...
 
edm::EDGetTokenT< l1t::MuonBxCollectionmuCollToken_
 
const double theL1MaxEta
 
const double theL1MinPt
 
const unsigned theL1MinQuality
 
edm::InputTag theSource
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
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< Bconsumes (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 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 ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
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

HLTL1TMuonSelector: Simple selector to output a subset of L1 muon collection

based on RecoMuon/L2MuonSeedGenerator

Author
D. Olivito

Definition at line 37 of file HLTL1TMuonSelector.h.

Constructor & Destructor Documentation

◆ HLTL1TMuonSelector()

HLTL1TMuonSelector::HLTL1TMuonSelector ( const edm::ParameterSet iConfig)
explicit

Constructor.

Definition at line 31 of file HLTL1TMuonSelector.cc.

References muCollToken_, and theSource.

32  : theSource(iConfig.getParameter<InputTag>("InputObjects")),
33  theL1MinPt(iConfig.getParameter<double>("L1MinPt")),
34  theL1MaxEta(iConfig.getParameter<double>("L1MaxEta")),
35  theL1MinQuality(iConfig.getParameter<unsigned int>("L1MinQuality")),
36  centralBxOnly_(iConfig.getParameter<bool>("CentralBxOnly")) {
37  muCollToken_ = consumes<MuonBxCollection>(theSource);
38 
39  produces<MuonBxCollection>();
40 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const unsigned theL1MinQuality
edm::InputTag theSource
edm::EDGetTokenT< l1t::MuonBxCollection > muCollToken_
bool centralBxOnly_
use central bx only muons
const double theL1MaxEta

◆ ~HLTL1TMuonSelector()

HLTL1TMuonSelector::~HLTL1TMuonSelector ( )
overridedefault

Destructor.

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 45 of file HLTL1TMuonSelector.cc.

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

45  {
47  desc.add<edm::InputTag>("InputObjects", edm::InputTag("hltGmtStage2Digis"));
48  desc.add<double>("L1MinPt", -1.);
49  desc.add<double>("L1MaxEta", 5.0);
50  desc.add<unsigned int>("L1MinQuality", 0);
51  desc.add<bool>("CentralBxOnly", true);
52  descriptions.add("hltL1TMuonSelector", desc);
53 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

void HLTL1TMuonSelector::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 55 of file HLTL1TMuonSelector.cc.

References BXVector< T >::begin(), centralBxOnly_, ALCARECOTkAlJpsiMuMu_cff::charge, BXVector< T >::end(), PVValHelper::eta, JetChargeProducer_cfi::exp, BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), iEvent, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LogTrace, metname, eostools::move(), muCollToken_, convertSQLitetoXML_cfg::output, phi, DiDispStaMuonMonitor_cfi::pt, quality, BXVector< T >::size(), AlCaHLTBitMon_QueryRunRegistry::string, theL1MaxEta, theL1MinPt, theL1MinQuality, and theta().

55  {
56  const std::string metname = "Muon|RecoMuon|HLTL1TMuonSelector";
57 
58  unique_ptr<MuonBxCollection> output(new MuonBxCollection());
59 
60  // Muon particles
62  iEvent.getByToken(muCollToken_, muColl);
63  LogTrace(metname) << "Number of muons " << muColl->size() << endl;
64 
65  for (int ibx = muColl->getFirstBX(); ibx <= muColl->getLastBX(); ++ibx) {
66  if (centralBxOnly_ && (ibx != 0))
67  continue;
68  for (auto it = muColl->begin(ibx); it != muColl->end(ibx); it++) {
69  unsigned int quality = it->hwQual();
70  int valid_charge = it->hwChargeValid();
71 
72  float pt = it->pt();
73  float eta = it->eta();
74  float theta = 2 * atan(exp(-eta));
75  float phi = it->phi();
76  int charge = it->charge();
77  // Set charge=0 for the time being if the valid charge bit is zero
78  if (!valid_charge)
79  charge = 0;
80 
81  if (pt < theL1MinPt || fabs(eta) > theL1MaxEta)
82  continue;
83 
84  LogTrace(metname) << "L1 Muon Found";
85  LogTrace(metname) << "Pt = " << pt << " GeV/c";
86  LogTrace(metname) << "eta = " << eta;
87  LogTrace(metname) << "theta = " << theta << " rad";
88  LogTrace(metname) << "phi = " << phi << " rad";
89  LogTrace(metname) << "charge = " << charge;
90 
91  if (quality <= theL1MinQuality)
92  continue;
93  LogTrace(metname) << "quality = " << quality;
94 
95  output->push_back(ibx, *it);
96  }
97  }
98 
99  iEvent.put(std::move(output));
100 }
int getLastBX() const
int getFirstBX() const
const std::string metname
#define LogTrace(id)
const_iterator begin(int bx) const
unsigned size(int bx) const
const unsigned theL1MinQuality
string quality
edm::EDGetTokenT< l1t::MuonBxCollection > muCollToken_
int iEvent
Definition: GenABIO.cc:224
BXVector< Muon > MuonBxCollection
Definition: Muon.h:11
bool centralBxOnly_
use central bx only muons
const_iterator end(int bx) const
const double theL1MaxEta
Definition: output.py:1
Geom::Theta< T > theta() const
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

◆ centralBxOnly_

bool HLTL1TMuonSelector::centralBxOnly_
private

use central bx only muons

Definition at line 58 of file HLTL1TMuonSelector.h.

Referenced by produce().

◆ muCollToken_

edm::EDGetTokenT<l1t::MuonBxCollection> HLTL1TMuonSelector::muCollToken_
private

Definition at line 51 of file HLTL1TMuonSelector.h.

Referenced by HLTL1TMuonSelector(), and produce().

◆ theL1MaxEta

const double HLTL1TMuonSelector::theL1MaxEta
private

Definition at line 54 of file HLTL1TMuonSelector.h.

Referenced by produce().

◆ theL1MinPt

const double HLTL1TMuonSelector::theL1MinPt
private

Definition at line 53 of file HLTL1TMuonSelector.h.

Referenced by produce().

◆ theL1MinQuality

const unsigned HLTL1TMuonSelector::theL1MinQuality
private

Definition at line 55 of file HLTL1TMuonSelector.h.

Referenced by produce().

◆ theSource

edm::InputTag HLTL1TMuonSelector::theSource
private

Definition at line 49 of file HLTL1TMuonSelector.h.

Referenced by HLTL1TMuonSelector().