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 "AliMUONDigit.h"
22 #include "TClonesArray.h"
25 /// An iterator to access digits (stored into AliMUONData).
27 /// Iteration can occur on tracking chambers only, trigger chambers only,
31 //_____________________________________________________________________________
32 AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONData* data,
36 AliMUONVDataIterator(),
38 fFirstChamber(firstChamber),
39 fLastChamber(lastChamber)
47 //_____________________________________________________________________________
48 AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONDataDigitIterator& rhs)
50 AliMUONVDataIterator()
55 //_____________________________________________________________________________
56 AliMUONDataDigitIterator&
57 AliMUONDataDigitIterator::operator=(const AliMUONDataDigitIterator& rhs)
63 //_____________________________________________________________________________
65 AliMUONDataDigitIterator::CopyTo(AliMUONDataDigitIterator& destination) const
67 destination.fData=fData;
68 destination.fFirstChamber=fFirstChamber;
69 destination.fLastChamber=fLastChamber;
70 destination.fCurrentDigit=fCurrentDigit;
71 destination.fCurrentChamber=fCurrentChamber;
72 destination.fDigits=fDigits;
75 //_____________________________________________________________________________
77 AliMUONDataDigitIterator::Next()
79 // Return current element and self-position to the next one.
85 // get the pointer to be returned
86 rv = fDigits->At(fCurrentDigit);
87 // prepare for the next position, if it exists
88 if ( fCurrentDigit < fDigits->GetLast() )
96 if ( fCurrentChamber <= fLastChamber )
98 fDigits = fData->Digits(fCurrentChamber);
110 //_____________________________________________________________________________
112 AliMUONDataDigitIterator::Remove()
114 // Remove current element.
118 fDigits->RemoveAt(fCurrentDigit);
126 //_____________________________________________________________________________
128 AliMUONDataDigitIterator::Reset()
132 fCurrentChamber = fFirstChamber;
133 fDigits = fData->Digits(fCurrentChamber);