AliRoot Core  v5-06-15 (45dab64)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AliMUONPainterEnv.h
Go to the documentation of this file.
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 
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  static const char* SeparatorWithinPart() { return fgkSeparatorWithinPart; }
85 
87 
88 private:
93 
94  TEnv* fEnv;
95 
96  static const char* fgkNumberOfDataSourcesKey;
97  static const char* fgkDataSourceKey;
98  static const char* fgkDefaultRangeKey;
99  static const char* fgkDisableAutoPedCanvasKey;
100  static const char* fgkSeparatorWithinRange;
101  static const char* fgkSeparatorWithinPart;
103 
104  ClassDef(AliMUONPainterEnv,3) // Painter display resource file
105 };
106 
107 #endif
Double_t Double(const char *resourceName, Double_t defaultValue=0.0) const
static TString TupleMiddle(const TString &tuple, const char *sep)
Int_t NumberOfDataSources() const
static TString ID2Type(const char *dataSourceID)
static const char * fgkSeparatorWithinRange
static const char * fgkDefaultRangeKey
key used to specify the default ranges for data representation
static const char * fgkDisableAutoPedCanvasKey
static TString TupleSecond(const TString &tuple, const char *sep)
static const char * fgkSeparatorWithinPart
TString AddDataSource(const char *dataSourceDescriptor)
TString String(const char *resourceName, const char *defaultValue="") const
void SetDefaultRange(const char *dataSourceType, const char *dimensionName, Double_t xmin, Double_t xmax)
TString DataSourceType(const char *dataSourceName) const
Resource file handling.
static TString TupleLast(const TString &tuple, const char *sep)
static const char * SeparatorWithinPart()
static TString Descriptor2Ranges(const char *dataSourceDescriptor)
static const char * fgkNumberOfDataSourcesKey
key used to store the # of data sources in the resource file
static TString TupleFirst(const TString &tuple, const char *sep)
Int_t Integer(const char *resourceName, Int_t defaultValue=0) const
Int_t GetDataSourceIndex(const char *dataSourceName) const
void SetDimensionRange(const char *dataSourceName, const char *dimensionName, Double_t xmin, Double_t xmax)
static TString ID2Origin(const char *dataSourceID)
TString DataSourceID(const char *dataSourceName) const
TString DataSourceURI(const char *dataSourceName) const
TString DataSourceDescriptor(const char *dataSourceName) const
TString GetDefaultRange(const char *dataSourceType, const char *dimensionName) const
static TString Descriptor2Name(const char *dataSourceDescriptor)
TString DataSourceName(const char *dataSourceName) const
void Print(Option_t *opt="") const
AliMUONPainterEnv(const char *resourceFile=".mchviewrc")
TString DataSourceRanges(const char *dataSourceName) const
TEnv * fEnv
the worker class
static Bool_t Ranges2DimensionRange(const char *ranges, const char *dimensionName, Double_t &xmin, Double_t &xmax)
static TString ID2URI(const char *dataSourceID)
static const char * fgkDataSourceKey
key used to store the data source URIs in the resource file
AliMUONPainterEnv & operator=(const AliMUONPainterEnv &rhs)
Not implemented.
static const char * fgkSeparatorBetweenDescriptorParts
TString DataSourceOrigin(const char *dataSourceName) const
void Set(const char *resourceName, Int_t value)
static TString Descriptor2ID(const char *dataSourceDescriptor)
static const char * SeparatorBetweenDescriptorParts()
void ForceDataSourceToDefaultRange(const char *dataSourceName, const char *dim="")