ATLAS Offline Software
Lvl1MuForwardSectorLogicData.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3 */
4 #include <iomanip>
5 #include <iostream>
6 
8 
9 namespace LVL1MUONIF {
10 
13  m_id_system = 2;
14  }
15 
17  if ( ( right.getSystemId() == m_id_system ) &&
18  ( this != &right ) ) {
19  m_bcid = right.bcid();
21  for ( size_t i = 0; i < 2; ++i ) {
22  m_roi[ i ] = right.roi( i );
23  m_ovl[ i ] = right.ovl( i );
24  m_pt[ i ] = right.pt( i );
25  m_charge[ i ] = right.charge( i );
26  m_2candidates[ i ] = right.is2candidates( i );
27  }
28  }
29  return *this;
30  }
31 
33 
34  unsigned int val = 0;
35  // Bit 0
36  if ( is2candidatesInSector() ) {
37  val = 1;
38  }
39  // Bit 1-6
40  if ( roi( 0 ) < 0 ) {
41  val |= 0x007E;
42  } else {
43  val |= ( roi( 0 ) & 0x03F ) << 1;
44  }
45  // Bit 7-9
46  val |= 0x0380;
47  // Bit 10-15
48  if ( roi( 1 ) < 0 ) {
49  val |= 0x00FC00;
50  } else {
51  val |= ( roi( 1 ) & 0x003F ) << 10;
52  }
53  // Bit 16-18
54  val |= 0x070000;
55  // bit 19-21
56  if ( pt( 0 ) < 0 ) {
57  val |= 0x0380000;
58  } else {
59  val |= ( pt( 0 ) & 0x0007 ) << 19;
60  }
61  // bit 22-24
62  if ( pt( 1 ) < 0 ) {
63  val |= 0x01C00000;
64  } else {
65  val |= ( pt( 1 ) & 0x0007 ) << 22;
66  }
67  // bit 25
68  val |= 0x02000000;
69  // bit 26
70  val |= 0x04000000;
71  // bit 27-29
72  val |= ( bcid() & 0x07 ) << 27;
73  // bit 30
74  if ( charge( 0 ) > 0 ) val |= 0x040000000;
75  // bit 31
76  if ( charge( 1 ) > 0 ) val |= 0x040000000;
77 
78  return val;
79  }
80 
82 
83  unsigned int val;
84  // Bit 0
85  if ( value & 0x0001 ) {
87  } else {
89  }
90  // Bit 1-9
91  val = ( value >> 1 ) & 0x003F;
92  if ( val == 0x003F ) {
93  roi( 0, -1 );
94  ovl( 0, -1 );
95  } else {
96  roi( 0, val );
97  ovl( 0, -1 );
98  }
99  // Bit 10-18
100  val = ( value >> 10 ) & 0x003F;
101  if ( val == 0x003F ) {
102  roi( 1, -1 );
103  ovl( 1, -1 );
104  } else {
105  roi( 1, val );
106  ovl( 1, -1 );
107  }
108  // bit 19-21
109  val = ( value >> 19 ) & 0x0007;
110  if ( val == 0x0007 ) {
111  pt( 0, -1 );
112  } else {
113  pt( 0, val );
114  }
115  // bit 22-24
116  val = ( value >> 22 ) & 0x0007;
117  if ( val == 0x0007 ) {
118  pt( 1, -1 );
119  } else {
120  pt( 1, val );
121  }
122  // bit 25
123  clear2candidates( 0 );
124  // bit 26
125  clear2candidates( 1 );
126  // bit 27-29
127  val = ( value >> 27 ) & 0x0007;
128  bcid( val );
129  // bit 30
130  val = ( value >> 30 ) & 0x0001;
131  if ( val != 0 ) charge( 0, + 1 );
132  // bit 31
133  val = ( value >> 31 ) & 0x0001;
134  if ( val != 0 ) charge( 1, + 1 );
135 
136  return *this;
137  }
138 
139  void Lvl1MuForwardSectorLogicData::printOut( std::ostream& out ) const {
140 
141  out << "Bit 0 " << " >2candidates in a sector ";
142  out << std::setw( 8 ) << m_2candidatesInSector << std::endl;
143 
144  out << "Bit 1-6 " << " ROI<1> ";
145  if ( m_roi[ 0 ] == -1 ) {
146  out << std::setw( 8 ) << "NA" << std::endl;
147  } else {
148  out << std::setw( 8 ) << m_roi[ 0 ] << std::endl;
149  }
150  out << "Bit 7-9 " << " NA " << std::endl;
151  out << "Bit 10-15 " << " ROI<2> ";
152  if ( m_roi[ 1 ] == -1 ) {
153  out << std::setw( 8 ) << "NA" << std::endl;
154  } else {
155  out << std::setw( 8 ) << m_roi[ 1 ] << std::endl;
156  }
157  out << "Bit 16-18 " << " NA " << std::endl;
158 
159  out << "Bit 19-21 " << " Pt1 ";
160  if ( m_pt[ 0 ] == -1 ) {
161  out << std::setw( 8 ) << "No Hit" << std::endl;
162  } else {
163  out << std::setw( 8 ) << m_pt[ 0 ] << std::endl;
164  }
165  out << "Bit 22-24 " << " Pt2 ";
166  if ( m_pt[ 1 ] == -1 ) {
167  out << std::setw( 8 ) << "No Hit" << std::endl;
168  } else {
169  out << std::setw( 8 ) << m_pt[ 1 ] << std::endl;
170  }
171 
172  out << "Bit 25-26 " << " NA " << std::endl;
173  out << "Bit 27-29 " << " BCID ";
174  out << std::setw( 8 ) << m_bcid << std::endl;
175  out << "Bit 30 " << " charge in ROI1 ";
176  out << std::setw( 8 ) << m_charge[ 0 ] << std::endl;
177  out << "Bit 31 " << " charge in ROI2 ";
178  out << std::setw( 8 ) << m_charge[ 1 ] << std::endl;
179 
180  }
181 
182 } // namespace LVL1MUONIF
LVL1MUONIF::Lvl1MuSectorLogicData
Base class for the data coming from one SL board.
Definition: Lvl1MuSectorLogicData.h:34
LVL1MUONIF::Lvl1MuSectorLogicData::pt
int pt(size_t id) const
Definition: Lvl1MuSectorLogicData.h:50
LVL1MUONIF::Lvl1MuSectorLogicData::m_2candidatesInSector
bool m_2candidatesInSector
Definition: Lvl1MuSectorLogicData.h:79
LVL1MUONIF
Namespace for the LVL1 muon interface classes.
Definition: Lvl1MuBarrelSectorLogicData.cxx:9
LVL1MUONIF::Lvl1MuSectorLogicData::bcid
int bcid() const
Definition: Lvl1MuSectorLogicData.h:47
Lvl1MuForwardSectorLogicData.h
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
LVL1MUONIF::Lvl1MuSectorLogicData::m_2candidates
bool m_2candidates[2]
Definition: Lvl1MuSectorLogicData.h:83
athena.value
value
Definition: athena.py:124
LVL1MUONIF::Lvl1MuForwardSectorLogicData::getWordFormat
SectorLogicWord getWordFormat() const
Get data in 32 bit word format.
Definition: Lvl1MuForwardSectorLogicData.cxx:32
LVL1MUONIF::Lvl1MuSectorLogicData::m_charge
int m_charge[2]
Definition: Lvl1MuSectorLogicData.h:85
LVL1MUONIF::Lvl1MuSectorLogicData::getSystemId
int getSystemId() const
Definition: Lvl1MuSectorLogicData.h:73
LVL1MUONIF::Lvl1MuSectorLogicData::clear2candidates
void clear2candidates(size_t id)
Definition: Lvl1MuSectorLogicData.h:62
LVL1MUONIF::Lvl1MuSectorLogicData::m_ovl
int m_ovl[2]
Definition: Lvl1MuSectorLogicData.h:81
LVL1MUONIF::Lvl1MuSectorLogicData::clear2candidatesInSector
void clear2candidatesInSector()
Definition: Lvl1MuSectorLogicData.h:55
LVL1MUONIF::Lvl1MuSectorLogicData::m_pt
int m_pt[2]
Definition: Lvl1MuSectorLogicData.h:82
LVL1MUONIF::Lvl1MuSectorLogicData::ovl
int ovl(size_t id) const
Definition: Lvl1MuSectorLogicData.h:49
lumiFormat.i
int i
Definition: lumiFormat.py:85
LVL1MUONIF::Lvl1MuSectorLogicData::m_id_system
int m_id_system
Definition: Lvl1MuSectorLogicData.h:86
LVL1MUONIF::Lvl1MuSectorLogicData::roi
int roi(size_t id) const
Definition: Lvl1MuSectorLogicData.h:48
LVL1MUONIF::Lvl1MuForwardSectorLogicData
Class representing data from a forward SL board.
Definition: Lvl1MuForwardSectorLogicData.h:27
LVL1MUONIF::Lvl1MuSectorLogicData::m_roi
int m_roi[2]
Definition: Lvl1MuSectorLogicData.h:80
LVL1MUONIF::Lvl1MuForwardSectorLogicData::convertFromWordFormat
const Lvl1MuSectorLogicData & convertFromWordFormat(const SectorLogicWord &)
Convert SectorLogicData from 32 bit word data.
Definition: Lvl1MuForwardSectorLogicData.cxx:81
LVL1MUONIF::Lvl1MuSectorLogicData::set2candidatesInSector
void set2candidatesInSector()
Definition: Lvl1MuSectorLogicData.h:54
LVL1MUONIF::Lvl1MuForwardSectorLogicData::operator=
Lvl1MuForwardSectorLogicData & operator=(const Lvl1MuSectorLogicData &right)
Definition: Lvl1MuForwardSectorLogicData.cxx:16
LVL1MUONIF::Lvl1MuSectorLogicData::SectorLogicWord
unsigned int SectorLogicWord
Definition: Lvl1MuSectorLogicData.h:44
LVL1MUONIF::Lvl1MuForwardSectorLogicData::printOut
virtual void printOut(std::ostream &out) const
print out data
Definition: Lvl1MuForwardSectorLogicData.cxx:139
LVL1MUONIF::Lvl1MuSectorLogicData::charge
int charge(size_t id) const
Definition: Lvl1MuSectorLogicData.h:51
Pythia8_RapidityOrderMPI.val
val
Definition: Pythia8_RapidityOrderMPI.py:14
LVL1MUONIF::Lvl1MuSectorLogicData::is2candidates
bool is2candidates(size_t id) const
Definition: Lvl1MuSectorLogicData.h:52
LVL1MUONIF::Lvl1MuSectorLogicData::is2candidatesInSector
bool is2candidatesInSector() const
Definition: Lvl1MuSectorLogicData.h:46
LVL1MUONIF::Lvl1MuSectorLogicData::m_bcid
int m_bcid
Definition: Lvl1MuSectorLogicData.h:84
LVL1MUONIF::Lvl1MuForwardSectorLogicData::Lvl1MuForwardSectorLogicData
Lvl1MuForwardSectorLogicData()
Definition: Lvl1MuForwardSectorLogicData.cxx:11