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 #include "AliMUONDataIterator.h"
20 #include "AliMUONConstants.h"
21 #include "AliMUONData.h"
22 #include "AliMUONDataDigitIterator.h"
26 // A wrapper to various iterators used to loop over
27 // objects handled by AliMUONData, like sdigits, digits, rawclusters,
30 // Currently only implemented for digits, as a proof-of-principle.
35 void GetChamberNumbers(AliMUONDataIterator::EIterationStyle type,
36 Int_t& firstChamber, Int_t& lastChamber)
40 case AliMUONDataIterator::kAllChambers:
42 lastChamber=AliMUONConstants::NCh()-1;
44 case AliMUONDataIterator::kTrackingChambers:
46 lastChamber=AliMUONConstants::NCh()-1;
48 case AliMUONDataIterator::kTriggerChambers:
49 firstChamber=AliMUONConstants::NTrackingCh();
50 lastChamber=AliMUONConstants::NCh()-1;
53 firstChamber=lastChamber=-1;
59 ClassImp(AliMUONDataIterator)
61 //_____________________________________________________________________________
62 AliMUONDataIterator::AliMUONDataIterator()
69 //_____________________________________________________________________________
70 AliMUONDataIterator::AliMUONDataIterator(AliMUONData* data,
71 const char* onWhatToIterate,
72 EIterationStyle howToIterate)
77 TString opt(onWhatToIterate);
79 if ( opt.Contains("digit") || opt.Contains("d") )
83 GetChamberNumbers(howToIterate,firstChamber,lastChamber);
84 if ( firstChamber >= 0 && lastChamber >= 0 )
86 data->GetLoader()->LoadDigits("READ");
87 data->SetTreeAddress("D,GLT");
88 fIterator = new AliMUONDataDigitIterator(data,firstChamber,lastChamber);
93 //_____________________________________________________________________________
94 AliMUONDataIterator::~AliMUONDataIterator()
99 //_____________________________________________________________________________
101 AliMUONDataIterator::Next()
103 if (fIterator) return fIterator->Next();
107 //_____________________________________________________________________________
109 AliMUONDataIterator::Remove()
111 if (fIterator) return fIterator->Remove();
115 //_____________________________________________________________________________
117 AliMUONDataIterator::Reset()
119 if (fIterator) fIterator->Reset();