ATLAS Offline Software
MuonQualityWord.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 /***************************************************************************
6  Reconstruction/MuonIdentification/muonEvent/MuonQualityWord.h
7  Author: Ketevi A. Assamagan, July 2009
8  Transienti class to hold muon quality bits and the methods to manipulate it
9  so as to return the the isLoose, isMedium and isTight to the use.
10  This object is not persistified.
11  ---------------------------------------------------------------------------
12  ***************************************************************************/
13 
15 #include "GaudiKernel/MsgStream.h"
16 
18 
19  : m_qualityWord (qualityWord)
20 {}
21 
24 
25 = default;
26 
32  if ( this != &rhs ) {
34  }
35  return *this;
36 }
37 
39 MsgStream& operator << ( MsgStream& sl, const MuonQualityWord& qword)
40 // if namespace, need to use MsgStream& Rec::operator :-(
41 {
42  sl <<"Muon quality word: "<<qword.qualityWord()<< " [";
43  for( int index =15 ; index >= 0 ; index--){
44  if (index==12 || index==8 || index==4) {
45  if( qword.qualityWord() & (1<<index) ) sl << " 1 ][" ;
46  else sl << " 0 ][" ;
47  } else if (index==0) {
48  if( qword.qualityWord() & (1<<index) ) sl << " 1 ]" ;
49  else sl << " 0 ]" ;
50  } else {
51  if( qword.qualityWord() & (1<<index) ) sl << " 1" ;
52  else sl << " 0" ;
53  }
54  }
55  sl << endmsg;
56  return sl;
57 }
58 
60 std::ostream& operator << ( std::ostream& sl, const MuonQualityWord& qword)
61 // if namespace, need to use MsgStream& Rec::operator :-(
62 {
63  sl <<"Muon quality word: "<<qword.qualityWord()<< " [";
64  for( int index =15 ; index >= 0 ; index--){
65  if (index==12 || index==8 || index==4) {
66  if( qword.qualityWord() & (1<<index) ) sl << " 1 ][" ;
67  else sl << " 0 ][" ;
68  } else if (index==0) {
69  if( qword.qualityWord() & (1<<index) ) sl << " 1 ]" ;
70  else sl << " 0 ]" ;
71  } else {
72  if( qword.qualityWord() & (1<<index) ) sl << " 1" ;
73  else sl << " 0" ;
74  }
75  }
76  sl << std::endl;
77  return sl;
78 }
index
Definition: index.py:1
MuonQualityWord::MuonQualityWord
MuonQualityWord()
default constructor
Definition: MuonQualityWord.h:49
MuonQualityWord::qualityWord
uint16_t qualityWord() const
get back the quality word
Definition: MuonQualityWord.h:72
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
operator<<
MsgStream & operator<<(MsgStream &sl, const MuonQualityWord &qword)
MsgStream output.
Definition: MuonQualityWord.cxx:39
MuonQualityWord::operator=
MuonQualityWord & operator=(const MuonQualityWord &)
assignment operator
Definition: MuonQualityWord.cxx:31
MuonQualityWord.h
MuonQualityWord
A bitted word defining different levels of muon identification qualities (in terms of purity and effi...
Definition: MuonQualityWord.h:41
MuonQualityWord::m_qualityWord
uint16_t m_qualityWord
Definition: MuonQualityWord.h:76