otsdaq  v1_01_03
 All Classes Namespaces Functions
EventBuilderApp.cc
1 #include "otsdaq/EventBuilderApp/EventBuilderApp.h"
2 #include "otsdaq/EventBuilderApp/EventBuilderInterface.h"
3 #include "otsdaq-core/MessageFacility/MessageFacility.h"
4 #include "otsdaq-core/Macros/CoutHeaderMacros.h"
5 #include "otsdaq-core/XmlUtilities/HttpXmlDocument.h"
6 #include "otsdaq-core/SOAPUtilities/SOAPUtilities.h"
7 #include "otsdaq-core/SOAPUtilities/SOAPCommand.h"
8 
9 #include "otsdaq-core/ConfigurationDataFormats/ConfigurationGroupKey.h"
10 #include "otsdaq-core/ConfigurationInterface/ConfigurationManager.h"
11 #include "otsdaq-core/ConfigurationPluginDataFormats/XDAQContextConfiguration.h"
12 
13 #include <toolbox/fsm/FailedEvent.h>
14 
15 #include <xdaq/NamespaceURI.h>
16 #include <xoap/Method.h>
17 
18 #include <memory>
19 #include "messagefacility/MessageLogger/MessageLogger.h"
20 #include "artdaq/DAQdata/configureMessageFacility.hh"
21 #include "artdaq/DAQrate/quiet_mpi.hh"
22 #include "cetlib/exception.h"
23 #include "artdaq/BuildInfo/GetPackageBuildInfo.hh"
24 #include "fhiclcpp/make_ParameterSet.h"
25 
26 #include <fstream>
27 #include <iostream>
28 #include <cassert>
29 
30 using namespace ots;
31 
32 XDAQ_INSTANTIATOR_IMPL(EventBuilderApp)
33 
34 //========================================================================================================================
35 EventBuilderApp::EventBuilderApp(xdaq::ApplicationStub* stub)
36 throw (xdaq::exception::Exception)
37 : xdaq::Application (stub)
38 , SOAPMessenger (this)
39 , stateMachineWorkLoopManager_ (toolbox::task::bind(this, &EventBuilderApp::stateMachineThread, "StateMachine"))
40 , stateMachineSemaphore_ (toolbox::BSem::FULL)
41 , theConfigurationManager_ (new ConfigurationManager)//(Singleton<ConfigurationManager>::getInstance()) //I always load the full config but if I want to load a partial configuration (new ConfigurationManager)
42 , XDAQContextConfigurationName_(theConfigurationManager_->__GET_CONFIG__(XDAQContextConfiguration)->getConfigurationName())
43 , supervisorConfigurationPath_ ("INITIALIZED INSIDE THE CONTRUCTOR BECAUSE IT NEEDS supervisorContextUID_ and supervisorApplicationUID_")
44 , supervisorContextUID_ ("INITIALIZED INSIDE THE CONTRUCTOR TO LAUNCH AN EXCEPTION")
45 , supervisorApplicationUID_ ("INITIALIZED INSIDE THE CONTRUCTOR TO LAUNCH AN EXCEPTION")
46 //, theConfigurationGroupKey_ (nullptr)
47 //, supervisorInstance_ (this->getApplicationDescriptor()->getInstance())
48 // theFEWInterfacesManager_ (theConfigurationManager_,this->getApplicationDescriptor()->getInstance())
49 {
50  INIT_MF("EventBuilderApp");
51  xgi::bind (this, &EventBuilderApp::Default, "Default" );
52  xgi::bind (this, &EventBuilderApp::stateMachineXgiHandler, "StateMachineXgiHandler");
53 
54  xoap::bind(this, &EventBuilderApp::stateMachineStateRequest, "StateMachineStateRequest", XDAQ_NS_URI );
55  xoap::bind(this, &EventBuilderApp::stateMachineErrorMessageRequest, "StateMachineErrorMessageRequest", XDAQ_NS_URI );
56 
57  try
58  {
59  supervisorContextUID_ = theConfigurationManager_->__GET_CONFIG__(XDAQContextConfiguration)->getContextUID(getApplicationContext()->getContextDescriptor()->getURL());
60  }
61  catch(...)
62  {
63  __MOUT_ERR__ << "XDAQ Supervisor could not access it's configuration through the Configuration Context Group." <<
64  " The XDAQContextConfigurationName = " << XDAQContextConfigurationName_ <<
65  ". The supervisorApplicationUID = " << supervisorApplicationUID_ << std::endl;
66  throw;
67  }
68  try
69  {
70  supervisorApplicationUID_ = theConfigurationManager_->__GET_CONFIG__(XDAQContextConfiguration)->getApplicationUID
71  (
72  getApplicationContext()->getContextDescriptor()->getURL(),
73  getApplicationDescriptor()->getLocalId()
74  );
75  }
76  catch(...)
77  {
78  __MOUT_ERR__ << "XDAQ Supervisor could not access it's configuration through the Configuration Application Group."
79  << " The supervisorApplicationUID = " << supervisorApplicationUID_ << std::endl;
80  throw;
81  }
82  supervisorConfigurationPath_ = "/" + supervisorContextUID_ + "/LinkToApplicationConfiguration/" + supervisorApplicationUID_ + "/LinkToSupervisorConfiguration";
83 
84  setStateMachineName(supervisorApplicationUID_);
85  init();
86 }
87 
88 //========================================================================================================================
89 EventBuilderApp::~EventBuilderApp(void)
90 {
91  destroy();
92 }
93 //========================================================================================================================
94 void EventBuilderApp::init(void)
95 {
96  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR INIT START!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
97  theSupervisorDescriptorInfo_.init(getApplicationContext());
98  artdaq::configureMessageFacility("eventbuilder");
99 
100  // initialization
101 
102  int const wanted_threading_level { MPI_THREAD_MULTIPLE };
103  //int const wanted_threading_level { MPI_THREAD_FUNNELED };
104 
105  MPI_Comm local_group_comm;
106  try
107  {
108  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR TRYING MPISENTRY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
109  mpiSentry_.reset( new artdaq::MPISentry(0, 0, wanted_threading_level, artdaq::TaskType::EventBuilderTask, local_group_comm) );
110  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR DONE MPISENTRY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
111  }
112  catch (cet::exception& errormsg)
113  {
114  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR INIT ERROR!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
115  mf::LogError("EventBuilderMain") << errormsg ;
116  mf::LogError("EventBuilderMain") << "MPISentry error encountered in EventBuilderMain; exiting...";
117  throw errormsg;
118  }
119 
120  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR NO ERRORS MAKING MSG FACILITY!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
121  std::string name = "Builder";
122  unsigned short port = 5200;
123  //artdaq::setMsgFacAppName(supervisorApplicationUID_, port);
124  artdaq::setMsgFacAppName(name, port);
125  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR MSG FACILITY DONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
126  mf::LogDebug(name + "Supervisor") << "artdaq version " <<
127 // mf::LogDebug(supervisorApplicationUID_) << " artdaq version " <<
128  artdaq::GetPackageBuildInfo::getPackageBuildInfo().getPackageVersion()
129  << ", built " <<
130  artdaq::GetPackageBuildInfo::getPackageBuildInfo().getBuildTimestamp();
131 
132  // create the EventBuilderInterface
133  //theARTDAQEventBuilderInterfaces_[0] = new EventBuilderInterface(mpiSentry_->rank(), local_group_comm, name );
134  theARTDAQEventBuilderInterfaces_[0] = new EventBuilderInterface(mpiSentry_->rank(), name );
135  //theARTDAQEventBuilderInterfaces_[0] = new EventBuilderInterface(mpiSentry_->rank(), local_group_comm, supervisorApplicationUID_ );
136  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR INIT DONE!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
137 }
138 
139 //========================================================================================================================
140 void EventBuilderApp::destroy(void)
141 {
142  //called by destructor
143  mpiSentry_.reset();
144 }
145 
146 //========================================================================================================================
147 void EventBuilderApp::Default(xgi::Input * in, xgi::Output * out )
148 throw (xgi::exception::Exception)
149 {
150 
151  *out << "<!DOCTYPE HTML><html lang='en'><frameset col='100%' row='100%'><frame src='/WebPath/html/EventBuilderApp.html?urn=" <<
152  this->getApplicationDescriptor()->getLocalId() <<"'></frameset></html>";
153 }
154 
155 //========================================================================================================================
156 void EventBuilderApp::stateMachineXgiHandler(xgi::Input * in, xgi::Output * out )
157 throw (xgi::exception::Exception)
158 {}
159 
160 //========================================================================================================================
161 void EventBuilderApp::stateMachineResultXgiHandler(xgi::Input* in, xgi::Output* out )
162 throw (xgi::exception::Exception)
163 {}
164 
165 //========================================================================================================================
166 xoap::MessageReference EventBuilderApp::stateMachineXoapHandler(xoap::MessageReference message )
167 throw (xoap::exception::Exception)
168 {
169  std::cout << __COUT_HDR_FL__ << "Soap Handler!" << std::endl;
170  stateMachineWorkLoopManager_.removeProcessedRequests();
171  stateMachineWorkLoopManager_.processRequest(message);
172  std::cout << __COUT_HDR_FL__ << "Done - Soap Handler!" << std::endl;
173  return message;
174 }
175 
176 //========================================================================================================================
177 xoap::MessageReference EventBuilderApp::stateMachineResultXoapHandler(xoap::MessageReference message )
178 throw (xoap::exception::Exception)
179 {
180  std::cout << __COUT_HDR_FL__ << "Soap Handler!" << std::endl;
181  //stateMachineWorkLoopManager_.removeProcessedRequests();
182  //stateMachineWorkLoopManager_.processRequest(message);
183  std::cout << __COUT_HDR_FL__ << "Done - Soap Handler!" << std::endl;
184  return message;
185 }
186 
187 //========================================================================================================================
188 bool EventBuilderApp::stateMachineThread(toolbox::task::WorkLoop* workLoop)
189 {
190  stateMachineSemaphore_.take();
191  std::cout << __COUT_HDR_FL__ << "Re-sending message..." << SOAPUtilities::translate(stateMachineWorkLoopManager_.getMessage(workLoop)).getCommand() << std::endl;
192  std::string reply = send(this->getApplicationDescriptor(),stateMachineWorkLoopManager_.getMessage(workLoop));
193  stateMachineWorkLoopManager_.report(workLoop, reply, 100, true);
194  std::cout << __COUT_HDR_FL__ << "Done with message" << std::endl;
195  stateMachineSemaphore_.give();
196  return false;//execute once and automatically remove the workloop so in WorkLoopManager the try workLoop->remove(job_) could be commented out
197  //return true;//go on and then you must do the workLoop->remove(job_) in WorkLoopManager
198 }
199 
200 //========================================================================================================================
201 xoap::MessageReference EventBuilderApp::stateMachineStateRequest(xoap::MessageReference message)
202 throw (xoap::exception::Exception)
203 {
204  std::cout << __COUT_HDR_FL__ << theStateMachine_.getCurrentStateName() << std::endl;
205  return SOAPUtilities::makeSOAPMessageReference(theStateMachine_.getCurrentStateName());
206 }
207 
208 //========================================================================================================================
209 xoap::MessageReference EventBuilderApp::stateMachineErrorMessageRequest(xoap::MessageReference message)
210 throw (xoap::exception::Exception)
211 {
212  __MOUT__<< "theStateMachine_.getErrorMessage() = " << theStateMachine_.getErrorMessage() << std::endl;
213 
214  SOAPParameters retParameters;
215  retParameters.addParameter("ErrorMessage",theStateMachine_.getErrorMessage());
216  return SOAPUtilities::makeSOAPMessageReference("stateMachineErrorMessageRequestReply",retParameters);
217 }
218 
219 //========================================================================================================================
220 void EventBuilderApp::stateInitial(toolbox::fsm::FiniteStateMachine& fsm)
221 throw (toolbox::fsm::exception::Exception)
222 {
223 
224 }
225 
226 //========================================================================================================================
227 void EventBuilderApp::stateHalted(toolbox::fsm::FiniteStateMachine& fsm)
228 throw (toolbox::fsm::exception::Exception)
229 {
230 
231 }
232 
233 //========================================================================================================================
234 void EventBuilderApp::stateRunning(toolbox::fsm::FiniteStateMachine& fsm)
235 throw (toolbox::fsm::exception::Exception)
236 {
237 
238 }
239 
240 //========================================================================================================================
241 void EventBuilderApp::stateConfigured(toolbox::fsm::FiniteStateMachine& fsm)
242 throw (toolbox::fsm::exception::Exception)
243 {
244 
245 }
246 
247 //========================================================================================================================
248 void EventBuilderApp::statePaused(toolbox::fsm::FiniteStateMachine& fsm)
249 throw (toolbox::fsm::exception::Exception)
250 {
251 
252 }
253 
254 //========================================================================================================================
255 void EventBuilderApp::inError (toolbox::fsm::FiniteStateMachine & fsm)
256 throw (toolbox::fsm::exception::Exception)
257 {
258  std::cout << __COUT_HDR_FL__ << "Fsm current state: " << theStateMachine_.getCurrentStateName()<< std::endl;
259  //rcmsStateNotifier_.stateChanged("Error", "");
260 }
261 
262 //========================================================================================================================
263 void EventBuilderApp::enteringError (toolbox::Event::Reference e)
264 throw (toolbox::fsm::exception::Exception)
265 {
266  std::cout << __COUT_HDR_FL__ << "Fsm current state: " << theStateMachine_.getCurrentStateName()<< std::endl;
267  toolbox::fsm::FailedEvent& failedEvent = dynamic_cast<toolbox::fsm::FailedEvent&>(*e);
268  std::ostringstream error;
269  error << "Failure performing transition from "
270  << failedEvent.getFromState()
271  << " to "
272  << failedEvent.getToState()
273  << " exception: " << failedEvent.getException().what();
274  std::cout << __COUT_HDR_FL__ << error.str() << std::endl;
275  //diagService_->reportError(errstr.str(),DIAGERROR);
276 
277 }
278 
279 #define ARTDAQ_FCL_PATH std::string(getenv("USER_DATA")) + "/"+ "ARTDAQConfigurations/"
280 #define ARTDAQ_FILE_PREAMBLE "builder"
281 
282 //========================================================================================================================
283 void EventBuilderApp::transitionConfiguring(toolbox::Event::Reference e)
284 throw (toolbox::fsm::exception::Exception)
285 {
286 
287  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR CONFIGURING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
288  std::cout << __COUT_HDR_FL__ << SOAPUtilities::translate(theStateMachine_.getCurrentMessage()) << std::endl;
289 
290 
291  std::pair<std::string /*group name*/, ConfigurationGroupKey> theGroup(
292  SOAPUtilities::translate(theStateMachine_.getCurrentMessage()).
293  getParameters().getValue("ConfigurationGroupName"),
294  ConfigurationGroupKey(SOAPUtilities::translate(theStateMachine_.getCurrentMessage()).
295  getParameters().getValue("ConfigurationGroupKey")));
296 
297  __MOUT__ << "Configuration group name: " << theGroup.first << " key: " <<
298  theGroup.second << std::endl;
299 
300  theConfigurationManager_->loadConfigurationGroup(
301  theGroup.first,
302  theGroup.second, true);
303 
304  //theConfigurationManager_->setupEventBuilderAppConfiguration(theConfigurationGroupKey_,supervisorInstance_);
305 
306  //Now that the configuration manager has all the necessary configurations I can create all objects dependent of the configuration
307  //std::string configString = "daq:{event_builder:{expected_fragments_per_event:2 first_fragment_receiver_rank:0 fragment_receiver_count:2 mpi_buffer_count:16 print_event_store_stats:true send_triggers:true trigger_port:5001 use_art:true verbose:false} max_fragment_size_words:2.097152e6} outputs:{netMonOutput:{module_type:\"NetMonOutput\"}} physics:{my_output_modules:[\"netMonOutput\"]} process_name:\"DAQ\" services:{Timing:{summaryOnly:true} scheduler:{fileMode:\"NOMERGE\"} user:{NetMonTransportServiceInterface:{data_receiver_count:1 first_data_receiver_rank:4 max_fragment_size_words:2.097152e6 mpi_buffer_count:8 service_provider:\"NetMonTransportService\"}}} source:{fragment_type_map:[[1,\"UDP\"]] module_type:\"RawInput\" resume_after_timeout:true waiting_time:900}";
308 
309  //ONLY 1 BOARD READER IN THE SYSTEM
310  //std::string configString = "daq:{event_builder:{expected_fragments_per_event:1 first_fragment_receiver_rank:0 fragment_receiver_count:1 mpi_buffer_count:16 print_event_store_stats:true send_triggers:true trigger_port:5001 use_art:true verbose:false} max_fragment_size_words:2.097152e6} outputs:{netMonOutput:{module_type:\"RootMPIOutput\"}} physics:{analyzers:{wf: {module_type:\"WFViewer\" fragment_ids:[0] fragment_type_labels:[ \"DataGen\" ] prescale:60 write_to_file:true fileName:\"/tmp/otsdaqdemo_onmon_evb.root\"}} a1:[\"wf\"] my_output_modules:[\"netMonOutput\"]} process_name:\"DAQ\" services:{Timing:{summaryOnly:true} scheduler:{fileMode:\"NOMERGE\" errorOnFailureToPut: false} user:{NetMonTransportServiceInterface:{data_receiver_count:1 first_data_receiver_rank:2 max_fragment_size_words:2.097152e6 mpi_buffer_count:8 service_provider:\"NetMonTransportService\"}}} source:{fragment_type_map:[[1,\"UDP\"], [4,\"DataGen\"]] module_type:\"RawInput\" resume_after_timeout:true waiting_time:900}";
311 
312  //2 BOARD READERS IN THE SYSTEM
313  //std::string configString = "daq:{event_builder:{expected_fragments_per_event:1 first_fragment_receiver_rank:0 fragment_receiver_count:1 mpi_buffer_count:16 print_event_store_stats:true send_triggers:true trigger_port:5001 use_art:true verbose:false} max_fragment_size_words:2.097152e6} outputs:{netMonOutput:{module_type:\"RootMPIOutput\"}} physics:{analyzers:{wf: {module_type:\"WFViewer\" fragment_ids:[0] fragment_type_labels:[ \"DataGen\" ] prescale:60 write_to_file:true fileName:\"/tmp/otsdaqdemo_onmon_evb.root\"}} a1:[\"wf\"] my_output_modules:[\"netMonOutput\"]} process_name:\"DAQ\" services:{Timing:{summaryOnly:true} scheduler:{fileMode:\"NOMERGE\" errorOnFailureToPut: false} user:{NetMonTransportServiceInterface:{data_receiver_count:1 first_data_receiver_rank:2 max_fragment_size_words:2.097152e6 mpi_buffer_count:8 service_provider:\"NetMonTransportService\"}}} source:{fragment_type_map:[[1,\"UDP\"], [4,\"DataGen\"]] module_type:\"RawInput\" resume_after_timeout:true waiting_time:900}";
314 
315  //__MOUT__ << configString << std::endl;
316  __MOUT__ << std::endl;
317  __MOUT__ << std::endl;
318  //__MOUT__ << theConfigurationManager_->getNode(XDAQContextConfigurationName_).getNode(supervisorConfigurationPath_).getNode("ConfigurationString").getValue<std::string>() << std::endl;
319  fhicl::ParameterSet pset;
320  //fhicl::make_ParameterSet(configString, pset);
321 
322 
323  std::string filename = ARTDAQ_FCL_PATH + ARTDAQ_FILE_PREAMBLE + "-";
324  std::string uid = theConfigurationManager_->getNode(XDAQContextConfigurationName_).getNode(supervisorConfigurationPath_).getValue();
325 
326  __MOUT__ << "uid: " << uid << std::endl;
327  for(unsigned int i=0;i<uid.size();++i)
328  if((uid[i] >= 'a' && uid[i] <= 'z') ||
329  (uid[i] >= 'A' && uid[i] <= 'Z') ||
330  (uid[i] >= '0' && uid[i] <= '9')) //only allow alpha numeric in file name
331  filename += uid[i];
332  filename += ".fcl";
333 
334  __MOUT__ << "filename: " << filename << std::endl;
335 
336  std::string fileFclString;
337  {
338  std::ifstream in(filename, std::ios::in | std::ios::binary);
339  if (in)
340  {
341  std::string contents;
342  in.seekg(0, std::ios::end);
343  fileFclString.resize(in.tellg());
344  in.seekg(0, std::ios::beg);
345  in.read(&fileFclString[0], fileFclString.size());
346  in.close();
347  }
348  }
349  __MOUT__ << fileFclString << std::endl;
350 
351  try
352  {
353  fhicl::make_ParameterSet(fileFclString, pset);
354 
355  //fhicl::make_ParameterSet(theConfigurationManager_->getNode(XDAQContextConfigurationName_).getNode(supervisorConfigurationPath_).getNode("ConfigurationString").getValue<std::string>(), pset);
356 
357  for(std::map<int,EventBuilderInterface*>::iterator it=theARTDAQEventBuilderInterfaces_.begin(); it!=theARTDAQEventBuilderInterfaces_.end(); it++)
358  it->second->configure(pset);
359  }
360  catch(const cet::coded_exception<fhicl::error, &fhicl::detail::translate>& e)
361  {
362  __SS__ << "Error was caught while configuring: " << e.what() << std::endl;
363  __MOUT_ERR__ << "\n" << ss.str();
364  theStateMachine_.setErrorMessage(ss.str());
365  throw toolbox::fsm::exception::Exception(
366  "Transition Error" /*name*/,
367  ss.str() /* message*/,
368  "EventBuilderApp::transitionConfiguring" /*module*/,
369  __LINE__ /*line*/,
370  __FUNCTION__ /*function*/
371  );
372  }
373 
374  std::cout << __COUT_HDR_FL__ << "ARTDAQBUILDER SUPERVISOR DONE CONFIGURING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
375 
376 }
377 
378 //========================================================================================================================
379 void EventBuilderApp::transitionHalting(toolbox::Event::Reference e)
380 throw (toolbox::fsm::exception::Exception)
381 {
382 
383  for(auto it=theARTDAQEventBuilderInterfaces_.begin(); it!=theARTDAQEventBuilderInterfaces_.end(); it++)
384  it->second->halt();
385 }
386 
387 //========================================================================================================================
388 void EventBuilderApp::transitionInitializing(toolbox::Event::Reference e)
389 throw (toolbox::fsm::exception::Exception)
390 {
391 
392 }
393 
394 //========================================================================================================================
395 void EventBuilderApp::transitionPausing(toolbox::Event::Reference e)
396 throw (toolbox::fsm::exception::Exception)
397 {
398 
399  for(std::map<int,EventBuilderInterface*>::iterator it=theARTDAQEventBuilderInterfaces_.begin(); it!=theARTDAQEventBuilderInterfaces_.end(); it++)
400  it->second->pause();
401 }
402 
403 //========================================================================================================================
404 void EventBuilderApp::transitionResuming(toolbox::Event::Reference e)
405 throw (toolbox::fsm::exception::Exception)
406 {
407 
408  for(std::map<int,EventBuilderInterface*>::iterator it=theARTDAQEventBuilderInterfaces_.begin(); it!=theARTDAQEventBuilderInterfaces_.end(); it++)
409  it->second->resume();
410 }
411 
412 //========================================================================================================================
413 void EventBuilderApp::transitionStarting(toolbox::Event::Reference e)
414 throw (toolbox::fsm::exception::Exception)
415 {
416 
417  for(std::map<int,EventBuilderInterface*>::iterator it=theARTDAQEventBuilderInterfaces_.begin(); it!=theARTDAQEventBuilderInterfaces_.end(); it++)
418  it->second->start(SOAPUtilities::translate(theStateMachine_.getCurrentMessage()).getParameters().getValue("RunNumber"));
419 }
420 
421 //========================================================================================================================
422 void EventBuilderApp::transitionStopping(toolbox::Event::Reference e)
423 throw (toolbox::fsm::exception::Exception)
424 {
425 
426  for(std::map<int,EventBuilderInterface*>::iterator it=theARTDAQEventBuilderInterfaces_.begin(); it!=theARTDAQEventBuilderInterfaces_.end(); it++)
427  it->second->stop();
428 
429  for(std::map<int,EventBuilderInterface*>::iterator it=theARTDAQEventBuilderInterfaces_.begin(); it!=theARTDAQEventBuilderInterfaces_.end(); it++)
430  it->second->halt();
431 }