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"
25 /// \class AliMpManuIterator
27 /// Class to loop over all manus of MUON Tracker
29 /// \author Laurent Aphecetche, Subatech
32 ClassImp(AliMpManuIterator)
35 //_____________________________________________________________________________
36 AliMpManuIterator::AliMpManuIterator()
38 fIterator(AliMpDDLStore::Instance()->CreateBusPatchIterator()),
39 fCurrentBusPatch(0x0),
46 //_____________________________________________________________________________
47 AliMpManuIterator::~AliMpManuIterator()
53 //_____________________________________________________________________________
55 AliMpManuIterator::Next(Int_t& detElemId, Int_t& manuId)
57 /// Set the next (de,manu) pair and return kTRUE, or kFALSE if ended.
61 if ( fCurrentManuIndex < fCurrentBusPatch->GetNofManus() )
63 detElemId = fCurrentBusPatch->GetDEId();
64 manuId = fCurrentBusPatch->GetManuId(fCurrentManuIndex);
69 fCurrentBusPatch = static_cast<AliMpBusPatch*>(fIterator->Next());
70 if (!fCurrentBusPatch )
74 fCurrentManuIndex = -1;
75 return Next(detElemId,manuId);
79 //_____________________________________________________________________________
81 AliMpManuIterator::Reset()
83 /// Rewind the iterator
86 fCurrentBusPatch = static_cast<AliMpBusPatch*>(fIterator->Next());
88 fCurrentManuIndex = -1;