ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
GeoMaterialPropertyVector Class Reference

#include <GeoMaterialPropertyVector.h>

Collaboration diagram for GeoMaterialPropertyVector:

Public Member Functions

bool operator++ ()
 
GeoMaterialPropertyVectoroperator= (const GeoMaterialPropertyVector &right)
 
 GeoMaterialPropertyVector ()
 
 GeoMaterialPropertyVector (double *PhotonMomenta, double *PropertyValues, int NumElements)
 
 GeoMaterialPropertyVector (const GeoMaterialPropertyVector &right)
 
 ~GeoMaterialPropertyVector ()
 
void ResetIterator ()
 
void AddElement (double aPhotonMomentum, double aPropertyValue)
 
double GetProperty () const
 
double GetPhotonMomentum () const
 
void DumpVector ()
 

Private Member Functions

GeoMPVEntry GetEntry (int i) const
 

Private Attributes

std::vector< GeoMPVEntry * > m_MPV
 
int m_NumEntries
 
int m_CurrentEntry
 

Detailed Description

Definition at line 11 of file GeoMaterialPropertyVector.h.

Constructor & Destructor Documentation

◆ GeoMaterialPropertyVector() [1/3]

GeoMaterialPropertyVector::GeoMaterialPropertyVector ( )
inline

Definition at line 18 of file GeoMaterialPropertyVector.h.

18  : m_MPV(0)
19  {
20  m_CurrentEntry = -1;
21  m_NumEntries = 0;
22  };

◆ GeoMaterialPropertyVector() [2/3]

GeoMaterialPropertyVector::GeoMaterialPropertyVector ( double *  PhotonMomenta,
double *  PropertyValues,
int  NumElements 
)

Definition at line 39 of file GeoMaterialPropertyVector.cxx.

42 {
43  m_NumEntries = 0;
44  m_CurrentEntry = -1;
45 
46  for(int i = 0; i < NumElements; i++)
47  AddElement(PhotonMomenta[i], PropertyValues[i]);
48 }

◆ GeoMaterialPropertyVector() [3/3]

GeoMaterialPropertyVector::GeoMaterialPropertyVector ( const GeoMaterialPropertyVector right)

Definition at line 50 of file GeoMaterialPropertyVector.cxx.

51 {
52  m_NumEntries = 0;
53  m_CurrentEntry = -1;
54 
55  for(int i = 0 ; i < right.m_NumEntries; i++)
56  {
57  GeoMPVEntry *newElement = new GeoMPVEntry(right.GetEntry(i));
58  m_MPV.push_back(newElement);
59  m_NumEntries++;
60  }
61 }

◆ ~GeoMaterialPropertyVector()

GeoMaterialPropertyVector::~GeoMaterialPropertyVector ( )

Definition at line 63 of file GeoMaterialPropertyVector.cxx.

64 {
65  for(unsigned i=0; i<m_MPV.size(); ++i)
66  delete m_MPV[i];
67  m_MPV.clear();
68 }

Member Function Documentation

◆ AddElement()

void GeoMaterialPropertyVector::AddElement ( double  aPhotonMomentum,
double  aPropertyValue 
)

Definition at line 75 of file GeoMaterialPropertyVector.cxx.

77 {
78  GeoMPVEntry *newElement;
79 
80  newElement = new GeoMPVEntry(aPhotonMomentum, aPropertyValue);
81  m_MPV.push_back(newElement);
82  m_NumEntries++;
83 }

◆ DumpVector()

void GeoMaterialPropertyVector::DumpVector ( )

Definition at line 101 of file GeoMaterialPropertyVector.cxx.

102 {
103  if (m_MPV.empty())
104  {
105  std::cerr << "nothing to dump\n";
106  throw std::runtime_error("GeoMaterialPropertyVector::DumpVector ==>Nothing to dump! Vector is empty");
107  }
108 
109  for (int i = 0; i < m_NumEntries; i++)
110  {
111  std::cout << "m_MPV["<< i << "]: ";
112  m_MPV[i]->DumpEntry();
113  }
114  std::cout << " Done DumpVector of " << m_NumEntries << " entries\n";
115 
116 }

◆ GetEntry()

GeoMPVEntry GeoMaterialPropertyVector::GetEntry ( int  i) const
private

Definition at line 118 of file GeoMaterialPropertyVector.cxx.

119 {
120  return *m_MPV[i];
121 }

◆ GetPhotonMomentum()

double GeoMaterialPropertyVector::GetPhotonMomentum ( ) const

Definition at line 93 of file GeoMaterialPropertyVector.cxx.

94 {
96  throw std::runtime_error("GeoMaterialPropertyVector::GetPhotonMomentum ==>Iterator attempted to Retrieve Photon Momentum out of range");
97  else
98  return m_MPV[m_CurrentEntry]->GetPhotonMomentum();
99 }

◆ GetProperty()

double GeoMaterialPropertyVector::GetProperty ( ) const

Definition at line 85 of file GeoMaterialPropertyVector.cxx.

86 {
88  throw std::runtime_error("GeoMaterialPropertyVector::GetProperty ==>Iterator attempted to Retrieve Property out of range");
89  else
90  return m_MPV[m_CurrentEntry]->GetProperty();
91 }

◆ operator++()

bool GeoMaterialPropertyVector::operator++ ( )

Definition at line 9 of file GeoMaterialPropertyVector.cxx.

10 {
13  return true;
14  else
15  return false;
16 }

◆ operator=()

GeoMaterialPropertyVector & GeoMaterialPropertyVector::operator= ( const GeoMaterialPropertyVector right)

Definition at line 18 of file GeoMaterialPropertyVector.cxx.

19 {
20  if (this == &right) return *this;
21 
22  for(unsigned i=0; i<m_MPV.size(); ++i)
23  delete m_MPV[i];
24  m_MPV.clear();
25 
26  m_NumEntries = 0;
27  m_CurrentEntry = -1;
28 
29  for(int i = 0 ; i < right.m_NumEntries; i++)
30  {
31  GeoMPVEntry *newElement = new GeoMPVEntry(right.GetEntry(i));
32  m_MPV.push_back(newElement);
33  m_NumEntries++;
34  }
35 
36  return *this;
37 }

◆ ResetIterator()

void GeoMaterialPropertyVector::ResetIterator ( )

Definition at line 70 of file GeoMaterialPropertyVector.cxx.

71 {
72  m_CurrentEntry = -1;
73 }

Member Data Documentation

◆ m_CurrentEntry

int GeoMaterialPropertyVector::m_CurrentEntry
private

Definition at line 49 of file GeoMaterialPropertyVector.h.

◆ m_MPV

std::vector<GeoMPVEntry*> GeoMaterialPropertyVector::m_MPV
private

Definition at line 47 of file GeoMaterialPropertyVector.h.

◆ m_NumEntries

int GeoMaterialPropertyVector::m_NumEntries
private

Definition at line 48 of file GeoMaterialPropertyVector.h.


The documentation for this class was generated from the following files:
GeoMaterialPropertyVector::AddElement
void AddElement(double aPhotonMomentum, double aPropertyValue)
Definition: GeoMaterialPropertyVector.cxx:75
GeoMaterialPropertyVector::m_CurrentEntry
int m_CurrentEntry
Definition: GeoMaterialPropertyVector.h:49
GeoMaterialPropertyVector::m_MPV
std::vector< GeoMPVEntry * > m_MPV
Definition: GeoMaterialPropertyVector.h:47
GeoMaterialPropertyVector::GetEntry
GeoMPVEntry GetEntry(int i) const
Definition: GeoMaterialPropertyVector.cxx:118
lumiFormat.i
int i
Definition: lumiFormat.py:85
GeoMPVEntry
Definition: GeoMPVEntry.h:9
GeoMaterialPropertyVector::m_NumEntries
int m_NumEntries
Definition: GeoMaterialPropertyVector.h:48