28 std::vector<const TreeAccessor*>
accessors;
32 cout <<
"Skipping invalid file " <<
fileName << endl;
47 cout <<
"file " <<
fileList <<
" not accessible" << endl;
54 std::vector<const TreeAccessor*>
accessors;
59 cout <<
"Skipping invalid file " <<
fileName << endl;
62 cout << std::setw(2) << ++
i <<
" - " <<
fileName << endl;
77 std::vector<const TreeAccessor*>
accessors;
83 cout <<
"Skipping invalid file " <<
fileName << endl;
86 cout << std::setw(2) <<
i+1 <<
" - " <<
fileName <<
" , nEvents = " <<
accessor->nEvents() <<
", nRuns = " <<
accessor->nRuns() << endl;
95 MultiTreeAccessor::~MultiTreeAccessor()
102 const EventData* MultiTreeAccessor::eventData(
unsigned int i)
const
104 unsigned int nEventsSoFar = 0;
107 if (
i < nEventsSoFar +
n)
return accessor->eventData(
i - nEventsSoFar);
114 const RunData* MultiTreeAccessor::runData(
unsigned int i)
const
116 unsigned int nRunsSoFar = 0;
119 if (
i < nRunsSoFar +
n)
return accessor->runData(
i - nRunsSoFar);
135 unsigned int MultiTreeAccessor::nRuns()
const
144 unsigned int MultiTreeAccessor::historySize(
unsigned int i)
const
147 unsigned int size = 0;
156 const History* MultiTreeAccessor::getCellHistory(
unsigned int i)
const
159 std::vector<const Data*> allData;
160 std::vector<const EventData*> allEventData;
163 if (!thisHistory)
continue;
167 const std::vector<const EventData*>& thisEventData = thisHistory->
eventData();
168 std::map<const EventData*, const EventData*> eventMap;
170 if (eventMap.find(
event) != eventMap.end())
continue;
172 eventMap[
event] = newED;
173 allEventData.push_back(newED);
176 for (
unsigned int i = 0;
i < thisHistory->
nData();
i++) {
186 auto *
h = cellInfo ?
new History(allData, *cellInfo, allEventData,
i):
nullptr;
192 const CellInfo* MultiTreeAccessor::getCellInfo(
unsigned int i)
const
206 for (
unsigned int i = 0;
i < m_accessors.size();
i++)
208 cout <<
"Merging data..." << endl;
210 if (!singleContainer)
return false;
211 delete singleContainer;
218 std::vector< std::vector<const TreeAccessor*> > filteredAccessors(filterList.
size());
220 for (
unsigned int i = 0;
i < nAccessors();
i++) {
222 cout <<
"Processing data " <<
i <<
" of " << nAccessors();
223 if (treeAcc) cout <<
" (fileName = " << treeAcc->
fileName() <<
")";
227 for (
unsigned int f = 0;
f < filterList.
size();
f++) {
228 std::string pathname = (string)filterList.
fileName(
f);
229 if( pathname.find(
"eos/atlas/") < pathname.length() ){
230 int nslashes = 0, slpos = 0;
231 for(
int k1 = 0; k1 < (
int)pathname.length(); k1++ ){
232 if( nslashes > 2 )
break;
233 if( pathname[k1] !=
'/' )
continue;
237 pathname.resize( slpos );
239 TString thisFN = Form(
"%s_filter%d.root", pathname.c_str(),
i );
243 if (filteredTreeAccs.size() != filterList.
size()) {
244 cout <<
"Filtering failed, exiting" << endl;
245 return std::vector<MultiTreeAccessor*>();
247 for (
unsigned int f = 0;
f < filteredTreeAccs.size();
f++) filteredAccessors[
f].push_back(filteredTreeAccs[
f]);
250 std::vector<MultiTreeAccessor*>
result;