Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
#include <PersistentAccessor.h>
Definition at line 24 of file PersistentAccessor.h.
◆ PersistentAccessor() [1/3]
PersistentAccessor::PersistentAccessor |
( |
TTree & |
cellTree, |
|
|
TTree & |
SCTree, |
|
|
TTree & |
eventTree, |
|
|
TTree * |
runTree, |
|
|
TFile * |
file |
|
) |
| |
Constructor
Definition at line 26 of file PersistentAccessor.cxx.
36 cout <<
"WARNING: could not load all the baskets of the event tree into memory -- processing will be very slow." << endl;
37 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 | ) |
|
◆ addSC()
◆ cellTree()
const TTree& LArSamples::PersistentAccessor::cellTree |
( |
| ) |
const |
|
inline |
◆ currentContainer()
◆ currentContainerSC()
◆ 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 |
◆ getSCEntry()
int LArSamples::PersistentAccessor::getSCEntry |
( |
unsigned int |
i | ) |
const |
|
inline |
◆ historyContainer()
◆ historyContainerSC()
◆ historySize()
unsigned int PersistentAccessor::historySize |
( |
unsigned int |
i | ) |
const |
◆ historySizeSC()
unsigned int PersistentAccessor::historySizeSC |
( |
unsigned int |
i | ) |
const |
◆ merge() [1/2]
Definition at line 209 of file PersistentAccessor.cxx.
213 unsigned int size = 0;
216 int evtIndex = 0, runIndex = 0;
217 std::map<std::pair<int, int>,
int> evtMap;
218 std::map<int, int> runMap;
219 std::map< std::pair<const PersistentAccessor*, int>,
int > evtAccMap;
221 cout <<
"Merging runs" << endl;
224 cout <<
"Cannot merge: one of the inputs is null!" << endl;
228 for (
unsigned int i = 0;
i <
accessor->nRuns();
i++) {
230 if (runMap.find(
run) != runMap.end())
continue;
231 runMap[
run] = runIndex;
239 cout <<
"Merging events" << endl;
240 unsigned int nEventsTotal = 0, iEvt = 0;
242 nEventsTotal +=
accessor->nEvents();
245 for (
unsigned int i = 0;
i <
accessor->nEvents();
i++) {
247 if (iEvt % 100000 == 0) cout <<
"Merging event " << iEvt <<
"/" << nEventsTotal << endl;
248 std::pair<int, int> evtId(
accessor->eventData(
i)->run(),
accessor->eventData(
i)->event());
249 std::pair<const PersistentAccessor*, int> evtAccId(
accessor,
i);
250 if (evtMap.find(evtId) != evtMap.end()) {
251 cout <<
"ERROR: Skipping duplicate entry for run " <<
accessor->eventData(
i)->run() <<
", event " <<
accessor->eventData(
i)->event() << endl;
254 evtAccMap[evtAccId] = evtIndex;
255 evtMap[evtId] = evtIndex;
256 std::map<int, int>::const_iterator
idx = runMap.find(
accessor->eventData(
i)->run());
257 int newRunIndex = (
idx == runMap.end() ? -999 :
idx->second);
267 cout <<
"Merging cells" << endl;
269 if (
i % 10000 == 0) {
276 if (!history || !history->
isValid())
continue;
283 std::map<std::pair<const PersistentAccessor*, int>,
int>::const_iterator newIndex
285 if (newIndex == evtAccMap.end()) cout <<
"Event not found for cell " <<
i <<
", data " << j <<
"." << endl;
286 newDC->
setEventIndex(newIndex != evtAccMap.end() ? newIndex->second : -1);
287 newHistory->
add(newDC);
297 newAcc->
add(newHistory);
302 cout <<
"Merging SC" << endl;
304 if (
i % 10000 == 0) {
311 if (!history || !history->
isValid())
continue;
318 std::map<std::pair<const PersistentAccessor*, int>,
int>::const_iterator newIndex
320 if (newIndex == evtAccMap.end()) cout <<
"Event not found for cell " <<
i <<
", data " << j <<
"." << endl;
321 newDC->
setEventIndex(newIndex != evtAccMap.end() ? newIndex->second : -1);
322 newHistory->
add(newDC);
332 newAcc->
addSC(newHistory);
336 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 191 of file PersistentAccessor.cxx.
195 cout <<
"Writing " <<
m_runTree->GetEntries() <<
" run(s)..." << endl;
197 cout <<
"Writing " <<
m_eventTree->GetEntries() <<
" event(s)..." << endl;
199 cout <<
"Writing " <<
m_cellTree->GetEntries() <<
" cell(s)..." << endl;
201 cout <<
"Writing " <<
m_SCTree->GetEntries() <<
" SC(s)..." << endl;
204 cout <<
"Writing done!" << endl;
◆ SCTree()
const TTree& LArSamples::PersistentAccessor::SCTree |
( |
| ) |
const |
|
inline |
◆ 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_historyContSC
◆ 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 |
◆ m_SCTree
TTree * LArSamples::PersistentAccessor::m_SCTree |
|
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)
const TTree & SCTree() const
void add(HistoryContainer *cont)
HistoryContainer * m_historyContSC
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 HistoryContainer * historyContainerSC(unsigned int i) const
const AccessorWrapper< T > * accessor(xAOD::JetAttribute::AttributeID id)
Returns an attribute accessor corresponding to an AttributeID.
const CellInfo * cellInfo() const
static const unsigned int nChannelsSC
void add(const DataContainer *data)
append data (takes ownership)
void addSC(HistoryContainer *cont)
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)
PersistentAccessor(TTree &cellTree, TTree &SCTree, TTree &eventTree, TTree *runTree, TFile *file)
Constructor
void setEventIndex(int index)
unsigned int nDataContainers() const