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"
31 #include "TObjArray.h"
34 ClassImp(AliMUONDigitStoreV1Iterator)
37 //_____________________________________________________________________________
38 AliMUONDigitStoreV1Iterator::AliMUONDigitStoreV1Iterator(TObjArray* a,
42 : AliMUONTOTCAStoreIterator(a,AliMpDEManager::GetChamberId(firstDetElemId),
43 AliMpDEManager::GetChamberId(lastDetElemId)),
45 fFirstDetElemId(firstDetElemId),
46 fLastDetElemId(lastDetElemId),
52 //_____________________________________________________________________________
53 AliMUONDigitStoreV1Iterator::AliMUONDigitStoreV1Iterator(const AliMUONDigitStoreV1Iterator& rhs)
54 : AliMUONTOTCAStoreIterator(rhs),
56 fFirstDetElemId(rhs.fFirstDetElemId),
57 fLastDetElemId(rhs.fLastDetElemId),
58 fCathode(rhs.fCathode)
63 //_____________________________________________________________________________
65 AliMUONDigitStoreV1Iterator::operator=(const TIterator& rhs)
67 /// overriden assignment operator (imposed by Root's definition of TIterator ?)
68 if ( this != &rhs && rhs.IsA() == AliMUONDigitStoreV1Iterator::Class())
70 const AliMUONDigitStoreV1Iterator& rhs1 =
71 static_cast<const AliMUONDigitStoreV1Iterator&>(rhs);
74 fFirstDetElemId = rhs1.fFirstDetElemId;
75 fLastDetElemId = rhs1.fLastDetElemId;
76 fCathode = rhs1.fCathode;
81 //_____________________________________________________________________________
82 AliMUONDigitStoreV1Iterator&
83 AliMUONDigitStoreV1Iterator::operator=(const AliMUONDigitStoreV1Iterator& rhs)
85 /// assignement operator
89 fFirstDetElemId = rhs.fFirstDetElemId;
90 fLastDetElemId = rhs.fLastDetElemId;
91 fCathode = rhs.fCathode;
96 //_____________________________________________________________________________
97 AliMUONDigitStoreV1Iterator::~AliMUONDigitStoreV1Iterator()
102 //_____________________________________________________________________________
104 AliMUONDigitStoreV1Iterator::GetCollection() const
106 /// Return the TObjArray we're iterating upon
110 //_____________________________________________________________________________
112 AliMUONDigitStoreV1Iterator::Next()
114 /// Return the next digit (with its DE in [fFirstDetElemId,fLastDetElemId],
115 /// and its cathode == fCathode (or any cathode if fCathode==2)
118 TObject* object = 0x0;
120 while ( (object = static_cast<AliMUONVDigit*>(AliMUONTOTCAStoreIterator::Next()) ) )
122 AliMUONVDigit* digit = static_cast<AliMUONVDigit*>(object);
124 if ( digit->DetElemId() >= fFirstDetElemId &&
125 digit->DetElemId() <= fLastDetElemId )
127 if ( fCathode == 2 || digit->Cathode() == fCathode )