CMS 3D CMS Logo

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

#include <HLTL1MuonSelector.h>

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

Public Member Functions

 HLTL1MuonSelector (const edm::ParameterSet &)
 Constructor. More...
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~HLTL1MuonSelector () 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 final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const 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
 
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::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< l1extra::L1MuonParticleCollectionmuCollToken_
 
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 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 ()
 
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

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

based on RecoMuon/L2MuonSeedGenerator

Author
D. Olivito

Definition at line 41 of file HLTL1MuonSelector.h.

Constructor & Destructor Documentation

◆ HLTL1MuonSelector()

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

Constructor.

Definition at line 31 of file HLTL1MuonSelector.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  muCollToken_ = consumes<L1MuonParticleCollection>(theSource);
37 
38  produces<L1MuonParticleCollection>();
39 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > muCollToken_
const unsigned theL1MinQuality
const double theL1MaxEta
edm::InputTag theSource
const double theL1MinPt

◆ ~HLTL1MuonSelector()

HLTL1MuonSelector::~HLTL1MuonSelector ( )
overridedefault

Destructor.

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 44 of file HLTL1MuonSelector.cc.

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

44  {
46  desc.add<edm::InputTag>("InputObjects", edm::InputTag(""));
47  desc.add<double>("L1MinPt", -1.);
48  desc.add<double>("L1MaxEta", 5.0);
49  desc.add<unsigned int>("L1MinQuality", 0);
50  descriptions.add("hltL1MuonSelector", desc);
51 }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 53 of file HLTL1MuonSelector.cc.

References Reference_intrackfit_cff::barrel, ALCARECOTkAlJpsiMuMu_cff::charge, L1MuGMTCand::charge_valid(), L1MuGMTCand::empty(), PVValHelper::eta, JetChargeProducer_cfi::exp, iEvent, LogTrace, metname, eostools::move(), muCollToken_, convertSQLitetoXML_cfg::output, phi, DiDispStaMuonMonitor_cfi::pt, quality, L1MuGMTCand::quality(), AlCaHLTBitMon_QueryRunRegistry::string, theL1MaxEta, theL1MinPt, theL1MinQuality, and theta().

53  {
54  const std::string metname = "Muon|RecoMuon|HLTL1MuonSelector";
55 
56  unique_ptr<L1MuonParticleCollection> output(new L1MuonParticleCollection());
57 
58  // Muon particles
60  iEvent.getByToken(muCollToken_, muColl);
61  LogTrace(metname) << "Number of muons " << muColl->size() << endl;
62 
63  L1MuonParticleCollection::const_iterator it;
64  L1MuonParticleRef::key_type l1ParticleIndex = 0;
65 
66  for (it = muColl->begin(); it != muColl->end(); ++it, ++l1ParticleIndex) {
67  const L1MuGMTExtendedCand muonCand = (*it).gmtMuonCand();
68  unsigned int quality = 0;
69  bool valid_charge = false;
70  ;
71 
72  if (muonCand.empty()) {
73  LogWarning(metname) << "HLTL1MuonSelector: WARNING, no L1MuGMTCand! " << endl;
74  LogWarning(metname) << "HLTL1MuonSelector: this should make sense only within MC tests" << endl;
75  // FIXME! Temporary to handle the MC input
76  quality = 7;
77  valid_charge = true;
78  } else {
79  quality = muonCand.quality();
80  valid_charge = muonCand.charge_valid();
81  }
82 
83  float pt = (*it).pt();
84  float eta = (*it).eta();
85  float theta = 2 * atan(exp(-eta));
86  float phi = (*it).phi();
87  int charge = (*it).charge();
88  // Set charge=0 for the time being if the valid charge bit is zero
89  if (!valid_charge)
90  charge = 0;
91  bool barrel = !(*it).isForward();
92 
93  if (pt < theL1MinPt || fabs(eta) > theL1MaxEta)
94  continue;
95 
96  LogTrace(metname) << "L1 Muon Found";
97  LogTrace(metname) << "Pt = " << pt << " GeV/c";
98  LogTrace(metname) << "eta = " << eta;
99  LogTrace(metname) << "theta = " << theta << " rad";
100  LogTrace(metname) << "phi = " << phi << " rad";
101  LogTrace(metname) << "charge = " << charge;
102  LogTrace(metname) << "In Barrel? = " << barrel;
103 
104  if (quality <= theL1MinQuality)
105  continue;
106  LogTrace(metname) << "quality = " << quality;
107 
108  output->push_back(L1MuonParticle(*it));
109 
110  } // loop over L1MuonParticleCollection
111 
112  iEvent.put(std::move(output));
113 }
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:164
const std::string metname
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > muCollToken_
const unsigned theL1MinQuality
#define LogTrace(id)
unsigned int quality() const
get quality
Definition: L1MuGMTCand.h:90
string quality
bool charge_valid() const
is the charge valid ?
Definition: L1MuGMTCand.h:135
int iEvent
Definition: GenABIO.cc:224
const double theL1MaxEta
std::vector< L1MuonParticle > L1MuonParticleCollection
bool empty() const
is it an empty muon candidate?
Definition: L1MuGMTCand.h:61
Definition: output.py:1
Log< level::Warning, false > LogWarning
Geom::Theta< T > theta() const
def move(src, dest)
Definition: eostools.py:511
const double theL1MinPt

Member Data Documentation

◆ muCollToken_

edm::EDGetTokenT<l1extra::L1MuonParticleCollection> HLTL1MuonSelector::muCollToken_
private

Definition at line 55 of file HLTL1MuonSelector.h.

Referenced by HLTL1MuonSelector(), and produce().

◆ theL1MaxEta

const double HLTL1MuonSelector::theL1MaxEta
private

Definition at line 58 of file HLTL1MuonSelector.h.

Referenced by produce().

◆ theL1MinPt

const double HLTL1MuonSelector::theL1MinPt
private

Definition at line 57 of file HLTL1MuonSelector.h.

Referenced by produce().

◆ theL1MinQuality

const unsigned HLTL1MuonSelector::theL1MinQuality
private

Definition at line 59 of file HLTL1MuonSelector.h.

Referenced by produce().

◆ theSource

edm::InputTag HLTL1MuonSelector::theSource
private

Definition at line 53 of file HLTL1MuonSelector.h.

Referenced by HLTL1MuonSelector().