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 //-----------------------------------------------------------------------------
19 /// \class AliMUONDigitStoreVImplIterator
21 /// Implementation of AliMUONVDataIterator for AliMUONDigitStoreVImpl
23 /// \author Laurent Aphecetche, Subatech
25 //-----------------------------------------------------------------------------
27 #include "AliMUONDigitStoreVImplIterator.h"
29 #include "AliMUONVDigit.h"
30 #include "AliMUONDigitStoreVImpl.h"
31 #include "AliMUON2DMap.h"
32 #include "AliMUONVCalibParam.h"
33 #include <TClonesArray.h>
37 ClassImp(AliMUONDigitStoreVImplIterator)
40 //_____________________________________________________________________________
41 AliMUONDigitStoreVImplIterator::AliMUONDigitStoreVImplIterator(const AliMUONDigitStoreVImpl* store)
47 fStoreIterator(store->fMap->CreateIterator()),
48 fCurrentCalibParam(0x0),
49 fCurrentCalibParamIndex(-1)
51 /// ctor for full iteration
54 //_____________________________________________________________________________
55 AliMUONDigitStoreVImplIterator::AliMUONDigitStoreVImplIterator(const AliMUONDigitStoreVImpl* store,
61 fFirstDetElemId(firstDE),
62 fLastDetElemId(lastDE),
64 fStoreIterator(store->fMap->CreateIterator(firstDE,lastDE)),
65 fCurrentCalibParam(0x0),
66 fCurrentCalibParamIndex(-1)
68 /// ctor for partial iteration
71 //_____________________________________________________________________________
72 AliMUONDigitStoreVImplIterator&
73 AliMUONDigitStoreVImplIterator::operator=(const TIterator&)
75 // overriden assignment operator (imposed by Root's declaration of Titerator ?)
76 Fatal("TIterator::operator=","Not implementeable"); // because there's no clone in TIterator :-(
80 //_____________________________________________________________________________
81 AliMUONDigitStoreVImplIterator::~AliMUONDigitStoreVImplIterator()
84 delete fStoreIterator;
87 //_____________________________________________________________________________
89 AliMUONDigitStoreVImplIterator::Next()
91 /// Return next digit in store
92 if ( !fCurrentCalibParam )
94 fCurrentCalibParam = static_cast<AliMUONVCalibParam*>(fStoreIterator->Next());
95 fCurrentCalibParamIndex = 0;
96 if ( !fCurrentCalibParam ) return 0x0;
100 AliMUONVDigit* d(0x0);
104 while ( fCurrentCalibParamIndex < 64 && ix < 0 )
106 ix = fCurrentCalibParam->ValueAsInt(fCurrentCalibParamIndex++);
111 d = static_cast<AliMUONVDigit*>(fkStore->fDigits->UncheckedAt(ix));
118 while ( fCurrentCalibParamIndex < 64 && ix < 0 )
120 ix = fCurrentCalibParam->ValueAsInt(fCurrentCalibParamIndex++);
125 d = static_cast<AliMUONVDigit*>(fkStore->fDigits->UncheckedAt(ix));
127 if ( fCathode == 2 || d->Cathode() == fCathode )
143 fCurrentCalibParam = 0x0;
150 //_____________________________________________________________________________
152 AliMUONDigitStoreVImplIterator::Reset()
154 /// Reset the iterator
155 fCurrentCalibParam = 0x0;
156 fCurrentCalibParamIndex = 0;
157 fStoreIterator->Reset();