CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::L1MuonParticleCollection
muCollToken_
 
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_, and theSource.

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 ( )

Destructor.

Definition at line 44 of file HLTL1MuonSelector.cc.

44  {
45 }

Member Function Documentation

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

Definition at line 48 of file HLTL1MuonSelector.cc.

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

48  {
50  desc.add<edm::InputTag>("InputObjects",edm::InputTag(""));
51  desc.add<double>("L1MinPt",-1.);
52  desc.add<double>("L1MaxEta",5.0);
53  desc.add<unsigned int>("L1MinQuality",0);
54  descriptions.add("hltL1MuonSelector",desc);
55 }
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

Implements edm::global::EDProducerBase.

Definition at line 57 of file HLTL1MuonSelector.cc.

References Reference_intrackfit_cff::barrel, RecoTauCleanerPlugins::charge, L1MuGMTCand::charge_valid(), L1MuGMTCand::empty(), eta, create_public_lumi_plots::exp, edm::Event::getByToken(), LogTrace, metname, muCollToken_, convertSQLitetoXML_cfg::output, phi, EnergyCorrector::pt, edm::Event::put(), L1MuGMTCand::quality(), HLT_25ns10e33_v2_cff::quality, AlCaHLTBitMon_QueryRunRegistry::string, theL1MaxEta, theL1MinPt, theL1MinQuality, and theta().

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