ATLAS Offline Software
CTPFiles.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <iostream>
7 #include <iomanip>
8 #include <stdexcept>
9 
10 using namespace std;
11 
12 unsigned int TrigConf::CTPFiles::ALL_CTPCORELUT_SIZE = 0;
13 unsigned int TrigConf::CTPFiles::ALL_CTPCORECAM_SIZE = 0;
14 unsigned int TrigConf::CTPFiles::ALL_CTPINMONSEL_SIZE = 0;
15 unsigned int TrigConf::CTPFiles::ALL_CTPINMONDEC_SIZE = 0;
16 unsigned int TrigConf::CTPFiles::CTPMON_MUX_OUTPUT_NUMBER = 0;
17 unsigned int TrigConf::CTPFiles::CTPMON_ADDRESS_SELECTOR_NUMBER = 0;
18 unsigned int TrigConf::CTPFiles::ALL_CTPMONSELECTOR_SIZE = 0;
19 unsigned int TrigConf::CTPFiles::ALL_CTPMONDECODER_SIZE = 0;
20 
21 
24  m_Lvl1MasterTableId(0),
25  m_smxId(0),
26  m_LoadCtpcoreFiles(true),
27  m_LoadCtpinFiles(true),
28  m_LoadCtpmonFiles(true)
29 {}
30 
31 void
33  if(run==1) {
34  ALL_CTPCORELUT_SIZE = 49664;
35  ALL_CTPCORECAM_SIZE = 8192;
36 
37  ALL_CTPINMONSEL_SIZE = 124;
38  ALL_CTPINMONDEC_SIZE = 4096;
39 
40  CTPMON_MUX_OUTPUT_NUMBER = 9;
41  CTPMON_ADDRESS_SELECTOR_NUMBER = 24;
42  ALL_CTPMONSELECTOR_SIZE = CTPMON_MUX_OUTPUT_NUMBER * CTPMON_ADDRESS_SELECTOR_NUMBER;
43  ALL_CTPMONDECODER_SIZE = 6656;
44  } else {
45  // https://svnweb.cern.ch/trac/atlastdaq/browser/LVL1/ctp/CtpcorePlusModule/trunk/CtpcorePlusModule/CtpcorePlusModule.h
46  ALL_CTPCORELUT_SIZE = 725248; // 0xb1100
47  ALL_CTPCORECAM_SIZE = 55296;
48 
49  ALL_CTPINMONSEL_SIZE = 124;
50  ALL_CTPINMONDEC_SIZE = 4096;
51 
52  CTPMON_MUX_OUTPUT_NUMBER = 9;
53  CTPMON_ADDRESS_SELECTOR_NUMBER = 24;
54  ALL_CTPMONSELECTOR_SIZE = CTPMON_MUX_OUTPUT_NUMBER * CTPMON_ADDRESS_SELECTOR_NUMBER;
55  ALL_CTPMONDECODER_SIZE = 6656;
56  }
57 }
58 
59 
60 // get the files
61 const std::vector<uint32_t> &
63  return m_ctpcoreLUT;
64 }
65 
66 void
67 TrigConf::CTPFiles::setCtpcoreLUT( const std::vector<u_int>& vec)
68 {
69  if(vec.size() != ALL_CTPCORELUT_SIZE)
70  throw std::runtime_error( "CTPFiles: LUT size incorrect" );
71  m_ctpcoreLUT = vec;
72 }
73 
74 const std::vector<uint32_t> &
76  return m_ctpcoreCAM;
77 }
78 
79 void
80 TrigConf::CTPFiles::setCtpcoreCAM( const std::vector<u_int>& vec ) {
81  if(vec.size() != ALL_CTPCORECAM_SIZE)
82  throw std::runtime_error( "CTPFiles: CAM size incorrect" );
83  m_ctpcoreCAM = vec;
84 }
85 
86 // get the different decoder & selection files
87 const std::vector<uint32_t> &
89  return m_ctpinMonSelectorSlot7;
90 }
91 
92 void
93 TrigConf::CTPFiles::setCtpinMonSelectorSlot7( const std::vector<u_int>& vec ) {
94  if(vec.size() != ALL_CTPINMONSEL_SIZE)
95  throw std::runtime_error( "CTPFiles: MonSel size slot 7 incorrect" );
96  m_ctpinMonSelectorSlot7 = vec;
97 }
98 
99 const std::vector<uint32_t> &
101  return m_ctpinMonSelectorSlot8;
102 }
103 
104 void
105 TrigConf::CTPFiles::setCtpinMonSelectorSlot8( const std::vector<u_int>& vec ) {
106  if(vec.size() != ALL_CTPINMONSEL_SIZE)
107  throw std::runtime_error( "CTPFiles: MonSel size slot 8 incorrect" );
108  m_ctpinMonSelectorSlot8 = vec;
109 }
110 
111 
112 const std::vector<uint32_t> &
114  return m_ctpinMonSelectorSlot9;
115 }
116 
117 void
118 TrigConf::CTPFiles::setCtpinMonSelectorSlot9( const std::vector<u_int>& vec ) {
119  if(vec.size() != ALL_CTPINMONSEL_SIZE)
120  throw std::runtime_error( "CTPFiles: MonSel size slot 9 incorrect" );
121  m_ctpinMonSelectorSlot9 = vec;
122 }
123 
124 
125 const std::vector<uint32_t> &
127  return m_ctpmonSelector;
128 }
129 
130 
131 void
132 TrigConf::CTPFiles::setCtpmonSelector( const std::vector<u_int>& vec ) {
133  if(vec.size() != ALL_CTPMONSELECTOR_SIZE)
134  throw std::runtime_error( "CTPFiles: CTPMON Selector size incorrect" );
135  m_ctpmonSelector = vec;
136 }
137 
138 
139 const std::vector<uint32_t> &
141  return m_ctpinMonDecoderSlot7;
142 }
143 
144 void TrigConf::CTPFiles::setCtpinMonDecoderSlot7( const std::vector<u_int>& vec ) {
145  if(vec.size() != ALL_CTPINMONDEC_SIZE)
146  throw std::runtime_error( "CTPFiles: MonSel size slot 7 incorrect" );
147  m_ctpinMonDecoderSlot7 = vec;
148 }
149 
150 const std::vector<uint32_t> &
152  return m_ctpinMonDecoderSlot8;
153 }
154 
155 void
157  if(vec.size() != ALL_CTPINMONDEC_SIZE)
158  throw std::runtime_error( "CTPFiles: MonSel size slot 8 incorrect" );
159  m_ctpinMonDecoderSlot8 = vec;
160 }
161 
162 
163 const std::vector<uint32_t> &
165  return m_ctpinMonDecoderSlot9;
166 }
167 
168 void
170  if(vec.size() != ALL_CTPINMONDEC_SIZE)
171  throw std::runtime_error( "CTPFiles: MonSel size slot 9 incorrect" );
172  m_ctpinMonDecoderSlot9 = vec;
173 }
174 
175 const std::vector<uint32_t> &
177  return m_ctpmonDecoder;
178 }
179 
180 
181 void
182 TrigConf::CTPFiles::setCtpmonDecoder(const std::vector<u_int>& vec) {
183  if(vec.size() != ALL_CTPMONDECODER_SIZE)
184  throw std::runtime_error( "CTPFiles: CTPMON Decoder size incorrect" );
185  m_ctpmonDecoder = vec;
186 }
187 
188 // get files stop
189 
190 void
191 TrigConf::CTPFiles::print(const std::string& indent, unsigned int /*detail*/) const {
192  cout << indent << "CTPFiles: " << endl;
193  cout << indent << "id:\t\t\t" << id() << endl;
194  cout << indent << "Name: \t\t\t" << name() << endl;
195  cout << indent << "Version: \t\t" << version() << endl;
196  cout << indent << "Print the LUT" << endl;
197 
198  for (unsigned int i=0; i<(ALL_CTPCORELUT_SIZE); i++)
199  cout << indent << i << "\t:t0x" << setw(8) << setfill('0')
200  << hex << m_ctpcoreLUT[i] << dec << endl;
201 
202  cout << indent << "Print the CAM" << endl;
203  for (unsigned int i=0; i<(ALL_CTPCORECAM_SIZE); i++)
204  cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
205  << hex << m_ctpcoreCAM[i] << dec << endl;
206 
207  cout << indent << "Print the CTPIN mon decoders slot 7" << endl;
208  for (unsigned int i=0; i<(ALL_CTPINMONDEC_SIZE); i++)
209  cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
210  << hex << m_ctpinMonDecoderSlot7[i] << dec << endl;
211  cout << indent << "Print the CTPIN mon decoders slot 8" << endl;
212  for (unsigned int i=0; i<(ALL_CTPINMONDEC_SIZE); i++)
213  cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
214  << hex << m_ctpinMonDecoderSlot8[i] << dec << endl;
215  cout << indent << "Print the CTPIN mon decoders slot 9" << endl;
216  for (unsigned int i=0; i<(ALL_CTPINMONDEC_SIZE); i++)
217  cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
218  << hex << m_ctpinMonDecoderSlot9[i] << dec << endl;
219 
220  cout << indent << "Print the CTPIN mon selectors slot 7" << endl;
221  for (unsigned int i=0; i<(ALL_CTPINMONSEL_SIZE); i++)
222  cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
223  << hex << m_ctpinMonSelectorSlot7[i] << dec << endl;
224  cout << indent << "Print the CTPIN mon selectors slot 8" << endl;
225  for (unsigned int i=0; i<(ALL_CTPINMONSEL_SIZE); i++)
226  cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
227  << hex << m_ctpinMonSelectorSlot8[i] << dec << endl;
228  cout << indent << "Print the CTPIN mon selectors slot 9" << endl;
229  for (unsigned int i=0; i<(ALL_CTPINMONSEL_SIZE); i++)
230  cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
231  << hex << m_ctpinMonSelectorSlot9[i] << dec << endl;
232 
233  cout << indent << "Print the CTPMON selector" << endl;
234  for (unsigned int i=0; i < ALL_CTPMONSELECTOR_SIZE; i++)
235  cout << indent << i << "\t:\t" << setw(2) << setfill(' ')
236  << m_ctpmonSelector[i] << endl;
237  cout << indent << "Print the CTPMON decoder" << endl;
238  for (unsigned int i=0; i < ALL_CTPMONDECODER_SIZE; i++)
239  cout << indent << i << "\t:\t0x" << setw(8) << setfill('0')
240  << hex << m_ctpmonDecoder[i] << dec << endl;
241 
242  cout << indent << "SMX no " << m_smxId << " '" << m_smxName << "'" << endl;
243  cout << indent << "VHDL slot 7 : " << endl;
244  cout << m_ctpinSmxVhdlSlot7 << endl;
245  cout << indent << "VHDL slot 8 : " << endl;
246  cout << m_ctpinSmxVhdlSlot8 << endl;
247  cout << indent << "VHDL slot 9 : " << endl;
248  cout << m_ctpinSmxVhdlSlot9 << endl;
249 
250  cout << indent << "SVFI slot 7 : " << endl;
251  cout << m_ctpinSmxSvfiSlot7 << endl;
252  cout << indent << "SVFI slot 8 : " << endl;
253  cout << m_ctpinSmxSvfiSlot8 << endl;
254  cout << indent << "SVFI slot 9 : " << endl;
255  cout << m_ctpinSmxSvfiSlot9 << endl;
256 
257  cout << indent << "SMX Output file: " << endl;
258  cout << m_ctpinSmxOutput << endl;
259 }
TrigConf::CTPFiles::ctpcoreLUT
const std::vector< uint32_t > & ctpcoreLUT() const
Definition: CTPFiles.cxx:62
TrigConf::CTPFiles::setCtpcoreCAM
void setCtpcoreCAM(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:80
TrigConf::CTPFiles::setCtpmonSelector
void setCtpmonSelector(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:132
TrigConf::CTPFiles::ctpcoreCAM
const std::vector< uint32_t > & ctpcoreCAM() const
Definition: CTPFiles.cxx:75
TrigConf::CTPFiles::setCtpinMonDecoderSlot7
void setCtpinMonDecoderSlot7(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:144
CTPFiles.h
TrigConf::CTPFiles::ctpmonDecoder
const std::vector< uint32_t > & ctpmonDecoder() const
Definition: CTPFiles.cxx:176
TrigConf::CTPFiles::setFileSizes
void setFileSizes(unsigned int run)
Definition: CTPFiles.cxx:32
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
CxxUtils::vec
typename vecDetail::vec_typedef< T, N >::type vec
Define a nice alias for the vectorized type.
Definition: vec.h:207
TrigConf::CTPFiles::setCtpcoreLUT
void setCtpcoreLUT(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:67
TrigConf::CTPFiles::setCtpmonDecoder
void setCtpmonDecoder(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:182
geometry_dat_to_json.indent
indent
Definition: geometry_dat_to_json.py:36
TrigConf::CTPFiles::setCtpinMonDecoderSlot9
void setCtpinMonDecoderSlot9(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:169
lumiFormat.i
int i
Definition: lumiFormat.py:85
TrigConf::CTPFiles::ctpinMonDecoderSlot9
const std::vector< uint32_t > & ctpinMonDecoderSlot9() const
Definition: CTPFiles.cxx:164
run
Definition: run.py:1
TrigConf::CTPFiles::setCtpinMonSelectorSlot8
void setCtpinMonSelectorSlot8(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:105
TrigConf::CTPFiles::ctpinMonSelectorSlot9
const std::vector< uint32_t > & ctpinMonSelectorSlot9() const
Definition: CTPFiles.cxx:113
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TrigConf::CTPFiles::ctpmonSelector
const std::vector< uint32_t > & ctpmonSelector() const
Definition: CTPFiles.cxx:126
get_generator_info.version
version
Definition: get_generator_info.py:33
TrigConf::CTPFiles::ctpinMonDecoderSlot8
const std::vector< uint32_t > & ctpinMonDecoderSlot8() const
Definition: CTPFiles.cxx:151
TrigConf::CTPFiles::setCtpinMonSelectorSlot9
void setCtpinMonSelectorSlot9(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:118
TrigConf::CTPFiles::ctpinMonSelectorSlot8
const std::vector< uint32_t > & ctpinMonSelectorSlot8() const
Definition: CTPFiles.cxx:100
TrigConf::L1DataBaseclass
Definition: L1DataBaseclass.h:22
TrigConf::CTPFiles::ctpinMonSelectorSlot7
const std::vector< uint32_t > & ctpinMonSelectorSlot7() const
Definition: CTPFiles.cxx:88
TrigConf::CTPFiles::setCtpinMonDecoderSlot8
void setCtpinMonDecoderSlot8(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:156
TrigConf::CTPFiles::setCtpinMonSelectorSlot7
void setCtpinMonSelectorSlot7(const std::vector< u_int > &vec)
Definition: CTPFiles.cxx:93
TrigConf::CTPFiles::ctpinMonDecoderSlot7
const std::vector< uint32_t > & ctpinMonDecoderSlot7() const
Definition: CTPFiles.cxx:140
TrigConf::CTPFiles::print
virtual void print(const std::string &indent="", unsigned int detail=1) const override
Definition: CTPFiles.cxx:191
TrigConf::CTPFiles::CTPFiles
CTPFiles()
Definition: CTPFiles.cxx:22