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),
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),
70 initImpactParameters();
77 embeddedMuonBestTrack_(
false),
78 embeddedTunePMuonBestTrack_(
false),
79 embeddedTrack_(
false),
80 embeddedStandAloneMuon_(
false),
81 embeddedCombinedMuon_(
false),
82 embeddedTCMETMuonCorrs_(
false),
83 embeddedCaloMETMuonCorrs_(
false),
84 embeddedPickyMuon_(
false),
85 embeddedTpfmsMuon_(
false),
86 embeddedDytMuon_(
false),
87 embeddedPFCandidate_(
false),
89 cachedNormChi2_(
false),
91 cachedNumberOfValidHits_(
false),
92 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),
128 initImpactParameters();
139 out <<
"\tpat::Muon: ";
140 out << std::setiosflags(std::ios::right);
142 out << std::setprecision(3);
143 out <<
" E/pT/eta/phi " << obj.
energy() <<
"/" << obj.
pt() <<
"/" << obj.
eta() <<
"/" << obj.
phi();
148 void Muon::initImpactParameters() {
155 void Muon::initSimInfo() {
159 simHeaviestMotherFlavour_ = 0;
172 if (embeddedTrack_) {
181 if (embeddedStandAloneMuon_) {
190 if (embeddedCombinedMuon_) {
199 if (embeddedPickyMuon_) {
208 if (embeddedTpfmsMuon_) {
217 if (embeddedDytMuon_) {
226 if (!muonBestTrack_.empty()) {
235 if (!tunePMuonBestTrack_.empty()) {
237 }
else if (muonBestTrackType() == tunePMuonBestTrackType()) {
238 return muonBestTrack();
246 if (embeddedPFCandidate_) {
249 return pfCandidateRef_;
255 if (pfCandidateRef_.isNonnull() && i == 0)
257 if (refToOrig_.isNonnull() && pfCandidateRef_.isNonnull() && i == 1)
259 if (refToOrig_.isNonnull() && !pfCandidateRef_.isNonnull() && i == 0)
266 muonBestTrack_.clear();
267 embeddedMuonBestTrack_ =
false;
268 bool alreadyEmbedded =
false;
270 switch (muonBestTrackType()) {
272 alreadyEmbedded =
true;
276 alreadyEmbedded =
true;
279 if (embeddedStandAloneMuon_)
280 alreadyEmbedded =
true;
283 if (embeddedCombinedMuon_)
284 alreadyEmbedded =
true;
287 if (embeddedTpfmsMuon_)
288 alreadyEmbedded =
true;
291 if (embeddedPickyMuon_)
292 alreadyEmbedded =
true;
295 if (embeddedDytMuon_)
296 alreadyEmbedded =
true;
300 if (force || !alreadyEmbedded) {
302 embeddedMuonBestTrack_ =
true;
308 tunePMuonBestTrack_.clear();
309 bool alreadyEmbedded =
false;
310 embeddedTunePMuonBestTrack_ =
false;
312 switch (tunePMuonBestTrackType()) {
314 alreadyEmbedded =
true;
318 alreadyEmbedded =
true;
321 if (embeddedStandAloneMuon_)
322 alreadyEmbedded =
true;
325 if (embeddedCombinedMuon_)
326 alreadyEmbedded =
true;
329 if (embeddedTpfmsMuon_)
330 alreadyEmbedded =
true;
333 if (embeddedPickyMuon_)
334 alreadyEmbedded =
true;
337 if (embeddedDytMuon_)
338 alreadyEmbedded =
true;
341 if (muonBestTrackType() == tunePMuonBestTrackType()) {
342 if (embeddedMuonBestTrack_)
343 alreadyEmbedded =
true;
346 if (force || !alreadyEmbedded) {
348 embeddedTunePMuonBestTrack_ =
true;
357 embeddedTrack_ =
true;
363 standAloneMuon_.clear();
366 embeddedStandAloneMuon_ =
true;
372 combinedMuon_.clear();
375 embeddedCombinedMuon_ =
true;
381 caloMETMuonCorrs_.clear();
382 caloMETMuonCorrs_.push_back(t);
383 embeddedCaloMETMuonCorrs_ =
true;
388 tcMETMuonCorrs_.clear();
389 tcMETMuonCorrs_.push_back(t);
390 embeddedTCMETMuonCorrs_ =
true;
398 pickyMuon_.push_back(*tk);
399 embeddedPickyMuon_ =
true;
408 tpfmsMuon_.push_back(*tk);
409 embeddedTpfmsMuon_ =
true;
418 dytMuon_.push_back(*tk);
419 embeddedDytMuon_ =
true;
432 if (pfCandidateRef_.isAvailable() && pfCandidateRef_.isNonnull()) {
434 embeddedPFCandidate_ =
true;
447 double Muon::normChi2()
const {
448 if (cachedNormChi2_) {
452 return t->chi2() / t->ndof();
461 if (cachedNumberOfValidHits_) {
462 return numberOfValidHits_;
465 return t->numberOfValidHits();
471 double Muon::dB(IpType type_)
const {
473 if (cachedIP_ & (1 <<
int(type_))) {
482 double Muon::edB(IpType type_)
const {
484 if (cachedIP_ & (1 <<
int(type_))) {
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.
virtual TrackRef muonBestTrack() const
Muon()
default constructor
std::ostream & operator<<(std::ostream &, BeamSpot beam)
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
SelectionType selectionTypeFromString(const std::string &label)
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
virtual TrackRef dytTrack() const
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