ATLAS Offline Software
Loading...
Searching...
No Matches
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.
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}
unsigned int pos() const
const Interface * m_interface

◆ ~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
39 const History* history = m_interface->cellHistory(m_pos);
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}
const History * history() const

◆ 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: