FairRoot/PandaRoot
Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
analysis
rho
RhoBase
RhoCandListIterator.cxx
Go to the documentation of this file.
1
// //
3
// RhoCandListIterator //
4
// //
5
// Iterator class for RhoCandList //
6
// //
7
// Author List: //
8
// Marcel Kunze, RUB, Feb. 99 //
9
// Copyright (C) 1999-2001, Ruhr-University Bochum. //
10
// Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
11
// //
13
14
#include "
RhoBase/RhoCandListIterator.h
"
15
#include "
RhoBase/RhoCandList.h
"
16
#include "
RhoBase/RhoCandidate.h
"
17
18
ClassImp
(
RhoCandListIterator
)
19
20
using namespace
std
;
21
22
RhoCandListIterator
::
RhoCandListIterator
(
RhoCandList
& li ) :
23
fList ( &li ), fCurrentIndex ( 0 ) {}
24
25
RhoCandListIterator::RhoCandListIterator
(
const
RhoCandListIterator
& li ) :
26
TObject(li), fList ( li.fList ), fCurrentIndex ( li.fCurrentIndex ) {}
27
28
RhoCandListIterator::~RhoCandListIterator
() {}
29
30
RhoCandidate
*
RhoCandListIterator::Next
()
31
{
32
if
(
fList
==0 ) {
return
0; }
33
return
fCurrentIndex
<
fList
->
GetNumberOfTracks
() ?
fList
->
Get
(
fCurrentIndex
++ ) : 0;
34
}
35
36
RhoCandidate
*
RhoCandListIterator::Current
()
37
{
38
return
fCurrentIndex
<
fList
->
GetNumberOfTracks
() ?
fList
->
Get
(
fCurrentIndex
) : 0;
39
}
40
41
RhoCandidate
*
RhoCandListIterator::Previous
()
42
{
43
if
(
fCurrentIndex
>=
fList
->
GetNumberOfTracks
() ) {
fCurrentIndex
=
fList
->
GetNumberOfTracks
(); }
44
return
fCurrentIndex
?
fList
->
Get
( --
fCurrentIndex
) : 0;
45
}
46
47
void
RhoCandListIterator::Rewind
()
48
{
49
fCurrentIndex
= 0;
50
}
51
52
void
RhoCandListIterator::SkipAll
()
53
{
54
fCurrentIndex
=
fList
->
GetNumberOfTracks
();
55
}
56
57
int
RhoCandListIterator::Index
()
const
58
{
59
return
fCurrentIndex
;
60
}
61
62
void
RhoCandListIterator::Skip
(
int
si )
63
{
64
if
( si +
int
(
fCurrentIndex
) < 0 ) {
65
Rewind
();
66
}
else
{
67
fCurrentIndex
+= si;
68
}
69
}
RhoCandListIterator::~RhoCandListIterator
~RhoCandListIterator()
Definition:
RhoCandListIterator.cxx:28
RhoCandListIterator::RhoCandListIterator
RhoCandListIterator(RhoCandList &)
Definition:
RhoCandListIterator.cxx:22
RhoCandListIterator::Skip
void Skip(int)
Definition:
RhoCandListIterator.cxx:62
RhoCandListIterator::fCurrentIndex
int fCurrentIndex
Pointer to the associated list.
Definition:
RhoCandListIterator.h:65
std
Definition:
MvdMQ/run/runFileSampler.cxx:18
RhoCandidate.h
RhoCandidate
Definition:
RhoCandidate.h:44
RhoCandListIterator
Definition:
RhoCandListIterator.h:21
RhoCandListIterator::SkipAll
void SkipAll()
Definition:
RhoCandListIterator.cxx:52
RhoCandListIterator::Index
int Index() const
Definition:
RhoCandListIterator.cxx:57
RhoCandListIterator::Rewind
void Rewind()
Definition:
RhoCandListIterator.cxx:47
RhoCandList
Definition:
RhoCandList.h:27
RhoCandListIterator::Current
RhoCandidate * Current()
Definition:
RhoCandListIterator.cxx:36
RhoCandListIterator::Next
RhoCandidate * Next()
Definition:
RhoCandListIterator.cxx:30
RhoCandListIterator::fList
RhoCandList * fList
Definition:
RhoCandListIterator.h:63
RhoCandList::GetNumberOfTracks
Int_t GetNumberOfTracks() const
Definition:
RhoCandList.cxx:72
ClassImp
ClassImp(RhoCandListIterator) using namespace std
RhoCandListIterator.h
RhoCandList.h
RhoCandList::Get
RhoCandidate * Get(Int_t)
Definition:
RhoCandList.cxx:94
RhoCandListIterator::Previous
RhoCandidate * Previous()
Definition:
RhoCandListIterator.cxx:41
Generated on Sun Aug 18 2019 03:01:56 for FairRoot/PandaRoot by
1.8.8