|
ATLAS Offline Software
|
#include <PersistentAccessor.h>
Definition at line 24 of file PersistentAccessor.h.
◆ PersistentAccessor() [1/3]
PersistentAccessor::PersistentAccessor |
( |
TTree & |
cellTree, |
|
|
TTree & |
eventTree, |
|
|
TTree * |
runTree, |
|
|
TFile * |
file |
|
) |
| |
Constructor
Definition at line 26 of file PersistentAccessor.cxx.
35 cout <<
"WARNING: could not load all the baskets of the event tree into memory -- processing will be very slow." << endl;
36 cout <<
"Please check if the file you are loading is too large or corrupted." << endl;
◆ PersistentAccessor() [2/3]
PersistentAccessor::PersistentAccessor |
( |
const TString & |
fileName | ) |
|
◆ PersistentAccessor() [3/3]
◆ ~PersistentAccessor()
PersistentAccessor::~PersistentAccessor |
( |
| ) |
|
|
virtual |
◆ add()
◆ addEvent()
void PersistentAccessor::addEvent |
( |
EventData * |
eventData | ) |
|
◆ addRun()
void PersistentAccessor::addRun |
( |
RunData * |
runData | ) |
|
◆ cellTree()
const TTree& LArSamples::PersistentAccessor::cellTree |
( |
| ) |
const |
|
inline |
◆ currentContainer()
◆ eventData()
const EventData * PersistentAccessor::eventData |
( |
unsigned int |
i | ) |
const |
◆ eventTree()
const TTree& LArSamples::PersistentAccessor::eventTree |
( |
| ) |
const |
|
inline |
◆ file()
TFile* LArSamples::PersistentAccessor::file |
( |
| ) |
const |
|
inline |
◆ fileName()
TString PersistentAccessor::fileName |
( |
| ) |
const |
◆ getCellEntry()
int LArSamples::PersistentAccessor::getCellEntry |
( |
unsigned int |
i | ) |
const |
|
inline |
◆ historyContainer()
◆ historySize()
unsigned int PersistentAccessor::historySize |
( |
unsigned int |
i | ) |
const |
◆ merge() [1/2]
Definition at line 181 of file PersistentAccessor.cxx.
185 unsigned int size = 0;
188 int evtIndex = 0, runIndex = 0;
189 std::map<std::pair<int, int>,
int> evtMap;
190 std::map<int, int> runMap;
191 std::map< std::pair<const PersistentAccessor*, int>,
int > evtAccMap;
193 cout <<
"Merging runs" << endl;
196 cout <<
"Cannot merge: one of the inputs is null!" << endl;
200 for (
unsigned int i = 0;
i <
accessor->nRuns();
i++) {
202 if (runMap.find(
run) != runMap.end())
continue;
203 runMap[
run] = runIndex;
211 cout <<
"Merging events" << endl;
212 unsigned int nEventsTotal = 0, iEvt = 0;
214 nEventsTotal +=
accessor->nEvents();
217 for (
unsigned int i = 0;
i <
accessor->nEvents();
i++) {
219 if (iEvt % 100000 == 0) cout <<
"Merging event " << iEvt <<
"/" << nEventsTotal << endl;
220 std::pair<int, int> evtId(
accessor->eventData(
i)->run(),
accessor->eventData(
i)->event());
221 std::pair<const PersistentAccessor*, int> evtAccId(
accessor,
i);
222 if (evtMap.find(evtId) != evtMap.end()) {
223 cout <<
"ERROR: Skipping duplicate entry for run " <<
accessor->eventData(
i)->run() <<
", event " <<
accessor->eventData(
i)->event() << endl;
226 evtAccMap[evtAccId] = evtIndex;
227 evtMap[evtId] = evtIndex;
228 std::map<int, int>::const_iterator
idx = runMap.find(
accessor->eventData(
i)->run());
229 int newRunIndex = (
idx == runMap.end() ? -999 :
idx->second);
239 if (
i % 10000 == 0) {
246 if (!history || !history->
isValid())
continue;
253 std::map<std::pair<const PersistentAccessor*, int>,
int>::const_iterator newIndex
255 if (newIndex == evtAccMap.end()) cout <<
"Event not found for cell " <<
i <<
", data " << j <<
"." << endl;
256 newDC->
setEventIndex(newIndex != evtAccMap.end() ? newIndex->second : -1);
257 newHistory->
add(newDC);
261 cout <<
"Shape not filled for hash = " <<
i <<
", index = " << j <<
", gain = " << history->
dataContainer(j)->
gain() << endl;
267 newAcc->
add(newHistory);
271 cout <<
"Merging done, final size = " <<
size << endl;
◆ merge() [2/2]
◆ nEvents()
unsigned int LArSamples::PersistentAccessor::nEvents |
( |
| ) |
const |
|
inline |
◆ nRuns()
unsigned int LArSamples::PersistentAccessor::nRuns |
( |
| ) |
const |
|
inline |
◆ open()
◆ operator=()
◆ runData()
const RunData * PersistentAccessor::runData |
( |
unsigned int |
i | ) |
const |
◆ runTree()
const TTree& LArSamples::PersistentAccessor::runTree |
( |
| ) |
const |
|
inline |
◆ save()
bool PersistentAccessor::save |
( |
| ) |
const |
Definition at line 165 of file PersistentAccessor.cxx.
169 cout <<
"Writing " <<
m_runTree->GetEntries() <<
" run(s)..." << endl;
171 cout <<
"Writing " <<
m_eventTree->GetEntries() <<
" event(s)..." << endl;
173 cout <<
"Writing " <<
m_cellTree->GetEntries() <<
" cell(s)..." << endl;
176 cout <<
"Writing done!" << endl;
◆ m_cellTree
TTree* LArSamples::PersistentAccessor::m_cellTree |
|
private |
◆ m_eventData
EventData* LArSamples::PersistentAccessor::m_eventData |
|
mutableprivate |
◆ m_eventTree
TTree * LArSamples::PersistentAccessor::m_eventTree |
|
private |
◆ m_file
TFile* LArSamples::PersistentAccessor::m_file |
|
mutableprivate |
◆ m_historyCont
◆ m_runCache
std::map<unsigned int, const RunData*> LArSamples::PersistentAccessor::m_runCache |
|
mutableprivate |
◆ m_runData
RunData* LArSamples::PersistentAccessor::m_runData |
|
mutableprivate |
◆ m_runTree
TTree * LArSamples::PersistentAccessor::m_runTree |
|
private |
The documentation for this class was generated from the following files:
JetConstituentVector::iterator iterator
void setRunData(const RunData *runData)
CaloGain::CaloGain gain() const
const RunData * runData(unsigned int i) const
const DataContainer * dataContainer(unsigned int i) const
int run(int argc, char *argv[])
const TTree & runTree() const
const EventData * eventData(unsigned int i) const
void addEvent(EventData *eventData)
void add(HistoryContainer *cont)
PersistentAccessor(TTree &cellTree, TTree &eventTree, TTree *runTree, TFile *file)
Constructor
static const unsigned int nChannels
unsigned int nEvents() const
const ShapeInfo * shape(CaloGain::CaloGain gain) const
void decrementInstanceCount() const
InDet::SiSpacePointsSeedMakerEventData EventData
HistoryContainer * m_historyCont
static PersistentAccessor * open(const TString &fileName)
unsigned int nRuns() const
const TTree & cellTree() const
void incrementInstanceCount() const
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
const CellInfo * cellInfo() const
void add(const DataContainer *data)
append data (takes ownership)
const TTree & eventTree() const
void addRun(RunData *runData)
std::map< unsigned int, const RunData * > m_runCache
const HistoryContainer * historyContainer(unsigned int i) const
static PersistentAccessor * merge(const std::vector< const PersistentAccessor * > &accessors, const TString &fileName)
void setEventIndex(int index)
unsigned int nDataContainers() const