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

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

#include <HistoryIterator.h>

Collaboration diagram for LArSamples::HistoryIterator:

Public Member Functions

 HistoryIterator (const Interface &interface, unsigned int pos=0, double eMin=-1, double adcMaxMin=-1)
 Constructor
More...
 
virtual ~HistoryIterator ()
 
const Historyhistory () const
 
unsigned int pos () const
 
bool isValid () const
 
const Historyoperator* () const
 
HistoryIteratoroperator++ ()
 
const Historynext ()
 
bool operator== (unsigned int otherPos) const
 

Private Attributes

const Interfacem_interface
 
unsigned int m_pos
 
double m_eMin
 
double m_adcMaxMin
 

Detailed Description

storage of the time histories of all the cells

Definition at line 20 of file HistoryIterator.h.

Constructor & Destructor Documentation

◆ HistoryIterator()

HistoryIterator::HistoryIterator ( const Interface interface,
unsigned int  pos = 0,
double  eMin = -1,
double  adcMaxMin = -1 
)

Constructor

Definition at line 17 of file HistoryIterator.cxx.

19  : m_interface(&interface), m_pos(pos),
20  m_eMin(eMin), m_adcMaxMin(adcMaxMin)
21 {
22  if (!isValid()) next();
23 }

◆ ~HistoryIterator()

virtual LArSamples::HistoryIterator::~HistoryIterator ( )
inlinevirtual

Definition at line 27 of file HistoryIterator.h.

27 { }

Member Function Documentation

◆ history()

const History * HistoryIterator::history ( ) const

Definition at line 26 of file HistoryIterator.cxx.

27 {
28  return m_interface->cellHistory(m_pos);
29 }

◆ isValid()

bool HistoryIterator::isValid ( ) const

Definition at line 32 of file HistoryIterator.cxx.

33 {
34  if (m_pos >= Definitions::nChannels) return false;
35  unsigned int size = m_interface->historySize(m_pos);
36  if (size == 0) return false;
37  if (m_eMin < 0 && m_adcMaxMin < 0) return true;
38 
40  bool found = false;
41  for (unsigned int i = 0; i < history->nData(); i++) {
42  if (history->data(i)->energy() > m_eMin && history->data(i)->adcMax() > m_adcMaxMin) {
43  found = true;
44  break;
45  }
46  }
47  return found;
48 }

◆ next()

const History * HistoryIterator::next ( )

Definition at line 51 of file HistoryIterator.cxx.

52 {
53  m_pos++;
54 
55  for (; m_pos < m_interface->end(); m_pos++)
56  if (isValid()) break;
57 
58  return history();
59 }

◆ operator*()

const History* LArSamples::HistoryIterator::operator* ( ) const
inline

Definition at line 34 of file HistoryIterator.h.

34 { return history(); }

◆ operator++()

HistoryIterator * HistoryIterator::operator++ ( )

Definition at line 62 of file HistoryIterator.cxx.

63 {
64  next();
65  return this;
66 }

◆ operator==()

bool LArSamples::HistoryIterator::operator== ( unsigned int  otherPos) const
inline

Definition at line 38 of file HistoryIterator.h.

38 { return pos() == otherPos; }

◆ pos()

unsigned int LArSamples::HistoryIterator::pos ( ) const
inline

Definition at line 30 of file HistoryIterator.h.

30 { return m_pos; }

Member Data Documentation

◆ m_adcMaxMin

double LArSamples::HistoryIterator::m_adcMaxMin
private

Definition at line 45 of file HistoryIterator.h.

◆ m_eMin

double LArSamples::HistoryIterator::m_eMin
private

Definition at line 45 of file HistoryIterator.h.

◆ m_interface

const Interface* LArSamples::HistoryIterator::m_interface
private

Definition at line 42 of file HistoryIterator.h.

◆ m_pos

unsigned int LArSamples::HistoryIterator::m_pos
private

Definition at line 43 of file HistoryIterator.h.


The documentation for this class was generated from the following files:
LArSamples::HistoryIterator::m_eMin
double m_eMin
Definition: HistoryIterator.h:45
LArSamples::HistoryIterator::isValid
bool isValid() const
Definition: HistoryIterator.cxx:32
LArSamples::Data::adcMax
double adcMax() const
Definition: Data.h:129
LArSamples::HistoryIterator::pos
unsigned int pos() const
Definition: HistoryIterator.h:30
LArSamples::History
Definition: History.h:40
LArSamples::Interface::cellHistory
const History * cellHistory(unsigned int i) const
Definition: Interface.cxx:114
LArSamples::HistoryIterator::history
const History * history() const
Definition: HistoryIterator.cxx:26
LArSamples::Interface::end
unsigned int end() const
Definition: Interface.h:60
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
LArSamples::History::data
const Data * data(unsigned int i) const
Definition: History.cxx:88
LArSamples::Definitions::nChannels
static const unsigned int nChannels
Definition: Definitions.h:14
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArSamples::History::nData
unsigned int nData() const
Definition: History.h:56
LArSamples::HistoryIterator::m_adcMaxMin
double m_adcMaxMin
Definition: HistoryIterator.h:45
CondAlgsOpts.found
int found
Definition: CondAlgsOpts.py:101
LArSamples::Interface::historySize
unsigned int historySize(unsigned int i) const
Definition: Interface.h:57
LArSamples::HistoryIterator::m_interface
const Interface * m_interface
Definition: HistoryIterator.h:42
LArSamples::Data::energy
double energy() const
Definition: Data.h:113
LArSamples::HistoryIterator::next
const History * next()
Definition: HistoryIterator.cxx:51
LArSamples::HistoryIterator::m_pos
unsigned int m_pos
Definition: HistoryIterator.h:43