AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONDigitStoreV1Iterator.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 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
26 
28 
29 #include "AliLog.h"
30 #include "AliMpDEManager.h"
31 #include "AliMUONVDigit.h"
32 #include "TObjArray.h"
33 
37 
38 //_____________________________________________________________________________
40  Int_t firstDetElemId,
41  Int_t lastDetElemId,
42  Int_t cathode)
43 : AliMUONTOTCAStoreIterator(a,AliMpDEManager::GetChamberId(firstDetElemId),
44  AliMpDEManager::GetChamberId(lastDetElemId)),
45 fArray(a),
46 fFirstDetElemId(firstDetElemId),
47 fLastDetElemId(lastDetElemId),
48 fCathode(cathode)
49 {
51 }
52 
53 //_____________________________________________________________________________
56  fArray(rhs.fArray),
57  fFirstDetElemId(rhs.fFirstDetElemId),
58  fLastDetElemId(rhs.fLastDetElemId),
59  fCathode(rhs.fCathode)
60 {
62 }
63 
64 //_____________________________________________________________________________
67 {
69 
70  if ( this != &rhs )
71  {
72  if ( rhs.IsA() != AliMUONDigitStoreV1Iterator::Class() )
73  {
74  AliErrorGeneral("AliMUONDigitStoreV1Iterator::operator=","Wrong type");
75  }
76  else
77  {
78  const AliMUONDigitStoreV1Iterator& rhs1 =
79  static_cast<const AliMUONDigitStoreV1Iterator&>(rhs);
80 
82  }
83  }
84  return *this;
85 }
86 
87 //_____________________________________________________________________________
90 {
92  if ( this != &rhs )
93  {
94  TIterator::operator=(rhs);
95  fArray = rhs.fArray;
98  fCathode = rhs.fCathode;
99  }
100  return *this;
101 }
102 
103 //_____________________________________________________________________________
105 {
107 }
108 
109 //_____________________________________________________________________________
110 const TCollection*
112 {
114  return fArray;
115 }
116 
117 //_____________________________________________________________________________
118 TObject*
120 {
124 
125  TObject* object = 0x0;
126 
127  while ( (object = static_cast<AliMUONVDigit*>(AliMUONTOTCAStoreIterator::Next()) ) )
128  {
129  AliMUONVDigit* digit = static_cast<AliMUONVDigit*>(object);
130 
131  if ( digit->DetElemId() >= fFirstDetElemId &&
132  digit->DetElemId() <= fLastDetElemId )
133  {
134  if ( fCathode == 2 || digit->Cathode() == fCathode )
135  {
136  return digit;
137  }
138  }
139  }
140 
141  return 0x0;
142 }
Iterator on a store composed of a TObjArray of TClonesArrays.
Int_t fFirstDetElemId
first detection element to iterate upon
#define TObjArray
virtual Int_t DetElemId() const =0
The detection element this digit belongs to.
ClassImp(TPCGenInfo)
Definition: AliTPCCmpNG.C:254
Int_t fCathode
cathode to iterate upon
Int_t fLastDetElemId
last detection element to iterate upon
virtual Int_t Cathode() const =0
Cathode number this digit is on (0 or 1)
virtual const TCollection * GetCollection() const
Implementation of TIterator for AliMUONDigitStoreV1.
TObjArray * fArray
array we iterate upon
AliMUONDigitStoreV1Iterator & operator=(const TIterator &rhs)
The manager class for definition of detection element types.
AliMUONDigitStoreV1Iterator(const AliMUONDigitStoreV1Iterator &rhs)
ABC of a MUON digit.
Definition: AliMUONVDigit.h:18