otsdaq_components  v2_02_00
DACStream.cc
1 #include "otsdaq-components/DetectorConfiguration/DACStream.h"
2 #include "otsdaq-core/ConfigurationInterface/ConfigurationTree.h"
3 #include "otsdaq-components/DetectorConfiguration/FSSRDACsConfiguration.h"
4 
5 using namespace ots;
6 
7 
8 //==============================================================================
9 DACStream::DACStream(void)
10 {}
11 
12 //==============================================================================
13 DACStream::~DACStream(void)
14 {}
15 
16 //==============================================================================
17 void DACStream::makeStream(const ConfigurationTree& feToDetectorTree)
18 {
19  theChannelStreamMap_.clear();
20  std::multimap<unsigned int, ROCStream>::iterator currentElement;
21  std::string detectorType = "";
22  auto feWriterDetectorList = feToDetectorTree.getChildren();
23 
24  FSSRDACsConfiguration dacsMaker;
25  for(auto& it : feWriterDetectorList)
26  {
27  const ConfigurationTree& detectorConfiguration = it.second.getNode("LinkToDetectorTable");
28  const ConfigurationTree& dacsConfiguration = detectorConfiguration.getNode("LinkToDACsTable");
29  const ConfigurationTree& maskConfiguration = detectorConfiguration.getNode("LinkToMaskTable");
30  //__COUT__ << feToDetectorTree << std::endl;
31  //__COUT__ << detectorConfiguration << std::endl;
32  //__COUT__ << dacsConfiguration << std::endl;
33  //__COUT__ << dacsConfiguration << std::endl;
34  currentElement = theChannelStreamMap_.insert(std::pair<unsigned int, ROCStream>(it.second.getNode("FEWriterChannel").getValue<unsigned int>(),ROCStream()));
35  currentElement->second.setDetectorID (it.first);
36  detectorType = detectorConfiguration.getNode("DetectorType").getValue<std::string>();
37  currentElement->second.setROCType (detectorType);
38  currentElement->second.setROCStatus (detectorConfiguration.getNode(ViewColumnInfo::COL_NAME_STATUS).getValue<bool>());
39  currentElement->second.setFEWROCAddress(it.second.getNode("FEWriterDetectorAddress").getValue<unsigned int>());
40  currentElement->second.setROCDACs (dacsMaker.getROCDACs(dacsConfiguration));
41 // __COUT__ << "MASK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" << std::endl;
42 // __COUT__ << maskConfiguration.getNode("KillMask").getValue<std::string>() << std::endl;
43  currentElement->second.setROCMask (maskConfiguration.getNode("KillMask").getValue<std::string>());
44  }
45 
46 
47 }