ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
LArSamples::DataStore Class Reference

storage of the time histories of all the cells More...

#include <DataStore.h>

Collaboration diagram for LArSamples::DataStore:

Public Member Functions

 DataStore ()
 Constructor
More...
 
virtual ~DataStore ()
 Destructor. More...
 
const HistoryContainerhistoryContainer (unsigned int i) const
 
const EventDataeventData (unsigned int i) const
 
const RunDatarunData (unsigned int i) const
 
HistoryContainermakeNewHistory (const IdentifierHash &hash, CellInfo *info)
 append data (takes ownership of everything) More...
 
bool addData (const IdentifierHash &hash, DataContainer *data)
 
unsigned int addEvent (EventData *eventData)
 
unsigned int addRun (RunData *eventData)
 
unsigned int nChannels () const
 
unsigned int size () const
 
unsigned int nFilledChannels () const
 
unsigned int nEvents () const
 
unsigned int nRuns () const
 
double footprint () const
 
bool writeTrees (const char *fileName)
 

Private Member Functions

HistoryContainer *& hist_cont (unsigned int i)
 
EventData *& eventData (unsigned int i)
 
RunData *& runData (unsigned int i)
 

Private Attributes

std::vector< HistoryContainer * > m_cellHistories
 
std::vector< EventData * > m_events
 
std::vector< RunData * > m_runs
 

Friends

class ::LArShapeDumper
 
class D3PDConverter
 

Detailed Description

storage of the time histories of all the cells

Definition at line 32 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

Constructor & Destructor Documentation

◆ DataStore()

DataStore::DataStore ( )

Constructor

Definition at line 26 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

26  : m_cellHistories(nChannels(), nullptr)
27 {
28 }

◆ ~DataStore()

DataStore::~DataStore ( )
virtual

Destructor.

Definition at line 31 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

32 {
34  delete h;
35 }

Member Function Documentation

◆ addData()

bool DataStore::addData ( const IdentifierHash hash,
DataContainer data 
)

Definition at line 47 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

48 {
49  HistoryContainer*& histCont = hist_cont(hash);
50  histCont->add(data);
51  return true;
52 }

◆ addEvent()

unsigned int DataStore::addEvent ( EventData eventData)

Definition at line 55 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

56 {
57  m_events.push_back(eventData);
58  return nEvents() - 1;
59 }

◆ addRun()

unsigned int DataStore::addRun ( RunData eventData)

Definition at line 62 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

63 {
64  m_runs.push_back(runData);
65  return nRuns() - 1;
66 }

◆ eventData() [1/2]

EventData*& LArSamples::DataStore::eventData ( unsigned int  i)
inlineprivate

Definition at line 68 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

68 { return m_events[i]; }

◆ eventData() [2/2]

const EventData* LArSamples::DataStore::eventData ( unsigned int  i) const
inline

Definition at line 43 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

43 { return m_events[i]; }

◆ footprint()

double DataStore::footprint ( ) const

Definition at line 97 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

98 {
99  double fp = sizeof(*this);
100  for (unsigned int i = 0; i < nChannels(); i++) {
102  if (!hist) continue;
103  fp += hist->footprint();
104  }
105 
106  return fp;
107 }

◆ hist_cont()

HistoryContainer*& LArSamples::DataStore::hist_cont ( unsigned int  i)
inlineprivate

Definition at line 67 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

67 { return m_cellHistories[i]; }

◆ historyContainer()

const HistoryContainer* LArSamples::DataStore::historyContainer ( unsigned int  i) const
inline

Definition at line 42 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

42 { return m_cellHistories[i]; }

◆ makeNewHistory()

HistoryContainer * DataStore::makeNewHistory ( const IdentifierHash hash,
CellInfo info 
)

append data (takes ownership of everything)

Definition at line 38 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

39 {
40  HistoryContainer*& histCont = hist_cont(hash);
41  if (histCont) return histCont;
42  histCont = new HistoryContainer(info);
43  return histCont;
44 }

◆ nChannels()

unsigned int LArSamples::DataStore::nChannels ( ) const
inline

Definition at line 53 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

53 { return Definitions::nChannels; }

◆ nEvents()

unsigned int LArSamples::DataStore::nEvents ( ) const
inline

Definition at line 56 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

56 { return m_events.size(); }

◆ nFilledChannels()

unsigned int DataStore::nFilledChannels ( ) const

Definition at line 83 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

84 {
85  unsigned int n = 0;
86 
87  for (unsigned int i = 0; i < nChannels(); i++) {
89  if (!hist) continue;
90  n++;
91  }
92 
93  return n;
94 }

◆ nRuns()

unsigned int LArSamples::DataStore::nRuns ( ) const
inline

Definition at line 57 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

57 { return m_runs.size(); }

◆ runData() [1/2]

RunData*& LArSamples::DataStore::runData ( unsigned int  i)
inlineprivate

Definition at line 69 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

69 { return m_runs[i]; }

◆ runData() [2/2]

const RunData* LArSamples::DataStore::runData ( unsigned int  i) const
inline

Definition at line 44 of file LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h.

44 { return m_runs[i]; }

◆ size()

unsigned int DataStore::size ( ) const

Definition at line 69 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

70 {
71  unsigned int size = 0;
72 
73  for (unsigned int i = 0; i < nChannels(); i++) {
75  if (!hist) continue;
76  size += hist->nDataContainers();
77  }
78 
79  return size;
80 }

◆ writeTrees()

bool DataStore::writeTrees ( const char *  fileName)

Definition at line 110 of file LArCalorimeter/LArCafJobs/src/DataStore.cxx.

111 {
113 
114  for (unsigned int i = 0; i < nRuns(); i++) {
115  RunData*& r = runData(i);
116  acc->addRun(r);
117  delete r; r = nullptr;
118  }
119 
120  for (unsigned int i = 0; i < nEvents(); i++) {
121  EventData*& ev = eventData(i);
122  acc->addEvent(ev);
123  delete ev; ev = nullptr;
124  }
125 
126  for (unsigned int i = 0; i < nChannels(); i++) {
127  HistoryContainer*& hc = hist_cont(i);
128  acc->add(hc);
129  delete hc; hc = nullptr;
130  }
131 
132  bool result = acc->save();
133  delete acc;
134  return result;
135 }

Friends And Related Function Documentation

◆ ::LArShapeDumper

friend class ::LArShapeDumper
friend

◆ D3PDConverter

friend class D3PDConverter
friend

Member Data Documentation

◆ m_cellHistories

std::vector<HistoryContainer*> LArSamples::DataStore::m_cellHistories
private

◆ m_events

std::vector<EventData*> LArSamples::DataStore::m_events
private

◆ m_runs

std::vector<RunData*> LArSamples::DataStore::m_runs
private

The documentation for this class was generated from the following files:
grepfile.info
info
Definition: grepfile.py:38
beamspotman.r
def r
Definition: beamspotman.py:676
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
get_generator_info.result
result
Definition: get_generator_info.py:21
LArSamples::DataStore::historyContainer
const HistoryContainer * historyContainer(unsigned int i) const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:42
plotmaker.hist
hist
Definition: plotmaker.py:148
LArSamples::DataStore::runData
const RunData * runData(unsigned int i) const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:44
LArSamples::PersistentAccessor
Definition: PersistentAccessor.h:24
LArSamples::RunData
Definition: RunData.h:21
LArSamples::DataStore::hist_cont
HistoryContainer *& hist_cont(unsigned int i)
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:67
FortranAlgorithmOptions.fileName
fileName
Definition: FortranAlgorithmOptions.py:13
ev
int ev
Definition: globals.cxx:25
LArSamples::Definitions::nChannels
static const unsigned int nChannels
Definition: Definitions.h:14
LArSamples::DataStore::m_runs
std::vector< RunData * > m_runs
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:73
lumiFormat.i
int i
Definition: lumiFormat.py:92
trigmenu_modify_prescale_json.fp
fp
Definition: trigmenu_modify_prescale_json.py:53
h
beamspotman.n
n
Definition: beamspotman.py:731
extractSporadic.h
list h
Definition: extractSporadic.py:97
LArSamples::DataStore::nChannels
unsigned int nChannels() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:53
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
LArSamples::DataStore::eventData
const EventData * eventData(unsigned int i) const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:43
LArSamples::DataStore::m_events
std::vector< EventData * > m_events
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:72
LArSamples::DataStore::size
unsigned int size() const
Definition: LArCalorimeter/LArCafJobs/src/DataStore.cxx:69
LArSamples::DataStore::nEvents
unsigned int nEvents() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:56
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
LArSamples::HistoryContainer
Definition: HistoryContainer.h:29
LArSamples::HistoryContainer::add
void add(const DataContainer *data)
append data (takes ownership)
Definition: HistoryContainer.h:46
LArSamples::DataStore::m_cellHistories
std::vector< HistoryContainer * > m_cellHistories
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:71
LArSamples::EventData
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:29
LArSamples::DataStore::nRuns
unsigned int nRuns() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:57