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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () 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
 
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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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::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
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::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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<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)
 

Detailed Description

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

based on RecoMuon/L2MuonSeedGenerator

Author
D. Olivito

Definition at line 33 of file HLTL1TMuonSelector.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 of file HLTL1TMuonSelector.cc.

References muCollToken_, theSource, and ~HLTL1TMuonSelector().

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

Destructor.

Referenced by HLTL1TMuonSelector().

Member Function Documentation

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

Definition at line 48 of file HLTL1TMuonSelector.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

48  {
50  desc.add<edm::InputTag>("InputObjects",edm::InputTag("hltGmtStage2Digis"));
51  desc.add<double>("L1MinPt",-1.);
52  desc.add<double>("L1MaxEta",5.0);
53  desc.add<unsigned int>("L1MinQuality",0);
54  desc.add<bool>("CentralBxOnly", true);
55  descriptions.add("hltL1TMuonSelector",desc);
56 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTL1TMuonSelector::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
override

Definition at line 58 of file HLTL1TMuonSelector.cc.

References BXVector< T >::begin(), centralBxOnly_, ALCARECOTkAlJpsiMuMu_cff::charge, DEFINE_FWK_MODULE, BXVector< T >::end(), PVValHelper::eta, JetChargeProducer_cfi::exp, edm::Event::getByToken(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), LogTrace, metname, eostools::move(), muCollToken_, convertSQLitetoXML_cfg::output, phi, EnergyCorrector::pt, edm::Event::put(), jets_cff::quality, BXVector< T >::size(), AlCaHLTBitMon_QueryRunRegistry::string, theL1MaxEta, theL1MinPt, theL1MinQuality, and theta().

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

Member Data Documentation

bool HLTL1TMuonSelector::centralBxOnly_
private

use central bx only muons

Definition at line 57 of file HLTL1TMuonSelector.h.

Referenced by produce().

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

Definition at line 50 of file HLTL1TMuonSelector.h.

Referenced by HLTL1TMuonSelector(), and produce().

const double HLTL1TMuonSelector::theL1MaxEta
private

Definition at line 53 of file HLTL1TMuonSelector.h.

Referenced by produce().

const double HLTL1TMuonSelector::theL1MinPt
private

Definition at line 52 of file HLTL1TMuonSelector.h.

Referenced by produce().

const unsigned HLTL1TMuonSelector::theL1MinQuality
private

Definition at line 54 of file HLTL1TMuonSelector.h.

Referenced by produce().

edm::InputTag HLTL1TMuonSelector::theSource
private

Definition at line 48 of file HLTL1TMuonSelector.h.

Referenced by HLTL1TMuonSelector().