CMS 3D CMS Logo

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

#include <HLTMuonL2SelectorForL3IO.h>

Inheritance diagram for HLTMuonL2SelectorForL3IO:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 HLTMuonL2SelectorForL3IO (const edm::ParameterSet &)
 constructor with config More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 select muons More...
 
virtual ~HLTMuonL2SelectorForL3IO ()
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::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
 
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
 
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)
 default values More...
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

const bool applyL3Filters_
 
const edm::EDGetTokenT< reco::TrackCollectionl2Src_
 
const edm::EDGetTokenT< reco::MuonTrackLinksCollectionl3linkToken_
 
const edm::EDGetTokenT< reco::RecoChargedCandidateCollectionl3OISrc_
 
const double max_NormalizedChi2_
 
const double max_PtDifference_
 
const int min_Nhits_
 
const int min_NmuonHits_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase 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

L2 muon selector for L3 IO: finds L2 muons not previous converted into (good) L3 muons

Author
Benjamin Radburn-Smith, Santiago Folgueras - Purdue University

Definition at line 23 of file HLTMuonL2SelectorForL3IO.h.

Constructor & Destructor Documentation

HLTMuonL2SelectorForL3IO::HLTMuonL2SelectorForL3IO ( const edm::ParameterSet iConfig)

constructor with config

Definition at line 17 of file HLTMuonL2SelectorForL3IO.cc.

References LogTrace.

17  :
18  l2Src_(consumes<reco::TrackCollection>(iConfig.getParameter<edm::InputTag>("l2Src"))),
19  l3OISrc_(consumes<reco::RecoChargedCandidateCollection>(iConfig.getParameter<edm::InputTag>("l3OISrc"))),
20  l3linkToken_(consumes<reco::MuonTrackLinksCollection>(iConfig.getParameter<edm::InputTag>("InputLinks"))),
21  applyL3Filters_(iConfig.getParameter<bool>("applyL3Filters")),
22  max_NormalizedChi2_ (iConfig.getParameter<double> ("MaxNormalizedChi2")),
23  max_PtDifference_ (iConfig.getParameter<double> ("MaxPtDifference")),
24  min_Nhits_ (iConfig.getParameter<int> ("MinNhits")),
25  min_NmuonHits_ (iConfig.getParameter<int> ("MinNmuonHits"))
26 {
27  LogTrace("Muon|RecoMuon|HLTMuonL2SelectorForL3IO")<<"constructor called";
28  produces<reco::TrackCollection>();
29 }
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > l3OISrc_
T getParameter(std::string const &) const
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > l3linkToken_
#define LogTrace(id)
const edm::EDGetTokenT< reco::TrackCollection > l2Src_
HLTMuonL2SelectorForL3IO::~HLTMuonL2SelectorForL3IO ( )
virtual

destructor

Definition at line 32 of file HLTMuonL2SelectorForL3IO.cc.

32 {}

Member Function Documentation

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

default values

Definition at line 94 of file HLTMuonL2SelectorForL3IO.cc.

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

94  {
96  desc.add<edm::InputTag>("l2Src",edm::InputTag("hltL2Muons","UpdatedAtVtx"));
97  desc.add<edm::InputTag>("l3OISrc",edm::InputTag("hltNewOIL3MuonCandidates"));
98  desc.add<edm::InputTag>("InputLinks",edm::InputTag("hltNewOIL3MuonsLinksCombination"));
99  desc.add<bool>("applyL3Filters",true);
100  desc.add<int>("MinNhits",1);
101  desc.add<double>("MaxNormalizedChi2",20.0);
102  desc.add<int>("MinNmuonHits",0);
103  desc.add<double>("MaxPtDifference",999.0); //relative difference
104  descriptions.add("HLTMuonL2SelectorForL3IO",desc);
105 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void HLTMuonL2SelectorForL3IO::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

select muons

create collection of L2 muons not already reconstructed as L3 muons

Definition at line 35 of file HLTMuonL2SelectorForL3IO.cc.

References funct::abs(), applyL3Filters_, reco::deltaR2(), reco::TrackBase::eta(), edm::Event::getByToken(), reco::MuonTrackLinks::globalTrack(), cutBasedMuonId_MuonPOG_V0_cff::globalTrack, reco::TrackBase::hitPattern(), checklumidiff::l, l2Src_, l3linkToken_, l3OISrc_, max_NormalizedChi2_, max_PtDifference_, metname, min_Nhits_, min_NmuonHits_, eostools::move(), reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfValidHits(), reco::HitPattern::numberOfValidMuonHits(), reco::TrackBase::phi(), reco::TrackBase::pt(), edm::Event::put(), mps_fire::result, reco::MuonTrackLinks::standAloneTrack(), and AlCaHLTBitMon_QueryRunRegistry::string.

35  {
36  const std::string metname = "Muon|RecoMuon|HLTMuonL2SelectorForL3IO";
37 
38  // IN:
40  iEvent.getByToken(l2Src_, l2muonH);
41 
43  iEvent.getByToken(l3OISrc_,l3muonH);
44 
45  // Read Links collection:
47  iEvent.getByToken(l3linkToken_, links);
48 
49  // OUT:
50  std::unique_ptr<reco::TrackCollection > result(new reco::TrackCollection());
51 
52  for (unsigned int il2=0; il2 != l2muonH->size(); ++il2){
53  reco::TrackRef l2muRef(l2muonH, il2);
54  bool re_do_this_L2=true;
55 
56  for (unsigned int il3=0; il3 != l3muonH->size(); ++il3){
58  reco::TrackRef tk = cand->track();
59 
60  bool useThisLink = false;
61  for (unsigned int l(0); l<links->size() && !useThisLink; ++l){
62  const reco::MuonTrackLinks* link = &links->at(l);
63 
64  // Check if the L3 link matches the L3 candidate
65  const reco::Track& globalTrack = *link->globalTrack();
66  float dR2 = deltaR2(tk->eta(),tk->phi(),globalTrack.eta(),globalTrack.phi());
67  if (dR2 < 0.02*0.02 and std::abs(tk->pt() - globalTrack.pt()) < 0.001*tk->pt()) {
68  useThisLink=true;
69  }
70 
71  if (!useThisLink) continue;
72 
73  // Check whether the stand-alone track matches a L2, if not, we will re-use this L2
74  const reco::TrackRef staTrack = link->standAloneTrack();
75  if (l2muRef==staTrack) re_do_this_L2=false;
76 
77  // Check the quality of the reconstructed L3, if poor quality, we will re-use this L2
78  if (staTrack==l2muRef && applyL3Filters_) {
79  re_do_this_L2 = true;
80  const reco::Track& globalTrack = *link->globalTrack();
81  if (globalTrack.numberOfValidHits()< min_Nhits_) continue; // cut on number of hits
82  if (globalTrack.normalizedChi2() > max_NormalizedChi2_ ) continue; //normalizedChi2 cut
83  if (globalTrack.hitPattern().numberOfValidMuonHits() < min_NmuonHits_ ) continue; //min muon hits cut
84  if (std::abs(globalTrack.pt()-l2muRef->pt()) > max_PtDifference_*globalTrack.pt()) continue; // pt difference
85  re_do_this_L2 = false;
86  }
87  }
88  }
89  if (re_do_this_L2) result->push_back(*l2muRef); // used the L2 if no L3 if matched or if the matched L3 has poor quality cuts.
90  }
91  iEvent.put(std::move(result));
92 }
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > l3OISrc_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:561
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
const std::string metname
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > l3linkToken_
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
double pt() const
track transverse momentum
Definition: TrackBase.h:621
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:820
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:446
const edm::EDGetTokenT< reco::TrackCollection > l2Src_
T1 deltaR2(T1 eta1, T2 phi1, T3 eta2, T4 phi2)
Definition: deltaR.h:36
int numberOfValidMuonHits() const
Definition: HitPattern.h:833
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

const bool HLTMuonL2SelectorForL3IO::applyL3Filters_
private

Definition at line 41 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const edm::EDGetTokenT<reco::TrackCollection> HLTMuonL2SelectorForL3IO::l2Src_
private

Definition at line 38 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const edm::EDGetTokenT<reco::MuonTrackLinksCollection> HLTMuonL2SelectorForL3IO::l3linkToken_
private

Definition at line 40 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const edm::EDGetTokenT<reco::RecoChargedCandidateCollection> HLTMuonL2SelectorForL3IO::l3OISrc_
private

Definition at line 39 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const double HLTMuonL2SelectorForL3IO::max_NormalizedChi2_
private

Definition at line 42 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const double HLTMuonL2SelectorForL3IO::max_PtDifference_
private

Definition at line 42 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const int HLTMuonL2SelectorForL3IO::min_Nhits_
private

Definition at line 43 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const int HLTMuonL2SelectorForL3IO::min_NmuonHits_
private

Definition at line 43 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().