test
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
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...
 
virtual void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~HLTL1TMuonSelector ()
 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

bool centralBxOnly_
 use central bx only muons More...
 
edm::EDGetTokenT
< l1t::MuonBxCollection
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

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

Destructor.

Definition at line 45 of file HLTL1TMuonSelector.cc.

45  {
46 }

Member Function Documentation

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

Definition at line 49 of file HLTL1TMuonSelector.cc.

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

49  {
51  desc.add<edm::InputTag>("InputObjects",edm::InputTag("hltGmtStage2Digis"));
52  desc.add<double>("L1MinPt",-1.);
53  desc.add<double>("L1MaxEta",5.0);
54  desc.add<unsigned int>("L1MinQuality",0);
55  desc.add<bool>("CentralBxOnly", true);
56  descriptions.add("hltL1TMuonSelector",desc);
57 }
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
overridevirtual

Implements edm::global::EDProducerBase.

Definition at line 59 of file HLTL1TMuonSelector.cc.

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

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

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