1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
18 #include "AliMUONDataDigitIterator.h"
20 #include "AliMUONData.h"
21 #include "TClonesArray.h"
24 /// \class AliMUONDataDigitIterator
26 /// An iterator to access digits (stored into AliMUONData).
28 /// Iteration can occur on tracking chambers only, trigger chambers only,
31 /// \author L. Aphecetche
35 ClassImp(AliMUONDataDigitIterator)
38 //_____________________________________________________________________________
39 AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONData* data,
43 AliMUONVDataIterator(),
45 fFirstChamber(firstChamber),
46 fLastChamber(lastChamber),
51 /// Standard constructor
55 //_____________________________________________________________________________
56 AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONDataDigitIterator& rhs)
58 AliMUONVDataIterator(),
71 //_____________________________________________________________________________
72 AliMUONDataDigitIterator::~AliMUONDataDigitIterator()
77 //_____________________________________________________________________________
78 AliMUONDataDigitIterator&
79 AliMUONDataDigitIterator::operator=(const AliMUONDataDigitIterator& rhs)
81 /// Assignment operator
87 //_____________________________________________________________________________
89 AliMUONDataDigitIterator::CopyTo(AliMUONDataDigitIterator& destination) const
91 /// Copy *this to destination
92 destination.fData=fData;
93 destination.fFirstChamber=fFirstChamber;
94 destination.fLastChamber=fLastChamber;
95 destination.fCurrentDigit=fCurrentDigit;
96 destination.fCurrentChamber=fCurrentChamber;
97 destination.fDigits=fDigits;
100 //_____________________________________________________________________________
102 AliMUONDataDigitIterator::Next()
104 /// Return current element and self-position to the next one.
110 // get the pointer to be returned
111 rv = fDigits->At(fCurrentDigit);
112 // prepare for the next position, if it exists
113 if ( fCurrentDigit < fDigits->GetLast() )
121 if ( fCurrentChamber <= fLastChamber )
123 fDigits = fData->Digits(fCurrentChamber);
135 //_____________________________________________________________________________
137 AliMUONDataDigitIterator::Remove()
139 /// Remove current element.
143 fDigits->RemoveAt(fCurrentDigit);
151 //_____________________________________________________________________________
153 AliMUONDataDigitIterator::Reset()
155 /// Reset the iterator
158 fCurrentChamber = fFirstChamber;
159 fDigits = fData->Digits(fCurrentChamber);