CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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<>

Public Member Functions

 HLTMuonL2SelectorForL3IO (const edm::ParameterSet &)
 constructor with config More...
 
void produce (edm::Event &, const edm::EventSetup &) override
 select muons More...
 
 ~HLTMuonL2SelectorForL3IO () override
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 default values More...
 

Private Attributes

const bool applyL3Filters_
 
const edm::EDGetTokenT
< reco::TrackCollection
l2Src_
 
const edm::EDGetTokenT
< reco::MuonTrackLinksCollection
l3linkToken_
 
const edm::EDGetTokenT
< reco::RecoChargedCandidateCollection
l3OISrc_
 
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<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

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 27 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.

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  LogTrace("Muon|RecoMuon|HLTMuonL2SelectorForL3IO") << "constructor called";
27  produces<reco::TrackCollection>();
28 }
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > l3OISrc_
#define LogTrace(id)
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > l3linkToken_
const edm::EDGetTokenT< reco::TrackCollection > l2Src_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTMuonL2SelectorForL3IO::~HLTMuonL2SelectorForL3IO ( )
override

destructor

Definition at line 31 of file HLTMuonL2SelectorForL3IO.cc.

31 {}

Member Function Documentation

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

default values

Definition at line 100 of file HLTMuonL2SelectorForL3IO.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

100  {
102  desc.add<edm::InputTag>("l2Src", edm::InputTag("hltL2Muons", "UpdatedAtVtx"));
103  desc.add<edm::InputTag>("l3OISrc", edm::InputTag("hltNewOIL3MuonCandidates"));
104  desc.add<edm::InputTag>("InputLinks", edm::InputTag("hltNewOIL3MuonsLinksCombination"));
105  desc.add<bool>("applyL3Filters", true);
106  desc.add<int>("MinNhits", 1);
107  desc.add<double>("MaxNormalizedChi2", 20.0);
108  desc.add<int>("MinNmuonHits", 0);
109  desc.add<double>("MaxPtDifference", 999.0); //relative difference
110  descriptions.add("HLTMuonL2SelectorForL3IO", desc);
111 }
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 
)
override

select muons

create collection of L2 muons not already reconstructed as L3 muons

Definition at line 34 of file HLTMuonL2SelectorForL3IO.cc.

References funct::abs(), applyL3Filters_, reco::deltaR2(), reco::TrackBase::eta(), edm::Event::getByToken(), reco::MuonTrackLinks::globalTrack(), reco::TrackBase::hitPattern(), cmsLHEtoEOSManager::l, l2Src_, l3linkToken_, l3OISrc_, MainPageGenerator::link, electronStore::links, 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.

34  {
35  const std::string metname = "Muon|RecoMuon|HLTMuonL2SelectorForL3IO";
36 
37  // IN:
39  iEvent.getByToken(l2Src_, l2muonH);
40 
42  iEvent.getByToken(l3OISrc_, l3muonH);
43 
44  // Read Links collection:
46  iEvent.getByToken(l3linkToken_, links);
47 
48  // OUT:
49  std::unique_ptr<reco::TrackCollection> result(new reco::TrackCollection());
50 
51  for (unsigned int il2 = 0; il2 != l2muonH->size(); ++il2) {
52  reco::TrackRef l2muRef(l2muonH, il2);
53  bool re_do_this_L2 = true;
54 
55  for (unsigned int il3 = 0; il3 != l3muonH->size(); ++il3) {
56  reco::RecoChargedCandidateRef cand(l3muonH, il3);
57  reco::TrackRef tk = cand->track();
58 
59  bool useThisLink = false;
60  for (unsigned int l(0); l < links->size() && !useThisLink; ++l) {
61  const reco::MuonTrackLinks* link = &links->at(l);
62 
63  // Check if the L3 link matches the L3 candidate
64  const reco::Track& globalTrack = *link->globalTrack();
65  float dR2 = deltaR2(tk->eta(), tk->phi(), globalTrack.eta(), globalTrack.phi());
66  if (dR2 < 0.02 * 0.02 and std::abs(tk->pt() - globalTrack.pt()) < 0.001 * tk->pt()) {
67  useThisLink = true;
68  }
69 
70  if (!useThisLink)
71  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)
76  re_do_this_L2 = false;
77 
78  // Check the quality of the reconstructed L3, if poor quality, we will re-use this L2
79  if (staTrack == l2muRef && applyL3Filters_) {
80  re_do_this_L2 = true;
81  const reco::Track& globalTrack = *link->globalTrack();
82  if (globalTrack.numberOfValidHits() < min_Nhits_)
83  continue; // cut on number of hits
84  if (globalTrack.normalizedChi2() > max_NormalizedChi2_)
85  continue; //normalizedChi2 cut
86  if (globalTrack.hitPattern().numberOfValidMuonHits() < min_NmuonHits_)
87  continue; //min muon hits cut
88  if (std::abs(globalTrack.pt() - l2muRef->pt()) > max_PtDifference_ * globalTrack.pt())
89  continue; // pt difference
90  re_do_this_L2 = false;
91  }
92  }
93  }
94  if (re_do_this_L2)
95  result->push_back(*l2muRef); // used the L2 if no L3 if matched or if the matched L3 has poor quality cuts.
96  }
97  iEvent.put(std::move(result));
98 }
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > l3OISrc_
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
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:593
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
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:649
tuple result
Definition: mps_fire.py:311
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > l3linkToken_
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
double pt() const
track transverse momentum
Definition: TrackBase.h:637
def move
Definition: eostools.py:511
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
constexpr auto deltaR2(const T1 &t1, const T2 &t2) -> decltype(t1.eta())
Definition: deltaR.h:16
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
const edm::EDGetTokenT< reco::TrackCollection > l2Src_
int numberOfValidMuonHits() const
Definition: HitPattern.h:817

Member Data Documentation

const bool HLTMuonL2SelectorForL3IO::applyL3Filters_
private

Definition at line 45 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

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

Definition at line 42 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

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

Definition at line 44 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

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

Definition at line 43 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const double HLTMuonL2SelectorForL3IO::max_NormalizedChi2_
private

Definition at line 46 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const double HLTMuonL2SelectorForL3IO::max_PtDifference_
private

Definition at line 46 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const int HLTMuonL2SelectorForL3IO::min_Nhits_
private

Definition at line 47 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

const int HLTMuonL2SelectorForL3IO::min_NmuonHits_
private

Definition at line 47 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().