Skip to content
Snippets Groups Projects
Commit 3527c892 authored by Oliver Kirsebom's avatar Oliver Kirsebom
Browse files

fixed ordering of channels

parent b6ef6971
No related branches found
No related tags found
No related merge requests found
......@@ -55,15 +55,14 @@ int main( int argc, char* argv[] ){
// data readers
vector<shared_ptr<VKRawReader>> readers;
size_t i = 0;
for (auto& in : input) {
if (find(_ignore.begin(), _ignore.end(), i) == _ignore.end()) {
for (size_t i = 0; i < input.size(); i++) {
auto& in = input[i];
if (find(_ignore.begin(), _ignore.end(), chan[i]) == _ignore.end()) {
auto r = make_shared<VKRawReader> (in);
readers.emplace_back(move(r));
}
i++;
}
// sorter
string output = Form("%ssorted/exp/s%04d_00.root", datadir.data(), run);
auto sorter = make_unique<VKSorter>(readers, output, window);
......@@ -206,22 +205,26 @@ void findFiles(int run, vector<string>& input, vector<size_t>& chan)
TString path = datadir + "raw/";
TSystemDirectory dir(path, path);
TList *files = dir.GetListOfFiles();
if (files) {
TSystemFile *file;
TString fname;
TIter next(files);
while ((file = (TSystemFile*)next())) {
fname = file->GetName();
if (!file->IsDirectory()) {
for (size_t c = 0; c < chanCount; c++) {
if (fname.EndsWith(Form("%04d_ch%03lu.txt", run, c))) {
input.push_back(fname.Data());
chan.push_back(c);
}
}
}
}
}
for (size_t c = 0; c < chanCount; c++) {
TString X = Form("%04d_ch%03lu.txt", run, c);
if (files) {
TSystemFile *file;
TString fname;
TIter next(files);
while (file = (TSystemFile*)next()) {
fname = file->GetName();
if (!file->IsDirectory()) {
if (fname.EndsWith(X)) {
input.push_back(fname.Data());
chan.push_back(c);
}
}
}
}
}
for (auto& i : input) i = datadir + "raw/" + i;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment