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...
 
virtual void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~HLTL1MuonSelector ()
 Destructor. More...
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- 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 ()
 
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, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
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
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 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

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

based on RecoMuon/L2MuonSeedGenerator

Author
D. Olivito

Definition at line 37 of file HLTL1MuonSelector.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 of file HLTL1MuonSelector.cc.

References muCollToken_, theSource, and ~HLTL1MuonSelector().

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 {
38  muCollToken_ = consumes<L1MuonParticleCollection>(theSource);
39 
40  produces<L1MuonParticleCollection>();
41 }
T getParameter(std::string const &) const
edm::EDGetTokenT< l1extra::L1MuonParticleCollection > muCollToken_
const unsigned theL1MinQuality
const double theL1MaxEta
edm::InputTag theSource
const double theL1MinPt
HLTL1MuonSelector::~HLTL1MuonSelector ( )
default

Destructor.

Referenced by HLTL1MuonSelector().

Member Function Documentation

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

Definition at line 47 of file HLTL1MuonSelector.cc.

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

47  {
49  desc.add<edm::InputTag>("InputObjects",edm::InputTag(""));
50  desc.add<double>("L1MinPt",-1.);
51  desc.add<double>("L1MaxEta",5.0);
52  desc.add<unsigned int>("L1MinQuality",0);
53  descriptions.add("hltL1MuonSelector",desc);
54 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTL1MuonSelector::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Definition at line 56 of file HLTL1MuonSelector.cc.

References Reference_intrackfit_cff::barrel, ALCARECOTkAlJpsiMuMu_cff::charge, L1MuGMTCand::charge_valid(), L1MuGMTCand::empty(), stringResolutionProvider_cfi::eta, JetChargeProducer_cfi::exp, edm::Event::getByToken(), LogTrace, metname, eostools::move(), muCollToken_, convertSQLitetoXML_cfg::output, phi, EnergyCorrector::pt, edm::Event::put(), btvTracks_cfi::quality, L1MuGMTCand::quality(), AlCaHLTBitMon_QueryRunRegistry::string, theL1MaxEta, theL1MinPt, theL1MinQuality, and theta().

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

Member Data Documentation

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

Definition at line 54 of file HLTL1MuonSelector.h.

Referenced by HLTL1MuonSelector(), and produce().

const double HLTL1MuonSelector::theL1MaxEta
private

Definition at line 57 of file HLTL1MuonSelector.h.

Referenced by produce().

const double HLTL1MuonSelector::theL1MinPt
private

Definition at line 56 of file HLTL1MuonSelector.h.

Referenced by produce().

const unsigned HLTL1MuonSelector::theL1MinQuality
private

Definition at line 58 of file HLTL1MuonSelector.h.

Referenced by produce().

edm::InputTag HLTL1MuonSelector::theSource
private

Definition at line 52 of file HLTL1MuonSelector.h.

Referenced by HLTL1MuonSelector().