Coverity fixes
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Mar 2011 14:56:25 +0000 (14:56 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 Mar 2011 14:56:25 +0000 (14:56 +0000)
STEER/AliConfig.cxx
STEER/AliConfig.h
STEER/AliRecoParam.cxx
STEER/AliReconstruction.cxx

index 5b0dfc9..d022a8f 100644 (file)
@@ -390,104 +390,6 @@ Int_t AliConfig::CreateDetectorTasks(const char *name, const char* title)
    return 0;
 }
 
-//____________________________________________________________________________
-void    AliConfig::Add (char *list)
-{
-  // Adds space separated list of objects to the
-  // configuration macro (?)
-  char *path;
-  
-  const char   *confPath = gSystem->Getenv ("ALICE_CONFIG_PATH");
-  if  (confPath) {
-    path = new char[strlen (confPath)+1];
-    strcpy (path, confPath);
-  } else {
-    const char   *alice = gSystem->Getenv ("ALICE_ROOT");
-    path = new char[strlen (alice) + 32];
-    
-    strcpy (path, ".:");
-    if (alice) {
-      strcat (path, alice);
-    }
-    strcat (path, "/macros/config");
-  }
-  
-  char   *token = strtok (path, ":");
-  
-  TList dirlist;
-  
-  dirlist.SetOwner(kTRUE);
-  
-  while (token != NULL)        
-    {
-      dirlist.Add (new TObjString(token));
-      token = strtok (NULL, ":");
-    }
-  
-  token = strtok (list, " ");
-  
-  while (token != NULL)
-    { 
-      AliInfo(Form("Configuring token=%s",token));
-      
-      TObject *obj;
-      TIter   next (&dirlist);
-      TString found = "\0";
-      
-      while ((obj = next ()))
-        {
-          TString dir(obj->GetName());
-          TString apath  = dir + "/" + token;
-          TString macro = apath + ".C";
-          if (!gSystem->AccessPathName (macro.Data())) 
-           {
-            gInterpreter->ExecuteMacro (macro.Data());                            
-            found = "(" + macro + ")";
-            if (macro.Contains("/")) 
-             {
-               TString dirname = gSystem->DirName(macro.Data());
-               TString macroConfigure = dirname + "/Configure.C";
-               if (!gSystem->AccessPathName (macroConfigure.Data()))
-                {
-                  gInterpreter->ExecuteMacro (macroConfigure.Data());                              
-                  found += " => Configured";
-                }                            
-             }
-            break;
-           } 
-          else 
-           {
-            TString macroDefault = apath + "/Default.C";
-            if (!gSystem->AccessPathName (macroDefault.Data()))
-              {
-                gInterpreter->ExecuteMacro (macroDefault.Data());
-                found = "(" + macro + ")";
-                TString macroConfigure = apath + "/Configure.C";
-                if (!gSystem->AccessPathName (macroConfigure.Data()))  
-                  {
-                    gInterpreter->ExecuteMacro (macroConfigure.Data());                                    
-                    found += " => Configured";
-                  }
-                break;                                     
-              }
-           }
-        }
-      
-      if (strlen(found.Data())) 
-        {
-          AliInfo(Form("found=%s  => OK",found.Data()));
-        } 
-      else 
-        {
-          AliError(" => FAILED.");
-          exit(1); 
-        }          
-      
-      token = strtok (NULL," ");
-    }
-  
-}
-
 /*****************************************************************************/
 
 TFolder* AliConfig::BuildEventFolder(const char* name,const char* title)
index 65ad5c2..693916a 100644 (file)
@@ -36,7 +36,6 @@ public:
   virtual ~ AliConfig (); 
 
   void       Add(TDatabasePDG *pdg);
-  void       Add(char *list);
   
   void       Add(AliGenerator *generator,const char* eventfolder = fgkDefaultEventFolderName);
   void       Add (TVirtualMC *mc,const char* eventfolder = fgkDefaultEventFolderName);
index d3d5caf..915aba7 100644 (file)
@@ -338,6 +338,7 @@ Bool_t AliRecoParam::AddDetRecoParamArray(Int_t iDet, TObjArray* parArray)
   // for a given detector
   // Basic check on the consistency of the array
   Bool_t defaultFound = kFALSE;
+  if (!parArray) return defaultFound;
   for(Int_t i = 0; i < parArray->GetEntriesFast(); i++) {
     AliDetectorRecoParam *par = (AliDetectorRecoParam*)parArray->At(i);
     if (!par) continue;
index 89cd7e1..3e1c2d2 100644 (file)
@@ -1700,8 +1700,9 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
 
   if (iEvent >= fRunLoader->GetNumberOfEvents()) {
     fRunLoader->SetEventNumber(iEvent);
-    fRunLoader->GetHeader()->Reset(fRawReader->GetRunNumber(), 
-                                  iEvent, iEvent);
+    if (fRawReader)
+      fRunLoader->GetHeader()->Reset(fRawReader->GetRunNumber(), 
+                                    iEvent, iEvent);
     fRunLoader->TreeE()->Fill();
     if (fRawReader && fRawReader->UseAutoSaveESD())
       fRunLoader->TreeE()->AutoSave("SaveSelf");
@@ -2082,6 +2083,7 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
   }
   if (fRunGlobalQA) {
     AliQADataMaker *qadm = AliQAManager::QAManager()->GetQADataMaker(AliQAv1::kGLOBAL);
+    if (qadm)
       qadm->SetEventSpecie(fRecoParam.GetEventSpecie()) ;
     if (qadm && IsInTasks(AliQAv1::kESDS))
       qadm->Exec(AliQAv1::kESDS, fesd);