$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h" 00002 #include "otsdaq-core/Macros/TablePluginMacros.h" 00003 #include "otsdaq-core/TablePluginDataFormats/ARTDAQAggregatorTable.h" 00004 #include "otsdaq-core/TablePluginDataFormats/XDAQContextTable.h" 00005 00006 #include <stdio.h> 00007 #include <sys/stat.h> //for mkdir 00008 #include <fstream> // std::fstream 00009 #include <iostream> 00010 00011 using namespace ots; 00012 00013 #define ARTDAQ_FCL_PATH std::string(getenv("USER_DATA")) + "/" + "ARTDAQConfigurations/" 00014 #define ARTDAQ_FILE_PREAMBLE "aggregator" 00015 00016 // helpers 00017 #define OUT out << tabStr << commentStr 00018 #define PUSHTAB tabStr += "\t" 00019 #define POPTAB tabStr.resize(tabStr.size() - 1) 00020 #define PUSHCOMMENT commentStr += "# " 00021 #define POPCOMMENT commentStr.resize(commentStr.size() - 2) 00022 00023 //======================================================================================================================== 00024 ARTDAQAggregatorTable::ARTDAQAggregatorTable(void) : TableBase("ARTDAQAggregatorTable") 00025 { 00027 // WARNING: the names used in C++ MUST match the Table INFO // 00029 } 00030 00031 //======================================================================================================================== 00032 ARTDAQAggregatorTable::~ARTDAQAggregatorTable(void) {} 00033 00034 //======================================================================================================================== 00035 void ARTDAQAggregatorTable::init(ConfigurationManager* configManager) 00036 { 00037 // make directory just in case 00038 mkdir((ARTDAQ_FCL_PATH).c_str(), 0755); 00039 00040 __COUT__ << "*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*&*" << std::endl; 00041 __COUT__ << configManager->__SELF_NODE__ << std::endl; 00042 00043 const XDAQContextTable* contextConfig = 00044 configManager->__GET_CONFIG__(XDAQContextTable); 00045 std::vector<const XDAQContextTable::XDAQContext*> aggContexts = 00046 contextConfig->getAggregatorContexts(); 00047 00048 // for each aggregator context 00049 // output associated fcl config file 00050 for(auto& aggContext : aggContexts) 00051 { 00052 ConfigurationTree aggConfigNode = contextConfig->getSupervisorConfigNode( 00053 configManager, 00054 aggContext->contextUID_, 00055 aggContext->applications_[0].applicationUID_); 00056 00057 __COUT__ << "Path for this aggregator config is " << aggContext->contextUID_ 00058 << "/" << aggContext->applications_[0].applicationUID_ << "/" 00059 << aggConfigNode.getValueAsString() << std::endl; 00060 00061 outputFHICL( 00062 configManager, 00063 aggConfigNode, 00064 contextConfig->getARTDAQAppRank(aggContext->contextUID_), 00065 contextConfig->getContextAddress(aggContext->contextUID_), 00066 contextConfig->getARTDAQDataPort(configManager, aggContext->contextUID_), 00067 contextConfig); 00068 } 00069 } 00070 00071 //======================================================================================================================== 00072 std::string ARTDAQAggregatorTable::getFHICLFilename( 00073 const ConfigurationTree& aggregatorNode) 00074 { 00075 __COUT__ << "ARTDAQ Aggregator UID: " << aggregatorNode.getValue() << std::endl; 00076 std::string filename = ARTDAQ_FCL_PATH + ARTDAQ_FILE_PREAMBLE + "-"; 00077 std::string uid = aggregatorNode.getValue(); 00078 for(unsigned int i = 0; i < uid.size(); ++i) 00079 if((uid[i] >= 'a' && uid[i] <= 'z') || (uid[i] >= 'A' && uid[i] <= 'Z') || 00080 (uid[i] >= '0' && uid[i] <= '9')) // only allow alpha numeric in file name 00081 filename += uid[i]; 00082 00083 filename += ".fcl"; 00084 00085 __COUT__ << "fcl: " << filename << std::endl; 00086 00087 return filename; 00088 } 00089 00090 //======================================================================================================================== 00091 void ARTDAQAggregatorTable::outputFHICL(ConfigurationManager* configManager, 00092 const ConfigurationTree& aggregatorNode, 00093 unsigned int selfRank, 00094 std::string selfHost, 00095 unsigned int selfPort, 00096 const XDAQContextTable* contextConfig) 00097 { 00098 /* 00099 the file will look something like this: 00100 00101 services: { 00102 scheduler: { 00103 fileMode: NOMERGE 00104 errorOnFailureToPut: false 00105 } 00106 NetMonTransportServiceInterface: { 00107 service_provider: NetMonTransportService 00108 } 00109 00110 #SimpleMemoryCheck: { } 00111 } 00112 00113 daq: { 00114 aggregator: { 00115 expected_events_per_bunch: 1 00116 print_event_store_stats: true 00117 event_queue_depth: 20 00118 event_queue_wait_time: 5 00119 onmon_event_prescale: 1 00120 xmlrpc_client_list: 00121 ";http://ironwork.fnal.gov:5205/RPC2,3;http://ironwork.fnal.gov:5206/RPC2,3;http://ironwork.fnal.gov:5235/RPC2,4;http://ironwork.fnal.gov:5236/RPC2,4;http://ironwork.fnal.gov:5265/RPC2,5;http://ironwork.fnal.gov:5266/RPC2,5" 00122 file_size_MB: 0.0 00123 file_duration: 0 00124 file_event_count: 0 00125 is_data_logger: true 00126 00127 sources: { 00128 s2: { transferPluginType: MPI source_rank: 2 max_fragment_size_bytes: 00129 2097152} s3: { transferPluginType: MPI source_rank: 3 max_fragment_size_bytes: 00130 2097152} 00131 00132 } 00133 } 00134 00135 metrics: { 00136 aggFile: { 00137 metricPluginType: "file" 00138 level: 3 00139 fileName: "/tmp/aggregator/agg_%UID%_metrics.log" 00140 uniquify: true 00141 } 00142 # ganglia: { 00143 # metricPluginType: "ganglia" 00144 # level: %{ganglia_level} 00145 # reporting_interval: 15.0 00146 # 00147 # configFile: "/etc/ganglia/gmond.conf" 00148 # group: "ARTDAQ" 00149 # } 00150 # msgfac: { 00151 # level: %{mf_level} 00152 # metricPluginType: "msgFacility" 00153 # output_message_application_name: "ARTDAQ Metric" 00154 # output_message_severity: 0 00155 # } 00156 # graphite: { 00157 # level: %{graphite_level} 00158 # metricPluginType: "graphite" 00159 # host: "localhost" 00160 # port: 20030 00161 # namespace: "artdaq." 00162 # } 00163 } 00164 00165 transfer_to_dispatcher: { 00166 transferPluginType: Shmem 00167 source_rank: 4 00168 destination_rank: 5 00169 max_fragment_size_bytes: 2097152 00170 } 00171 00172 } 00173 00174 source: { 00175 module_type: NetMonInput 00176 } 00177 outputs: { 00178 normalOutput: { 00179 module_type: RootOutput 00180 fileName: "/tmp/artdaqdemo_r%06r_sr%02s_%to.root" 00181 } 00182 00183 #normalOutputMod2: { 00184 # module_type: RootOutput 00185 # fileName: "/tmp/artdaqdemo_r%06r_sr%02s_%to_mod2.root" 00186 # SelectEvents: { SelectEvents: [ pmod2 ] } 00187 #} 00188 00189 #normalOutputMod3: { 00190 # module_type: RootOutput 00191 # fileName: "/tmp/artdaqdemo_r%06r_sr%02s_%to_mod3.root" 00192 # SelectEvents: { SelectEvents: [ pmod3 ] } 00193 #} 00194 00195 } 00196 physics: { 00197 analyzers: { 00198 00199 00200 checkintegrity: { 00201 module_type: CheckIntegrity 00202 raw_data_label: daq 00203 frag_type: TOY1 00204 } 00205 00206 } 00207 00208 producers: { 00209 00210 BuildInfo: 00211 { 00212 module_type: ArtdaqDemoBuildInfo 00213 instance_name: ArtdaqDemo 00214 } 00215 } 00216 00217 filters: { 00218 00219 prescaleMod2: { 00220 module_type: NthEvent 00221 nth: 2 00222 } 00223 00224 prescaleMod3: { 00225 module_type: NthEvent 00226 nth: 3 00227 } 00228 } 00229 00230 p2: [ BuildInfo ] 00231 pmod2: [ prescaleMod2 ] 00232 pmod3: [ prescaleMod3 ] 00233 00234 #a1: [ app, wf] 00235 00236 my_output_modules: [ normalOutput ] 00237 #my_output_modules: [ normalOutputMod2, normalOutputMod3 ] 00238 } 00239 process_name: DAQAG 00240 00241 */ 00242 00243 std::string filename = getFHICLFilename(aggregatorNode); 00244 00245 __COUT__ << "selfRank = " << selfRank << std::endl; 00246 00248 // generate xdaq run parameter file 00249 std::fstream out; 00250 00251 std::string tabStr = ""; 00252 std::string commentStr = ""; 00253 00254 out.open(filename, std::fstream::out | std::fstream::trunc); 00255 if(out.fail()) 00256 { 00257 __SS__ << "Failed to open ARTDAQ Aggregator fcl file: " << filename << std::endl; 00258 __SS_THROW__; 00259 } 00260 00261 //-------------------------------------- 00262 // header 00263 OUT << "###########################################################" << __E__; 00264 OUT << "#" << __E__; 00265 OUT << "# artdaq aggregator fcl configuration file produced by otsdaq." << __E__; 00266 OUT << "# Creation timestamp: " << StringMacros::getTimestampString() << __E__; 00267 OUT << "# Original filename: " << filename << __E__; 00268 OUT << "# otsdaq-ARTDAQ Aggregator UID: " << aggregatorNode.getValue() << __E__; 00269 OUT << "#" << __E__; 00270 OUT << "###########################################################" << __E__; 00271 OUT << "\n\n"; 00272 00273 //-------------------------------------- 00274 // handle services 00275 auto services = aggregatorNode.getNode("servicesLink"); 00276 if(!services.isDisconnected()) 00277 { 00278 OUT << "services: {\n"; 00279 00280 // scheduler 00281 PUSHTAB; 00282 OUT << "scheduler: {\n"; 00283 00284 PUSHTAB; 00285 OUT << "fileMode: " << services.getNode("schedulerFileMode").getValue() << "\n"; 00286 OUT << "errorOnFailureToPut: " 00287 << (services.getNode("schedulerErrorOnFailtureToPut").getValue<bool>() 00288 ? "true" 00289 : "false") 00290 << "\n"; 00291 POPTAB; 00292 00293 OUT << "}\n\n"; 00294 00295 // NetMonTransportServiceInterface 00296 OUT << "NetMonTransportServiceInterface: {\n"; 00297 00298 PUSHTAB; 00299 OUT << "service_provider: " << 00300 // services.getNode("NetMonTrasportServiceInterfaceServiceProvider").getEscapedValue() 00301 services.getNode("NetMonTrasportServiceInterfaceServiceProvider").getValue() 00302 << "\n"; 00303 00304 POPTAB; 00305 OUT << "}\n\n"; // end NetMonTransportServiceInterface 00306 00307 POPTAB; 00308 OUT << "}\n\n"; // end services 00309 } 00310 00311 //-------------------------------------- 00312 // handle daq 00313 auto daq = aggregatorNode.getNode("daqLink"); 00314 if(!daq.isDisconnected()) 00315 { 00316 OUT << "daq: {\n"; 00317 00318 // aggregator 00319 PUSHTAB; 00320 OUT << "aggregator: {\n"; 00321 00322 PUSHTAB; 00323 auto parametersLink = daq.getNode("daqAggregatorParametersLink"); 00324 if(!parametersLink.isDisconnected()) 00325 { 00326 auto parameters = parametersLink.getChildren(); 00327 for(auto& parameter : parameters) 00328 { 00329 if(!parameter.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00330 .getValue<bool>()) 00331 PUSHCOMMENT; 00332 00333 auto comment = parameter.second.getNode("CommentDescription"); 00334 OUT << parameter.second.getNode("daqParameterKey").getValue() << ": " 00335 << parameter.second.getNode("daqParameterValue").getValue() 00336 << (comment.isDefaultValue() ? "" : ("\t # " + comment.getValue())) 00337 << "\n"; 00338 00339 if(!parameter.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00340 .getValue<bool>()) 00341 POPCOMMENT; 00342 } 00343 } 00344 OUT << "\n"; // end daq aggregator parameters 00345 00346 OUT << "sources: {\n"; 00347 00348 PUSHTAB; 00349 auto sourcesGroup = daq.getNode("daqAggregatorSourcesLink"); 00350 if(!sourcesGroup.isDisconnected()) 00351 { 00352 try 00353 { 00354 auto sources = sourcesGroup.getChildren(); 00355 for(auto& source : sources) 00356 { 00357 std::string sourceContextUID = 00358 source.second.getNode("sourceARTDAQContextLink") 00359 .getValueAsString(); 00360 00361 std::string host = contextConfig->getContextAddress(sourceContextUID); 00362 unsigned int sourceRank = 00363 contextConfig->getARTDAQAppRank(sourceContextUID); 00364 unsigned int port = 00365 contextConfig->getARTDAQDataPort(configManager, sourceContextUID); 00366 00367 // open source object 00368 OUT << source.second.getNode("sourceKey").getValue() << ": {\n"; 00369 PUSHTAB; 00370 00371 OUT << "transferPluginType: " 00372 << source.second.getNode("transferPluginType").getValue() 00373 << __E__; 00374 00375 OUT << "source_rank: " << sourceRank << __E__; 00376 00377 try 00378 { 00379 OUT << "max_fragment_size_bytes: " 00380 << source.second 00381 .getNode("ARTDAQGlobalTableLink/maxFragmentSizeBytes") 00382 .getValue<unsigned long long>() 00383 << __E__; 00384 } 00385 catch(...) 00386 { 00387 __SS__ << "The field ARTDAQGlobalTableLink/maxFragmentSizeBytes " 00388 "could not be accessed. Make sure the link is valid." 00389 << __E__; 00390 __SS_THROW__; 00391 } 00392 00393 OUT << "host_map: [\n"; 00394 PUSHTAB; 00395 OUT << "{\n"; 00396 PUSHTAB; 00397 OUT << "rank: " << sourceRank << __E__; 00398 OUT << "host: \"" << host << "\"" << __E__; 00399 OUT << "portOffset: " << std::to_string(port) << __E__; 00400 POPTAB; 00401 OUT << "},\n"; 00402 OUT << "{\n"; 00403 PUSHTAB; 00404 OUT << "rank: " << selfRank << __E__; 00405 OUT << "host: \"" << selfHost << "\"" << __E__; 00406 OUT << "portOffset: " << std::to_string(selfPort) << __E__; 00407 POPTAB; 00408 OUT << "}" << __E__; 00409 POPTAB; 00410 OUT << "]" << __E__; // close host_map 00411 00412 POPTAB; 00413 OUT << "}" << __E__; // close source object 00414 } 00415 } 00416 catch(const std::runtime_error& e) 00417 { 00418 __SS__ << "Are the DAQ sources valid? Error occurred looking for " 00419 "Aggregator DAQ sources for UID '" 00420 << aggregatorNode.getValue() << "': " << e.what() << std::endl; 00421 __COUT_ERR__ << ss.str() << std::endl; 00422 __SS_THROW__; 00423 } 00424 } 00425 POPTAB; 00426 OUT << "}\n\n"; // end sources 00427 00428 POPTAB; 00429 OUT << "}\n\n"; // end aggregator 00430 00431 OUT << "metrics: {\n"; 00432 00433 PUSHTAB; 00434 auto metricsGroup = daq.getNode("daqMetricsLink"); 00435 if(!metricsGroup.isDisconnected()) 00436 { 00437 auto metrics = metricsGroup.getChildren(); 00438 00439 for(auto& metric : metrics) 00440 { 00441 if(!metric.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00442 .getValue<bool>()) 00443 PUSHCOMMENT; 00444 00445 OUT << metric.second.getNode("metricKey").getValue() << ": {\n"; 00446 PUSHTAB; 00447 00448 OUT << "metricPluginType: " 00449 << metric.second.getNode("metricPluginType").getValue() << "\n"; 00450 OUT << "level: " << metric.second.getNode("metricLevel").getValue() 00451 << "\n"; 00452 00453 auto metricParametersGroup = 00454 metric.second.getNode("metricParametersLink"); 00455 if(!metricParametersGroup.isDisconnected()) 00456 { 00457 auto metricParameters = metricParametersGroup.getChildren(); 00458 for(auto& metricParameter : metricParameters) 00459 { 00460 if(!metricParameter.second 00461 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00462 .getValue<bool>()) 00463 PUSHCOMMENT; 00464 00465 auto comment = 00466 metricParameter.second.getNode("CommentDescription"); 00467 OUT << metricParameter.second.getNode("metricParameterKey") 00468 .getValue() 00469 << ": " 00470 << metricParameter.second.getNode("metricParameterValue") 00471 .getValue() 00472 << (comment.isDefaultValue() ? "" 00473 : ("\t # " + comment.getValue())) 00474 << "\n"; 00475 00476 if(!metricParameter.second 00477 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00478 .getValue<bool>()) 00479 POPCOMMENT; 00480 } 00481 } 00482 POPTAB; 00483 OUT << "}\n\n"; // end metric 00484 00485 if(!metric.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00486 .getValue<bool>()) 00487 POPCOMMENT; 00488 } 00489 } 00490 POPTAB; 00491 OUT << "}\n\n"; // end metrics 00492 00493 OUT << "destinations: {\n"; 00494 00495 PUSHTAB; 00496 // other destinations 00497 auto destinationsGroup = daq.getNode("daqAggregatorDestinationsLink"); 00498 if(!destinationsGroup.isDisconnected()) 00499 { 00500 try 00501 { 00502 auto destinations = destinationsGroup.getChildren(); 00503 for(auto& destination : destinations) 00504 { 00505 auto destinationContextUID = 00506 destination.second.getNode("destinationARTDAQContextLink") 00507 .getValueAsString(); 00508 00509 unsigned int destinationRank = 00510 contextConfig->getARTDAQAppRank(destinationContextUID); 00511 std::string host = 00512 contextConfig->getContextAddress(destinationContextUID); 00513 unsigned int port = contextConfig->getARTDAQDataPort( 00514 configManager, destinationContextUID); 00515 00516 // open destination object 00517 OUT << destination.second.getNode("destinationKey").getValue() 00518 << ": {\n"; 00519 PUSHTAB; 00520 00521 OUT << "transferPluginType: " 00522 << destination.second.getNode("transferPluginType").getValue() 00523 << __E__; 00524 00525 OUT << "source_rank: " << destinationRank << __E__; 00526 00527 try 00528 { 00529 OUT << "max_fragment_size_bytes: " 00530 << destination.second 00531 .getNode("ARTDAQGlobalTableLink/maxFragmentSizeBytes") 00532 .getValue<unsigned long long>() 00533 << __E__; 00534 } 00535 catch(...) 00536 { 00537 __SS__ << "The field ARTDAQGlobalTableLink/maxFragmentSizeBytes " 00538 "could not be accessed. Make sure the link is valid." 00539 << __E__; 00540 __SS_THROW__; 00541 } 00542 00543 OUT << "host_map: [\n"; 00544 PUSHTAB; 00545 OUT << "{\n"; 00546 PUSHTAB; 00547 OUT << "rank: " << destinationRank << __E__; 00548 OUT << "host: \"" << host << "\"" << __E__; 00549 OUT << "portOffset: " << std::to_string(port) << __E__; 00550 POPTAB; 00551 OUT << "},\n"; 00552 OUT << "{\n"; 00553 PUSHTAB; 00554 OUT << "rank: " << selfRank << __E__; 00555 OUT << "host: \"" << selfHost << "\"" << __E__; 00556 OUT << "portOffset: " << std::to_string(selfPort) << __E__; 00557 POPTAB; 00558 OUT << "}" << __E__; 00559 POPTAB; 00560 OUT << "]" << __E__; // close host_map 00561 00562 POPTAB; 00563 OUT << "}" << __E__; // close source object 00564 } 00565 } 00566 catch(const std::runtime_error& e) 00567 { 00568 __SS__ << "Are the DAQ destinations valid? Error occurred looking for " 00569 "Aggregator DAQ destinations for UID '" 00570 << aggregatorNode.getValue() << "': " << e.what() << std::endl; 00571 __COUT_ERR__ << ss.str() << std::endl; 00572 __SS_THROW__; 00573 } 00574 } 00575 POPTAB; 00576 OUT << "}\n\n"; // end destinations 00577 00578 POPTAB; 00579 OUT << "}\n\n"; // end daq 00580 } 00581 00582 //-------------------------------------- 00583 // handle source 00584 auto source = aggregatorNode.getNode("sourceLink"); 00585 if(!source.isDisconnected()) 00586 { 00587 OUT << "source: {\n"; 00588 00589 PUSHTAB; 00590 OUT << "module_type: " << source.getNode("sourceModuleType").getValue() << "\n"; 00591 POPTAB; 00592 OUT << "}\n\n"; // end source 00593 } 00594 00595 //-------------------------------------- 00596 // handle outputs 00597 auto outputs = aggregatorNode.getNode("outputsLink"); 00598 if(!outputs.isDisconnected()) 00599 { 00600 OUT << "outputs: {\n"; 00601 00602 PUSHTAB; 00603 00604 auto outputPlugins = outputs.getChildren(); 00605 for(auto& outputPlugin : outputPlugins) 00606 { 00607 if(!outputPlugin.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00608 .getValue<bool>()) 00609 PUSHCOMMENT; 00610 00611 OUT << outputPlugin.second.getNode("outputKey").getValue() << ": {\n"; 00612 PUSHTAB; 00613 OUT << "module_type: " 00614 << outputPlugin.second.getNode("outputModuleType").getValue() << "\n"; 00615 auto pluginParameterLink = 00616 outputPlugin.second.getNode("outputModuleParameterLink"); 00617 if(!pluginParameterLink.isDisconnected()) 00618 { 00619 auto pluginParameters = pluginParameterLink.getChildren(); 00620 for(auto& pluginParameter : pluginParameters) 00621 { 00622 if(!pluginParameter.second 00623 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00624 .getValue<bool>()) 00625 PUSHCOMMENT; 00626 00627 auto comment = pluginParameter.second.getNode("CommentDescription"); 00628 OUT << pluginParameter.second.getNode("outputParameterKey").getValue() 00629 << ": " 00630 << pluginParameter.second.getNode("outputParameterValue") 00631 .getValue() 00632 << (comment.isDefaultValue() ? "" 00633 : ("\t # " + comment.getValue())) 00634 << "\n"; 00635 00636 if(!pluginParameter.second 00637 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00638 .getValue<bool>()) 00639 POPCOMMENT; 00640 } 00641 } 00642 POPTAB; 00643 OUT << "}\n\n"; // end output module 00644 00645 if(!outputPlugin.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00646 .getValue<bool>()) 00647 POPCOMMENT; 00648 } 00649 00650 POPTAB; 00651 OUT << "}\n\n"; // end outputs 00652 } 00653 00654 //-------------------------------------- 00655 // handle physics 00656 auto physics = aggregatorNode.getNode("physicsLink"); 00657 if(!physics.isDisconnected()) 00658 { 00660 OUT << "physics: {\n"; 00661 00662 PUSHTAB; 00663 00664 auto analyzers = physics.getNode("analyzersLink"); 00665 if(!analyzers.isDisconnected()) 00666 { 00668 OUT << "analyzers: {\n"; 00669 00670 PUSHTAB; 00671 auto modules = analyzers.getChildren(); 00672 for(auto& module : modules) 00673 { 00674 if(!module.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00675 .getValue<bool>()) 00676 PUSHCOMMENT; 00677 00678 OUT << module.second.getNode("analyzerKey").getValue() << ": {\n"; 00679 PUSHTAB; 00680 OUT << "module_type: " 00681 << module.second.getNode("analyzerModuleType").getValue() << "\n"; 00682 auto moduleParameterLink = 00683 module.second.getNode("analyzerModuleParameterLink"); 00684 if(!moduleParameterLink.isDisconnected()) 00685 { 00686 auto moduleParameters = moduleParameterLink.getChildren(); 00687 for(auto& moduleParameter : moduleParameters) 00688 { 00689 if(!moduleParameter.second 00690 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00691 .getValue<bool>()) 00692 PUSHCOMMENT; 00693 00694 auto comment = 00695 moduleParameter.second.getNode("CommentDescription"); 00696 OUT << moduleParameter.second.getNode("analyzerParameterKey") 00697 .getValue() 00698 << ": " 00699 << moduleParameter.second.getNode("analyzerParameterValue") 00700 .getValue() 00701 << (comment.isDefaultValue() ? "" 00702 : ("\t # " + comment.getValue())) 00703 << "\n"; 00704 00705 if(!moduleParameter.second 00706 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00707 .getValue<bool>()) 00708 POPCOMMENT; 00709 } 00710 } 00711 POPTAB; 00712 OUT << "}\n\n"; // end analyzer module 00713 00714 if(!module.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00715 .getValue<bool>()) 00716 POPCOMMENT; 00717 } 00718 POPTAB; 00719 OUT << "}\n\n"; // end analyzer 00720 } 00721 00722 auto producers = physics.getNode("producersLink"); 00723 if(!producers.isDisconnected()) 00724 { 00726 OUT << "producers: {\n"; 00727 00728 PUSHTAB; 00729 auto modules = producers.getChildren(); 00730 for(auto& module : modules) 00731 { 00732 if(!module.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00733 .getValue<bool>()) 00734 PUSHCOMMENT; 00735 00736 OUT << module.second.getNode("producerKey").getValue() << ": {\n"; 00737 PUSHTAB; 00738 OUT << "module_type: " 00739 << module.second.getNode("producerModuleType").getValue() << "\n"; 00740 auto moduleParameterLink = 00741 module.second.getNode("producerModuleParameterLink"); 00742 if(!moduleParameterLink.isDisconnected()) 00743 { 00744 auto moduleParameters = moduleParameterLink.getChildren(); 00745 for(auto& moduleParameter : moduleParameters) 00746 { 00747 if(!moduleParameter.second 00748 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00749 .getValue<bool>()) 00750 PUSHCOMMENT; 00751 00752 auto comment = 00753 moduleParameter.second.getNode("CommentDescription"); 00754 OUT << moduleParameter.second.getNode("producerParameterKey") 00755 .getValue() 00756 << ":" 00757 << moduleParameter.second.getNode("producerParameterValue") 00758 .getValue() 00759 << (comment.isDefaultValue() ? "" 00760 : ("\t # " + comment.getValue())) 00761 << "\n"; 00762 00763 if(!moduleParameter.second 00764 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00765 .getValue<bool>()) 00766 POPCOMMENT; 00767 } 00768 } 00769 POPTAB; 00770 OUT << "}\n\n"; // end producer module 00771 00772 if(!module.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00773 .getValue<bool>()) 00774 POPCOMMENT; 00775 } 00776 POPTAB; 00777 OUT << "}\n\n"; // end producer 00778 } 00779 00780 auto filters = physics.getNode("filtersLink"); 00781 if(!filters.isDisconnected()) 00782 { 00784 OUT << "filters: {\n"; 00785 00786 PUSHTAB; 00787 auto modules = filters.getChildren(); 00788 for(auto& module : modules) 00789 { 00790 if(!module.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00791 .getValue<bool>()) 00792 PUSHCOMMENT; 00793 00794 OUT << module.second.getNode("filterKey").getValue() << ": {\n"; 00795 PUSHTAB; 00796 OUT << "module_type: " 00797 << module.second.getNode("filterModuleType").getValue() << "\n"; 00798 auto moduleParameterLink = 00799 module.second.getNode("filterModuleParameterLink"); 00800 if(!moduleParameterLink.isDisconnected()) 00801 { 00802 auto moduleParameters = moduleParameterLink.getChildren(); 00803 for(auto& moduleParameter : moduleParameters) 00804 { 00805 if(!moduleParameter.second 00806 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00807 .getValue<bool>()) 00808 PUSHCOMMENT; 00809 00810 auto comment = 00811 moduleParameter.second.getNode("CommentDescription"); 00812 OUT << moduleParameter.second.getNode("filterParameterKey") 00813 .getValue() 00814 << ": " 00815 << moduleParameter.second.getNode("filterParameterValue") 00816 .getValue() 00817 << (comment.isDefaultValue() ? "" 00818 : ("\t # " + comment.getValue())) 00819 << "\n"; 00820 00821 if(!moduleParameter.second 00822 .getNode(TableViewColumnInfo::COL_NAME_STATUS) 00823 .getValue<bool>()) 00824 POPCOMMENT; 00825 } 00826 } 00827 POPTAB; 00828 OUT << "}\n\n"; // end filter module 00829 00830 if(!module.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00831 .getValue<bool>()) 00832 POPCOMMENT; 00833 } 00834 POPTAB; 00835 OUT << "}\n\n"; // end filter 00836 } 00837 00838 auto otherParameterLink = physics.getNode("physicsOtherParametersLink"); 00839 if(!otherParameterLink.isDisconnected()) 00840 { 00842 auto physicsParameters = otherParameterLink.getChildren(); 00843 for(auto& parameter : physicsParameters) 00844 { 00845 if(!parameter.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00846 .getValue<bool>()) 00847 PUSHCOMMENT; 00848 00849 auto comment = parameter.second.getNode("CommentDescription"); 00850 OUT << parameter.second.getNode("physicsParameterKey").getValue() << ": " 00851 << parameter.second.getNode("physicsParameterValue").getValue() 00852 << (comment.isDefaultValue() ? "" : ("\t # " + comment.getValue())) 00853 << "\n"; 00854 00855 if(!parameter.second.getNode(TableViewColumnInfo::COL_NAME_STATUS) 00856 .getValue<bool>()) 00857 POPCOMMENT; 00858 } 00859 } 00860 POPTAB; 00861 OUT << "}\n\n"; // end physics 00862 } 00863 00864 //-------------------------------------- 00865 // handle process_name 00866 try 00867 { 00868 OUT << "process_name: " 00869 << aggregatorNode.getNode( 00870 "ARTDAQGlobalTableForProcessNameLink/processNameForAggregators") 00871 << "\n"; 00872 } 00873 catch(...) 00874 { 00875 __SS__ << "The field " 00876 "ARTDAQGlobalTableForProcessNameLink/processNameForAggregators could " 00877 "not be accessed. " 00878 << "Make sure the link is valid from aggregator '" 00879 << aggregatorNode.getValue() << ".'" << __E__; 00880 __SS_THROW__; 00881 } 00882 00883 out.close(); 00884 } 00885 00886 DEFINE_OTS_TABLE(ARTDAQAggregatorTable)