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 /// \class AliMUONDigitStoreVImplIterator
20 /// Implementation of AliMUONVDataIterator for AliMUONDigitStoreVImpl
22 /// \author Laurent Aphecetche, Subatech
25 #include "AliMUONDigitStoreVImplIterator.h"
27 #include "AliMUONVDigit.h"
28 #include "AliMUONDigitStoreVImpl.h"
29 #include "AliMUON2DMap.h"
30 #include "AliMUONVCalibParam.h"
31 #include <TClonesArray.h>
35 ClassImp(AliMUONDigitStoreVImplIterator)
38 //_____________________________________________________________________________
39 AliMUONDigitStoreVImplIterator::AliMUONDigitStoreVImplIterator(const AliMUONDigitStoreVImpl* store)
45 fStoreIterator(store->fMap->CreateIterator()),
46 fCurrentCalibParam(0x0),
47 fCurrentCalibParamIndex(-1)
49 /// ctor for full iteration
52 //_____________________________________________________________________________
53 AliMUONDigitStoreVImplIterator::AliMUONDigitStoreVImplIterator(const AliMUONDigitStoreVImpl* store,
59 fFirstDetElemId(firstDE),
60 fLastDetElemId(lastDE),
62 fStoreIterator(store->fMap->CreateIterator(firstDE,lastDE)),
63 fCurrentCalibParam(0x0),
64 fCurrentCalibParamIndex(-1)
66 /// ctor for partial iteration
69 //_____________________________________________________________________________
70 AliMUONDigitStoreVImplIterator::AliMUONDigitStoreVImplIterator(const AliMUONDigitStoreVImplIterator& rhs)
73 fFirstDetElemId(rhs.fFirstDetElemId),
74 fLastDetElemId(rhs.fLastDetElemId),
75 fCathode(rhs.fCathode),
77 fCurrentCalibParam(0x0),
78 fCurrentCalibParamIndex(-1)
81 Fatal("AliMUONDigitStoreVImplIterator::copy tor","Not implementeable"); // because there's no clone in TIterator :-(
84 //_____________________________________________________________________________
85 AliMUONDigitStoreVImplIterator&
86 AliMUONDigitStoreVImplIterator::operator=(const AliMUONDigitStoreVImplIterator&)
88 /// assignment operator
89 Fatal("AliMUONDigitStoreVImplIterator::operator=","Not implementeable"); // because there's no clone in TIterator :-(
93 //_____________________________________________________________________________
95 AliMUONDigitStoreVImplIterator::operator=(const TIterator&)
97 /// overriden assignment operator (imposed by Root's declaration of Titerator ?)
98 Fatal("TIterator::operator=","Not implementeable"); // because there's no clone in TIterator :-(
102 //_____________________________________________________________________________
103 AliMUONDigitStoreVImplIterator::~AliMUONDigitStoreVImplIterator()
106 delete fStoreIterator;
109 //_____________________________________________________________________________
111 AliMUONDigitStoreVImplIterator::Next()
113 /// Return next digit in store
114 if ( !fCurrentCalibParam )
116 fCurrentCalibParam = static_cast<AliMUONVCalibParam*>(fStoreIterator->Next());
117 fCurrentCalibParamIndex = 0;
118 if ( !fCurrentCalibParam ) return 0x0;
122 AliMUONVDigit* d(0x0);
126 while ( fCurrentCalibParamIndex < 64 && ix < 0 )
128 ix = fCurrentCalibParam->ValueAsInt(fCurrentCalibParamIndex++);
133 d = static_cast<AliMUONVDigit*>(fStore->fDigits->UncheckedAt(ix));
140 while ( fCurrentCalibParamIndex < 64 && ix < 0 )
142 ix = fCurrentCalibParam->ValueAsInt(fCurrentCalibParamIndex++);
147 d = static_cast<AliMUONVDigit*>(fStore->fDigits->UncheckedAt(ix));
149 if ( fCathode == 2 || d->Cathode() == fCathode )
165 fCurrentCalibParam = 0x0;
172 //_____________________________________________________________________________
174 AliMUONDigitStoreVImplIterator::Reset()
176 /// Reset the iterator
177 fCurrentCalibParam = 0x0;
178 fCurrentCalibParamIndex = 0;
179 fStoreIterator->Reset();