ATLAS Offline Software
TagBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef MUONCOMBINEDEVENT_TAGBASE_H
6 #define MUONCOMBINEDEVENT_TAGBASE_H
7 
8 #include <string>
9 #include <vector>
10 
11 #include "xAODMuon/Muon.h"
12 
13 namespace Muon {
14  class MuonSegment;
15 }
16 
17 namespace Trk {
18  class Track;
19 }
20 
21 namespace MuonCombined {
22 
23  inline int authorRank(const xAOD::Muon::Author& a) {
24  if (a == xAOD::Muon::MuidCo) return 0;
25  if (a == xAOD::Muon::MuGirl) return 1;
26  if (a == xAOD::Muon::MuTagIMO) return 2;
27  if (a == xAOD::Muon::MuTag) return 3;
28  if (a == xAOD::Muon::CaloTag) return 4;
29  if (a == xAOD::Muon::CaloLikelihood) return 5;
30  //if (a == xAOD::Muon::CaloLikelihood) return 6; //duplicate
31  if (a == xAOD::Muon::MuidSA) return 7;
32  if (a == xAOD::Muon::STACO) return 8;
34  }
35 
36  inline int typeRank(const xAOD::Muon::MuonType& a) {
37  if (a == xAOD::Muon::Combined) return 0;
38  if (a == xAOD::Muon::SiliconAssociatedForwardMuon) return 1;
39  if (a == xAOD::Muon::SegmentTagged) return 2;
40  if (a == xAOD::Muon::MuonStandAlone) return 3;
41  if (a == xAOD::Muon::CaloTagged) return 4;
42  return 5;
43  }
44 
48  class TagBase {
49  public:
51  using Type = xAOD::Muon::MuonType;
53 
55  Type type() const { return m_type; }
56 
58  Author author() const { return m_author; }
59 
61  virtual ~TagBase() = default;
62 
64  virtual std::string name() const = 0;
65 
67  virtual std::string toString() const = 0;
68 
70  virtual const Trk::Track* primaryTrack() const;
71 
73  virtual std::vector<const Muon::MuonSegment*> associatedSegments() const;
74 
76  virtual bool isCommissioning() const;
77 
78  protected:
81 
82  private:
86  };
87 
88  inline bool TagBase::isCommissioning() const { return false; }
89  inline const Trk::Track* TagBase::primaryTrack() const { return nullptr; }
90 
91  inline std::vector<const Muon::MuonSegment*> TagBase::associatedSegments() const { return {}; }
92 
93  inline bool operator<(const TagBase& t1, const TagBase& t2) {
94  int r1 = typeRank(t1.type());
95  int r2 = typeRank(t2.type());
96  if (r1 != r2 && t1.author() != xAOD::Muon::STACO && t2.author() != xAOD::Muon::STACO) return r1 < r2;
97  return authorRank(t1.author()) < authorRank(t2.author());
98  }
99 
100  struct SortTagBasePtr {
101  bool operator()(const TagBase* t1, const TagBase* t2) const { return *t1 < *t2; }
102  };
103 
104 } // namespace MuonCombined
105 
106 #endif
MuonCombined::TagBase::type
Type type() const
access to MuonType
Definition: TagBase.h:55
MuonCombined::TagBase::TagBase
TagBase(Author author, Type type)
protected base class to be called by concrete implementations
Definition: TagBase.h:80
xAOD::MuGirl
@ MuGirl
MuGirl.
Definition: TrackingPrimitives.h:141
xAOD::MuTag
@ MuTag
Tracks produced by MuTag.
Definition: TrackingPrimitives.h:103
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
Muon.h
MuonCombined::TagBase::Author
xAOD::Muon::Author Author
Definition: TagBase.h:52
MuonCombined::TagBase::m_author
Author m_author
author and type info
Definition: TagBase.h:84
ALFA_EventTPCnv_Dict::t1
std::vector< ALFA_RawDataCollection_p1 > t1
Definition: ALFA_EventTPCnvDict.h:43
MuonCombined::TagBase::name
virtual std::string name() const =0
type string
MuonCombined::TagBase::isCommissioning
virtual bool isCommissioning() const
Returns whether the muon belongs to the commissioning chain.
Definition: TagBase.h:88
MuonCombined::TagBase::primaryTrack
virtual const Trk::Track * primaryTrack() const
access to primary muon system track, zero if non available
Definition: TagBase.h:89
Muon
This class provides conversion from CSC RDO data to CSC Digits.
Definition: TrackSystemController.h:49
MuonParameters::CaloTag
@ CaloTag
Definition: MuonParamDefs.h:64
xAOD::MuonSegment
MuonSegment_v1 MuonSegment
Reference the current persistent version:
Definition: Event/xAOD/xAODMuon/xAODMuon/MuonSegment.h:13
MuonCombined::SortTagBasePtr::operator()
bool operator()(const TagBase *t1, const TagBase *t2) const
Definition: TagBase.h:101
MuonParameters::MuTagIMO
@ MuTagIMO
Definition: MuonParamDefs.h:66
MuonCombined::TagBase::associatedSegments
virtual std::vector< const Muon::MuonSegment * > associatedSegments() const
access to associated segments, empty vector if non available
Definition: TagBase.h:91
MuonCombined::authorRank
int authorRank(const xAOD::Muon::Author &a)
Definition: TagBase.h:23
MuonCombined::typeRank
int typeRank(const xAOD::Muon::MuonType &a)
Definition: TagBase.h:36
MuonCombined::TagBase::m_type
Type m_type
author
Definition: TagBase.h:85
MuonCombined::TagBase::author
Author author() const
access to Muon Author
Definition: TagBase.h:58
xAODType
Definition: ObjectType.h:13
MuonParameters::NumberOfMuonAuthors
@ NumberOfMuonAuthors
Definition: MuonParamDefs.h:69
MuonCombined::TagBase::~TagBase
virtual ~TagBase()=default
destructor
Trk::Combined
@ Combined
Definition: TrackSummaryTool.h:32
Trk
Ensure that the ATLAS eigen extensions are properly loaded.
Definition: FakeTrackBuilder.h:9
MuonCombined::SortTagBasePtr
Definition: TagBase.h:100
MuonParameters::MuidSA
@ MuidSA
Definition: MuonParamDefs.h:59
MuonCombined::operator<
bool operator<(const CombinedFitTag &t1, const CombinedFitTag &t2)
Definition: CombinedFitTag.h:117
MuonCombined::TagBase::toString
virtual std::string toString() const =0
print content to string
MuonParameters::MuidCo
@ MuidCo
Definition: MuonParamDefs.h:60
ALFA_EventTPCnv_Dict::t2
std::vector< ALFA_RawDataContainer_p1 > t2
Definition: ALFA_EventTPCnvDict.h:44
a
TList * a
Definition: liststreamerinfos.cxx:10
MuonCombined
The MuonTagToSegMap is an auxillary construct that links the MuonSegments associated with a combined ...
Definition: IMuonSystemExtensionTool.h:23
Track
Definition: TriggerChamberClusterOnTrackCreator.h:21
xAOD::STACO
@ STACO
Tracks produced by STACO.
Definition: TrackingPrimitives.h:99
MuonParameters::CaloLikelihood
@ CaloLikelihood
Definition: MuonParamDefs.h:65
ParticleJetParams::Author
Author
Definition: ParticleJetParamDefs.h:33
MuonCombined::TagBase
base-class for combined reconstruction output Provides access to MuonType and Author
Definition: TagBase.h:48