27 std::vector<const TreeAccessor*>
accessors;
31 cout <<
"Skipping invalid file " <<
fileName << endl;
46 cout <<
"file " <<
fileList <<
" not accessible" << endl;
53 std::vector<const TreeAccessor*>
accessors;
58 cout <<
"Skipping invalid file " <<
fileName << endl;
61 cout << std::setw(2) << ++
i <<
" - " <<
fileName << endl;
76 std::vector<const TreeAccessor*>
accessors;
82 cout <<
"Skipping invalid file " <<
fileName << endl;
85 cout << std::setw(2) <<
i+1 <<
" - " <<
fileName <<
" , nEvents = " <<
accessor->nEvents() <<
", nRuns = " <<
accessor->nRuns() << endl;
94 MultiTreeAccessor::~MultiTreeAccessor()
101 const EventData* MultiTreeAccessor::eventData(
unsigned int i)
const
103 unsigned int nEventsSoFar = 0;
106 if (
i < nEventsSoFar +
n)
return accessor->eventData(
i - nEventsSoFar);
113 const RunData* MultiTreeAccessor::runData(
unsigned int i)
const
115 unsigned int nRunsSoFar = 0;
118 if (
i < nRunsSoFar +
n)
return accessor->runData(
i - nRunsSoFar);
134 unsigned int MultiTreeAccessor::nRuns()
const
143 unsigned int MultiTreeAccessor::historySize(
unsigned int i)
const
146 unsigned int size = 0;
155 const History* MultiTreeAccessor::getCellHistory(
unsigned int i)
const
158 std::vector<const Data*> allData;
159 std::vector<const EventData*> allEventData;
162 if (!thisHistory)
continue;
166 const std::vector<const EventData*>& thisEventData = thisHistory->
eventData();
167 std::map<const EventData*, const EventData*> eventMap;
169 if (eventMap.find(
event) != eventMap.end())
continue;
171 eventMap[
event] = newED;
172 allEventData.push_back(newED);
175 for (
unsigned int i = 0;
i < thisHistory->
nData();
i++) {
185 auto *
h = cellInfo ?
new History(allData, *cellInfo, allEventData,
i):
nullptr;
191 const CellInfo* MultiTreeAccessor::getCellInfo(
unsigned int i)
const
205 for (
unsigned int i = 0;
i < m_accessors.size();
i++)
207 cout <<
"Merging data..." << endl;
209 if (!singleContainer)
return false;
210 delete singleContainer;
217 std::vector< std::vector<const TreeAccessor*> > filteredAccessors(filterList.
size());
219 for (
unsigned int i = 0;
i < nAccessors();
i++) {
221 cout <<
"Processing data " <<
i <<
" of " << nAccessors();
222 if (treeAcc) cout <<
" (fileName = " << treeAcc->
fileName() <<
")";
226 for (
unsigned int f = 0;
f < filterList.
size();
f++) {
227 std::string pathname = (string)filterList.
fileName(
f);
228 if( pathname.find(
"eos/atlas/") < pathname.length() ){
229 int nslashes = 0, slpos = 0;
230 for(
int k1 = 0; k1 < (
int)pathname.length(); k1++ ){
231 if( nslashes > 2 )
break;
232 if( pathname[k1] !=
'/' )
continue;
236 pathname.resize( slpos );
238 TString thisFN = Form(
"%s_filter%d.root", pathname.c_str(),
i );
242 if (filteredTreeAccs.size() != filterList.
size()) {
243 cout <<
"Filtering failed, exiting" << endl;
244 return std::vector<MultiTreeAccessor*>();
246 for (
unsigned int f = 0;
f < filteredTreeAccs.size();
f++) filteredAccessors[
f].push_back(filteredTreeAccs[
f]);
249 std::vector<MultiTreeAccessor*>
result;