ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDBCTPFilesLoader.cxx
Go to the documentation of this file.
1// Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3#include "./TrigDBHelper.h"
6#include <iterator>
7#include <tuple>
8
10 TrigDBLoader("TrigDBCTPFilesLoader", connection)
11{
12 // CTP and MUCTPI hardware files only exist for schema versions >= 3
13
14 { // links to file tables
15 auto & q = m_link_queries[3];
16 // tables
17 q.addToTableList ( "SUPER_MASTER_TABLE", "SMT" );
18 q.addToTableList ( "L1_MENU", "L1TM" );
19 // bind vars
20 q.extendBinding<unsigned int>("smk");
21 // conditions
22 q.extendCondition("SMT.SMT_ID = :smk AND SMT.SMT_L1_MENU_ID = L1TM.L1TM_ID");
23 // attributes
24 q.extendOutput<unsigned int>( "L1TM.L1TM_CTP_FILES_ID");
25 q.extendOutput<unsigned int>( "L1TM.L1TM_CTP_SMX_ID");
26 q.extendOutput<unsigned int>( "L1TM.L1TM_MUCTPI_FILES_ID");
27 q.extendOutput<unsigned int>( "L1TM.L1TM_TMC_SIGNALS_ID");
28 }
29
30 { // ctp files
31 auto & q = m_ctpfiles_queries[3];
32 // tables
33 q.addToTableList ( "L1_CTP_FILES" );
34 // bind vars
35 q.extendBinding<unsigned int>("id");
36 // conditions
37 q.extendCondition("L1CF_ID = :id");
38 // attributes
39 q.extendOutput<coral::Blob>( "L1CF_LUT" );
40 q.extendOutput<coral::Blob>( "L1CF_CAM" );
41 q.extendOutput<coral::Blob>( "L1CF_MON_SEL_SLOT7" );
42 q.extendOutput<coral::Blob>( "L1CF_MON_SEL_SLOT8" );
43 q.extendOutput<coral::Blob>( "L1CF_MON_SEL_SLOT9" );
44 q.extendOutput<coral::Blob>( "L1CF_MON_SEL_CTPMON" );
45 q.extendOutput<coral::Blob>( "L1CF_MON_DEC_SLOT7" );
46 q.extendOutput<coral::Blob>( "L1CF_MON_DEC_SLOT8" );
47 q.extendOutput<coral::Blob>( "L1CF_MON_DEC_SLOT9" );
48 q.extendOutput<coral::Blob>( "L1CF_MON_DEC_CTPMON" );
49 q.extendOutput<coral::Blob>( "L1CF_MON_DMX" );
50 }
51
52 {
53 // ctp files >= v6
54 // in version 6 this field (ctp core switchmatrix) was added
55 auto q = m_ctpfiles_queries[3];
56 q.extendOutput<coral::Blob>( "L1CF_SMX" );
57 m_ctpfiles_queries[6] = std::move(q);
58 }
59
60 { // ctp smx
61 auto & q = m_ctpsmx_queries[3];
62 // tables
63 q.addToTableList ( "L1_CTP_SMX" );
64 // bind vars
65 q.extendBinding<unsigned int>("id");
66 // conditions
67 q.extendCondition("L1SMX_ID = :id");
68 // attributes
69 q.extendOutput<coral::Blob>( "L1SMX_OUTPUT" );
70 q.extendOutput<coral::Blob>( "L1SMX_VHDL_SLOT7" );
71 q.extendOutput<coral::Blob>( "L1SMX_VHDL_SLOT8" );
72 q.extendOutput<coral::Blob>( "L1SMX_VHDL_SLOT9" );
73 q.extendOutput<coral::Blob>( "L1SMX_SVFI_SLOT7" );
74 q.extendOutput<coral::Blob>( "L1SMX_SVFI_SLOT8" );
75 q.extendOutput<coral::Blob>( "L1SMX_SVFI_SLOT9" );
76 }
77
78 { // muctpi
79 auto & q = m_muctpi_queries[3];
80 // tables
81 q.addToTableList ( "L1_MUCTPI_FILES" );
82 // bind vars
83 q.extendBinding<unsigned int>("id");
84 // conditions
85 q.extendCondition("L1MF_ID = :id");
86 // attributes
87 q.extendOutput<coral::Blob>( "L1MF_DATA" );
88 }
89
90 { // tmc
91 auto & q = m_tmcsig_queries[3];
92 // tables
93 q.addToTableList ( "L1_TMC_SIGNALS" );
94 // bind vars
95 q.extendBinding<unsigned int>("id");
96 // conditions
97 q.extendCondition("L1TMC_ID = :id");
98 // attributes
99 q.extendOutput<coral::Blob>( "L1TMC_DATA" );
100 }
101}
102
103// Destructor defined here because QueryDefinition is an incomplete type in the header
105
106bool
108 TrigConf::L1CTPFiles & ctpfiles,
109 uint8_t loadMask,
110 const std::string & /*outFileName*/ ) const
111{
112 unsigned int ctpFilesID{0};
113 unsigned int ctpSmxID{0};
114 unsigned int muctpiID{0};
115 unsigned int tmcSignalsID{0};
116
117 auto session = createDBSession();
118 session->transaction().start( /*bool readonly=*/ true);
119 const size_t sv = schemaVersion(session.get());
120 try {
122 qdef.setBoundValue<unsigned int>("smk", smk);
123 auto q = qdef.createQuery( session.get() );
124 auto & cursor = q->execute();
125 if ( ! cursor.next() ) {
126 TRG_MSG_ERROR("Tried reading L1 CTPFiles, but super master key " << smk << " is not available" );
127 throw TrigConf::NoSMKException("TrigDBCTPFilesLoader: super master key " + std::to_string(smk) + " not available");
128 }
129 const coral::AttributeList& row = cursor.currentRow();
130 try {
131 ctpFilesID = row["L1TM.L1TM_CTP_FILES_ID"].data<unsigned int>();
132 }
133 catch(const coral::AttributeException & e) // NULL content
134 {}
135 try {
136 ctpSmxID = row["L1TM.L1TM_CTP_SMX_ID"].data<unsigned int>();
137 }
138 catch(const coral::AttributeException & e) // NULL content
139 {}
140 try {
141 muctpiID = row["L1TM.L1TM_MUCTPI_FILES_ID"].data<unsigned int>();
142 }
143 catch(const coral::AttributeException & e) // NULL content
144 {}
145 try {
146 tmcSignalsID = row["L1TM.L1TM_TMC_SIGNALS_ID"].data<unsigned int>();
147 }
148 catch(const coral::AttributeException & e) // NULL content
149 {}
150
151 TRG_MSG_INFO("ID of table L1_CTP_FILES : " << ctpFilesID);
152 TRG_MSG_INFO("ID of table L1_CTP_SMX : " << ctpSmxID);
153 TRG_MSG_INFO("ID of table L1_MUCTPI_FILES : " << muctpiID);
154 TRG_MSG_INFO("ID of table L1_TMC_SIGNALS : " << tmcSignalsID);
155 }
156 catch(coral::QueryException & ex) {
157 TRG_MSG_ERROR("When reading the files table links for super master key " << smk << " a coral::QueryException was caught ( " << ex.what() <<" )" );
158 throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
159 }
160
161 if(ctpFilesID>0 && (loadMask & 0x01)!=0 ) {
163 qdef.setBoundValue<unsigned int>("id", ctpFilesID);
164 loadCTPFiles(ctpfiles, qdef.createQuery( session.get() ), sv );
165 }
166
167 if(ctpSmxID>0 && (loadMask & 0x02)!=0) {
169 qdef.setBoundValue<unsigned int>("id", ctpSmxID);
170 loadCTPSMX(ctpfiles, qdef.createQuery( session.get() ), sv );
171 }
172
173 if(tmcSignalsID>0 && (loadMask & 0x04)!=0) {
175 qdef.setBoundValue<unsigned int>("id", tmcSignalsID);
176 loadTMC(ctpfiles, qdef.createQuery( session.get() ), sv );
177 }
178
179 if(muctpiID>0 && (loadMask & 0x08)!=0) {
181 qdef.setBoundValue<unsigned int>("id", muctpiID);
182 loadMUCTPI(ctpfiles, qdef.createQuery( session.get() ), sv );
183 }
184 return true;
185}
186
187
188void
189TrigConf::TrigDBCTPFilesLoader::loadCTPFiles(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query, size_t schemaVersion) const
190{
191 TRG_MSG_INFO("Loading data from table L1_CTP_FILES.");
192 try
193 {
194 auto & cursor = query->execute();
195 std::ignore = cursor.next();
196 const coral::AttributeList& row = cursor.currentRow();
197 {
198 ctpfiles.set_Ctpcore_LUT(
200 );
201 }
202 {
203 ctpfiles.set_Ctpcore_CAM(
205 );
206 }
207 if(schemaVersion>=6) {
208 ctpfiles.set_Ctpcore_SMX(
210 );
211 }
212
213 {
215 loadDBFieldIntoVector(row, "L1CF_MON_SEL_SLOT7", L1CTPFiles::CTPIN_MONSEL_SIZE)
216 );
217 }
218 {
220 loadDBFieldIntoVector(row, "L1CF_MON_SEL_SLOT8", L1CTPFiles::CTPIN_MONSEL_SIZE)
221 );
222 }
223 {
225 loadDBFieldIntoVector(row, "L1CF_MON_SEL_SLOT9", L1CTPFiles::CTPIN_MONSEL_SIZE)
226 );
227 }
228 {
230 loadDBFieldIntoVector(row, "L1CF_MON_DEC_SLOT7", L1CTPFiles::CTPIN_MONDEC_SIZE)
231 );
232 }
233 {
235 loadDBFieldIntoVector(row, "L1CF_MON_DEC_SLOT8", L1CTPFiles::CTPIN_MONDEC_SIZE)
236 );
237 }
238 {
240 loadDBFieldIntoVector(row, "L1CF_MON_DEC_SLOT9", L1CTPFiles::CTPIN_MONDEC_SIZE)
241 );
242 }
243 {
244 ctpfiles.set_Ctpmon_MonSelector(
246 );
247 }
248 {
249 ctpfiles.set_Ctpmon_MonDecoder(
250 loadDBFieldIntoVector(row, "L1CF_MON_DEC_CTPMON", L1CTPFiles::CTPMON_DECODER_SIZE)
251 );
252 }
253 {
254 ctpfiles.set_Ctpmon_DMX(
256 );
257 }
258 ctpfiles.set_HasCompleteCtpData(true);
259 }
260 catch(coral::QueryException & ex) {
261 TRG_MSG_ERROR("When reading the L1CTPFiles a coral::QueryException was caught ( " << ex.what() <<" )" );
262 throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
263 }
264}
265
266void
267TrigConf::TrigDBCTPFilesLoader::loadCTPSMX(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query, size_t) const {
268 TRG_MSG_INFO("Loading data from table L1_CTP_SMX");
269 try
270 {
271 auto & cursor = query->execute();
272 std::ignore = cursor.next();
273 const coral::AttributeList& row = cursor.currentRow();
274
275 ctpfiles.set_Smx_Output( loadDBFieldIntoString(row, "L1SMX_OUTPUT") );
276 ctpfiles.set_Smx_Vhdl_Slot7( loadDBFieldIntoString(row, "L1SMX_VHDL_SLOT7") );
277 ctpfiles.set_Smx_Vhdl_Slot8( loadDBFieldIntoString(row, "L1SMX_VHDL_SLOT8") );
278 ctpfiles.set_Smx_Vhdl_Slot9( loadDBFieldIntoString(row, "L1SMX_VHDL_SLOT9") );
279 ctpfiles.set_Smx_Svfi_Slot7( loadDBFieldIntoString(row, "L1SMX_SVFI_SLOT7") );
280 ctpfiles.set_Smx_Svfi_Slot8( loadDBFieldIntoString(row, "L1SMX_SVFI_SLOT8") );
281 ctpfiles.set_Smx_Svfi_Slot9( loadDBFieldIntoString(row, "L1SMX_SVFI_SLOT9") );
282 ctpfiles.set_HasCompleteSmxData(true);
283 }
284 catch(coral::QueryException & ex) {
285 TRG_MSG_ERROR("When reading the L1CTPFiles a coral::QueryException was caught ( " << ex.what() <<" )" );
286 throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
287 }
288}
289
290void
291TrigConf::TrigDBCTPFilesLoader::loadMUCTPI(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query, size_t) const {
292 TRG_MSG_INFO("Loading data from table L1_MUCTPI_FILES");
293
294 bool incomplete = false;
295 boost::property_tree::ptree pt;
296 try
297 {
298 auto & cursor = query->execute();
299 std::ignore = cursor.next();
300 const coral::AttributeList& row = cursor.currentRow();
301 const coral::Blob & blob = row["L1MF_DATA"].data<coral::Blob>();
302 blobToPtree(blob, pt);
303 }
304 catch(coral::QueryException & ex) {
305 TRG_MSG_ERROR("When reading the L1CTPFiles a coral::QueryException was caught ( " << ex.what() <<" )" );
306 throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
307 }
308 DataStructure ds("L1_MUCTPI_FILES", std::move(pt));
309 std::vector<std::string> keys = ds.getKeys();
311 if( auto dv = ds.getList_optional(L1CTPFiles::s_keyMap.at(k)) ) {
312 keys.erase( std::find(keys.begin(), keys.end(), L1CTPFiles::s_keyMap.at(k)) );
313 std::vector<uint32_t> v;
314 v.reserve(200);
315 for( const auto & x : *dv ) {
316 v.push_back(std::stoul(x.getValue<std::string>(), nullptr, 0));
317 }
318 ctpfiles.set_Muctpi(k, std::move(v));
319 } else {
320 incomplete = true;
321 }
322 }
323 for(const std::string & k : keys) {
324 if(ds.isNull(k)) {
325 TRG_MSG_INFO("Attribute " << k << " has null-content");
326 incomplete = true;
327 continue;
328 }
329 auto sopt = ds.getAttribute_optional<std::string>(k);
330 if(k.compare(0, 6, "pt_lut") == 0) {
331 auto dv = ds.getList(k);
332 std::vector<uint32_t> v;
333 v.reserve(200);
334 for( const auto & x : dv ) {
335 v.push_back(std::stoul(x.getValue<std::string>(), nullptr, 0));
336 }
337 ctpfiles.set_Muctpi_Extra_Ptlut(k, std::move(v));
338 } else if(k=="multiplicities_nbits") {
339 auto dv = ds.getList(k);
340 std::vector<uint32_t> v;
341 for( const auto & x : dv ) {
342 v.push_back(std::stoul(x.getValue<std::string>(), nullptr, 0));
343 }
344 ctpfiles.set_Muctpi_Nbits(std::move(v));
345 }
346 }
347 ctpfiles.set_HasCompleteMuctpiData(!incomplete);
348}
349
350void
351TrigConf::TrigDBCTPFilesLoader::loadTMC(L1CTPFiles & ctpfiles, std::unique_ptr<coral::IQuery> query, size_t) const {
352 TRG_MSG_INFO("Loading data from table L1_TMC_SIGNALS");
353 boost::property_tree::ptree pt;
354 try
355 {
356 auto & cursor = query->execute();
357 std::ignore = cursor.next();
358 const coral::AttributeList& row = cursor.currentRow();
359 const coral::Blob & blob = row["L1TMC_DATA"].data<coral::Blob>();
360 blobToPtree(blob, pt);
361 }
362 catch(coral::QueryException & ex) {
363 TRG_MSG_ERROR("When reading the L1CTPFiles a coral::QueryException was caught ( " << ex.what() <<" )" );
364 throw TrigConf::QueryException("TrigDBCTPFilesLoader: " + std::string(ex.what()));
365 }
366
367 DataStructure ds("L1_TMC", std::move(pt));
368
369 // should always be the correct type
370 if( auto ft = ds.getAttribute<std::string>("filetype"); ft != "tmcresult" ) {
371 throw TrigConf::ParsingException("TrigDBCTPFilesLoader::loadTMC: json structure of unexpected file type found. Expected 'tmcresult', but found " + ft);
372 }
373
374 // read the ctpcore inputs
375 if (auto dv = ds.getObject_optional("CTPCORE.TriggerInputs"))
376 {
377 std::vector<TrigConf::L1CTPFiles::CTPCoreInput> ctpcoreInputs;
378 for (const std::string &k : dv->getKeys())
379 {
380 const TrigConf::DataStructure &inp = dv->getObject(k);
381 const std::string &inputType = inp["type"];
383 if (inputType == "PIT")
384 {
386 }
387 else if (inputType == "DIR")
388 {
390 }
391 else if (inputType == "CTPX")
392 continue;
393 else
394 continue;
395 ctpcoreInputs.push_back(
397 inp.getAttribute<size_t>("number"), inp.getAttribute<std::string>("name"),
398 inp.getAttribute<size_t>("bit"), inp.getAttribute<size_t>("phase"),
399 inpEnum));
400 }
401 TRG_MSG_INFO("Loading ctpcore inputs " << ctpcoreInputs.size());
402 ctpfiles.set_Tmc_CtpcoreInputs(std::move(ctpcoreInputs));
403 }
404
405 // read the ctpcore CTPX inputs
406 if (auto dv = ds.getObject_optional("CTPCORE.TriggerInputs"))
407 {
408 std::vector<TrigConf::L1CTPFiles::CTPCoreCTPXInput> ctpcoreCTPXInputs;
409 for (const std::string &k : dv->getKeys())
410 {
411 const TrigConf::DataStructure &inp = dv->getObject(k);
412 const std::string &inputType = inp["type"];
414 if (inputType == "CTPX")
415 {
417 }
418 else if (inputType == "PIT" || inputType == "DIR")
419 continue;
420 else
421 continue;
422 ctpcoreCTPXInputs.push_back(
424 inp.getAttribute<size_t>("number"), inp.getAttribute<std::string>("name"),
425 inp.getAttribute<size_t>("bit"),
426 inpEnum));
427 }
428 TRG_MSG_INFO("Loading ctpcore CTPX inputs " << ctpcoreCTPXInputs.size());
429 ctpfiles.set_Tmc_CtpcoreCTPXInputs(std::move(ctpcoreCTPXInputs));
430 }
431
432 // read the ctpin map
433 std::vector<TrigConf::L1CTPFiles::CTPInCounter> ctpinCounters;
434 for (size_t slot : {7, 8, 9})
435 {
436 for (size_t conn : {0, 1, 2, 3})
437 {
438 std::string path = "CTPINs.SLOT" + std::to_string(slot) + ".Monitoring.Cables.CON" + std::to_string(conn);
439 if (auto dv = ds.getObject_optional(path))
440 {
441 if (auto ov = dv->getList_optional("outputs"))
442 {
443 for (const DataStructure &output : *ov)
444 {
445 ctpinCounters.push_back(
447 output.getAttribute<std::string>("TriggerCounter"), slot, conn, output.getAttribute<size_t>("number")));
448 }
449 }
450 }
451 }
452 }
453 TRG_MSG_INFO("Loading ctpin counters " << ctpinCounters.size());
454 ctpfiles.set_Tmc_CtpinCounters(std::move(ctpinCounters));
455
456 // read the ctpmon map
457 std::vector<TrigConf::L1CTPFiles::CTPMonCounter> ctpmonCounters;
458 if( auto dv = ds.getObject_optional("CTPMON.Monitoring") ) {
459 if (auto ov = dv->getList_optional("outputs"))
460 {
461 for (const DataStructure &output : *ov)
462 {
463 ctpmonCounters.push_back(
465 output.getAttribute<std::string>("TriggerCounter"), output.getAttribute<size_t>("number")));
466 }
467 }
468 }
469 TRG_MSG_INFO("Loading ctpmon counters " << ctpmonCounters.size());
470 ctpfiles.set_Tmc_CtpmonCounters(std::move(ctpmonCounters));
471
472 ctpfiles.set_Tmc_Data(std::move(ds));
473 ctpfiles.set_HasCompleteTmcData(true);
474}
475
476std::vector<uint32_t>
477TrigConf::TrigDBCTPFilesLoader::loadDBFieldIntoVector(const coral::AttributeList& row, const std::string& field, size_t size) const {
478 std::vector<uint32_t> vec;
479 if(size>0) {
480 vec.reserve(size);
481 }
482 try {
483 TRG_MSG_INFO("Loading " << field << " of size (#words) " << size);
484 const coral::Blob& blob = row[field].data<coral::Blob>();
485 boost::iostreams::stream<boost::iostreams::array_source> stream(
486 static_cast<const char*> (blob.startingAddress()),
487 blob.size()
488 );
489 std::string word{""};
490 while(stream >> word) {
491 vec.push_back(std::stoul(word,nullptr, 0));
492 }
493 }
494 catch(const coral::AttributeException & e) {} // NULL content
495 // check the size if a positive size was requested
496 if(size > 0 && size != vec.size()) {
497 TRG_MSG_ERROR("File content from DB of size " << vec.size() << ", but expect " << size);
498 throw std::runtime_error( "CTPFilesLoader: file of unexpected size" );
499 }
500
501 return vec;
502}
503
504std::string
505TrigConf::TrigDBCTPFilesLoader::loadDBFieldIntoString(const coral::AttributeList& row, const std::string& field) const {
506 std::string result;
507 try {
508 const coral::Blob& blob = row[field].data<coral::Blob>();
509 boost::iostreams::stream<boost::iostreams::array_source> stream(
510 static_cast<const char*> (blob.startingAddress()),
511 blob.size()
512 );
513 result = std::string (
514 std::istreambuf_iterator<char>(stream.rdbuf()),
515 std::istreambuf_iterator<char>()
516 );
517 TRG_MSG_INFO("Loading " << field << " of size " << result.size());
518 }
519 catch(const coral::AttributeException & e) {} // NULL content
520 if(result.empty()) {
521 TRG_MSG_ERROR("Field " << field << " in DB is empty");
522 throw std::runtime_error( "CTPFilesLoader: field " + field + " in DB is empty" );
523 }
524 return result;
525}
std::vector< size_t > vec
Loader class for Trigger configuration (L1 hardware files) from the Trigger DB.
#define x
Base class for Trigger configuration data and wrapper around underlying representation.
T getAttribute(const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
Access to simple attribute.
L1 menu configuration.
Definition L1CTPFiles.h:29
void set_Muctpi(MuctpiAccess key, std::vector< uint32_t > data)
void set_Ctpmon_MonSelector(std::vector< uint32_t > data)
void set_Tmc_CtpmonCounters(std::vector< TrigConf::L1CTPFiles::CTPMonCounter > data)
void set_Ctpin_MonSelector_Slot9(std::vector< uint32_t > data)
void set_HasCompleteCtpData(bool flag)
Setters of the various CTP data.
void set_HasCompleteSmxData(bool flag)
static const size_t CTPIN_MONDEC_SIZE
Definition L1CTPFiles.h:39
void set_Tmc_Data(DataStructure data)
void set_Ctpin_MonDecoder_Slot8(std::vector< uint32_t > data)
static const std::map< MuctpiAccess, std::string > s_keyMap
Definition L1CTPFiles.h:7
void set_Ctpin_MonSelector_Slot8(std::vector< uint32_t > data)
void set_Tmc_CtpcoreInputs(std::vector< TrigConf::L1CTPFiles::CTPCoreInput > data)
void set_Smx_Svfi_Slot8(const std::string &data)
void set_Ctpmon_MonDecoder(std::vector< uint32_t > data)
void set_Smx_Svfi_Slot9(const std::string &data)
void set_Tmc_CtpinCounters(std::vector< TrigConf::L1CTPFiles::CTPInCounter > data)
void set_Muctpi_Nbits(std::vector< uint32_t > data)
static const size_t CTPCORE_SMX_SIZE
Definition L1CTPFiles.h:36
static const size_t CTPMON_SELECTOR_SIZE
Definition L1CTPFiles.h:43
void set_Ctpcore_LUT(std::vector< uint32_t > data)
void set_Ctpmon_DMX(std::vector< uint32_t > data)
static const size_t CTPMON_DMX_SIZE
Definition L1CTPFiles.h:45
void set_Smx_Vhdl_Slot7(const std::string &data)
void set_Ctpin_MonDecoder_Slot7(std::vector< uint32_t > data)
void set_Muctpi_Extra_Ptlut(const std::string &key, std::vector< uint32_t > data)
void set_HasCompleteMuctpiData(bool flag)
static const size_t CTPIN_MONSEL_SIZE
Definition L1CTPFiles.h:38
void set_Ctpcore_SMX(std::vector< uint32_t > data)
void set_Smx_Output(const std::string &data)
void set_Smx_Vhdl_Slot9(const std::string &data)
void set_Tmc_CtpcoreCTPXInputs(std::vector< TrigConf::L1CTPFiles::CTPCoreCTPXInput > data)
void set_Ctpin_MonSelector_Slot7(std::vector< uint32_t > data)
void set_Smx_Svfi_Slot7(const std::string &data)
void set_Ctpin_MonDecoder_Slot9(std::vector< uint32_t > data)
static const size_t CTPMON_DECODER_SIZE
Definition L1CTPFiles.h:44
void set_Ctpcore_CAM(std::vector< uint32_t > data)
static const size_t CTPCORE_CAM_SIZE
Definition L1CTPFiles.h:35
void set_Smx_Vhdl_Slot8(const std::string &data)
void set_HasCompleteTmcData(bool flag)
static const size_t CTPCORE_LUT_SIZE
Definition L1CTPFiles.h:34
std::unique_ptr< coral::IQuery > createQuery(coral::ISessionProxy *session)
void setBoundValue(const std::string &fieldName, const T &value)
void loadMUCTPI(L1CTPFiles &ctpfiles, std::unique_ptr< coral::IQuery > query, size_t schemaVersion) const
TrigDBCTPFilesLoader(const std::string &connection)
Constructor.
std::vector< uint32_t > loadDBFieldIntoVector(const coral::AttributeList &row, const std::string &field, size_t size) const
virtual ~TrigDBCTPFilesLoader() override
Destructor - cannot be defined here because QueryDefinition is an incomplete type.
void loadCTPSMX(L1CTPFiles &ctpfiles, std::unique_ptr< coral::IQuery > query, size_t schemaVersion) const
std::map< size_t, QueryDefinition > m_tmcsig_queries
std::map< size_t, QueryDefinition > m_ctpfiles_queries
std::map< size_t, QueryDefinition > m_muctpi_queries
std::map< size_t, QueryDefinition > m_ctpsmx_queries
void loadCTPFiles(L1CTPFiles &ctpfiles, std::unique_ptr< coral::IQuery > query, size_t schemaVersion) const
void loadTMC(L1CTPFiles &ctpfiles, std::unique_ptr< coral::IQuery > query, size_t schemaVersion) const
std::map< size_t, QueryDefinition > m_link_queries
bool loadHardwareFiles(unsigned int smk, L1CTPFiles &ctpfiles, uint8_t loadMask=0x0F, const std::string &outFileName="") const
Load content from the Trigger DB into an L1CTPFiles object for a given super master key (SMK)
std::string loadDBFieldIntoString(const coral::AttributeList &row, const std::string &field) const
std::unique_ptr< coral::ISessionProxy > createDBSession() const
create (if needed) DB session and return the session proxy
QueryDefinition getQueryDefinition(size_t schemaVersion, const std::map< size_t, QueryDefinition > &queries) const
return query for given schemaVersion from possible queries
TrigDBLoader(const std::string &loaderName, const std::string &connection)
Constructor.
size_t schemaVersion(coral::ISessionProxy *session) const
access to TriggerDB schema version
void blobToPtree(const coral::Blob &blob, boost::property_tree::ptree &pt)
Definition query.py:1