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)
48 /// Standard constructor
52 //_____________________________________________________________________________
53 AliMUONDataDigitIterator::AliMUONDataDigitIterator(const AliMUONDataDigitIterator& rhs)
55 AliMUONVDataIterator()
62 //_____________________________________________________________________________
63 AliMUONDataDigitIterator::~AliMUONDataDigitIterator()
68 //_____________________________________________________________________________
69 AliMUONDataDigitIterator&
70 AliMUONDataDigitIterator::operator=(const AliMUONDataDigitIterator& rhs)
72 /// Assignment operator
78 //_____________________________________________________________________________
80 AliMUONDataDigitIterator::CopyTo(AliMUONDataDigitIterator& destination) const
82 /// Copy *this to destination
83 destination.fData=fData;
84 destination.fFirstChamber=fFirstChamber;
85 destination.fLastChamber=fLastChamber;
86 destination.fCurrentDigit=fCurrentDigit;
87 destination.fCurrentChamber=fCurrentChamber;
88 destination.fDigits=fDigits;
91 //_____________________________________________________________________________
93 AliMUONDataDigitIterator::Next()
95 /// Return current element and self-position to the next one.
101 // get the pointer to be returned
102 rv = fDigits->At(fCurrentDigit);
103 // prepare for the next position, if it exists
104 if ( fCurrentDigit < fDigits->GetLast() )
112 if ( fCurrentChamber <= fLastChamber )
114 fDigits = fData->Digits(fCurrentChamber);
126 //_____________________________________________________________________________
128 AliMUONDataDigitIterator::Remove()
130 /// Remove current element.
134 fDigits->RemoveAt(fCurrentDigit);
142 //_____________________________________________________________________________
144 AliMUONDataDigitIterator::Reset()
146 /// Reset the iterator
149 fCurrentChamber = fFirstChamber;
150 fDigits = fData->Digits(fCurrentChamber);