Commit 7fb7c2d4 authored by Riccardo Longo's avatar Riccardo Longo
Browse files

Detectors vector added to data reader. It's loaded while reading the config.xml

parent 00ffa8ae
......@@ -21,6 +21,7 @@
#include "XMLSettingsReader.h"
#include "Containers.h"
#include "Detector.h"
#include <TChain.h>
......@@ -42,7 +43,7 @@ class DataReader{
void ReadListOfFiles( std::string listname );
std::vector< Channel* > LoadConfigurationFile(std::string _inFile);
void LoadConfigurationFile(std::string _inFile);
void Run();
......@@ -78,6 +79,9 @@ class DataReader{
//TChain to accomodate many files (in case of a list of files)
TChain* m_fileChain;
//Vector of detectors placed in the 2018 setup (2 ZDCs, 1 RPD)
std::vector < Detector* > m_detectors;
//XML parser
XMLSettingsReader *m_XMLparser;
};
......
......@@ -105,7 +105,7 @@ void DataReader::ReadListOfFiles( std::string listname ){
m_fListOfFiles = listname;
}
std::vector < Channel* > DataReader::LoadConfigurationFile(std::string _inFile = "$JCaPA/Utils/ConfigFile2018.xml"){
void DataReader::LoadConfigurationFile(std::string _inFile = "$JCaPA/Utils/ConfigFile2018.xml"){
//Temporary implementation - objects will be just created within this method and loaded here.
//TODO: incorporate them in a data-member or better in a ZDC and RPD objects inheriting from a Detector class and return them
......@@ -113,7 +113,7 @@ std::vector < Channel* > DataReader::LoadConfigurationFile(std::string _inFile =
if (!m_XMLparser->parseFile(_inFile)) {
std::cerr << " Data Reader could not parse file : " << _inFile << std::endl;
return {};
return;
}
std::cout << "Loading .xml Configuration File..." << std::endl;
......@@ -146,8 +146,15 @@ std::vector < Channel* > DataReader::LoadConfigurationFile(std::string _inFile =
std::cout << "Loaded " << channelEntries.size() << " configuration entries " << std::endl;
if( channelEntries.size() < 18 ) std::cout << "WARNING!!!! Number of Channels < 18. Seems that some entry is missed for this run in the config.xml. BE CAREFUL!" << std::endl;
return channelEntries;
ZDC* zdc1 = new ZDC(channelEntries,1);
ZDC* zdc2 = new ZDC(channelEntries,2);
RPD* rpd = new RPD(channelEntries);
m_detectors.push_back(zdc1);
m_detectors.push_back(zdc2);
m_detectors.push_back(rpd);
std::cout << "Detector configuration: loading complete! " << std::endl;
return;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment