15 embeddedMuonBestTrack_(
false),
16 embeddedTunePMuonBestTrack_(
false),
17 embeddedTrack_(
false),
18 embeddedStandAloneMuon_(
false),
19 embeddedCombinedMuon_(
false),
20 embeddedTCMETMuonCorrs_(
false),
21 embeddedCaloMETMuonCorrs_(
false),
22 embeddedPickyMuon_(
false),
23 embeddedTpfmsMuon_(
false),
24 embeddedDytMuon_(
false),
25 embeddedPFCandidate_(
false),
27 cachedNormChi2_(
false),
29 cachedNumberOfValidHits_(
false),
30 numberOfValidHits_(0),
40 initImpactParameters();
47 embeddedMuonBestTrack_(
false),
48 embeddedTunePMuonBestTrack_(
false),
49 embeddedTrack_(
false),
50 embeddedStandAloneMuon_(
false),
51 embeddedCombinedMuon_(
false),
52 embeddedTCMETMuonCorrs_(
false),
53 embeddedCaloMETMuonCorrs_(
false),
54 embeddedPickyMuon_(
false),
55 embeddedTpfmsMuon_(
false),
56 embeddedDytMuon_(
false),
57 embeddedPFCandidate_(
false),
59 cachedNormChi2_(
false),
61 cachedNumberOfValidHits_(
false),
62 numberOfValidHits_(0),
72 initImpactParameters();
79 embeddedMuonBestTrack_(
false),
80 embeddedTunePMuonBestTrack_(
false),
81 embeddedTrack_(
false),
82 embeddedStandAloneMuon_(
false),
83 embeddedCombinedMuon_(
false),
84 embeddedTCMETMuonCorrs_(
false),
85 embeddedCaloMETMuonCorrs_(
false),
86 embeddedPickyMuon_(
false),
87 embeddedTpfmsMuon_(
false),
88 embeddedDytMuon_(
false),
89 embeddedPFCandidate_(
false),
91 cachedNormChi2_(
false),
93 cachedNumberOfValidHits_(
false),
94 numberOfValidHits_(0),
104 initImpactParameters();
111 embeddedMuonBestTrack_(
false),
112 embeddedTunePMuonBestTrack_(
false),
113 embeddedTrack_(
false),
114 embeddedStandAloneMuon_(
false),
115 embeddedCombinedMuon_(
false),
116 embeddedTCMETMuonCorrs_(
false),
117 embeddedCaloMETMuonCorrs_(
false),
118 embeddedPickyMuon_(
false),
119 embeddedTpfmsMuon_(
false),
120 embeddedDytMuon_(
false),
121 embeddedPFCandidate_(
false),
123 cachedNormChi2_(
false),
125 cachedNumberOfValidHits_(
false),
126 numberOfValidHits_(0),
136 initImpactParameters();
147 out <<
"\tpat::Muon: ";
148 out << std::setiosflags(std::ios::right);
150 out << std::setprecision(3);
151 out <<
" E/pT/eta/phi " <<
obj.energy() <<
"/" <<
obj.pt() <<
"/" <<
obj.eta() <<
"/" <<
obj.phi();
156 void Muon::initImpactParameters() {
163 void Muon::initSimInfo() {
167 simHeaviestMotherFlavour_ = 0;
177 simMatchQuality_ = 0.0;
182 if (embeddedTrack_) {
191 if (embeddedStandAloneMuon_) {
200 if (embeddedCombinedMuon_) {
209 if (embeddedPickyMuon_) {
218 if (embeddedTpfmsMuon_) {
227 if (embeddedDytMuon_) {
236 if (!muonBestTrack_.empty()) {
245 if (!tunePMuonBestTrack_.empty()) {
247 }
else if (muonBestTrackType() == tunePMuonBestTrackType()) {
248 return muonBestTrack();
256 if (embeddedPFCandidate_) {
259 return pfCandidateRef_;
265 if (pfCandidateRef_.isNonnull() &&
i == 0)
267 if (refToOrig_.isNonnull() && pfCandidateRef_.isNonnull() &&
i == 1)
269 if (refToOrig_.isNonnull() && !pfCandidateRef_.isNonnull() &&
i == 0)
276 muonBestTrack_.clear();
277 embeddedMuonBestTrack_ =
false;
278 bool alreadyEmbedded =
false;
280 switch (muonBestTrackType()) {
282 alreadyEmbedded =
true;
286 alreadyEmbedded =
true;
289 if (embeddedStandAloneMuon_)
290 alreadyEmbedded =
true;
293 if (embeddedCombinedMuon_)
294 alreadyEmbedded =
true;
297 if (embeddedTpfmsMuon_)
298 alreadyEmbedded =
true;
301 if (embeddedPickyMuon_)
302 alreadyEmbedded =
true;
305 if (embeddedDytMuon_)
306 alreadyEmbedded =
true;
310 if (
force || !alreadyEmbedded) {
312 embeddedMuonBestTrack_ =
true;
318 tunePMuonBestTrack_.clear();
319 bool alreadyEmbedded =
false;
320 embeddedTunePMuonBestTrack_ =
false;
322 switch (tunePMuonBestTrackType()) {
324 alreadyEmbedded =
true;
328 alreadyEmbedded =
true;
331 if (embeddedStandAloneMuon_)
332 alreadyEmbedded =
true;
335 if (embeddedCombinedMuon_)
336 alreadyEmbedded =
true;
339 if (embeddedTpfmsMuon_)
340 alreadyEmbedded =
true;
343 if (embeddedPickyMuon_)
344 alreadyEmbedded =
true;
347 if (embeddedDytMuon_)
348 alreadyEmbedded =
true;
351 if (muonBestTrackType() == tunePMuonBestTrackType()) {
352 if (embeddedMuonBestTrack_)
353 alreadyEmbedded =
true;
356 if (
force || !alreadyEmbedded) {
358 embeddedTunePMuonBestTrack_ =
true;
367 embeddedTrack_ =
true;
373 standAloneMuon_.clear();
376 embeddedStandAloneMuon_ =
true;
382 combinedMuon_.clear();
385 embeddedCombinedMuon_ =
true;
393 for (
auto const&
assoc : assocs) {
394 if (!
assoc->contains(trackExtra.
id())) {
399 trackExtra = trackExtraOut;
402 track.setExtra(trackExtra);
433 caloMETMuonCorrs_.clear();
434 caloMETMuonCorrs_.push_back(
t);
435 embeddedCaloMETMuonCorrs_ =
true;
440 tcMETMuonCorrs_.clear();
441 tcMETMuonCorrs_.push_back(
t);
442 embeddedTCMETMuonCorrs_ =
true;
450 pickyMuon_.push_back(*tk);
451 embeddedPickyMuon_ =
true;
460 tpfmsMuon_.push_back(*tk);
461 embeddedTpfmsMuon_ =
true;
470 dytMuon_.push_back(*tk);
471 embeddedDytMuon_ =
true;
477 inverseBeta_ =
t.inverseBeta();
478 inverseBetaErr_ =
t.inverseBetaErr();
484 if (pfCandidateRef_.isAvailable() && pfCandidateRef_.isNonnull()) {
486 embeddedPFCandidate_ =
true;
499 double Muon::normChi2()
const {
500 if (cachedNormChi2_) {
504 return t->chi2() /
t->ndof();
513 if (cachedNumberOfValidHits_) {
514 return numberOfValidHits_;
517 return t->numberOfValidHits();
523 double Muon::dB(IpType type_)
const {
525 if (cachedIP_ & (1 <<
int(type_))) {
534 double Muon::edB(IpType type_)
const {
536 if (cachedIP_ & (1 <<
int(type_))) {
ProductID id() const
Accessor for product ID.
Ptr< typename C::value_type > refToPtr(Ref< C, typename C::value_type, refhelper::FindUsingAdvance< C, typename C::value_type > > const &ref)
bool isMediumMuon(const reco::Muon &, bool run2016_hip_mitigation=false)
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector
reco::CandidatePtr pfCandidate_
virtual TrackRef pickyTrack() const
bool isNonnull() const
Checks for non-null.
CandidatePtr sourceCandidatePtr(size_type i) const override
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
virtual TrackRef dytTrack() const
bool isLooseMuon(const reco::Muon &)
SelectionType
Selector type.
Muon()
default constructor
std::ostream & operator<<(std::ostream &, BeamSpot beam)
ArbitrationType
define arbitration schemes
virtual TrackRef tunePMuonBestTrack() const
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
virtual TrackRef innerTrack() const
edm::Ref< PFCandidateCollection > PFCandidateRef
persistent reference to a PFCandidate
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
embedDytMuon
embed in AOD externally stored TeV-refit TPFMS muon track
virtual TrackRef muonBestTrack() const
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
SelectionType selectionTypeFromString(const std::string &label)
const reco::Muon::ArbitrationType arbitrationType
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
embedTunePMuonBestTrack
embed in AOD externally stored muon best track from global pflow
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
Analysis-level muon class.
virtual TrackRef tpfmsTrack() const