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

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
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

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

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
 

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::HLTMuonL2SelectorForL3IO ( const edm::ParameterSet iConfig)

constructor with config

Definition at line 17 of file HLTMuonL2SelectorForL3IO.cc.

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 }

References LogTrace.

◆ ~HLTMuonL2SelectorForL3IO()

HLTMuonL2SelectorForL3IO::~HLTMuonL2SelectorForL3IO ( )
override

destructor

Definition at line 31 of file HLTMuonL2SelectorForL3IO.cc.

31 {}

Member Function Documentation

◆ fillDescriptions()

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

default values

Definition at line 100 of file HLTMuonL2SelectorForL3IO.cc.

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 }

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

◆ produce()

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.

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 }

References funct::abs(), applyL3Filters_, HLTMuonOfflineAnalyzer_cfi::deltaR2, cutBasedMuonId_MuonPOG_V0_cff::globalTrack, iEvent, cmsLHEtoEOSManager::l, l2Src_, l3linkToken_, l3OISrc_, MainPageGenerator::link, electronStore::links, max_NormalizedChi2_, max_PtDifference_, metname, min_Nhits_, min_NmuonHits_, eostools::move(), mps_fire::result, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Data Documentation

◆ applyL3Filters_

const bool HLTMuonL2SelectorForL3IO::applyL3Filters_
private

Definition at line 45 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

◆ l2Src_

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

Definition at line 42 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

◆ l3linkToken_

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

Definition at line 44 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

◆ l3OISrc_

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

Definition at line 43 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

◆ max_NormalizedChi2_

const double HLTMuonL2SelectorForL3IO::max_NormalizedChi2_
private

Definition at line 46 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

◆ max_PtDifference_

const double HLTMuonL2SelectorForL3IO::max_PtDifference_
private

Definition at line 46 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

◆ min_Nhits_

const int HLTMuonL2SelectorForL3IO::min_Nhits_
private

Definition at line 47 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

◆ min_NmuonHits_

const int HLTMuonL2SelectorForL3IO::min_NmuonHits_
private

Definition at line 47 of file HLTMuonL2SelectorForL3IO.h.

Referenced by produce().

HLTMuonL2SelectorForL3IO::l3linkToken_
const edm::EDGetTokenT< reco::MuonTrackLinksCollection > l3linkToken_
Definition: HLTMuonL2SelectorForL3IO.h:44
cutBasedMuonId_MuonPOG_V0_cff.globalTrack
globalTrack
Definition: cutBasedMuonId_MuonPOG_V0_cff.py:135
MainPageGenerator.link
link
Definition: MainPageGenerator.py:271
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:85964
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
HLTMuonL2SelectorForL3IO::min_Nhits_
const int min_Nhits_
Definition: HLTMuonL2SelectorForL3IO.h:47
edm::Handle< reco::TrackCollection >
edm::Ref< TrackCollection >
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
HLTMuonL2SelectorForL3IO::min_NmuonHits_
const int min_NmuonHits_
Definition: HLTMuonL2SelectorForL3IO.h:47
reco::Track
Definition: Track.h:27
HLTMuonL2SelectorForL3IO::l2Src_
const edm::EDGetTokenT< reco::TrackCollection > l2Src_
Definition: HLTMuonL2SelectorForL3IO.h:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cand
Definition: decayParser.h:32
iEvent
int iEvent
Definition: GenABIO.cc:224
HLTMuonL2SelectorForL3IO::max_PtDifference_
const double max_PtDifference_
Definition: HLTMuonL2SelectorForL3IO.h:46
HLTMuonL2SelectorForL3IO::max_NormalizedChi2_
const double max_NormalizedChi2_
Definition: HLTMuonL2SelectorForL3IO.h:46
cmsLHEtoEOSManager.l
l
Definition: cmsLHEtoEOSManager.py:204
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
HLTMuonOfflineAnalyzer_cfi.deltaR2
deltaR2
Definition: HLTMuonOfflineAnalyzer_cfi.py:105
electronStore.links
links
Definition: electronStore.py:149
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
HLTMuonL2SelectorForL3IO::applyL3Filters_
const bool applyL3Filters_
Definition: HLTMuonL2SelectorForL3IO.h:45
mps_fire.result
result
Definition: mps_fire.py:311
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
HLTMuonL2SelectorForL3IO::l3OISrc_
const edm::EDGetTokenT< reco::RecoChargedCandidateCollection > l3OISrc_
Definition: HLTMuonL2SelectorForL3IO.h:43
metname
const std::string metname
Definition: MuonSeedOrcaPatternRecognition.cc:40