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"
29 #include "AliMpDEManager.h"
30 #include "AliMUONVDigit.h"
33 ClassImp(AliMUONDigitStoreV1Iterator)
36 //_____________________________________________________________________________
37 AliMUONDigitStoreV1Iterator::AliMUONDigitStoreV1Iterator(TObjArray* a,
41 : AliMUONTOTCAStoreIterator(a,AliMpDEManager::GetChamberId(firstDetElemId),
42 AliMpDEManager::GetChamberId(lastDetElemId)),
44 fFirstDetElemId(firstDetElemId),
45 fLastDetElemId(lastDetElemId),
51 //_____________________________________________________________________________
52 AliMUONDigitStoreV1Iterator::AliMUONDigitStoreV1Iterator(const AliMUONDigitStoreV1Iterator& rhs)
53 : AliMUONTOTCAStoreIterator(rhs),
55 fFirstDetElemId(rhs.fFirstDetElemId),
56 fLastDetElemId(rhs.fLastDetElemId),
57 fCathode(rhs.fCathode)
62 //_____________________________________________________________________________
64 AliMUONDigitStoreV1Iterator::operator=(const TIterator& rhs)
66 /// overriden assignment operator (imposed by Root's definition of TIterator ?)
67 if ( this != &rhs && rhs.IsA() == AliMUONDigitStoreV1Iterator::Class())
69 const AliMUONDigitStoreV1Iterator& rhs1 =
70 static_cast<const AliMUONDigitStoreV1Iterator&>(rhs);
73 fFirstDetElemId = rhs1.fFirstDetElemId;
74 fLastDetElemId = rhs1.fLastDetElemId;
75 fCathode = rhs1.fCathode;
80 //_____________________________________________________________________________
81 AliMUONDigitStoreV1Iterator&
82 AliMUONDigitStoreV1Iterator::operator=(const AliMUONDigitStoreV1Iterator& rhs)
84 /// assignement operator
88 fFirstDetElemId = rhs.fFirstDetElemId;
89 fLastDetElemId = rhs.fLastDetElemId;
90 fCathode = rhs.fCathode;
95 //_____________________________________________________________________________
96 AliMUONDigitStoreV1Iterator::~AliMUONDigitStoreV1Iterator()
101 //_____________________________________________________________________________
103 AliMUONDigitStoreV1Iterator::GetCollection() const
105 /// Return the TObjArray we're iterating upon
109 //_____________________________________________________________________________
111 AliMUONDigitStoreV1Iterator::Next()
113 /// Return the next digit (with its DE in [fFirstDetElemId,fLastDetElemId],
114 /// and its cathode == fCathode (or any cathode if fCathode==2)
117 TObject* object = 0x0;
119 while ( (object = static_cast<AliMUONVDigit*>(AliMUONTOTCAStoreIterator::Next()) ) )
121 AliMUONVDigit* digit = static_cast<AliMUONVDigit*>(object);
123 if ( digit->DetElemId() >= fFirstDetElemId &&
124 digit->DetElemId() <= fLastDetElemId )
126 if ( fCathode == 2 || digit->Cathode() == fCathode )