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 HistoryContainerhistoryContainerSC (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...
 
HistoryContainermakeNewHistorySC (const IdentifierHash &hash, CellInfo *info)
 
bool addData (const IdentifierHash &hash, DataContainer *data)
 
bool addDataSC (const IdentifierHash &hash, DataContainer *data)
 
unsigned int addEvent (EventData *eventData)
 
unsigned int addRun (RunData *eventData)
 
unsigned int nChannels () const
 
unsigned int nChannelsSC () const
 
unsigned int size () const
 
unsigned int nFilledChannels () const
 
unsigned int nFilledChannelsSC () 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)
 
HistoryContainer *& hist_cont_sc (unsigned int i)
 
EventData *& eventData (unsigned int i)
 
RunData *& runData (unsigned int i)
 

Private Attributes

std::vector< HistoryContainer * > m_cellHistories
 
std::vector< HistoryContainer * > m_cellHistoriesSC
 
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  :
27  m_cellHistories(nChannels(), nullptr),
28  m_cellHistoriesSC(nChannelsSC(), nullptr)
29 {
30 }

◆ ~DataStore()

DataStore::~DataStore ( )
virtual

Destructor.

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

34 {
36  delete h;
37 }

Member Function Documentation

◆ addData()

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

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

58 {
59  HistoryContainer*& histCont = hist_cont(hash);
60  histCont->add(data);
61  return true;
62 }

◆ addDataSC()

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

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

65 {
66  HistoryContainer*& histCont = hist_cont_sc(hash);
67  histCont->add(data);
68  return true;
69 }

◆ addEvent()

unsigned int DataStore::addEvent ( EventData eventData)

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

73 {
74  m_events.push_back(eventData);
75  return nEvents() - 1;
76 }

◆ addRun()

unsigned int DataStore::addRun ( RunData eventData)

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

80 {
81  m_runs.push_back(runData);
82  return nRuns() - 1;
83 }

◆ eventData() [1/2]

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

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

74 { return m_events[i]; }

◆ eventData() [2/2]

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

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

44 { return m_events[i]; }

◆ footprint()

double DataStore::footprint ( ) const

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

134 {
135  double fp = sizeof(*this);
136  for (unsigned int i = 0; i < nChannels(); i++) {
138  if (!hist) continue;
139  fp += hist->footprint();
140  }
141 
142  for (unsigned int i = 0; i < nChannelsSC(); i++) {
144  if (!hist) continue;
145  fp += hist->footprint();
146  }
147 
148  return fp;
149 }

◆ hist_cont()

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

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

72 { return m_cellHistories[i]; }

◆ hist_cont_sc()

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

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

73 { return m_cellHistoriesSC[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]; }

◆ historyContainerSC()

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

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

43 { return m_cellHistoriesSC[i]; }

◆ makeNewHistory()

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

append data (takes ownership of everything)

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

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

◆ makeNewHistorySC()

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

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

49 {
50  HistoryContainer*& histCont = hist_cont_sc(hash);
51  if (histCont) return histCont;
52  histCont = new HistoryContainer(info);
53  return histCont;
54 }

◆ nChannels()

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

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

56 { return Definitions::nChannels; }

◆ nChannelsSC()

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

◆ nEvents()

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

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

61 { return m_events.size(); }

◆ nFilledChannels()

unsigned int DataStore::nFilledChannels ( ) const

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

107 {
108  unsigned int n = 0;
109 
110  for (unsigned int i = 0; i < nChannels(); i++) {
112  if (!hist) continue;
113  n++;
114  }
115 
116  return n;
117 }

◆ nFilledChannelsSC()

unsigned int DataStore::nFilledChannelsSC ( ) const

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

120 {
121  unsigned int n = 0;
122 
123  for (unsigned int i = 0; i < nChannelsSC(); i++) {
125  if (!hist) continue;
126  n++;
127  }
128 
129  return n;
130 }

◆ nRuns()

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

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

62 { return m_runs.size(); }

◆ runData() [1/2]

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

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

75 { return m_runs[i]; }

◆ runData() [2/2]

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

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

45 { return m_runs[i]; }

◆ size()

unsigned int DataStore::size ( ) const

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

87 {
88  unsigned int size = 0;
89 
90  for (unsigned int i = 0; i < nChannels(); i++) {
92  if (!hist) continue;
93  size += hist->nDataContainers();
94  }
95 
96  for (unsigned int i = 0; i < nChannelsSC(); i++) {
98  if (!hist) continue;
99  size += hist->nDataContainers();
100  }
101 
102  return size;
103 }

◆ writeTrees()

bool DataStore::writeTrees ( const char *  fileName)

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

153 {
155 
156  for (unsigned int i = 0; i < nRuns(); i++) {
157  RunData*& r = runData(i);
158  acc->addRun(r);
159  delete r; r = nullptr;
160  }
161 
162  for (unsigned int i = 0; i < nEvents(); i++) {
163  EventData*& ev = eventData(i);
164  acc->addEvent(ev);
165  delete ev; ev = nullptr;
166  }
167 
168  for (unsigned int i = 0; i < nChannels(); i++) {
169  HistoryContainer*& hc = hist_cont(i);
170  acc->add(hc);
171  delete hc; hc = nullptr;
172  }
173 
174  for (unsigned int i = 0; i < nChannelsSC(); i++) {
176  acc->addSC(hc);
177  delete hc; hc = nullptr;
178  }
179 
180  bool result = acc->save();
181  delete acc;
182  return result;
183 }

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_cellHistoriesSC

std::vector<HistoryContainer*> LArSamples::DataStore::m_cellHistoriesSC
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:
LArSamples::DataStore::m_cellHistoriesSC
std::vector< HistoryContainer * > m_cellHistoriesSC
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:78
beamspotman.r
def r
Definition: beamspotman.py:672
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:45
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:72
ev
int ev
Definition: globals.cxx:25
LArSamples::DataStore::historyContainerSC
const HistoryContainer * historyContainerSC(unsigned int i) const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:43
LArSamples::Definitions::nChannels
static const unsigned int nChannels
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:14
LArSamples::DataStore::m_runs
std::vector< RunData * > m_runs
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:80
lumiFormat.i
int i
Definition: lumiFormat.py:85
trigmenu_modify_prescale_json.fp
fp
Definition: trigmenu_modify_prescale_json.py:53
h
beamspotman.n
n
Definition: beamspotman.py:727
extractSporadic.h
list h
Definition: extractSporadic.py:96
LArSamples::DataStore::nChannels
unsigned int nChannels() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:56
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
LArSamples::DataStore::eventData
const EventData * eventData(unsigned int i) const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:44
LArSamples::DataStore::m_events
std::vector< EventData * > m_events
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:79
LArSamples::DataStore::size
unsigned int size() const
Definition: LArCalorimeter/LArCafJobs/src/DataStore.cxx:86
LArSamples::DataStore::nEvents
unsigned int nEvents() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:61
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:108
LArSamples::HistoryContainer
Definition: HistoryContainer.h:29
LArSamples::Definitions::nChannelsSC
static const unsigned int nChannelsSC
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/Definitions.h:15
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:77
LArSamples::DataStore::nChannelsSC
unsigned int nChannelsSC() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:57
jobOptions.fileName
fileName
Definition: jobOptions.SuperChic_ALP2.py:39
LArSamples::DataStore::hist_cont_sc
HistoryContainer *& hist_cont_sc(unsigned int i)
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:73
LArSamples::EventData
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/EventData.h:29
python.ParticleTypeUtil.info
def info
Definition: ParticleTypeUtil.py:87
LArSamples::DataStore::nRuns
unsigned int nRuns() const
Definition: LArCalorimeter/LArCafJobs/LArCafJobs/DataStore.h:62