![]() |
AliRoot Core
v5-06-15 (45dab64)
|
Resource file handling. More...
#include <AliMUONPainterEnv.h>
Public Member Functions | |
AliMUONPainterEnv (const char *resourceFile=".mchviewrc") | |
virtual | ~AliMUONPainterEnv () |
TString | AddDataSource (const char *dataSourceDescriptor) |
TString | DataSourceDescriptor (const char *dataSourceName) const |
TString | DataSourceDescriptor (Int_t index) const |
TString | DataSourceName (const char *dataSourceName) const |
TString | DataSourceID (const char *dataSourceName) const |
TString | DataSourceOrigin (const char *dataSourceName) const |
TString | DataSourceRanges (const char *dataSourceName) const |
TString | DataSourceType (const char *dataSourceName) const |
TString | DataSourceURI (const char *dataSourceName) const |
Double_t | Double (const char *resourceName, Double_t defaultValue=0.0) const |
void | ForceDataSourceToDefaultRange (const char *dataSourceName, const char *dim="") |
Int_t | GetDataSourceIndex (const char *dataSourceName) const |
TString | GetDefaultRange (const char *dataSourceType, const char *dimensionName) const |
Int_t | Integer (const char *resourceName, Int_t defaultValue=0) const |
Int_t | NumberOfDataSources () const |
void | Print (Option_t *opt="") const |
void | Save () |
void | Set (const char *resourceName, Int_t value) |
void | Set (const char *resourceName, const char *value) |
void | Set (const char *resourceName, Double_t value) |
void | SetDefaultRange (const char *dataSourceType, const char *dimensionName, Double_t xmin, Double_t xmax) |
void | SetDimensionRange (const char *dataSourceName, const char *dimensionName, Double_t xmin, Double_t xmax) |
TString | String (const char *resourceName, const char *defaultValue="") const |
Static Public Member Functions | |
static TString | Descriptor2ID (const char *dataSourceDescriptor) |
static TString | Descriptor2Name (const char *dataSourceDescriptor) |
static TString | Descriptor2Ranges (const char *dataSourceDescriptor) |
static TString | ID2Origin (const char *dataSourceID) |
static TString | ID2URI (const char *dataSourceID) |
static TString | ID2Type (const char *dataSourceID) |
static Bool_t | Ranges2DimensionRange (const char *ranges, const char *dimensionName, Double_t &xmin, Double_t &xmax) |
static TString | TupleFirst (const TString &tuple, const char *sep) |
static TString | TupleLast (const TString &tuple, const char *sep) |
static TString | TupleMiddle (const TString &tuple, const char *sep) |
static TString | TupleSecond (const TString &tuple, const char *sep) |
static const char * | SeparatorWithinPart () |
static const char * | SeparatorBetweenDescriptorParts () |
Private Member Functions | |
AliMUONPainterEnv (const AliMUONPainterEnv &rhs) | |
Not implemented. More... | |
AliMUONPainterEnv & | operator= (const AliMUONPainterEnv &rhs) |
Not implemented. More... | |
Private Attributes | |
TEnv * | fEnv |
the worker class More... | |
Static Private Attributes | |
static const char * | fgkNumberOfDataSourcesKey = "NumberOfDataSources" |
key used to store the # of data sources in the resource file More... | |
static const char * | fgkDataSourceKey = "DataSource.%d" |
key used to store the data source URIs in the resource file More... | |
static const char * | fgkDefaultRangeKey = "defaultRange" |
key used to specify the default ranges for data representation More... | |
static const char * | fgkDisableAutoPedCanvasKey = "disableAutoPedCanvas" |
static const char * | fgkSeparatorWithinRange = "/" |
static const char * | fgkSeparatorWithinPart = "|" |
static const char * | fgkSeparatorBetweenDescriptorParts =";" |
Resource file handling.
A resource file handling class.
Used to get some things persistent between two sessions of the mchview program.
Main usage is for data sources.
Syntax is :
NumberOfDataSources: n DataSource.d: ID NAME RANGES
ID = ORIGIN;URI;TYPE URI = depends on source
where ORIGIN might be OCDB or FILE (see AliMUONPainterDataSourceFrame::CreateOCDBDataSource()) (see AliMUONPainterDataSourceFrame::CreateRawDataSource()) (see AliMUONPainterDataSourceFrame::CreateACFDataSource())
URI is a source dependent set of information (separated by ;) needed to recreate the source, e.g. local:///cvmfs/alice-ocdb.cern.ch/calibration/data/2015/OCDB;216253
TYPE is the data source type (e.g. PED, RAW, CALZ, see AliMUONPainterDataSourceTypes)
NAME is a (unique) shortname for display, e.g. PED216253(alien)
RANGES is a set of space separated range definition. A range definition indicates, for one of the dimension of the data source, the min and max value to be plotted. Syntax is DIMNAME;XMIN;XMAX
The full line ID NAME RANGES is called the data source descriptor
Examples :
DataSource.0: OCDB;local:///cvmfs/alice-ocdb.cern.ch/calibration/data/2015/OCDB;216253;PED PED216253(cvmfs) Mean;0;500 Sigma;0;5
DataSource.1: RAW;/alice/data/2015/LHC15c/000216293/raw/15000216293018.10.root;local:///cvmfs/alice-ocdb.cern.ch/calibration/data/2015/OCDB; ;0.000000e+00;4.096000e+03;-1;-1[-1]
DataSource.2: ACF;/Users/laurent/Code.nogit/OCDB/occupancy-asciifiles/occupancy.000119969023.130;OCC
Apart from data source descriptions, the following keywords are recognized :
disableAutoPedCanvas: 0 | 1
which is used to suppress the automatic creation of summary canvases when opening a pedestal source
defaultRange: TYPE1;DIMNAME1;XMIN1;XMAX1 TYPE1;DIMNAME2;XMIN2;XMAX2 TYPE2;DIMNAME3;XMIN3;XMAX3
which is used to define default ranges for some dimensions of some source types
Definition at line 21 of file AliMUONPainterEnv.h.
AliMUONPainterEnv::AliMUONPainterEnv | ( | const char * | resourceFile = ".mchviewrc" | ) |
Ctor
Definition at line 99 of file AliMUONPainterEnv.cxx.
|
virtual |
dtor
Definition at line 126 of file AliMUONPainterEnv.cxx.
|
private |
Not implemented.
TString AliMUONPainterEnv::AddDataSource | ( | const char * | dataSourceDescriptor | ) |
Add (or replace) a data source to the list of data sources we handle Return the full descriptor of the data source
Definition at line 132 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterDataSourceFrame::RegisterDataSource(), and SetDimensionRange().
TString AliMUONPainterEnv::DataSourceDescriptor | ( | const char * | dataSourceName | ) | const |
Definition at line 181 of file AliMUONPainterEnv.cxx.
Referenced by AddDataSource(), AliMUONPainterMatrixFrame::ColorSliderDefaultButtonWasClicked(), DataSourceID(), DataSourceName(), DataSourceRanges(), ForceDataSourceToDefaultRange(), GetDataSourceIndex(), AliMUONPainterMatrix::SetData(), and SetDimensionRange().
TString AliMUONPainterEnv::DataSourceDescriptor | ( | Int_t | index | ) | const |
Definition at line 171 of file AliMUONPainterEnv.cxx.
TString AliMUONPainterEnv::DataSourceID | ( | const char * | dataSourceName | ) | const |
Definition at line 188 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterMatrixFrame::ColorSliderSetDefaultButtonWasClicked(), DataSourceOrigin(), DataSourceType(), and DataSourceURI().
TString AliMUONPainterEnv::DataSourceName | ( | const char * | dataSourceName | ) | const |
Definition at line 194 of file AliMUONPainterEnv.cxx.
TString AliMUONPainterEnv::DataSourceOrigin | ( | const char * | dataSourceName | ) | const |
Definition at line 200 of file AliMUONPainterEnv.cxx.
TString AliMUONPainterEnv::DataSourceRanges | ( | const char * | dataSourceName | ) | const |
Definition at line 206 of file AliMUONPainterEnv.cxx.
Referenced by ForceDataSourceToDefaultRange().
TString AliMUONPainterEnv::DataSourceType | ( | const char * | dataSourceName | ) | const |
Definition at line 212 of file AliMUONPainterEnv.cxx.
Referenced by ForceDataSourceToDefaultRange().
TString AliMUONPainterEnv::DataSourceURI | ( | const char * | dataSourceName | ) | const |
Definition at line 218 of file AliMUONPainterEnv.cxx.
|
static |
From descriptor = ID NAME RANGES return the ID part
Definition at line 249 of file AliMUONPainterEnv.cxx.
Referenced by AddDataSource(), AliMUONPainterDataSourceFrame::CreateOCDBDataSource(), DataSourceID(), ForceDataSourceToDefaultRange(), AliMUONPainterDataSourceFrame::OpenRecentSource(), AliMUONPainterDataSourceFrame::RegisterDataSource(), and SetDimensionRange().
|
static |
From descriptor = ID NAME RANGES return the NAME part
Definition at line 224 of file AliMUONPainterEnv.cxx.
Referenced by AddDataSource(), DataSourceName(), ForceDataSourceToDefaultRange(), GetDataSourceIndex(), AliMUONPainterDataSourceFrame::OpenRecentSource(), and SetDimensionRange().
|
static |
From descriptor = ID NAME RANGES return the RANGES part
Definition at line 240 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterMatrixFrame::ColorSliderDefaultButtonWasClicked(), AliMUONPainterDataSourceFrame::CreateOCDBDataSource(), DataSourceRanges(), AliMUONPainterMatrix::SetData(), and SetDimensionRange().
Double_t AliMUONPainterEnv::Double | ( | const char * | resourceName, |
Double_t | defaultValue = 0.0 |
||
) | const |
Retrieve the value associated with a given source, as a double
Definition at line 258 of file AliMUONPainterEnv.cxx.
void AliMUONPainterEnv::ForceDataSourceToDefaultRange | ( | const char * | dataSourceName, |
const char * | dim = "" |
||
) |
Definition at line 266 of file AliMUONPainterEnv.cxx.
Referenced by AddDataSource(), and AliMUONPainterMatrixFrame::ColorSliderDefaultButtonWasClicked().
Int_t AliMUONPainterEnv::GetDataSourceIndex | ( | const char * | dataSourceName | ) | const |
Definition at line 333 of file AliMUONPainterEnv.cxx.
Referenced by DataSourceDescriptor(), and ForceDataSourceToDefaultRange().
TString AliMUONPainterEnv::GetDefaultRange | ( | const char * | dataSourceType, |
const char * | dimensionName | ||
) | const |
Get the default range for a given dimension if dimensionName="" return all the defined default ranges for this data source type
Definition at line 349 of file AliMUONPainterEnv.cxx.
Referenced by ForceDataSourceToDefaultRange().
|
static |
From ID = ORIGIN|URI|TYPE return ORIGIN
Definition at line 402 of file AliMUONPainterEnv.cxx.
Referenced by DataSourceOrigin(), and AliMUONPainterDataSourceFrame::OpenRecentSource().
|
static |
From ID = ORIGIN|URI|TYPE return TYPE
Definition at line 416 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterMatrixFrame::ColorSliderSetDefaultButtonWasClicked(), AliMUONPainterDataSourceFrame::CreateOCDBDataSource(), DataSourceType(), and AliMUONPainterDataSourceFrame::RegisterDataSource().
|
static |
From ID = ORIGIN|URI|TYPE return URI
Definition at line 409 of file AliMUONPainterEnv.cxx.
Referenced by AddDataSource(), AliMUONPainterDataSourceFrame::CreateOCDBDataSource(), and DataSourceURI().
Int_t AliMUONPainterEnv::Integer | ( | const char * | resourceName, |
Int_t | defaultValue = 0 |
||
) | const |
Retrieve the value associated with a given source, as an integer
Definition at line 424 of file AliMUONPainterEnv.cxx.
Referenced by NumberOfDataSources().
Int_t AliMUONPainterEnv::NumberOfDataSources | ( | ) | const |
Definition at line 433 of file AliMUONPainterEnv.cxx.
Referenced by AddDataSource(), DataSourceDescriptor(), and GetDataSourceIndex().
|
private |
Not implemented.
void AliMUONPainterEnv::Print | ( | Option_t * | opt = "" | ) | const |
Definition at line 440 of file AliMUONPainterEnv.cxx.
|
static |
Definition at line 446 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterMatrixFrame::ColorSliderDefaultButtonWasClicked(), and AliMUONPainterMatrix::SetData().
void AliMUONPainterEnv::Save | ( | ) |
Save the resource file
Definition at line 478 of file AliMUONPainterEnv.cxx.
Referenced by AddDataSource(), AliMUONPainterMatrixFrame::ColorSliderSetDefaultButtonWasClicked(), AliMUONMchViewApplication::Open(), AliMUONPainterDataSourceFrame::OpenFileDialog(), AliMUONPainterDataSourceFrame::OpenFileDialogACF(), AliMUONPainterDataSourceItem::SaveWithDialog(), AliMUONPainterMatrix::SetData(), and AliMUONPainterHelper::~AliMUONPainterHelper().
|
inlinestatic |
Definition at line 86 of file AliMUONPainterEnv.h.
Referenced by AliMUONPainterDataSourceFrame::CreateOCDBDataSource().
|
inlinestatic |
Definition at line 84 of file AliMUONPainterEnv.h.
Referenced by AliMUONPainterDataSourceFrame::CreateOCDBDataSource().
void AliMUONPainterEnv::Set | ( | const char * | resourceName, |
Int_t | value | ||
) |
Set an integer resource
Definition at line 486 of file AliMUONPainterEnv.cxx.
Referenced by AddDataSource(), ForceDataSourceToDefaultRange(), AliMUONMchViewApplication::Open(), AliMUONPainterDataSourceFrame::OpenFileDialog(), AliMUONPainterDataSourceFrame::OpenFileDialogACF(), AliMUONPainterDataSourceItem::SaveWithDialog(), and SetDefaultRange().
void AliMUONPainterEnv::Set | ( | const char * | resourceName, |
const char * | value | ||
) |
Set a string resource
Definition at line 494 of file AliMUONPainterEnv.cxx.
void AliMUONPainterEnv::Set | ( | const char * | resourceName, |
Double_t | value | ||
) |
Set a double resource
Definition at line 502 of file AliMUONPainterEnv.cxx.
void AliMUONPainterEnv::SetDefaultRange | ( | const char * | dataSourceType, |
const char * | dimensionName, | ||
Double_t | xmin, | ||
Double_t | xmax | ||
) |
Set the default range of a given dimension for a data source type
Definition at line 510 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterMatrixFrame::ColorSliderSetDefaultButtonWasClicked().
void AliMUONPainterEnv::SetDimensionRange | ( | const char * | dataSourceName, |
const char * | dimensionName, | ||
Double_t | xmin, | ||
Double_t | xmax | ||
) |
Replace i-th source dimension range by xmin,xmax
Definition at line 560 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterMatrix::SetDataRange().
TString AliMUONPainterEnv::String | ( | const char * | resourceName, |
const char * | defaultValue = "" |
||
) | const |
Retrieve the value associated with a given source, as a string
Definition at line 607 of file AliMUONPainterEnv.cxx.
Referenced by DataSourceDescriptor(), Descriptor2Name(), GetDefaultRange(), AliMUONMchViewApplication::Open(), Ranges2DimensionRange(), AliMUONPainterDataSourceItem::SaveWithDialog(), AliMUONPainterInterfaceHelper::SetBackgroundColor(), SetDefaultRange(), and SetDimensionRange().
|
static |
Assuming tuple = aaa;bbb;....;yyy;zzz returns aaa
Definition at line 615 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterDataSourceFrame::CreateOCDBDataSource(), Descriptor2ID(), ForceDataSourceToDefaultRange(), ID2Origin(), Ranges2DimensionRange(), SetDimensionRange(), and TupleSecond().
|
static |
Assuming tuple = aaa;bbb;....;yyy;zzz returns zzz
Definition at line 639 of file AliMUONPainterEnv.cxx.
Referenced by Descriptor2Ranges(), ID2Type(), and Ranges2DimensionRange().
|
static |
Assuming tuple = aaa;bbb;....;yyy;zzz returns bbb;....;yyy
Definition at line 630 of file AliMUONPainterEnv.cxx.
Referenced by AliMUONPainterDataSourceFrame::CreateOCDBDataSource(), ID2URI(), Ranges2DimensionRange(), and TupleSecond().
|
static |
Assuming tuple = aaa;bbb;....;yyy;zzz returns bbb
Definition at line 623 of file AliMUONPainterEnv.cxx.
Referenced by SetDefaultRange().
|
private |
|
staticprivate |
key used to store the data source URIs in the resource file
Definition at line 97 of file AliMUONPainterEnv.h.
Referenced by AddDataSource(), DataSourceDescriptor(), and ForceDataSourceToDefaultRange().
|
staticprivate |
key used to specify the default ranges for data representation
Definition at line 98 of file AliMUONPainterEnv.h.
Referenced by GetDefaultRange(), and SetDefaultRange().
|
staticprivate |
Definition at line 99 of file AliMUONPainterEnv.h.
|
staticprivate |
key used to store the # of data sources in the resource file
Definition at line 96 of file AliMUONPainterEnv.h.
Referenced by AddDataSource(), and NumberOfDataSources().
|
staticprivate |
Definition at line 102 of file AliMUONPainterEnv.h.
Referenced by Descriptor2ID(), Descriptor2Name(), Descriptor2Ranges(), ForceDataSourceToDefaultRange(), SeparatorBetweenDescriptorParts(), and SetDimensionRange().
|
staticprivate |
Definition at line 101 of file AliMUONPainterEnv.h.
Referenced by ForceDataSourceToDefaultRange(), GetDefaultRange(), ID2Origin(), ID2Type(), ID2URI(), Ranges2DimensionRange(), SeparatorWithinPart(), SetDefaultRange(), and SetDimensionRange().
|
staticprivate |
Definition at line 100 of file AliMUONPainterEnv.h.
Referenced by ForceDataSourceToDefaultRange(), GetDefaultRange(), Ranges2DimensionRange(), SetDefaultRange(), and SetDimensionRange().