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