ATLAS Offline Software
TreeAccessor.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include "LArSamplesMon/Data.h"
8 #include "LArCafJobs/EventData.h"
9 #include "LArCafJobs/RunData.h"
13 #include "TObjString.h"
14 #include "TFile.h"
15 #include "TTree.h"
16 #include "TSystem.h"
17 #include "TString.h"
18 #include <iostream>
19 #include <fstream>
20 #include <iomanip>
21 
22 using std::cout;
23 using std::endl;
24 
25 using namespace LArSamples;
26 
27 
29 {
30  TFile* file = TFile::Open(fileName);
31  if (!file) return nullptr;
32  if (!file->IsOpen()) { delete file; return nullptr; }
33  TTree* cellTree = (TTree*)file->Get("cells");
34  if (!cellTree) return nullptr;
35  TTree* eventTree = (TTree*)file->Get("events");
36  if (!eventTree) return nullptr;
37  TTree* runTree = (TTree*)file->Get("runs");
39  return accessor;
40 }
41 
42 
43 const CellInfo* TreeAccessor::getCellInfo(unsigned int i) const
44 {
45  const HistoryContainer* cont = historyContainer(i);
46  if (!cont || !cont->cellInfo()) return nullptr;
47  return new CellInfo(*cont->cellInfo());
48 }
49 
50 
51 const History* TreeAccessor::getCellHistory(unsigned int i) const
52 {
53  //cout << "A" << endl;
54  if (i >= cellTree().GetEntries()) return nullptr;
55  //cout << "---> TTree::GetEntry " << i << endl;
56  getCellEntry(i);
57  //cout << "---> done TTree::GetEntry" << endl;
58 
59  //cout << "B " << currentContainer()->nDataContainers() << endl;
60  std::vector<const EventData*> eventDatas;
61 
62  for (unsigned int k = 0; k < currentContainer()->nDataContainers(); k++) {
63  const EventData* evtData = eventData(currentContainer()->dataContainer(k)->eventIndex());
64  EventData* newEvtData = (evtData ? new EventData(*evtData) : nullptr);
65  eventDatas.push_back(newEvtData);
66  }
67  //cout << "C" << endl;
68  //cout << "---> TreeAcc : make new hist" << endl;
69  return (currentContainer()->cellInfo() ? new History(*currentContainer(), eventDatas, i) : nullptr);
70 }
71 
72 
73 TreeAccessor* TreeAccessor::merge(const std::vector<const Accessor*>& accessors,
74  const TString& fileName)
75 {
76  cout << "Merging to " << fileName << endl;
77  TreeAccessor* newAcc = new TreeAccessor(fileName);
78  unsigned int size = 0;
79  CellInfo* info = nullptr;
80 
81  int evtIndex = 0, runIndex = 0;
82  std::map<std::pair<int, int>, int> evtMap;
83  std::map<int, int> runMap;
84 
85  cout << "Merging runs" << endl;
86  for (const Accessor* accessor : accessors) {
87  if (!accessor) {
88  cout << "Cannot merge: one of the inputs is null!" << endl;
89  delete newAcc;
90  return nullptr;
91  }
92  for (unsigned int i = 0; i < accessor->nRuns(); i++) {
93  int run = accessor->runData(i)->run();
94  if (runMap.find(run) != runMap.end()) continue;
95  runMap[run] = runIndex;
96  RunData* newRun = new RunData(*accessor->runData(i));
97  newAcc->addRun(newRun);
98  delete newRun;
99  runIndex++;
100  }
101  }
102 
103  cout << "Merging events" << endl;
104  unsigned int nEventsTotal = 0, iEvt = 0;
105  for (const Accessor* accessor : accessors)
106  nEventsTotal += accessor->nEvents();
107  for (const Accessor* accessor : accessors) {
108  for (unsigned int i = 0; i < accessor->nEvents(); i++) {
109  iEvt++;
110  if (iEvt % 100000 == 0) cout << "Merging event " << iEvt << "/" << nEventsTotal << endl;
111  std::pair<int, int> evtId(accessor->eventData(i)->run(), accessor->eventData(i)->event());
112  if (evtMap.find(evtId) != evtMap.end()) continue;
113  evtMap[evtId] = evtIndex;
114  std::map<int, int>::const_iterator idx = runMap.find(accessor->eventData(i)->run());
115  int newRunIndex = (idx == runMap.end() ? -999 : idx->second);
116  //cout << "Storing eventData for run " << accessor->eventData(i)->run() << " at index " << newRunIndex << " instead of " << accessor->eventData(i)->runIndex() << endl;
117  EventData* newEvent = new EventData(*accessor->eventData(i), newRunIndex);
118  newAcc->addEvent(newEvent);
119  delete newEvent;
120  evtIndex++;
121  }
122  }
123 
124  for (unsigned int i = 0; i < newAcc->nChannels(); i++) {
125  if (i % 10000 == 0) {
126  cout << "Merging channel " << i << "/" << newAcc->nChannels() << " (current size = " << size << ")" << endl;
127  //ClassCounts::printCountsTable();
128  }
130  for (const Accessor* accessor : accessors) {
131  const History* history = accessor->cellHistory(i);
132  if (!history || !history->isValid()) continue;
133  if (!historyContainer) {
134  info = new CellInfo(*history->cellInfo());
136  }
137  for (unsigned int j = 0; j < history->nData(); j++) {
138  DataContainer* newDC = new DataContainer(history->data(j)->container());
139  std::map<std::pair<int, int>, int>::const_iterator newIndex
140  = evtMap.find(std::make_pair(history->data(j)->run(), history->data(j)->event()));
141  if (newIndex == evtMap.end()) cout << "Event not found for cell " << i << ", data " << j << "." << endl;
142  newDC->setEventIndex(newIndex != evtMap.end() ? newIndex->second : -1);
143  historyContainer->add(newDC);
144  if (!info->shape(history->data(j)->gain())) {
145  const ShapeInfo* shape = history->cellInfo()->shape(history->data(j)->gain());
146  if (!shape)
147  cout << "Shape not filled for hash = " << i << ", index = " << j << ", gain = " << Data::gainStr(history->data(j)->gain()) << endl;
148  info->setShape(history->data(j)->gain(), (shape ? new ShapeInfo(*shape) : nullptr));
149  }
150  }
151  }
153  newAcc->add(historyContainer);
154  delete historyContainer;
155  }
156 
157  cout << "Merging done, final size = " << size << endl;
158  newAcc->save();
159  return newAcc;
160 }
161 
162 
163 TreeAccessor* TreeAccessor::merge(const std::vector<const Accessor*>& accessors,const TString& fileName,const TString& LBFile)
164 {
165  // O.Simard - 01.07.2011
166  // Alternative version with LB cleaning.
167 
168  bool kBadLB=false;
169  std::vector<unsigned int> LBList;
170  std::ifstream infile(LBFile.Data());
171  std::string line;
172  // assume single-line format with coma-separated LBs (from python)
173  std::getline(infile,line,'\n');
174  TString filter(line.c_str());
175  TObjArray* list = filter.Tokenize(", "); // coma\space delimiters
176  if(list->GetEntries() == 0){
177  printf("No LB filtering specified, or bad format. Exiting.\n");
178  delete list;
179  return nullptr;
180  }
181 
182  for(int k = 0; k < list->GetEntries(); k++){
183  TObjString* tobs = (TObjString*)(list->At(k));
184  LBList.push_back((unsigned int)(tobs->String()).Atoi());
185  }
186  delete list;
187  printf("LB List: %d\n",(int)LBList.size());
188 
189 
190  // from here it is similar to other functions of this class
191  TreeAccessor* newAcc = new TreeAccessor(fileName);
192  unsigned int size = 0;
193  CellInfo* info = nullptr;
194 
195  int evtIndex = 0, runIndex = 0;
196  std::map<std::pair<int, int>, int> evtMap;
197  std::map<int, int> runMap;
198 
199  cout << "Merging runs" << endl;
200  for (const Accessor* accessor : accessors) {
201  if (!accessor) {
202  cout << "Cannot merge: one of the inputs is null!" << endl;
203  delete newAcc;
204  return nullptr;
205  }
206  for (unsigned int i = 0; i < accessor->nRuns(); i++) {
207  int run = accessor->runData(i)->run();
208  if (runMap.find(run) != runMap.end()) continue;
209  runMap[run] = runIndex;
210  RunData* newRun = new RunData(*accessor->runData(i));
211  newAcc->addRun(newRun);
212  delete newRun;
213  runIndex++;
214  }
215  }
216 
217  cout << "Merging events" << endl;
218  unsigned int nEventsTotal = 0, iEvt = 0;
219  for (const Accessor* accessor : accessors)
220  nEventsTotal += accessor->nEvents();
221  for (const Accessor* accessor : accessors) {
222  for (unsigned int i = 0; i < accessor->nEvents(); i++) {
223  iEvt++;
224  if (iEvt % 100000 == 0) cout << "Merging event " << iEvt << "/" << nEventsTotal << endl;
225 
226  // ----
227  // skip LBs which are found in the list
228  kBadLB=false;
229  for(unsigned int ilb = 0 ; ilb < LBList.size() ; ilb++){
230  if(LBList.at(ilb)==accessor->eventData(i)->lumiBlock()){
231  kBadLB=true;
232  //printf(" == Rejecting Event in LB %4d\n",accessor->eventData(i)->lumiBlock());
233  break;
234  }
235  }
236  if(kBadLB) continue;
237  // ----
238 
239  std::pair<int, int> evtId(accessor->eventData(i)->run(), accessor->eventData(i)->event());
240  if (evtMap.find(evtId) != evtMap.end()) continue;
241  evtMap[evtId] = evtIndex;
242  std::map<int, int>::const_iterator idx = runMap.find(accessor->eventData(i)->run());
243  int newRunIndex = (idx == runMap.end() ? -999 : idx->second);
244  EventData* newEvent = new EventData(*accessor->eventData(i), newRunIndex);
245  newAcc->addEvent(newEvent);
246  delete newEvent;
247  evtIndex++;
248  }
249  }
250 
251  for (unsigned int i = 0; i < newAcc->nChannels(); i++) {
252  if (i % 10000 == 0) {
253  cout << "Merging channel " << i << "/" << newAcc->nChannels() << " (current size = " << size << ")" << endl;
254  //ClassCounts::printCountsTable();
255  }
257  for (const Accessor* accessor : accessors) {
258  const History* history = accessor->cellHistory(i);
259  if (!history || !history->isValid()) continue;
260  if (!historyContainer) {
261  info = new CellInfo(*history->cellInfo());
263  }
264  for (unsigned int j = 0; j < history->nData(); j++) {
265  DataContainer* newDC = new DataContainer(history->data(j)->container());
266  std::map<std::pair<int, int>, int>::const_iterator newIndex
267  = evtMap.find(std::make_pair(history->data(j)->run(), history->data(j)->event()));
268  //if (newIndex == evtMap.end()) cout << "Event not found for cell " << i << ", data " << j << "." << endl;
269  newDC->setEventIndex(newIndex != evtMap.end() ? newIndex->second : -1);
270  historyContainer->add(newDC);
271  if (!info->shape(history->data(j)->gain())) {
272  const ShapeInfo* shape = history->cellInfo()->shape(history->data(j)->gain());
273  if (!shape)
274  cout << "Shape not filled for hash = " << i << ", index = " << j << ", gain = " << Data::gainStr(history->data(j)->gain()) << endl;
275  info->setShape(history->data(j)->gain(), (shape ? new ShapeInfo(*shape) : nullptr));
276  }
277  }
278  }
279  if(historyContainer){
281  }
282  newAcc->add(historyContainer);
283  delete historyContainer;
284  historyContainer=nullptr;
285  //}
286  }
287 
288  cout << "Merging done, final size = " << size << endl;
289  newAcc->save();
290  return newAcc;
291 }
292 
293 
295  const FilterParams& filterParams,
296  const TString& fileName,
297  const DataTweaker& tweaker)
298 {
299  FilterList filterList; filterList.add(filterParams, fileName);
300  std::vector<TreeAccessor*> result = filter(accessor, filterList, tweaker);
301  return (!result.empty() ? result[0] : nullptr);
302 }
303 
304 std::vector<TreeAccessor*>
306  const FilterList& filterList,
307  const DataTweaker& tweaker)
308 {
309  if (filterList.size() == 0) {
310  cout << "No filter categories specified, done! (?)" << endl;
311  return std::vector<TreeAccessor*>();
312  }
313 
314  for (unsigned int f = 0; f < filterList.size(); f++) {
315  cout << "Skimming to " << filterList.fileName(f) << endl;
316  if (!gSystem->AccessPathName(filterList.fileName(f))) {
317  cout << "File already exists, exiting." << endl;
318  return std::vector<TreeAccessor*>();
319  }
320  }
321 
322  std::vector<TreeAccessor*> newAccessors;
323  for (unsigned int f = 0; f < filterList.size(); f++)
324  newAccessors.push_back(new TreeAccessor(filterList.fileName(f)));
325  std::map<std::pair<unsigned int, unsigned int>, unsigned int> eventIndices;
326  std::vector< std::map<unsigned int, unsigned int> > eventsToKeep(filterList.size());
327  std::vector< std::map<unsigned int, unsigned int> > runsToKeep(filterList.size());
328 
329  double nTot = 0, nPass = 0;
330 
331  for (unsigned int i = 0; i < accessor.nEvents(); i++) {
332  const EventData* eventData = accessor.eventData(i);
333  eventIndices[std::pair<unsigned int, unsigned int>(eventData->run(), eventData->event())] = i;
334  }
335 
336  for (unsigned int i = 0; i < accessor.nChannels(); i++) {
337  if (i % 25000 == 0) {
338  cout << "Filtering " << i << "/" << accessor.nChannels()
339  << " (passing so far = " << nPass << ", total seen = " << nTot << ")" << endl;
340  //ClassCounts::printCountsTable();
341  }
342  bool first = true;
343 
344  const History* history = nullptr;
345  for (unsigned int f = 0; f < filterList.size(); f++) {
346  history = accessor.pass(i, filterList.filterParams(f));
347  if (history) break;
348  }
349  for (unsigned int f = 0; f < filterList.size(); f++) {
350  if (!history || !history->cellInfo() || !filterList.filterParams(f).passCell(*history->cellInfo())) {
352  newAccessors[f]->add(newHist);
353  delete newHist;
354  continue;
355  }
356  if (first) { nTot += history->nData(); first = false; }
357  HistoryContainer* newHist = new HistoryContainer(new CellInfo(*history->cellInfo()));
358  for (unsigned int k = 0; k < history->nData(); k++) {
359  if (!filterList.filterParams(f).passEvent(*history->data(k))) continue;
360  const EventData* eventData = history->data(k)->eventData();
361  std::map<std::pair<unsigned int, unsigned int>, unsigned int>::const_iterator findIndex =
362  eventIndices.find(std::pair<unsigned int, unsigned int>(eventData->run(), eventData->event()));
363  if (findIndex == eventIndices.end()) {
364  cout << "Inconsistent event numbering!!!" << endl;
365  delete newHist;
366  return std::vector<TreeAccessor*>();
367  }
368  int oldEvtIndex = findIndex->second;
369  bool isNewEvt = (eventsToKeep[f].find(oldEvtIndex) == eventsToKeep[f].end());
370  unsigned int newEvtIndex = (isNewEvt ? eventsToKeep[f].size() : eventsToKeep[f][oldEvtIndex]);
371  if (isNewEvt) eventsToKeep[f][oldEvtIndex] = newEvtIndex;
372 
373  int oldRunIndex = history->data(k)->eventData()->runIndex();
374  bool isNewRun = (runsToKeep[f].find(oldRunIndex) == runsToKeep[f].end());
375  unsigned int newRunIndex = (isNewRun ? runsToKeep[f].size() : runsToKeep[f][oldRunIndex]);
376  if (isNewRun) runsToKeep[f][oldRunIndex] = newRunIndex;
377 
378  Data* newData = tweaker.tweak(*history->data(k), newEvtIndex);
379  if (!newData) {
380  cout << "Filtering failed on data " << k << " of cell " << i << ", aborting" << endl;
381  delete newHist;
382  for (unsigned int f = 0; f < filterList.size(); f++) delete newAccessors[f];
383  return std::vector<TreeAccessor*>();
384  }
385  nPass++;
386  newHist->add(newData->dissolve());
387  }
388  newAccessors[f]->add(newHist);
389  delete newHist;
390  }
391  }
392 
393  for (unsigned int f = 0; f < filterList.size(); f++) {
394  cout << "Adding runs..." << endl;
395  std::vector<unsigned int> runsToKeep_ordered(runsToKeep[f].size());
396  for (const auto& runIndex : runsToKeep[f])
397  runsToKeep_ordered[runIndex.second] = runIndex.first;
398 
399  for (unsigned int runIndex : runsToKeep_ordered) {
400  RunData* newRun = new RunData(*accessor.runData(runIndex));
401  newAccessors[f]->addRun(newRun);
402  delete newRun;
403  }
404  cout << "Adding events..." << endl;
405  std::vector<unsigned int> eventsToKeep_ordered(eventsToKeep[f].size());
406  for (const auto& eventIndex : eventsToKeep[f])
407  eventsToKeep_ordered[eventIndex.second] = eventIndex.first;
408 
409  for (unsigned int eventIndex : eventsToKeep_ordered) {
410  std::map<unsigned int, unsigned int>::const_iterator idx = runsToKeep[f].find(accessor.eventData(eventIndex)->runIndex());
411  int newRunIndex = (idx == runsToKeep[f].end() ? 0 : idx->second);
412  EventData* newEvent = tweaker.tweak(*accessor.eventData(eventIndex), newRunIndex);
413  newAccessors[f]->addEvent(newEvent);
414  delete newEvent;
415  }
416  }
417  cout << "Filtering done! final size = " << nPass << endl;
418  //ClassCounts::printCountsTable();
419  for (unsigned int f = 0; f < filterList.size(); f++) {
420  cout << "Saving " << newAccessors[f]->fileName() << endl;
421  newAccessors[f]->save();
422  }
423  return newAccessors;
424 }
425 
426 
428 {
429  TreeAccessor* newAccessor = new TreeAccessor(fileName);
430 
431  std::vector<short> samples(5, 0);
432  std::vector<float> autoCorrs(4, 0);
433 
434  RunData* dummyRun = new RunData(0);
435  newAccessor->addRun(dummyRun);
436  delete dummyRun;
437 
438  EventData* dummyEvent = new EventData(0, 0, 0, 0);
439  newAccessor->addEvent(dummyEvent);
440  delete dummyEvent;
441 
442  for (unsigned int i = 0; i < accessor.nChannels(); i++) {
443  if (i % 25000 == 0)
444  cout << "Templating " << i << "/" << accessor.nChannels() << endl;
445  const History* history = accessor.cellHistory(i);
446  if (!history || !history->cellInfo()) {
448  newAccessor->add(newHist);
449  delete newHist;
450  continue;
451  }
452  HistoryContainer* newHist = new HistoryContainer(new CellInfo(*history->cellInfo()));
453  DataContainer* dataContainer = new DataContainer(CaloGain::LARHIGHGAIN, samples, 0, 0, 0, 0, autoCorrs);
454  newHist->add(dataContainer);
455  newAccessor->add(newHist);
456  delete newHist;
457  }
458 
459  newAccessor->save();
460  return newAccessor;
461 }
462 
463 bool TreeAccessor::writeToFile(const TString& fileName) const
464 {
465  TFile* newFile = new TFile(fileName, "RECREATE");
466  if (newFile && !newFile->IsOpen()) { delete newFile; newFile = nullptr; }
467  if (!newFile) return false;
468 
469  cellTree().Write();
470  eventTree().Write();
471 
472  delete newFile;
473 
474  return true;
475 }
grepfile.info
info
Definition: grepfile.py:38
LArSamples::FilterParams::passCell
bool passCell(const CellInfo &info) const
Definition: FilterParams.cxx:482
RunData.h
LArSamples::FilterParams::passEvent
bool passEvent(const Data &data) const
Definition: FilterParams.cxx:427
checkFileSG.line
line
Definition: checkFileSG.py:75
LArSamples::Data::container
const DataContainer & container() const
Definition: Data.h:161
get_generator_info.result
result
Definition: get_generator_info.py:21
LArSamples::PersistentAccessor::currentContainer
HistoryContainer * currentContainer() const
Definition: PersistentAccessor.h:62
run.infile
string infile
Definition: run.py:13
LArSamples::FilterParams
Definition: FilterParams.h:50
LArSamples::EventData::event
int event() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:44
LArSamples::History::cellInfo
const CellInfo * cellInfo() const
Definition: History.h:61
LArSamples::Accessor
A base class for accessing ntuple data.
Definition: LArCalorimeter/LArSamplesMon/LArSamplesMon/Accessor.h:24
LArSamples::History
Definition: History.h:40
checkCorrelInHIST.ilb
ilb
Definition: checkCorrelInHIST.py:563
ClassCounts.h
LArSamples::FilterList::filterParams
const FilterParams & filterParams(unsigned int i) const
Definition: FilterList.h:30
LArSamples::Data::run
int run() const
Definition: Data.cxx:27
run
int run(int argc, char *argv[])
Definition: ttree2hdf5.cxx:28
LArSamples
Definition: AbsShape.h:24
TreeAccessor.h
LArSamples::EventData::runIndex
int runIndex() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:53
GetEntries
TGraphErrors * GetEntries(TH2F *histo)
Definition: TRTCalib_makeplots.cxx:4019
FilterParams.h
LArSamples::PersistentAccessor::runTree
const TTree & runTree() const
Definition: PersistentAccessor.h:45
LArSamples::ShapeInfo
Definition: ShapeInfo.h:24
LArSamples::PersistentAccessor::addEvent
void addEvent(EventData *eventData)
Definition: PersistentAccessor.cxx:149
LArSamples::TreeAccessor::getCellInfo
const CellInfo * getCellInfo(unsigned int i) const
Definition: TreeAccessor.cxx:43
LArSamples::FilterList::add
void add(const FilterParams &params, const TString &fileName)
Definition: FilterList.h:27
LArSamples::Data::event
int event() const
Definition: Data.cxx:28
DataTweaker.h
LArSamples::PersistentAccessor::file
TFile * file() const
Definition: PersistentAccessor.h:47
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
LArSamples::RunData
Definition: RunData.h:21
LArSamples::History::data
const Data * data(unsigned int i) const
Definition: History.cxx:89
LArSamples::TreeAccessor::getCellHistory
const History * getCellHistory(unsigned int i) const
Definition: TreeAccessor.cxx:51
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
lumiFormat.i
int i
Definition: lumiFormat.py:85
LArSamples::Data::gainStr
static TString gainStr(CaloGain::CaloGain gain)
Definition: Data.cxx:502
LArSamples::CellInfo::shape
const ShapeInfo * shape(CaloGain::CaloGain gain) const
Definition: CellInfo.cxx:78
MakeNewFileFromOldAndSubstitution.newHist
dictionary newHist
Definition: ICHEP2016/MakeNewFileFromOldAndSubstitution.py:96
LArSamples::TreeAccessor::makeTemplate
static TreeAccessor * makeTemplate(const Accessor &accessor, const TString &fileName)
Definition: TreeAccessor.cxx:427
LArSamples::EventData::run
int run() const
Definition: EventData.cxx:59
hist_file_dump.f
f
Definition: hist_file_dump.py:135
ITk::EventData
InDet::SiSpacePointsSeedMakerEventData EventData
Definition: ITkSiSpacePointsSeedMaker.h:63
run
Definition: run.py:1
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
LArSamples::DataTweaker
Definition: DataTweaker.h:23
LArSamples::History::nData
unsigned int nData() const
Definition: History.h:56
LArSamples::TreeAccessor::merge
static TreeAccessor * merge(const std::vector< const Accessor * > &accessors, const TString &fileName="")
Definition: TreeAccessor.cxx:73
EventData.h
LArSamples::TreeAccessor::eventData
const EventData * eventData(unsigned int i) const
Definition: TreeAccessor.h:64
LArSamples::FilterList
Definition: FilterList.h:21
LArSamples::DataTweaker::tweak
Data * tweak(const Data &data, int evtIndex=-1) const
Definition: DataTweaker.cxx:47
LArSamples::PersistentAccessor::getCellEntry
int getCellEntry(unsigned int i) const
Definition: PersistentAccessor.h:67
LArSamples::PersistentAccessor::cellTree
const TTree & cellTree() const
Definition: PersistentAccessor.h:43
LArSamples::Data
Definition: Data.h:77
LArSamples::FilterList::fileName
const TString & fileName(unsigned int i) const
Definition: FilterList.h:31
LArSamples::TreeAccessor::TreeAccessor
TreeAccessor(TTree &cellTree, TTree &eventTree, TTree *runTree, TFile *file)
Constructor
Definition: TreeAccessor.h:37
LArSamples::Data::dissolve
const DataContainer * dissolve()
Definition: Data.cxx:56
LArSamples::Data::gain
CaloGain::CaloGain gain() const
Definition: Data.h:90
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
LArSamples::CellInfo
Definition: CellInfo.h:31
xAOD::JetAttributeAccessor::accessor
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
Definition: JetAccessorMap.h:26
LArSamples::HistoryContainer::cellInfo
const CellInfo * cellInfo() const
Definition: HistoryContainer.h:43
LArSamples::PersistentAccessor::save
bool save() const
Definition: PersistentAccessor.cxx:165
LArSamples::TreeAccessor::filter
static TreeAccessor * filter(const Accessor &accessor, const FilterParams &filterParams, const TString &fileName, const DataTweaker &tweaker)
Definition: TreeAccessor.cxx:294
LArSamples::DataContainer
Definition: DataContainer.h:25
LArSamples::HistoryContainer
Definition: HistoryContainer.h:29
LArSamples::HistoryContainer::add
void add(const DataContainer *data)
append data (takes ownership)
Definition: HistoryContainer.h:46
DeMoScan.first
bool first
Definition: DeMoScan.py:536
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
LArSamples::PersistentAccessor::eventTree
const TTree & eventTree() const
Definition: PersistentAccessor.h:44
LArSamples::TreeAccessor::writeToFile
bool writeToFile(const TString &fileName) const
Definition: TreeAccessor.cxx:463
Data.h
xAODRootTest.accessors
dictionary accessors
Definition: xAODRootTest.py:73
LArSamples::PersistentAccessor::addRun
void addRun(RunData *runData)
Definition: PersistentAccessor.cxx:157
LArSamples::TreeAccessor::add
void add(HistoryContainer *cont)
Definition: TreeAccessor.h:69
LArSamples::PersistentAccessor::historyContainer
const HistoryContainer * historyContainer(unsigned int i) const
Definition: PersistentAccessor.cxx:99
LArSamples::Data::eventData
const EventData * eventData() const
Definition: Data.h:100
LArSamples::History::isValid
bool isValid() const
Definition: History.cxx:150
LArSamples::TreeAccessor
Definition: TreeAccessor.h:32
LArSamples::FilterList::size
unsigned int size() const
Definition: FilterList.h:29
LArSamples::EventData
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:29
LArSamples::PersistentAccessor::fileName
TString fileName() const
Definition: PersistentAccessor.cxx:135
LArSamples::DataContainer::setEventIndex
void setEventIndex(int index)
Definition: DataContainer.h:92
LArSamples::AbsLArCells::nChannels
virtual unsigned int nChannels() const
Definition: AbsLArCells.h:34
fitman.k
k
Definition: fitman.py:528
LArSamples::TreeAccessor::open
static TreeAccessor * open(const TString &fileName)
Definition: TreeAccessor.cxx:28
LArSamples::HistoryContainer::nDataContainers
unsigned int nDataContainers() const
Definition: HistoryContainer.h:40
EventInfoCnvParams::eventIndex
thread_local event_number_t eventIndex
Definition: IEvtIdModifierSvc.h:34