]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpDataStreams.h
Separating run-dependent mapping data from data, which are not
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpDataStreams.h
CommitLineData
228fd720 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
4// $Id$
5// $MpId: AliMpDataStreams.h,v 1.10 2006/05/24 13:58:07 ivana Exp $
6
7/// \ingroup basic
8/// \class AliMpDataStreams
9/// \brief Mapping data streams provider
10///
11/// The class provides input streams for mapping data;
12/// the input streams can be represented either by the
ab167304 13/// data files or by string streams filled from string map (AliMpDataMap).
14/// The string map is set from outside (AliMpCDB) and is not
15/// deleted in this class.
16/// The data streams returned by CreateDataStream() function
17/// must be deleted by the client code.
228fd720 18///
ab167304 19/// The selection between files and string streams is
20/// done in the constructor:
21/// if data map is provided, reading is performed from streams,
22/// otherwise reading is performed from file.
23/// User can also use the set function to select reading
24/// from files also when the data map is provided: \n
25/// void SetReadFromFiles();
228fd720 26///
27/// \author Ivana Hrivnacova; IPN Orsay
28
29#ifndef ALI_MP_DATA_STREAMS_H
30#define ALI_MP_DATA_STREAMS_H
31
32#include "AliMpDataMap.h"
33
34#include <TObject.h>
35#include <TString.h>
36
37#include <fstream>
38#include <sstream>
39
40//class TMap;
41class AliMpDataMap;
42
43class AliMpDataStreams : public TObject
44{
45 public:
ab167304 46 AliMpDataStreams(AliMpDataMap* map = 0x0);
47 AliMpDataStreams(TRootIOCtor* ioCtor);
228fd720 48 virtual ~AliMpDataStreams();
49
228fd720 50 // methods
51 istream& CreateDataStream(const TString& path) const;
52 Bool_t IsDataStream(const TString& path) const;
53
54 // set methods
ab167304 55 void SetReadFromFiles();
228fd720 56 Bool_t GetReadFromFiles() const;
57
58 private:
59 /// Not implemented
60 AliMpDataStreams(const AliMpDataStreams& right);
61 /// Not implemented
62 AliMpDataStreams& operator=(const AliMpDataStreams& right);
63
ab167304 64 // methods
65 void CutDataPath(string& dataPath) const;
228fd720 66
67 // data members
228fd720 68 AliMpDataMap* fMap; ///< data map
69 Bool_t fReadFromFiles; ///< option for reading data from files
70
71 ClassDef(AliMpDataStreams, 1) //File names and paths
72};
73
74#endif //ALI_MP_DATA_STREAMS_H