]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliConfig.cxx
Added new cuts, fixed bug in backround calculation.
[u/mrichter/AliRoot.git] / STEER / AliConfig.cxx
index 32b77489dbcb04e2f5d17f43199f41f95772f1f9..ac7bccabde1f71af01718ab853262fe9af203cd8 100644 (file)
@@ -118,50 +118,6 @@ AliConfig* AliConfig::Instance ()
     }
    return fgInstance;
 }
-
-//____________________________________________________________________________
-AliConfig::AliConfig():
-  fTopFolder(0x0),
-  fTaskFolder(0x0),
-  fConstFolder(0x0),
-  fDetectorTask(0x0),
-  fDetectorFolder(0x0)
-{
-  //
-  // Default constructor, mainly to keep coding conventions
-  //
-  fgInstance=0;//never mind, its going to exit in next step
-  AliFatal("Constructor should not be called for a singleton");
-}
-//____________________________________________________________________________
-
-AliConfig::AliConfig(const AliConfig& conf):
-  TNamed(conf),
-  fTopFolder(0x0),
-  fTaskFolder(0x0),
-  fConstFolder(0x0),
-  fDetectorTask(0x0),
-  fDetectorFolder(0x0)
-{
-  //
-  // Copy constructor, mainly to keep coding conventions
-  //
-  fgInstance=0;
-    
-  AliFatal("Copy constructor should not be called for a singleton");
-}
-//____________________________________________________________________________
-
-AliConfig& AliConfig::operator=(const AliConfig& /*conf*/)
-{
-  //
-  // Assignment, mainly to keep coding conventions
-  //
-  fgInstance=0;
-    
-  AliFatal("Assignment operator should not be called for a singleton");
-  return *this;
-}
 //____________________________________________________________________________
 
 AliConfig::AliConfig(const char *name, const char *title): 
@@ -443,7 +399,7 @@ void    AliConfig::Add (char *list)
   
   const char   *confPath = gSystem->Getenv ("ALICE_CONFIG_PATH");
   if  (confPath) {
-    path = new char[strlen (confPath)];
+    path = new char[strlen (confPath)+1];
     strcpy (path, confPath);
   } else {
     const char   *alice = gSystem->Getenv ("ALICE_ROOT");
@@ -458,11 +414,13 @@ void    AliConfig::Add (char *list)
   
   char   *token = strtok (path, ":");
   
-  TList  *dirlist = new TList;
+  TList dirlist;
+  
+  dirlist.SetOwner(kTRUE);
   
   while (token != NULL)        
     {
-      dirlist->Add (new TObjString(token));
+      dirlist.Add (new TObjString(token));
       token = strtok (NULL, ":");
     }
   
@@ -473,14 +431,14 @@ void    AliConfig::Add (char *list)
       AliInfo(Form("Configuring token=%s",token));
       
       TObject *obj;
-      TIter   next (dirlist);
+      TIter   next (&dirlist);
       TString found = "\0";
       
       while ((obj = next ()))
         {
           TString dir(obj->GetName());
-          TString path  = dir + "/" + token;
-          TString macro = path + ".C";
+          TString apath  = dir + "/" + token;
+          TString macro = apath + ".C";
           if (!gSystem->AccessPathName (macro.Data())) 
            {
             gInterpreter->ExecuteMacro (macro.Data());                            
@@ -499,12 +457,12 @@ void    AliConfig::Add (char *list)
            } 
           else 
            {
-            TString macroDefault = path + "/Default.C";
+            TString macroDefault = apath + "/Default.C";
             if (!gSystem->AccessPathName (macroDefault.Data()))
               {
                 gInterpreter->ExecuteMacro (macroDefault.Data());
                 found = "(" + macro + ")";
-                TString macroConfigure = path + "/Configure.C";
+                TString macroConfigure = apath + "/Configure.C";
                 if (!gSystem->AccessPathName (macroConfigure.Data()))  
                   {
                     gInterpreter->ExecuteMacro (macroConfigure.Data());                                    
@@ -528,8 +486,6 @@ void    AliConfig::Add (char *list)
       token = strtok (NULL," ");
     }
   
-  if (dirlist) delete dirlist;
-  
 }
 
 /*****************************************************************************/