16 embeddedMuonBestTrack_(
false),
17 embeddedTunePMuonBestTrack_(
false),
18 embeddedTrack_(
false),
19 embeddedStandAloneMuon_(
false),
20 embeddedCombinedMuon_(
false),
21 embeddedTCMETMuonCorrs_(
false),
22 embeddedCaloMETMuonCorrs_(
false),
23 embeddedPickyMuon_(
false),
24 embeddedTpfmsMuon_(
false),
25 embeddedDytMuon_(
false),
26 embeddedPFCandidate_(
false),
28 cachedNormChi2_(
false),
30 cachedNumberOfValidHits_(
false),
31 numberOfValidHits_(0),
39 initImpactParameters();
46 embeddedMuonBestTrack_(
false),
47 embeddedTunePMuonBestTrack_(
false),
48 embeddedTrack_(
false),
49 embeddedStandAloneMuon_(
false),
50 embeddedCombinedMuon_(
false),
51 embeddedTCMETMuonCorrs_(
false),
52 embeddedCaloMETMuonCorrs_(
false),
53 embeddedPickyMuon_(
false),
54 embeddedTpfmsMuon_(
false),
55 embeddedDytMuon_(
false),
56 embeddedPFCandidate_(
false),
58 cachedNormChi2_(
false),
60 cachedNumberOfValidHits_(
false),
61 numberOfValidHits_(0),
69 initImpactParameters();
76 embeddedMuonBestTrack_(
false),
77 embeddedTunePMuonBestTrack_(
false),
78 embeddedTrack_(
false),
79 embeddedStandAloneMuon_(
false),
80 embeddedCombinedMuon_(
false),
81 embeddedTCMETMuonCorrs_(
false),
82 embeddedCaloMETMuonCorrs_(
false),
83 embeddedPickyMuon_(
false),
84 embeddedTpfmsMuon_(
false),
85 embeddedDytMuon_(
false),
86 embeddedPFCandidate_(
false),
88 cachedNormChi2_(
false),
90 cachedNumberOfValidHits_(
false),
91 numberOfValidHits_(0),
99 initImpactParameters();
106 embeddedMuonBestTrack_(
false),
107 embeddedTunePMuonBestTrack_(
false),
108 embeddedTrack_(
false),
109 embeddedStandAloneMuon_(
false),
110 embeddedCombinedMuon_(
false),
111 embeddedTCMETMuonCorrs_(
false),
112 embeddedCaloMETMuonCorrs_(
false),
113 embeddedPickyMuon_(
false),
114 embeddedTpfmsMuon_(
false),
115 embeddedDytMuon_(
false),
116 embeddedPFCandidate_(
false),
118 cachedNormChi2_(
false),
120 cachedNumberOfValidHits_(
false),
121 numberOfValidHits_(0),
129 initImpactParameters();
142 out <<
"\tpat::Muon: ";
143 out << std::setiosflags(std::ios::right);
145 out << std::setprecision(3);
146 out <<
" E/pT/eta/phi " 155 void Muon::initImpactParameters() {
162 void Muon::initSimInfo() {
166 simHeaviestMotherFlavour_ = 0;
180 if (embeddedTrack_) {
190 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();
259 if (embeddedPFCandidate_) {
262 return pfCandidateRef_;
269 if(refToOrig_.isNonnull() && pfCandidateRef_.isNonnull() && i==1 )
return refToOrig_;
270 if(refToOrig_.isNonnull() && ! pfCandidateRef_.isNonnull() && i==0 )
return refToOrig_;
276 muonBestTrack_.clear();
277 embeddedMuonBestTrack_ =
false;
278 bool alreadyEmbedded =
false;
280 switch (muonBestTrackType()) {
281 case None: alreadyEmbedded =
true;
break;
282 case InnerTrack:
if (embeddedTrack_) alreadyEmbedded =
true;
break;
283 case OuterTrack:
if (embeddedStandAloneMuon_) alreadyEmbedded =
true;
break;
284 case CombinedTrack:
if (embeddedCombinedMuon_) alreadyEmbedded =
true;
break;
285 case TPFMS:
if (embeddedTpfmsMuon_) alreadyEmbedded =
true;
break;
286 case Picky:
if (embeddedPickyMuon_) alreadyEmbedded =
true;
break;
287 case DYT:
if (embeddedDytMuon_) alreadyEmbedded =
true;
break;
290 if (force || !alreadyEmbedded) {
292 embeddedMuonBestTrack_ =
true;
298 tunePMuonBestTrack_.clear();
299 bool alreadyEmbedded =
false;
300 embeddedTunePMuonBestTrack_ =
false;
302 switch (tunePMuonBestTrackType()) {
303 case None: alreadyEmbedded =
true;
break;
304 case InnerTrack:
if (embeddedTrack_) alreadyEmbedded =
true;
break;
305 case OuterTrack:
if (embeddedStandAloneMuon_) alreadyEmbedded =
true;
break;
306 case CombinedTrack:
if (embeddedCombinedMuon_) alreadyEmbedded =
true;
break;
307 case TPFMS:
if (embeddedTpfmsMuon_) alreadyEmbedded =
true;
break;
308 case Picky:
if (embeddedPickyMuon_) alreadyEmbedded =
true;
break;
309 case DYT:
if (embeddedDytMuon_) alreadyEmbedded =
true;
break;
311 if (muonBestTrackType() == tunePMuonBestTrackType()) {
312 if (embeddedMuonBestTrack_) alreadyEmbedded =
true;
315 if (force || !alreadyEmbedded) {
317 embeddedTunePMuonBestTrack_ =
true;
327 embeddedTrack_ =
true;
334 standAloneMuon_.clear();
337 embeddedStandAloneMuon_ =
true;
344 combinedMuon_.clear();
347 embeddedCombinedMuon_ =
true;
353 caloMETMuonCorrs_.clear();
354 caloMETMuonCorrs_.push_back(t);
355 embeddedCaloMETMuonCorrs_ =
true;
360 tcMETMuonCorrs_.clear();
361 tcMETMuonCorrs_.push_back(t);
362 embeddedTCMETMuonCorrs_ =
true;
370 pickyMuon_.push_back(*tk);
371 embeddedPickyMuon_ =
true;
380 tpfmsMuon_.push_back(*tk);
381 embeddedTpfmsMuon_ =
true;
390 dytMuon_.push_back(*tk);
391 embeddedDytMuon_ =
true;
398 if ( pfCandidateRef_.isAvailable() && pfCandidateRef_.isNonnull()) {
400 embeddedPFCandidate_ =
true;
414 double Muon::normChi2()
const {
415 if ( cachedNormChi2_ ) {
419 return t->chi2() / t->ndof();
427 unsigned int Muon::numberOfValidHits()
const {
428 if ( cachedNumberOfValidHits_ ) {
429 return numberOfValidHits_;
432 return t->numberOfValidHits();
438 double Muon::dB(IpType type_)
const {
440 if ( cachedIP_ & (1 <<
int(type_))) {
450 double Muon::edB(IpType type_)
const {
452 if ( cachedIP_ & (1 <<
int(type_))) {
embedCombinedMuon
whether to embed in AOD externally stored standalone muon track
embedPFCandidate
embed in AOD externally stored the electron's pflow preshower clusters
bool isNonnull() const
Checks for non-null.
double eta() const final
momentum pseudorapidity
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 innerTrack() const
reco::CandidatePtr pfCandidate_
CandidatePtr sourceCandidatePtr(size_type i) const override
embedDytMuon
embed in AOD externally stored TeV-refit TPFMS muon track
double pt() const final
transverse momentum
virtual TrackRef tpfmsTrack() const
bool isLooseMuon(const reco::Muon &)
SelectionType
Selector type.
embedPickyMuon
embed in AOD externally stored standalone muon track
virtual TrackRef muonBestTrack() const
Muon()
default constructor
std::ostream & operator<<(std::ostream &, BeamSpot beam)
embedTrack
embed in AOD externally stored particle flow candidate
ArbitrationType
define arbitration schemes
double energy() const final
energy
virtual TrackRef pickyTrack() const
float segmentCompatibility(const reco::Muon &muon, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
edm::Ref< PFCandidateCollection > PFCandidateRef
persistent reference to a PFCandidate
bool isSoftMuon(const reco::Muon &, const reco::Vertex &, bool run2016_hip_mitigation=false)
virtual TrackRef outerTrack() const
reference to Track reconstructed in the muon detector only
bool isGoodMuon(const reco::Muon &muon, SelectionType type, reco::Muon::ArbitrationType arbitrationType=reco::Muon::SegmentAndTrackArbitration)
main GoodMuon wrapper call
bool isHighPtMuon(const reco::Muon &, const reco::Vertex &)
edm::Ptr< Candidate > CandidatePtr
persistent reference to an object in a collection of Candidate objects
embedTpfmsMuon
embed in AOD externally stored TeV-refit picky muon track
SelectionType selectionTypeFromString(const std::string &label)
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
virtual TrackRef dytTrack() const
embedStandAloneMuon
whether to embed in AOD externally stored gsf track
embedTunePMuonBestTrack
embed in AOD externally stored muon best track from global pflow
virtual TrackRef tunePMuonBestTrack() const
bool isTightMuon(const reco::Muon &, const reco::Vertex &)
double phi() const final
momentum azimuthal angle
Analysis-level muon class.
virtual TrackRef globalTrack() const
reference to Track reconstructed in both tracked and muon detector