]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - test/cosmic/rawqa.C
coding convention for type (_t) and access of reference data from alien OCDB
[u/mrichter/AliRoot.git] / test / cosmic / rawqa.C
index 6550e0495a7adbafb8602bbcb8686882c9881f9e..d760a6db27315d49fc709b67dd3ff272660872ef 100644 (file)
 #include <TSystem.h>
 
 #include "AliCDBManager.h"
+#include "AliDAQ.h"
 #include "AliLog.h"
 #include "AliQA.h"
 #include "AliQADataMakerSteer.h"
 #include "AliRawReader.h"
 #include "AliRawReaderRoot.h"
-#include "AliDAQ.h"
+#include "AliTRDrawStreamBase.h"
 
 TString ClassName() { return "rawqa" ; } 
 
 //________________________________qa______________________________________
 void rawqa(const Int_t runNumber, Int_t maxFiles = 10, const char* year = "08") 
 {      
-       const char * kDefaultOCDBStorage = Form("alien://folder=/alice/data/20%s/LHC%sa/OCDB/", year, year) ; 
+       char kDefaultOCDBStorage[120] ; 
+       sprintf(kDefaultOCDBStorage, "alien://folder=/alice/data/20%s/LHC%sa/OCDB/", year, year) ; 
+       AliQA::SetQARefStorage(Form("%s%s/", AliQA::GetQARefDefaultStorage(), year)) ;  
+       AliQA::SetQARefDataDirName("Data") ; //Data, Pedestals, BlackEvent, ..... 
        
        UInt_t maxEvents = 99999 ;
        if ( maxFiles < 0 ) {
@@ -69,17 +73,15 @@ void rawqa(const Int_t runNumber, Int_t maxFiles = 10, const char* year = "08")
        if (local) 
                in.open("tempo.txt", ifstream::in) ; 
 
-       AliCDBManager* man = AliCDBManager::Instance();
-       man->SetDefaultStorage(kDefaultOCDBStorage) ;  
-       AliQA::SetQARefStorage("alien://folder=/alice/QA/2008/") ; 
-       man->SetSpecificStorage("*", AliQA::GetQARefStorage());
        AliQADataMakerSteer qas ; 
        TString detectors  = ""; 
        TString detectorsW = ""; 
        UShort_t file = 0 ; 
        UShort_t filesProcessed = 0 ; 
        UShort_t eventsProcessed = 0 ; 
+       AliCDBManager* man = AliCDBManager::Instance();
        for ( file = 0 ; file < maxFiles ; file++) {
+               man->SetDefaultStorage(kDefaultOCDBStorage) ;  
                if ( qas.GetCurrentEvent() >= maxEvents) 
                        break ;
 
@@ -103,6 +105,7 @@ void rawqa(const Int_t runNumber, Int_t maxFiles = 10, const char* year = "08")
                AliLog::Flush();
                // check which detectors are present 
                AliRawReader * rawReader = new AliRawReaderRoot(input);
+               AliTRDrawStreamBase::SetRawStreamVersion("TB");
                while ( rawReader->NextEvent() ) {
                        man->SetRun(rawReader->GetRunNumber());
                        AliLog::Flush();
@@ -126,9 +129,6 @@ void rawqa(const Int_t runNumber, Int_t maxFiles = 10, const char* year = "08")
                        if ( !detectors.IsNull() )
                                break ; 
                }
-               // TEMPORARY REMOVAL OF TRD!!!
-               detectors.ReplaceAll("TRD", "") ;
-               // TEMPORARY REMOVAL OF TRD!!!
                if ( !detectors.IsNull() ) {
                        qas.SetMaxEvents(maxEvents) ;   
                        detectorsW = qas.Run(detectors, rawReader) ;
@@ -147,13 +147,17 @@ void rawqa(const Int_t runNumber, Int_t maxFiles = 10, const char* year = "08")
        AliInfo(Form("\n\n********** Summary for run %d **********", runNumber)) ; 
        printf("     detectors present in the run        : %s\n", detectors.Data()) ; 
        printf("     detectors present in the run with QA: %s\n", detectorsW.Data()) ; 
-       printf("     number of files/events processed           : %d/%d\n", filesProcessed, eventsProcessed) ; 
+       printf("     number of files/events processed    : %d/%d\n", filesProcessed, eventsProcessed) ; 
        TFile * qaResult = TFile::Open(AliQA::GetQAResultFileName()) ; 
        if ( qaResult ) {
-               AliQA * qa = dynamic_cast<AliQA *>(qaResult->Get("QA")) ; 
-               for (Int_t index = 0 ; index < AliQA::kNDET ; index++)
-                       if (detectorsW.Contains(AliQA::GetDetName(AliQA::DETECTORINDEX(index)))) 
-                               qa->ShowStatus(AliQA::DETECTORINDEX(index)) ;
+               AliQA * qa = dynamic_cast<AliQA *>(qaResult->Get(AliQA::GetQAName())) ; 
+               if ( qa) {
+                       for (Int_t index = 0 ; index < AliQA::kNDET ; index++)
+                               if (detectorsW.Contains(AliQA::GetDetName(AliQA::DETECTORINDEX_t(index)))) 
+                                       qa->ShowStatus(AliQA::DETECTORINDEX_t(index)) ;
+               } else {
+                       AliError(Form("%s not found in %s !", AliQA::GetQAName(), AliQA::GetQAResultFileName())) ; 
+               }
        } else {
                AliError(Form("%s has not been produced !", AliQA::GetQAResultFileName())) ; 
        }