ATLAS Offline Software
Loading...
Searching...
No Matches
PersistentAccessor.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
9
10#ifndef LArSamples_PersistentAccessor_H
11#define LArSamples_PersistentAccessor_H
12
13#include "LArCafJobs/CellInfo.h"
16#include "LArCafJobs/RunData.h"
17#include "TString.h"
18#include "TTree.h"
19
20class TFile;
21
22namespace LArSamples {
23
25
26 public:
27
29 PersistentAccessor(TTree& cellTree, TTree& SCTree, TTree& eventTree, TTree* runTree, TFile* file);
30 PersistentAccessor(const TString& fileName);
31
34
35 static PersistentAccessor* open(const TString& fileName);
36
37 virtual ~PersistentAccessor();
38
39 unsigned int historySize(unsigned int i) const;
40 unsigned int historySizeSC(unsigned int i) const;
41
42 bool save() const;
43
44 const TTree& cellTree() const { return *m_cellTree; }
45 const TTree& SCTree() const { return *m_SCTree; }
46 const TTree& eventTree() const { return *m_eventTree; }
47 const TTree& runTree() const { return *m_runTree; }
48
49 TFile* file() const { return m_file; }
50 TString fileName() const;
51
52 const HistoryContainer* historyContainer(unsigned int i) const;
53 const HistoryContainer* historyContainerSC(unsigned int i) const;
54
55 unsigned int nEvents() const { return m_eventTree->GetEntries(); }
56 const EventData* eventData(unsigned int i) const;
57
58 unsigned int nRuns() const { return m_runTree->GetEntries(); }
59 const RunData* runData(unsigned int i) const;
60
61 void add(HistoryContainer* cont);
62 void addSC(HistoryContainer* cont);
63 void addEvent(EventData* eventData);
64 void addRun(RunData* runData);
65
68
69 static PersistentAccessor* merge(const std::vector<const PersistentAccessor*>& accessors, const TString& fileName);
70 static PersistentAccessor* merge(const std::vector<TString>& inputFiles, const TString& fileName);
71
72 int getCellEntry(unsigned int i) const { return m_cellTree->GetEntry(i); }
73 int getSCEntry(unsigned int i) const { return m_SCTree->GetEntry(i); }
74
75 private:
76
78 mutable TFile* m_file;
83 mutable std::map<unsigned int, const RunData*> m_runCache;
84 };
85}
86
87#endif
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
HistoryContainer * currentContainer() const
PersistentAccessor(const PersistentAccessor &)
unsigned int historySizeSC(unsigned int i) const
static PersistentAccessor * open(const TString &fileName)
unsigned int historySize(unsigned int i) const
std::map< unsigned int, const RunData * > m_runCache
HistoryContainer * currentContainerSC() const
int getCellEntry(unsigned int i) const
PersistentAccessor(TTree &cellTree, TTree &SCTree, TTree &eventTree, TTree *runTree, TFile *file)
Constructor.
int getSCEntry(unsigned int i) const
bool add(const std::string &hname, TKey *tobj)
Definition fastadd.cxx:55
Definition merge.py:1