]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
correct the making of the GridCollection and simplified Merge method
authorschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Mar 2009 10:44:34 +0000 (10:44 +0000)
committerschutz <schutz@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 17 Mar 2009 10:44:34 +0000 (10:44 +0000)
STEER/AliQAManager.cxx
STEER/AliQAManager.h

index 4c0bce11e20f860d561a5d5f01c779ce5ad8ee6a..2ee43d93baa9131f02c204521d354b3f68b41e8f 100644 (file)
@@ -708,12 +708,14 @@ Bool_t AliQAManager::IsSelected(const char * det)
 }
 
 //_____________________________________________________________________________
-Bool_t AliQAManager::Merge(const Int_t runNumber) const
+Bool_t AliQAManager::Merge(Int_t runNumber) const
 {
-       // Merge data from all the cycles from all detectors in one single file per run
+       // Merge data from all detectors from a given run in one single file 
        // Merge the QA results from all the data chunks in one run 
+ if ( runNumber == -1)
+   runNumber = fRunNumber ; 
  Bool_t rv = MergeData(runNumber) ; 
- rv *= MergeResults(runNumber) ;
+ //rv *= MergeResults(runNumber) ; // not needed for the time being
  return rv ; 
 }
        
@@ -741,7 +743,7 @@ Bool_t AliQAManager::MergeXML(const char * collectionFile, const char * subFile,
   printf("***  Wk-Dir = |%s|             \n",gSystem->WorkingDirectory());
   printf("***  Coll   = |%s|             \n",collectionFile);                  
   
-  TGridCollection * collection = (TGridCollection*)gROOT->ProcessLine(Form("TAlienCollection::Open(\"%s\", 0)",collectionFile));
+  TGridCollection * collection = (TGridCollection*)gROOT->ProcessLine(Form("TAlienCollection::Open(\"%s\")",collectionFile));
   TGridResult* result = collection->GetGridResult("", 0, 0);
   
   Int_t index = 0  ;
@@ -781,45 +783,16 @@ Bool_t AliQAManager::MergeXML(const char * collectionFile, const char * subFile,
 //_____________________________________________________________________________
 Bool_t AliQAManager::MergeData(const Int_t runNumber) const
 {
-       // Merge all the cycles from all detectors in one single file per run
-       TString cmd ;
-       if (runNumber != -1) 
-               cmd = Form(".! ls *%s*.%d.root > tempo.txt", AliQA::GetQADataFileName(), runNumber) ; 
-       else 
-               cmd = Form(".! ls *%s*.*.root > tempo.txt", AliQA::GetQADataFileName()) ; 
-       gROOT->ProcessLine(cmd.Data()) ;
-       ifstream in("tempo.txt") ; 
-       const Int_t runMax = 10 ;  
-       TString file[AliQA::kNDET*runMax] ;
-       
-       Int_t index = 0 ; 
-       while ( 1 ) {
-               in >> file[index] ; 
-               if ( !in.good() ) 
-                       break ; 
-               AliInfo(Form("index = %d file = %s", index, (file[index]).Data())) ; 
-               index++ ;
-       }
-       
-       if ( index == 0 ) { 
-               AliError(Form("run number %d not found", runNumber)) ; 
-               return kFALSE ; 
-       }
-
+       // Merge QA data from all detectors for a given run in one single file 
+  
   TFileMerger merger ; 
-  TString outFileName ;
-  if (runNumber != -1) 
-    outFileName = Form("Merged.%s.Data.%d.root",AliQA::GetQADataFileName(),runNumber); 
-  else 
-    outFileName = Form("Merged.%s.Data.root",AliQA::GetQADataFileName()); 
+  TString outFileName = Form("Merged.%s.Data.root",AliQA::GetQADataFileName()) ;
   merger.OutputFile(outFileName.Data()) ; 
-  for (Int_t ifile = 0 ; ifile < index-1 ; ifile++) {
-    TString pattern(Form("%s.%d.", AliQA::GetQADataFileName(), runNumber)); 
-    TString tmp(file[ifile]) ; 
-    if (tmp.Contains(pattern)) {
-      merger.AddFile(tmp) ; 
-    }
-       }
+  for (UInt_t iDet = 0; iDet < fgkNDetectors ; iDet++) {
+    char * file = gSystem->Which(gSystem->WorkingDirectory(), Form("%s.%s.%d.root", AliQA::GetDetName(iDet), AliQA::GetQADataFileName(), runNumber)); 
+    if (file) 
+      merger.AddFile(file) ; 
+  }
   merger.Merge() ; 
        return kTRUE ; 
 }
@@ -828,6 +801,7 @@ Bool_t AliQAManager::MergeData(const Int_t runNumber) const
 Bool_t AliQAManager::MergeResults(const Int_t runNumber) const
 {
        // Merge the QA result from all the data chunks in a run 
+  // to be revised whwn it will be used (see MergeData)
        TString cmd ;
        cmd = Form(".! ls %s*.root > tempo.txt", AliQA::GetQADataFileName()) ; 
        gROOT->ProcessLine(cmd.Data()) ;
index 8921521379b8c1e698a358f288d45bc822a53319..23f18744381c99a45de29c7570b3a13d9b7be654 100644 (file)
@@ -50,7 +50,7 @@ public:
        AliQADataMaker * GetQADataMaker(const Int_t iDet) ; 
        void        Increment() ;
        void        InitQADataMaker(UInt_t run, TObjArray * detArray=0x0) ;
-       Bool_t      Merge(const Int_t runNumber = -1 ) const ;  
+       Bool_t      Merge(Int_t runNumber = -1) const ;  
   Bool_t      MergeXML(const char * collection, const char * subFile = 0, const char * outFile = 0) ; 
   static      AliQAManager * QAManager(const Char_t * mode="", TMap *entryCache = NULL, Int_t run = -1) ;
        void        Reset(const Bool_t sameCycle = kFALSE) ;