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 "AliMpManuIterator.h"
20 #include "AliMpBusPatch.h"
21 #include "AliMpDDLStore.h"
24 /// \class AliMpManuIterator
26 /// Class to loop over all manus of MUON Tracker
28 /// \author Laurent Aphecetche, Subatech
31 ClassImp(AliMpManuIterator)
34 //_____________________________________________________________________________
35 AliMpManuIterator::AliMpManuIterator()
37 fIterator(new TExMapIter(AliMpDDLStore::Instance()->GetBusPatchesIterator())),
38 fCurrentBusPatch(0x0),
45 //_____________________________________________________________________________
46 AliMpManuIterator::~AliMpManuIterator()
52 //_____________________________________________________________________________
54 AliMpManuIterator::Next(Int_t& detElemId, Int_t& manuId)
56 /// Set the next (de,manu) pair and return kTRUE, or kFALSE if ended.
60 if ( fCurrentManuIndex < fCurrentBusPatch->GetNofManus() )
62 detElemId = fCurrentBusPatch->GetDEId();
63 manuId = fCurrentBusPatch->GetManuId(fCurrentManuIndex);
68 fCurrentBusPatch = NextBusPatch();
69 if (!fCurrentBusPatch )
73 fCurrentManuIndex = -1;
74 return Next(detElemId,manuId);
78 //_____________________________________________________________________________
80 AliMpManuIterator::NextBusPatch() const
82 /// Return next bus patch
86 Bool_t ok = fIterator->Next(key,value);
90 return reinterpret_cast<AliMpBusPatch*>(value);
95 //_____________________________________________________________________________
97 AliMpManuIterator::Reset()
99 /// Rewind the iterator
102 fCurrentBusPatch = NextBusPatch();
104 fCurrentManuIndex = -1;