Line data Source code
1 : #ifndef ALIMUONPAINTERENV_H
2 : #define ALIMUONPAINTERENV_H
3 :
4 : /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 : * See cxx source for full Copyright notice */
6 :
7 : // $Id$
8 :
9 : /// \ingroup graphics
10 : /// \class AliMUONPainterEnv
11 : /// \brief Resource file handling
12 : ///
13 : // Author Laurent Aphecetche, Subatech
14 :
15 : #ifndef ROOT_TObject
16 : # include "TObject.h"
17 : #endif
18 :
19 : class TEnv;
20 :
21 : class AliMUONPainterEnv : public TObject
22 : {
23 : public:
24 : AliMUONPainterEnv(const char* resourceFile=".mchviewrc");
25 : virtual ~AliMUONPainterEnv();
26 :
27 : TString AddDataSource(const char* dataSourceDescriptor);
28 :
29 : TString DataSourceDescriptor(const char* dataSourceName) const;
30 :
31 : TString DataSourceDescriptor(Int_t index) const;
32 :
33 : TString DataSourceName(const char* dataSourceName) const;
34 : TString DataSourceID(const char* dataSourceName) const;
35 :
36 : TString DataSourceOrigin(const char* dataSourceName) const;
37 : TString DataSourceRanges(const char* dataSourceName) const;
38 : TString DataSourceType(const char* dataSourceName) const;
39 : TString DataSourceURI(const char* dataSourceName) const;
40 :
41 : static TString Descriptor2ID(const char* dataSourceDescriptor);
42 : static TString Descriptor2Name(const char* dataSourceDescriptor);
43 : static TString Descriptor2Ranges(const char* dataSourceDescriptor);
44 :
45 : Double_t Double(const char* resourceName, Double_t defaultValue=0.0) const;
46 :
47 : void ForceDataSourceToDefaultRange(const char* dataSourceName, const char* dim="");
48 :
49 : Int_t GetDataSourceIndex(const char* dataSourceName) const;
50 :
51 : TString GetDefaultRange(const char* dataSourceType, const char* dimensionName) const;
52 :
53 : static TString ID2Origin(const char* dataSourceID);
54 : static TString ID2URI(const char* dataSourceID);
55 : static TString ID2Type(const char* dataSourceID);
56 :
57 : Int_t Integer(const char* resourceName, Int_t defaultValue=0) const;
58 :
59 : Int_t NumberOfDataSources() const;
60 :
61 : void Print(Option_t* opt="") const;
62 :
63 : static Bool_t Ranges2DimensionRange(const char* ranges, const char* dimensionName, Double_t& xmin, Double_t& xmax);
64 :
65 : void Save();
66 :
67 : void Set(const char* resourceName, Int_t value);
68 :
69 : void Set(const char* resourceName, const char* value);
70 :
71 : void Set(const char* resourceName, Double_t value);
72 :
73 : void SetDefaultRange(const char* dataSourceType, const char* dimensionName, Double_t xmin, Double_t xmax);
74 :
75 : void SetDimensionRange(const char* dataSourceName, const char* dimensionName, Double_t xmin, Double_t xmax);
76 :
77 : TString String(const char* resourceName, const char* defaultValue="") const;
78 :
79 : static TString TupleFirst(const TString& tuple, const char* sep);
80 : static TString TupleLast(const TString& tuple, const char* sep);
81 : static TString TupleMiddle(const TString& tuple, const char* sep);
82 : static TString TupleSecond(const TString& tuple, const char* sep);
83 :
84 0 : static const char* SeparatorWithinPart() { return fgkSeparatorWithinPart; }
85 :
86 0 : static const char* SeparatorBetweenDescriptorParts() { return fgkSeparatorBetweenDescriptorParts; }
87 :
88 : private:
89 : /// Not implemented
90 : AliMUONPainterEnv(const AliMUONPainterEnv& rhs);
91 : /// Not implemented
92 : AliMUONPainterEnv& operator=(const AliMUONPainterEnv& rhs);
93 :
94 : TEnv* fEnv; ///< the worker class
95 :
96 : static const char* fgkNumberOfDataSourcesKey; ///< key used to store the # of data sources in the resource file
97 : static const char* fgkDataSourceKey; ///< key used to store the data source URIs in the resource file
98 : static const char* fgkDefaultRangeKey; ///< key used to specify the default ranges for data representation
99 : static const char* fgkDisableAutoPedCanvasKey;
100 : static const char* fgkSeparatorWithinRange;
101 : static const char* fgkSeparatorWithinPart;
102 : static const char* fgkSeparatorBetweenDescriptorParts;
103 :
104 12 : ClassDef(AliMUONPainterEnv,3) // Painter display resource file
105 : };
106 :
107 : #endif
|