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),
38 initImpactParameters();
45 embeddedMuonBestTrack_(
false),
46 embeddedTunePMuonBestTrack_(
false),
47 embeddedTrack_(
false),
48 embeddedStandAloneMuon_(
false),
49 embeddedCombinedMuon_(
false),
50 embeddedTCMETMuonCorrs_(
false),
51 embeddedCaloMETMuonCorrs_(
false),
52 embeddedPickyMuon_(
false),
53 embeddedTpfmsMuon_(
false),
54 embeddedDytMuon_(
false),
55 embeddedPFCandidate_(
false),
57 cachedNormChi2_(
false),
59 cachedNumberOfValidHits_(
false),
60 numberOfValidHits_(0),
67 initImpactParameters();
74 embeddedMuonBestTrack_(
false),
75 embeddedTunePMuonBestTrack_(
false),
76 embeddedTrack_(
false),
77 embeddedStandAloneMuon_(
false),
78 embeddedCombinedMuon_(
false),
79 embeddedTCMETMuonCorrs_(
false),
80 embeddedCaloMETMuonCorrs_(
false),
81 embeddedPickyMuon_(
false),
82 embeddedTpfmsMuon_(
false),
83 embeddedDytMuon_(
false),
84 embeddedPFCandidate_(
false),
86 cachedNormChi2_(
false),
88 cachedNumberOfValidHits_(
false),
89 numberOfValidHits_(0),
96 initImpactParameters();
103 embeddedMuonBestTrack_(
false),
104 embeddedTunePMuonBestTrack_(
false),
105 embeddedTrack_(
false),
106 embeddedStandAloneMuon_(
false),
107 embeddedCombinedMuon_(
false),
108 embeddedTCMETMuonCorrs_(
false),
109 embeddedCaloMETMuonCorrs_(
false),
110 embeddedPickyMuon_(
false),
111 embeddedTpfmsMuon_(
false),
112 embeddedDytMuon_(
false),
113 embeddedPFCandidate_(
false),
115 cachedNormChi2_(
false),
117 cachedNumberOfValidHits_(
false),
118 numberOfValidHits_(0),
125 initImpactParameters();
138 out <<
"\tpat::Muon: ";
139 out << std::setiosflags(std::ios::right);
141 out << std::setprecision(3);
142 out <<
" E/pT/eta/phi " 151 void Muon::initImpactParameters() {
158 void Muon::initSimInfo() {
162 simHeaviestMotherFlavour_ = 0;
176 if (embeddedTrack_) {
186 if (embeddedStandAloneMuon_) {
196 if (embeddedCombinedMuon_) {
205 if (embeddedPickyMuon_) {
214 if (embeddedTpfmsMuon_) {
223 if (embeddedDytMuon_) {
232 if (!muonBestTrack_.empty()) {
241 if (!tunePMuonBestTrack_.empty()) {
243 }
else if (muonBestTrackType() == tunePMuonBestTrackType()) {
244 return muonBestTrack();
255 if (embeddedPFCandidate_) {
258 return pfCandidateRef_;
265 if(refToOrig_.isNonnull() && pfCandidateRef_.isNonnull() && i==1 )
return refToOrig_;
266 if(refToOrig_.isNonnull() && ! pfCandidateRef_.isNonnull() && i==0 )
return refToOrig_;
272 muonBestTrack_.clear();
273 embeddedMuonBestTrack_ =
false;
274 bool alreadyEmbedded =
false;
276 switch (muonBestTrackType()) {
277 case None: alreadyEmbedded =
true;
break;
278 case InnerTrack:
if (embeddedTrack_) alreadyEmbedded =
true;
break;
279 case OuterTrack:
if (embeddedStandAloneMuon_) alreadyEmbedded =
true;
break;
280 case CombinedTrack:
if (embeddedCombinedMuon_) alreadyEmbedded =
true;
break;
281 case TPFMS:
if (embeddedTpfmsMuon_) alreadyEmbedded =
true;
break;
282 case Picky:
if (embeddedPickyMuon_) alreadyEmbedded =
true;
break;
283 case DYT:
if (embeddedDytMuon_) alreadyEmbedded =
true;
break;
286 if (force || !alreadyEmbedded) {
288 embeddedMuonBestTrack_ =
true;
294 tunePMuonBestTrack_.clear();
295 bool alreadyEmbedded =
false;
296 embeddedTunePMuonBestTrack_ =
false;
298 switch (tunePMuonBestTrackType()) {
299 case None: alreadyEmbedded =
true;
break;
300 case InnerTrack:
if (embeddedTrack_) alreadyEmbedded =
true;
break;
301 case OuterTrack:
if (embeddedStandAloneMuon_) alreadyEmbedded =
true;
break;
302 case CombinedTrack:
if (embeddedCombinedMuon_) alreadyEmbedded =
true;
break;
303 case TPFMS:
if (embeddedTpfmsMuon_) alreadyEmbedded =
true;
break;
304 case Picky:
if (embeddedPickyMuon_) alreadyEmbedded =
true;
break;
305 case DYT:
if (embeddedDytMuon_) alreadyEmbedded =
true;
break;
307 if (muonBestTrackType() == tunePMuonBestTrackType()) {
308 if (embeddedMuonBestTrack_) alreadyEmbedded =
true;
311 if (force || !alreadyEmbedded) {
313 embeddedTunePMuonBestTrack_ =
true;
323 embeddedTrack_ =
true;
330 standAloneMuon_.clear();
333 embeddedStandAloneMuon_ =
true;
340 combinedMuon_.clear();
343 embeddedCombinedMuon_ =
true;
349 caloMETMuonCorrs_.clear();
350 caloMETMuonCorrs_.push_back(t);
351 embeddedCaloMETMuonCorrs_ =
true;
356 tcMETMuonCorrs_.clear();
357 tcMETMuonCorrs_.push_back(t);
358 embeddedTCMETMuonCorrs_ =
true;
366 pickyMuon_.push_back(*tk);
367 embeddedPickyMuon_ =
true;
376 tpfmsMuon_.push_back(*tk);
377 embeddedTpfmsMuon_ =
true;
386 dytMuon_.push_back(*tk);
387 embeddedDytMuon_ =
true;
394 if ( pfCandidateRef_.isAvailable() && pfCandidateRef_.isNonnull()) {
396 embeddedPFCandidate_ =
true;
410 double Muon::normChi2()
const {
411 if ( cachedNormChi2_ ) {
415 return t->chi2() / t->ndof();
423 unsigned int Muon::numberOfValidHits()
const {
424 if ( cachedNumberOfValidHits_ ) {
425 return numberOfValidHits_;
428 return t->numberOfValidHits();
434 double Muon::dB(IpType type_)
const {
436 if ( cachedIP_ & (1 <<
int(type_))) {
446 double Muon::edB(IpType type_)
const {
448 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
CandidatePtr sourceCandidatePtr(size_type i) const override
embedDytMuon
embed in AOD externally stored TeV-refit TPFMS muon track
reco::PFCandidatePtr pfCandidate_
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