ATLAS Offline Software
MuonOverlapDescriptor.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
8 #include <utility>
9 
10 #include "GaudiKernel/MsgStream.h"
11 
12 Rec::MuonOverlapDescriptor::MuonOverlapDescriptor(bool SharesIDTrack, bool SharesSpectroTrack, unsigned int SharedPrecisionHits,
13  unsigned int TotalPrecisionHits, unsigned int SharedSpectroPhiHits,
14  unsigned int TotalSpectroPhiHits, std::set<Identifier> msIntersection)
15 
16  :
17  m_sharesIndetTrack(SharesIDTrack),
18  m_sharesSpectroTrack(SharesSpectroTrack),
19  m_sharedPrecisionHits(SharedPrecisionHits),
20  m_totalPrecisionHits(TotalPrecisionHits),
21  m_sharedSpectroPhiHits(SharedSpectroPhiHits),
22  m_totalSpectroPhiHits(TotalSpectroPhiHits),
23  m_intersection(std::move(msIntersection)) {}
24 
27  m_sharesIndetTrack(false),
28  m_sharesSpectroTrack(false),
29  m_sharedPrecisionHits(0),
30  m_totalPrecisionHits(0),
31  m_sharedSpectroPhiHits(0),
32  m_totalSpectroPhiHits(0),
33  m_intersection() {}
34 
37  m_sharesIndetTrack(input.m_sharesIndetTrack),
38  m_sharesSpectroTrack(input.m_sharesSpectroTrack),
39  m_sharedPrecisionHits(input.m_sharedPrecisionHits),
40  m_totalPrecisionHits(input.m_totalPrecisionHits),
41  m_sharedSpectroPhiHits(input.m_sharedSpectroPhiHits),
42  m_totalSpectroPhiHits(input.m_totalSpectroPhiHits) {}
43 
46 
49  if (this != &rhs) {
50  m_sharesIndetTrack = rhs.m_sharesIndetTrack;
51  m_sharesSpectroTrack = rhs.m_sharesSpectroTrack;
52  m_sharedPrecisionHits = rhs.m_sharedPrecisionHits;
53  m_totalPrecisionHits = rhs.m_totalPrecisionHits;
54  m_sharedSpectroPhiHits = rhs.m_sharedSpectroPhiHits;
55  m_totalSpectroPhiHits = rhs.m_totalSpectroPhiHits;
56  }
57  return *this;
58 }
59 
61 bool Rec::MuonOverlapDescriptor::hasOverlap(unsigned int toleratedSharedhits) const {
62  return sharesIndetTrack() || sharesSpectroTrack() ||
63 
64  nSharedPrecisionHits() > toleratedSharedhits ||
65 
66  nSharedSpectroPhiHits() > toleratedSharedhits;
67 }
68 
70 MsgStream& Rec::operator<<(MsgStream& sl, const MuonOverlapDescriptor& itself)
71 // if namespace, need to use MsgStream& Rec::operator :-(
72 {
73  if (itself.hasOverlap()) {
74  sl << "Muon overlap desriptor: " << endmsg;
75  sl << "ID pointers: " << (itself.sharesIndetTrack() ? "identical" : "different")
76  << ", MS pointers: " << (itself.sharesSpectroTrack() ? "identical" : "different") << endmsg;
77  sl << "MS hits: " << itself.nSharedPrecisionHits() << " shared prec. hits of " << itself.nTotalPrecisionHits() << " total."
78  << endmsg;
79  sl << " " << itself.nSharedSpectroPhiHits() << " shared phi hits of " << itself.nTotalSpectroPhiHits() << " totoal."
80  << endmsg;
81  } else
82  sl << "Muon overlap desriptor: no Overlap." << endmsg;
83  return sl;
84 }
85 
87 std::ostream& Rec::operator<<(std::ostream& sl, const MuonOverlapDescriptor& itself)
88 // if namespace, need to use MsgStream& Rec::operator :-(
89 {
90  if (itself.hasOverlap()) {
91  sl << "Muon overlap desriptor: " << std::endl;
92  sl << "ID pointers: " << (itself.sharesIndetTrack() ? "identical" : "different")
93  << ", MS pointers: " << (itself.sharesSpectroTrack() ? "identical" : "different") << std::endl;
94  sl << "MS hits: " << itself.nSharedPrecisionHits() << " shared prec. hits of " << itself.nTotalPrecisionHits() << " total."
95  << std::endl;
96  sl << " " << itself.nSharedSpectroPhiHits() << " shared phi hits of " << itself.nTotalSpectroPhiHits() << " totoal."
97  << std::endl;
98  } else
99  sl << "Muon overlap desriptor: no Overlap." << std::endl;
100 
101  return sl;
102 }
Rec::MuonOverlapDescriptor::nTotalSpectroPhiHits
unsigned int nTotalSpectroPhiHits() const
Total MS phi hits to compare to.
Definition: MuonOverlapDescriptor.h:58
Rec::MuonOverlapDescriptor::m_sharesSpectroTrack
bool m_sharesSpectroTrack
Definition: MuonOverlapDescriptor.h:67
Rec::MuonOverlapDescriptor::m_sharedSpectroPhiHits
unsigned int m_sharedSpectroPhiHits
Definition: MuonOverlapDescriptor.h:70
Rec::MuonOverlapDescriptor::~MuonOverlapDescriptor
~MuonOverlapDescriptor()
destructor
Rec::MuonOverlapDescriptor::m_totalSpectroPhiHits
unsigned int m_totalSpectroPhiHits
Definition: MuonOverlapDescriptor.h:71
Rec::MuonOverlapDescriptor::nSharedPrecisionHits
unsigned int nSharedPrecisionHits() const
Tell if there are shared MS precision shared hits.
Definition: MuonOverlapDescriptor.h:52
Rec::MuonOverlapDescriptor::hasOverlap
bool hasOverlap(unsigned int tolaratedSharedHits=0) const
summary method
Definition: MuonOverlapDescriptor.cxx:61
Rec::MuonOverlapDescriptor::sharesIndetTrack
bool sharesIndetTrack() const
Access if the overlap consists of sharing the ID track.
Definition: MuonOverlapDescriptor.h:46
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
Rec::MuonOverlapDescriptor::operator=
MuonOverlapDescriptor & operator=(const MuonOverlapDescriptor &)
assignment operator
Definition: MuonOverlapDescriptor.cxx:48
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
Rec::operator<<
MsgStream & operator<<(MsgStream &sl, const MuonOverlapDescriptor &des)
Overload of << operator for MsgStream for debug output.
Definition: MuonOverlapDescriptor.cxx:70
Rec::MuonOverlapDescriptor::sharesSpectroTrack
bool sharesSpectroTrack() const
Access if the overlap consists of sharing the MS track.
Definition: MuonOverlapDescriptor.h:49
Rec::MuonOverlapDescriptor
A class describing ID, MS and hit overlaps, mind this class is TRANSIENT ONLY.
Definition: MuonOverlapDescriptor.h:26
Rec::MuonOverlapDescriptor::MuonOverlapDescriptor
MuonOverlapDescriptor()
default constructor
Definition: MuonOverlapDescriptor.cxx:26
MuonOverlapDescriptor.h
Rec::MuonOverlapDescriptor::nSharedSpectroPhiHits
unsigned int nSharedSpectroPhiHits() const
Tell if there are shared MS phi shared hits.
Definition: MuonOverlapDescriptor.h:56
Rec::MuonOverlapDescriptor::nTotalPrecisionHits
unsigned int nTotalPrecisionHits() const
Total MS precision hits to compare to.
Definition: MuonOverlapDescriptor.h:54
Rec::MuonOverlapDescriptor::m_totalPrecisionHits
unsigned int m_totalPrecisionHits
Definition: MuonOverlapDescriptor.h:69
Rec::MuonOverlapDescriptor::m_sharedPrecisionHits
unsigned int m_sharedPrecisionHits
Definition: MuonOverlapDescriptor.h:68
Rec::MuonOverlapDescriptor::m_sharesIndetTrack
bool m_sharesIndetTrack
Definition: MuonOverlapDescriptor.h:66