};
ClassImp(AliConfig)
-AliConfig* AliConfig::fInstance = 0;
+AliConfig* AliConfig::fgInstance = 0;
//0 level folder
const TString AliConfig::fgkTopFolderName("Folders");
//
// Instance method for singleton class
//
- if(fInstance == 0)
+ if(fgInstance == 0)
{
- fInstance = new AliConfig (fgkTopFolderName,"Alice data exchange board");
+ fgInstance = new AliConfig (fgkTopFolderName,"Alice data exchange board");
}
- return fInstance;
+ return fgInstance;
}
//____________________________________________________________________________
//
// Default constructor, mainly to keep coding conventions
//
- fInstance=0;//never mind, its going to exit in next step
+ fgInstance=0;//never mind, its going to exit in next step
Fatal("ctor","Constructor should not be called for a singleton\n");
}
//____________________________________________________________________________
//
// Copy constructor, mainly to keep coding conventions
//
- fInstance=0;
+ fgInstance=0;
Fatal("copy ctor",
"Copy constructor should not be called for a singleton\n");
}
//____________________________________________________________________________
+AliConfig& AliConfig::operator=(const AliConfig& /*conf*/)
+{
+ //
+ // Assignment, mainly to keep coding conventions
+ //
+ fgInstance=0;
+
+ Fatal("Assignment operator",
+ "Assignment operator should not be called for a singleton\n");
+ return *this;
+}
+//____________________________________________________________________________
+
AliConfig::AliConfig(const char *name, const char *title):
TNamed(name,title),
fTopFolder(gROOT->GetRootFolder()->AddFolder(name,title)),
gROOT->GetListOfBrowsables()->Add(fTopFolder, name);
//Constants folder
- TFolder *fConstFolder = fTopFolder->AddFolder (fgkConstantsFolderName, "Constant parameters");
+ fConstFolder = fTopFolder->AddFolder (fgkConstantsFolderName, "Constant parameters");
fConstFolder->AddFolder("DatabasePDG", "PDG database");
// Add the tasks to //Folders
fDetectorTask[kDetTaskPID] = fgkPIDTaskName;
fDetectorTask[kDetTaskLast] = "";
- fInstance=this;
+ fgInstance=this;
}
//____________________________________________________________________________
AliConfig::~AliConfig()
{
+ // destructor
delete [] fDetectorFolder ;
delete [] fDetectorTask;
if (fTopFolder)
void AliConfig::AddInFolder (const char *dir, TObject *obj)
{
+ // Adds object "obj" to folder "dir"
TFolder *folder = dynamic_cast<TFolder *>(fTopFolder->FindObject(dir));
if (folder)
folder->Add (static_cast<TObject *>(obj));
//Create new task named 'name' and titled 'title'
//as a subtask of the task named 'taskname'
- if (AliLoader::fgDebug) Info("AddSubTask","Try to get folder named %s",taskname);
+ if (AliLoader::GetDebug()) Info("AddSubTask","Try to get folder named %s",taskname);
TObject* obj = fTopFolder->FindObject(taskname);
TTask * task = (obj)?dynamic_cast<TTask*>(obj):0x0;
if (task)
{
- if (AliLoader::fgDebug) Info("AddSubTask"," Got");
+ if (AliLoader::GetDebug()) Info("AddSubTask"," Got");
TTask * subtask = static_cast<TTask*>(task->GetListOfTasks()->FindObject(name));
if (!subtask)
{
//____________________________________________________________________________
TObject* AliConfig::FindInFolder (const char *dir, const char *name)
{
+ // Finds object with name "name" in folder "dir"
if(!name) return(fTopFolder->FindObject(name));
TFolder * folder = dynamic_cast<TFolder *>(fTopFolder->FindObject(dir));
if (!folder) return (NULL);
//____________________________________________________________________________
void AliConfig::Add (AliGenerator * obj,const char* eventfolder)
{
+ // Adds generator "obj" to the event folder "eventfolder"
TString path(eventfolder);
path = path + "/" + fgkGeneratorsFolderName;
AddInFolder(path,obj);
//____________________________________________________________________________
void AliConfig::Add (TVirtualMC * obj,const char* eventfolder)
{
+ // Adds TVirtualMC object to the event folder
TString path(eventfolder);
path = path + "/" + fgkMCFolderName;
AddInFolder(path, obj);
//____________________________________________________________________________
void AliConfig::Add (TDatabasePDG * obj)
{
+ // Adds TDataBase object
AddInFolder(fgkPDGFolderName, obj);
}
//____________________________________________________________________________
void AliConfig::Add(AliModule* obj,const char* eventfolder)
{
-
+ // Adds module to the event folder
TString path(eventfolder);
path = path + "/" + fgkModuleFolderName;
- if (AliLoader::fgDebug)
+ if (AliLoader::GetDebug())
Info("Add(AliModule*)","module name = %s, Ev. Fold. Name is %s.",
obj->GetName(),eventfolder);
AddInFolder(path, obj);
void AliConfig::Add(AliDetector * obj,const char* eventfolder)
{
- if (AliLoader::fgDebug)
+ // Adds new AliDetector objest to the correspondent event folder
+ if (AliLoader::GetDebug())
Info("Add(AliDetector*)","detector name = %s, Ev. Fold. Name is %s.",
obj->GetName(),eventfolder);
//____________________________________________________________________________
Int_t AliConfig::CreateDetectorTasks(const char *name, const char* title)
{
+ // Creates new detector's task "name"
Int_t i = 0;
Int_t tmp;
while (i < kDetTaskLast)
//____________________________________________________________________________
void AliConfig::Add (char *list)
{
+ // Adds space separated list of objects to the
+ // configuration macro (?)
char *path;
- const char *conf_path = gSystem->Getenv ("ALICE_CONFIG_PATH");
- if (conf_path) {
- path = new char[strlen (conf_path)];
- strcpy (path, conf_path);
+ const char *confPath = gSystem->Getenv ("ALICE_CONFIG_PATH");
+ if (confPath) {
+ path = new char[strlen (confPath)];
+ strcpy (path, confPath);
} else {
const char *alice = gSystem->Getenv ("ALICE_ROOT");
path = new char[strlen (alice) + 32];
}
/*****************************************************************************/
-const TString& AliConfig::GetDataFolderName()
+const TString& AliConfig::GetDataFolderName() const
{
//returns name of data folder path relative to event folder
return fgkDataFolderName;