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 "AliMUONV1DStore.h"
20 #include "AliMUONVDataIterator.h"
21 #include "AliMUONObjectPair.h"
22 #include "AliMpIntPair.h"
23 #include "AliMpHelper.h"
26 #include <Riostream.h>
28 /// \class AliMUONV1DStore
29 /// Defines an interface equivalent to a list of TObject, indexed
30 /// by integer (somehow a vector, except that indices are not necessarily
33 /// It's extremely simple and hopefully allow many implementations.
34 /// It also makes the object ownership self-evident.
36 /// \author Laurent Aphecetche
39 ClassImp(AliMUONV1DStore)
42 //_____________________________________________________________________________
43 AliMUONV1DStore::AliMUONV1DStore()
45 /// Default constructor
48 //_____________________________________________________________________________
49 AliMUONV1DStore::~AliMUONV1DStore()
55 AliMUONV1DStore::Print(Option_t* opt) const
58 /// opt is used to filter which i you want to see
59 /// e.g opt="I=12;opt=Full" to see complete values, but only for i=12
60 /// Warning : decoding of opt format is not really bullet-proof (yet?)
62 AliMUONVDataIterator* it = this->Iterator();
64 AliMUONObjectPair* pair;
66 TMap* m = AliMpHelper::Decode(opt);
69 Bool_t selectI = AliMpHelper::Decode(*m,"i",si);
71 AliMpHelper::Decode(*m,"opt",sopt);
76 while ( ( pair = static_cast<AliMUONObjectPair*>(it->Next() ) ) )
78 AliMpIntPair* ip = static_cast<AliMpIntPair*>(pair->First());
79 Int_t i = ip->GetFirst();
80 if ( selectI && i != si.Atoi() ) continue;
81 cout << Form("[%d]",i) << endl;
82 TObject* o = pair->Second();
85 o->Print(sopt.Data());