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
34 //_____________________________________________________________________________
35 AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONData* data,
39 AliMUONVDataIterator(),
41 fFirstChamber(firstChamber),
42 fLastChamber(lastChamber)
50 //_____________________________________________________________________________
51 AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONDataDigitIterator& rhs)
53 AliMUONVDataIterator()
58 //_____________________________________________________________________________
59 AliMUONDataDigitIterator&
60 AliMUONDataDigitIterator::operator=(const AliMUONDataDigitIterator& rhs)
66 //_____________________________________________________________________________
68 AliMUONDataDigitIterator::CopyTo(AliMUONDataDigitIterator& destination) const
70 // Copy *this to destination
71 destination.fData=fData;
72 destination.fFirstChamber=fFirstChamber;
73 destination.fLastChamber=fLastChamber;
74 destination.fCurrentDigit=fCurrentDigit;
75 destination.fCurrentChamber=fCurrentChamber;
76 destination.fDigits=fDigits;
79 //_____________________________________________________________________________
81 AliMUONDataDigitIterator::Next()
83 // Return current element and self-position to the next one.
89 // get the pointer to be returned
90 rv = fDigits->At(fCurrentDigit);
91 // prepare for the next position, if it exists
92 if ( fCurrentDigit < fDigits->GetLast() )
100 if ( fCurrentChamber <= fLastChamber )
102 fDigits = fData->Digits(fCurrentChamber);
114 //_____________________________________________________________________________
116 AliMUONDataDigitIterator::Remove()
118 // Remove current element.
122 fDigits->RemoveAt(fCurrentDigit);
130 //_____________________________________________________________________________
132 AliMUONDataDigitIterator::Reset()
134 // Resets the iterator
137 fCurrentChamber = fFirstChamber;
138 fDigits = fData->Digits(fCurrentChamber);