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 AliMUONDigitStoreV1Iterator
21 /// Implementation of TIteraor for AliMUONVDigitStoreV1
22 /// Reuses the AliMUONTOTCAStoreIterator iterator
24 /// \author Laurent Aphecetche, Subatech
25 //-----------------------------------------------------------------------------
27 #include "AliMUONDigitStoreV1Iterator.h"
30 #include "AliMpDEManager.h"
31 #include "AliMUONVDigit.h"
32 #include "TObjArray.h"
35 ClassImp(AliMUONDigitStoreV1Iterator)
38 //_____________________________________________________________________________
39 AliMUONDigitStoreV1Iterator::AliMUONDigitStoreV1Iterator(TObjArray* a,
43 : AliMUONTOTCAStoreIterator(a,AliMpDEManager::GetChamberId(firstDetElemId),
44 AliMpDEManager::GetChamberId(lastDetElemId)),
46 fFirstDetElemId(firstDetElemId),
47 fLastDetElemId(lastDetElemId),
53 //_____________________________________________________________________________
54 AliMUONDigitStoreV1Iterator::AliMUONDigitStoreV1Iterator(const AliMUONDigitStoreV1Iterator& rhs)
55 : AliMUONTOTCAStoreIterator(rhs),
57 fFirstDetElemId(rhs.fFirstDetElemId),
58 fLastDetElemId(rhs.fLastDetElemId),
59 fCathode(rhs.fCathode)
64 //_____________________________________________________________________________
65 AliMUONDigitStoreV1Iterator&
66 AliMUONDigitStoreV1Iterator::operator=(const TIterator& rhs)
68 /// overriden assignment operator (imposed by Root's definition of TIterator ?)
72 if ( rhs.IsA() != AliMUONDigitStoreV1Iterator::Class() )
74 AliErrorGeneral("AliMUONDigitStoreV1Iterator::operator=","Wrong type");
78 const AliMUONDigitStoreV1Iterator& rhs1 =
79 static_cast<const AliMUONDigitStoreV1Iterator&>(rhs);
81 AliMUONDigitStoreV1Iterator::operator=(rhs1);
87 //_____________________________________________________________________________
88 AliMUONDigitStoreV1Iterator&
89 AliMUONDigitStoreV1Iterator::operator=(const AliMUONDigitStoreV1Iterator& rhs)
91 /// assignement operator
94 TIterator::operator=(rhs);
96 fFirstDetElemId = rhs.fFirstDetElemId;
97 fLastDetElemId = rhs.fLastDetElemId;
98 fCathode = rhs.fCathode;
103 //_____________________________________________________________________________
104 AliMUONDigitStoreV1Iterator::~AliMUONDigitStoreV1Iterator()
109 //_____________________________________________________________________________
111 AliMUONDigitStoreV1Iterator::GetCollection() const
113 /// Return the TObjArray we're iterating upon
117 //_____________________________________________________________________________
119 AliMUONDigitStoreV1Iterator::Next()
121 /// Return the next digit (with its DE in [fFirstDetElemId,fLastDetElemId],
122 /// and its cathode == fCathode (or any cathode if fCathode==2)
125 TObject* object = 0x0;
127 while ( (object = static_cast<AliMUONVDigit*>(AliMUONTOTCAStoreIterator::Next()) ) )
129 AliMUONVDigit* digit = static_cast<AliMUONVDigit*>(object);
131 if ( digit->DetElemId() >= fFirstDetElemId &&
132 digit->DetElemId() <= fLastDetElemId )
134 if ( fCathode == 2 || digit->Cathode() == fCathode )