AliRoot Core  v5-06-30 (35d6c57)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMpManuIterator.cxx
Go to the documentation of this file.
1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15 
16 // $Id$
17 
18 #include "AliMpManuIterator.h"
19 
20 #include "AliMpBusPatch.h"
21 #include "AliMpDDLStore.h"
22 #include "TExMap.h"
23 #include "AliLog.h"
24 
30 
34 
35 //_____________________________________________________________________________
37 : TObject(),
38 fIterator(AliMpDDLStore::Instance()->CreateBusPatchIterator()),
39 fCurrentBusPatch(0x0),
40 fCurrentManuIndex(-1)
41 {
43  Reset();
44 }
45 
46 //_____________________________________________________________________________
48 {
50  delete fIterator;
51 }
52 
53 //_____________________________________________________________________________
54 Bool_t
55 AliMpManuIterator::Next(Int_t& detElemId, Int_t& manuId)
56 {
58 
60 
61  if ( fCurrentManuIndex < fCurrentBusPatch->GetNofManus() )
62  {
63  detElemId = fCurrentBusPatch->GetDEId();
65  return kTRUE;
66  }
67  else
68  {
69  fCurrentBusPatch = static_cast<AliMpBusPatch*>(fIterator->Next());
70  if (!fCurrentBusPatch )
71  {
72  return kFALSE;
73  }
74  fCurrentManuIndex = -1;
75  return Next(detElemId,manuId);
76  }
77 }
78 
79 //_____________________________________________________________________________
80 void
82 {
84  fIterator->Reset();
85 
86  fCurrentBusPatch = static_cast<AliMpBusPatch*>(fIterator->Next());
87 
88  fCurrentManuIndex = -1;
89 }
AliMpBusPatch * fCurrentBusPatch
current bus patch
The top container class for DDLs, det elements and bus patched.
Definition: AliMpDDLStore.h:35
Int_t GetDEId() const
Return the Detection element Id.
Definition: AliMpBusPatch.h:93
Int_t GetManuId(Int_t index) const
Bool_t Next(Int_t &detElemId, Int_t &manuId)
Class to loop over all manus of MUON Tracker.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
TIterator * fIterator
internal iterator
The class defines the properties of BusPatch.
Definition: AliMpBusPatch.h:21
Int_t fCurrentManuIndex
current manu index in current bus patch