CMS 3D CMS Logo

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

#include <HLTL1MuonNoL2Selector.h>

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

Public Member Functions

 HLTL1MuonNoL2Selector (const edm::ParameterSet &)
 Constructor. More...
 
virtual void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
 ~HLTL1MuonNoL2Selector ()
 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< l1t::MuonBxCollectionmuCollToken_
 
edm::InputTag seedMapTag_
 
edm::EDGetTokenT< SeedMapseedMapToken_
 
edm::InputTag theL1CandTag_
 
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefstheL1CandToken_
 
const double theL1MaxEta_
 
const double theL1MinPt_
 
const unsigned theL1MinQuality_
 
edm::InputTag theL1Source_
 
edm::InputTag theL2CandTag_
 
edm::EDGetTokenT< reco::RecoChargedCandidateCollectiontheL2CandToken_
 

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

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

based on RecoMuon/L2MuonSeedGenerator

Author
D. Olivito

HLTL1MuonNoL2Selector: Simple selector to output a subset of L1 muon collection with no L2 link.

based on RecoMuon/L2MuonSeedGenerator

Author
S. Folgueras

Definition at line 37 of file HLTL1MuonNoL2Selector.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 32 of file HLTL1MuonNoL2Selector.cc.

References muCollToken_, theL1Source_, and ~HLTL1MuonNoL2Selector().

32  :
33  theL1Source_(iConfig.getParameter<InputTag>("InputObjects")),
34  theL1MinPt_(iConfig.getParameter<double>("L1MinPt")),
35  theL1MaxEta_(iConfig.getParameter<double>("L1MaxEta")),
36  theL1MinQuality_(iConfig.getParameter<unsigned int>("L1MinQuality")),
37  theL2CandTag_ (iConfig.getParameter< edm::InputTag > ("L2CandTag")),
38  theL2CandToken_ (consumes<reco::RecoChargedCandidateCollection>(theL2CandTag_)),
39  theL1CandTag_ (iConfig.getParameter<InputTag > ("L1CandTag")),
40  theL1CandToken_ (consumes<trigger::TriggerFilterObjectWithRefs>(theL1CandTag_)),
41  seedMapTag_( iConfig.getParameter<InputTag >("SeedMapTag") ),
42  seedMapToken_(consumes<SeedMap>(seedMapTag_))
43 {
44  muCollToken_ = consumes<MuonBxCollection>(theL1Source_);
45 
46  produces<MuonBxCollection>();
47 }
T getParameter(std::string const &) const
edm::EDGetTokenT< l1t::MuonBxCollection > muCollToken_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theL2CandToken_
edm::EDGetTokenT< SeedMap > seedMapToken_
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > theL1CandToken_
HLTL1MuonNoL2Selector::~HLTL1MuonNoL2Selector ( )
default

Destructor.

Referenced by HLTL1MuonNoL2Selector().

Member Function Documentation

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

Definition at line 53 of file HLTL1MuonNoL2Selector.cc.

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

53  {
55  desc.add<edm::InputTag>("InputObjects",edm::InputTag(""));
56  desc.add<edm::InputTag>("L2CandTag",edm::InputTag("hltL2MuonCandidates"));
57  desc.add<edm::InputTag>("L1CandTag",edm::InputTag(""));
58  desc.add<edm::InputTag>("SeedMapTag",edm::InputTag("hltL2Muons"));
59  desc.add<double>("L1MinPt",-1.);
60  desc.add<double>("L1MaxEta",5.0);
61  desc.add<unsigned int>("L1MinQuality",0);
62  descriptions.add("hltL1MuonNoL2Selector",desc);
63 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTL1MuonNoL2Selector::produce ( edm::StreamID  ,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overridevirtual

Definition at line 65 of file HLTL1MuonNoL2Selector.cc.

References BXVector< T >::begin(), SoftLeptonByDistance_cfi::distance, BXVector< T >::end(), spr::find(), edm::Event::getByToken(), BXVector< T >::getFirstBX(), BXVector< T >::getLastBX(), trigger::TriggerRefsCollections::getObjects(), LogTrace, metname, eostools::move(), muCollToken_, convertSQLitetoXML_cfg::output, edm::RefVector< C, T, F >::push_back(), edm::Event::put(), SurveyInfoScenario_cff::seed, seedMapToken_, BXVector< T >::size(), AlCaHLTBitMon_QueryRunRegistry::string, theL1CandToken_, theL2CandToken_, and trigger::TriggerL1Mu.

66 {
67  using namespace std;
68  using namespace reco;
69  using namespace trigger;
70 
71  const std::string metname = "Muon|RecoMuon|HLTL1MuonNoL2Selector";
72 
73  unique_ptr<MuonBxCollection> output(new MuonBxCollection());
74 
75  // Get hold of L2 trks
77  iEvent.getByToken(theL2CandToken_,L2cands);
78 
79  // get the L2 to L1 map object for this event
80  // HLTMuonL2ToL1TMap mapL2ToL1(theL1CandToken_, seedMapToken_, iEvent);
81 
82  // Muon particles
84  iEvent.getByToken(muCollToken_, muColl);
85  LogTrace(metname) << "Number of muons " << muColl->size() << endl;
86 
87  edm::Handle<SeedMap> seedMapHandle;
88  iEvent.getByToken(seedMapToken_, seedMapHandle);
89 
90  std::vector<l1t::MuonRef> firedL1Muons_;
92  iEvent.getByToken(theL1CandToken_, L1Cands);
93  L1Cands->getObjects(trigger::TriggerL1Mu, firedL1Muons_);
94 
95  for (int ibx = muColl->getFirstBX(); ibx <= muColl->getLastBX(); ++ibx) {
96  if (ibx != 0) continue;
97  for (auto it = muColl->begin(ibx); it != muColl->end(ibx); it++){
98  l1t::MuonRef l1muon(muColl, distance(muColl->begin(muColl->getFirstBX()),it) );
99 
100  // only select L1's that fired:
101  if(find(firedL1Muons_.begin(), firedL1Muons_.end(), l1muon) == firedL1Muons_.end()) continue;
102 
103  // Loop over L2's to find whether the L1 fired this L2.
104  bool isTriggeredByL1=false;
105  for (auto const & cand : *L2cands) {
106  TrackRef l2muon = cand.get<TrackRef>();
107  const edm::RefVector<L2MuonTrajectorySeedCollection>& seeds = (*seedMapHandle)[l2muon->seedRef().castTo<edm::Ref<L2MuonTrajectorySeedCollection> >()];
108  for(auto const & seed : seeds){
109  // Check if the L2 was seeded by a triggered L1, in such case skip the loop.
110  if(find(firedL1Muons_.begin(), firedL1Muons_.end(), seed->l1tParticle()) != firedL1Muons_.end()){
111  isTriggeredByL1 = true;
112  break;
113  }
114  }
115  if (!isTriggeredByL1) {
116  output->push_back( ibx, *it);
117  }
118  }
119  }
120  } // loop over L1
121 
122  iEvent.put(std::move(output));
123 }
const_iterator end(int bx) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
void getObjects(Vids &ids, VRphoton &refs) const
various physics-level getters:
unsigned size(int bx) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
enum start value shifted to 81 so as to avoid clashes with PDG codes
const std::string metname
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
edm::EDGetTokenT< l1t::MuonBxCollection > muCollToken_
edm::EDGetTokenT< reco::RecoChargedCandidateCollection > theL2CandToken_
#define LogTrace(id)
BXVector< Muon > MuonBxCollection
Definition: Muon.h:10
int getFirstBX() const
edm::EDGetTokenT< SeedMap > seedMapToken_
fixed size matrix
int getLastBX() const
edm::EDGetTokenT< trigger::TriggerFilterObjectWithRefs > theL1CandToken_
const_iterator begin(int bx) const
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

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

Definition at line 57 of file HLTL1MuonNoL2Selector.h.

Referenced by HLTL1MuonNoL2Selector(), and produce().

edm::InputTag HLTL1MuonNoL2Selector::seedMapTag_
private

Definition at line 62 of file HLTL1MuonNoL2Selector.h.

edm::EDGetTokenT<SeedMap> HLTL1MuonNoL2Selector::seedMapToken_
private

Definition at line 63 of file HLTL1MuonNoL2Selector.h.

Referenced by produce().

edm::InputTag HLTL1MuonNoL2Selector::theL1CandTag_
private

Definition at line 60 of file HLTL1MuonNoL2Selector.h.

edm::EDGetTokenT<trigger::TriggerFilterObjectWithRefs> HLTL1MuonNoL2Selector::theL1CandToken_
private

Definition at line 61 of file HLTL1MuonNoL2Selector.h.

Referenced by produce().

const double HLTL1MuonNoL2Selector::theL1MaxEta_
private

Definition at line 54 of file HLTL1MuonNoL2Selector.h.

const double HLTL1MuonNoL2Selector::theL1MinPt_
private

Definition at line 53 of file HLTL1MuonNoL2Selector.h.

const unsigned HLTL1MuonNoL2Selector::theL1MinQuality_
private

Definition at line 55 of file HLTL1MuonNoL2Selector.h.

edm::InputTag HLTL1MuonNoL2Selector::theL1Source_
private

Definition at line 52 of file HLTL1MuonNoL2Selector.h.

Referenced by HLTL1MuonNoL2Selector().

edm::InputTag HLTL1MuonNoL2Selector::theL2CandTag_
private

Definition at line 58 of file HLTL1MuonNoL2Selector.h.

edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTL1MuonNoL2Selector::theL2CandToken_
private

Definition at line 59 of file HLTL1MuonNoL2Selector.h.

Referenced by produce().