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),
37 initImpactParameters();
44 embeddedMuonBestTrack_(
false),
45 embeddedTunePMuonBestTrack_(
false),
46 embeddedTrack_(
false),
47 embeddedStandAloneMuon_(
false),
48 embeddedCombinedMuon_(
false),
49 embeddedTCMETMuonCorrs_(
false),
50 embeddedCaloMETMuonCorrs_(
false),
51 embeddedPickyMuon_(
false),
52 embeddedTpfmsMuon_(
false),
53 embeddedDytMuon_(
false),
54 embeddedPFCandidate_(
false),
56 cachedNormChi2_(
false),
58 cachedNumberOfValidHits_(
false),
59 numberOfValidHits_(0),
65 initImpactParameters();
72 embeddedMuonBestTrack_(
false),
73 embeddedTunePMuonBestTrack_(
false),
74 embeddedTrack_(
false),
75 embeddedStandAloneMuon_(
false),
76 embeddedCombinedMuon_(
false),
77 embeddedTCMETMuonCorrs_(
false),
78 embeddedCaloMETMuonCorrs_(
false),
79 embeddedPickyMuon_(
false),
80 embeddedTpfmsMuon_(
false),
81 embeddedDytMuon_(
false),
82 embeddedPFCandidate_(
false),
84 cachedNormChi2_(
false),
86 cachedNumberOfValidHits_(
false),
87 numberOfValidHits_(0),
93 initImpactParameters();
100 embeddedMuonBestTrack_(
false),
101 embeddedTunePMuonBestTrack_(
false),
102 embeddedTrack_(
false),
103 embeddedStandAloneMuon_(
false),
104 embeddedCombinedMuon_(
false),
105 embeddedTCMETMuonCorrs_(
false),
106 embeddedCaloMETMuonCorrs_(
false),
107 embeddedPickyMuon_(
false),
108 embeddedTpfmsMuon_(
false),
109 embeddedDytMuon_(
false),
110 embeddedPFCandidate_(
false),
112 cachedNormChi2_(
false),
114 cachedNumberOfValidHits_(
false),
115 numberOfValidHits_(0),
121 initImpactParameters();
134 out <<
"\tpat::Muon: ";
135 out << std::setiosflags(std::ios::right);
137 out << std::setprecision(3);
138 out <<
" E/pT/eta/phi " 147 void Muon::initImpactParameters() {
154 void Muon::initSimInfo() {
158 simHeaviestMotherFlavour_ = 0;
172 if (embeddedTrack_) {
182 if (embeddedStandAloneMuon_) {
192 if (embeddedCombinedMuon_) {
201 if (embeddedPickyMuon_) {
210 if (embeddedTpfmsMuon_) {
219 if (embeddedDytMuon_) {
228 if (!muonBestTrack_.empty()) {
237 if (!tunePMuonBestTrack_.empty()) {
239 }
else if (muonBestTrackType() == tunePMuonBestTrackType()) {
240 return muonBestTrack();
251 if (embeddedPFCandidate_) {
254 return pfCandidateRef_;
261 if(refToOrig_.isNonnull() && pfCandidateRef_.isNonnull() && i==1 )
return refToOrig_;
262 if(refToOrig_.isNonnull() && ! pfCandidateRef_.isNonnull() && i==0 )
return refToOrig_;
268 muonBestTrack_.clear();
269 embeddedMuonBestTrack_ =
false;
270 bool alreadyEmbedded =
false;
272 switch (muonBestTrackType()) {
273 case None: alreadyEmbedded =
true;
break;
274 case InnerTrack:
if (embeddedTrack_) alreadyEmbedded =
true;
break;
275 case OuterTrack:
if (embeddedStandAloneMuon_) alreadyEmbedded =
true;
break;
276 case CombinedTrack:
if (embeddedCombinedMuon_) alreadyEmbedded =
true;
break;
277 case TPFMS:
if (embeddedTpfmsMuon_) alreadyEmbedded =
true;
break;
278 case Picky:
if (embeddedPickyMuon_) alreadyEmbedded =
true;
break;
279 case DYT:
if (embeddedDytMuon_) alreadyEmbedded =
true;
break;
282 if (force || !alreadyEmbedded) {
284 embeddedMuonBestTrack_ =
true;
290 tunePMuonBestTrack_.clear();
291 bool alreadyEmbedded =
false;
292 embeddedTunePMuonBestTrack_ =
false;
294 switch (tunePMuonBestTrackType()) {
295 case None: alreadyEmbedded =
true;
break;
296 case InnerTrack:
if (embeddedTrack_) alreadyEmbedded =
true;
break;
297 case OuterTrack:
if (embeddedStandAloneMuon_) alreadyEmbedded =
true;
break;
298 case CombinedTrack:
if (embeddedCombinedMuon_) alreadyEmbedded =
true;
break;
299 case TPFMS:
if (embeddedTpfmsMuon_) alreadyEmbedded =
true;
break;
300 case Picky:
if (embeddedPickyMuon_) alreadyEmbedded =
true;
break;
301 case DYT:
if (embeddedDytMuon_) alreadyEmbedded =
true;
break;
303 if (muonBestTrackType() == tunePMuonBestTrackType()) {
304 if (embeddedMuonBestTrack_) alreadyEmbedded =
true;
307 if (force || !alreadyEmbedded) {
309 embeddedTunePMuonBestTrack_ =
true;
319 embeddedTrack_ =
true;
326 standAloneMuon_.clear();
329 embeddedStandAloneMuon_ =
true;
336 combinedMuon_.clear();
339 embeddedCombinedMuon_ =
true;
345 caloMETMuonCorrs_.clear();
346 caloMETMuonCorrs_.push_back(t);
347 embeddedCaloMETMuonCorrs_ =
true;
352 tcMETMuonCorrs_.clear();
353 tcMETMuonCorrs_.push_back(t);
354 embeddedTCMETMuonCorrs_ =
true;
362 pickyMuon_.push_back(*tk);
363 embeddedPickyMuon_ =
true;
372 tpfmsMuon_.push_back(*tk);
373 embeddedTpfmsMuon_ =
true;
382 dytMuon_.push_back(*tk);
383 embeddedDytMuon_ =
true;
390 if ( pfCandidateRef_.isAvailable() && pfCandidateRef_.isNonnull()) {
392 embeddedPFCandidate_ =
true;
406 double Muon::normChi2()
const {
407 if ( cachedNormChi2_ ) {
411 return t->chi2() / t->ndof();
419 unsigned int Muon::numberOfValidHits()
const {
420 if ( cachedNumberOfValidHits_ ) {
421 return numberOfValidHits_;
424 return t->numberOfValidHits();
430 double Muon::dB(IpType type_)
const {
432 if ( cachedIP_ & (1 <<
int(type_))) {
442 double Muon::edB(IpType type_)
const {
444 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