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 /// \class AliMUONDigitStoreV1Iterator
20 /// Implementation of TIteraor for AliMUONVDigitStoreV1
21 /// Reuses the AliMUONTOTCAStoreIterator iterator
23 /// \author Laurent Aphecetche, Subatech
25 #include "AliMUONDigitStoreV1Iterator.h"
27 #include "AliMpDEManager.h"
28 #include "AliMUONVDigit.h"
31 ClassImp(AliMUONDigitStoreV1Iterator)
34 //_____________________________________________________________________________
35 AliMUONDigitStoreV1Iterator::AliMUONDigitStoreV1Iterator(TObjArray* a,
39 : AliMUONTOTCAStoreIterator(a,AliMpDEManager::GetChamberId(firstDetElemId),
40 AliMpDEManager::GetChamberId(lastDetElemId)),
42 fFirstDetElemId(firstDetElemId),
43 fLastDetElemId(lastDetElemId),
49 //_____________________________________________________________________________
50 AliMUONDigitStoreV1Iterator::AliMUONDigitStoreV1Iterator(const AliMUONDigitStoreV1Iterator& rhs)
51 : AliMUONTOTCAStoreIterator(rhs),
53 fFirstDetElemId(rhs.fFirstDetElemId),
54 fLastDetElemId(rhs.fLastDetElemId),
55 fCathode(rhs.fCathode)
60 //_____________________________________________________________________________
62 AliMUONDigitStoreV1Iterator::operator=(const TIterator& rhs)
64 /// overriden assignment operator (imposed by Root's definition of TIterator ?)
65 if ( this != &rhs && rhs.IsA() == AliMUONDigitStoreV1Iterator::Class())
67 const AliMUONDigitStoreV1Iterator& rhs1 =
68 static_cast<const AliMUONDigitStoreV1Iterator&>(rhs);
71 fFirstDetElemId = rhs1.fFirstDetElemId;
72 fLastDetElemId = rhs1.fLastDetElemId;
73 fCathode = rhs1.fCathode;
78 //_____________________________________________________________________________
79 AliMUONDigitStoreV1Iterator&
80 AliMUONDigitStoreV1Iterator::operator=(const AliMUONDigitStoreV1Iterator& rhs)
82 /// assignement operator
86 fFirstDetElemId = rhs.fFirstDetElemId;
87 fLastDetElemId = rhs.fLastDetElemId;
88 fCathode = rhs.fCathode;
93 //_____________________________________________________________________________
94 AliMUONDigitStoreV1Iterator::~AliMUONDigitStoreV1Iterator()
99 //_____________________________________________________________________________
101 AliMUONDigitStoreV1Iterator::GetCollection() const
103 /// Return the TObjArray we're iterating upon
107 //_____________________________________________________________________________
109 AliMUONDigitStoreV1Iterator::Next()
111 /// Return the next digit (with its DE in [fFirstDetElemId,fLastDetElemId],
112 /// and its cathode == fCathode (or any cathode if fCathode==2)
115 TObject* object = 0x0;
117 while ( (object = static_cast<AliMUONVDigit*>(AliMUONTOTCAStoreIterator::Next()) ) )
119 AliMUONVDigit* digit = static_cast<AliMUONVDigit*>(object);
121 if ( digit->DetElemId() >= fFirstDetElemId &&
122 digit->DetElemId() <= fLastDetElemId )
124 if ( fCathode == 2 || digit->Cathode() == fCathode )