Skip to content
Snippets Groups Projects
Commit 41d2c558 authored by Stephen A. Wood's avatar Stephen A. Wood
Browse files

Fix up problems in map file detector ID parsing

parent af6fa628
Branches
Tags
No related merge requests found
......@@ -236,12 +236,19 @@ void THcDetectorMap::Load(const char *fname)
}
line.erase(0,1); // Erase "!"
if(! ((pos=line.find("_ID=")) == string::npos)) {
Int_t llen = line.length();
fIDMap[fNIDs].name = new char [pos+1];
strncpy(fIDMap[fNIDs].name,line.c_str(),pos);
fIDMap[fNIDs].name[pos] = '\0';
start = (pos += 4); // Move to after "="
while(isdigit(line.at(pos++)));
fIDMap[fNIDs++].id = atoi(line.substr(start,pos).c_str());
while(pos < llen) {
if(isdigit(line.at(pos))) {
pos++;
} else {
break;
}
}
fIDMap[fNIDs++].id = atoi(line.substr(start,pos-start).c_str());
}
continue;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment