6 #include <TGridResult.h>
12 #include "AliCDBManager.h"
16 #include "AliQAManager.h"
17 #include "AliRawReader.h"
18 #include "AliRawReaderRoot.h"
19 //#include "AliTRDrawStreamBase.h"
20 #include "AliGeomManager.h"
22 TString ClassName() { return "rawqa" ; }
24 //________________________________qa______________________________________
25 void rawqa(Char_t * filename, Int_t run)
27 // TGrid * grid = TGrid::Connect("alien://") ;
30 // filename = Form("alien:///alice/data/2009/LHC09c/000085034/raw/09000085034023.40.root") ;
32 // filename = "raw.root" ;
35 // Set the CDB storage location
36 AliCDBManager * man = AliCDBManager::Instance();
37 // man->SetDefaultStorage("local://cdb2");
38 man->SetDefaultStorage("raw://");
40 // set the location of reference data
41 //AliQAv1::SetQARefStorage(Form("%s%s/", AliQAv1::GetQARefDefaultStorage(), year)) ;
42 AliQAv1::SetQARefStorage("local://$ALICE_ROOT/QAref") ;
44 AliLog::SetGlobalDebugLevel(0) ;
47 Bool_t detIn[AliDAQ::kNDetectors] = {kFALSE} ;
48 const char * detNameOff[AliDAQ::kNDetectors] = {"ITS", "ITS", "ITS", "TPC", "TRD", "TOF", "HMPID", "PHOS", "PHOS",
49 "PMD", "MUON", "MUON", "FMD", "T0", "VZERO", "ZDC", "ACORDE", "TRG",
50 "EMCAL", "DAQ_TEST", "HLT"} ;
52 AliQAManager * qam = AliQAManager::QAManager(AliQAv1::kRECMODE) ;
53 qam->SetEventSpecie(AliRecoParam::kCosmic) ;
54 AliQAv1::Instance()->SetEventSpecie(AliRecoParam::kCosmic) ;
55 TString detectors = "";
56 TString detectorsW = "";
57 UShort_t eventsProcessed = 0 ;
58 UShort_t filesProcessed = 1 ;
60 AliGeomManager::LoadGeometry();
61 printf("INFO: Proccessing file %s\n", filename) ;
62 // check which detectors are present
63 TString alienName = Form("alien://%s", filename) ;
64 AliRawReader * rawReader = new AliRawReaderRoot(alienName.Data());
65 //AliTRDrawStreamBase::SetRawStreamVersion("TB");
66 while ( rawReader->NextEvent() ) {
67 man->SetRun(rawReader->GetRunNumber());
70 while (rawReader->ReadNextData(data)) {
71 Int_t detID = rawReader->GetDetectorID();
72 if (detID < 0 || detID >= AliDAQ::kNDetectors) {
73 printf("INFO: Wrong detector ID! Skipping payload...\n");
76 detIn[detID] = kTRUE ;
78 for (Int_t detID = 0; detID < AliDAQ::kNDetectors ; detID++) {
80 if ( ! detectors.Contains(detNameOff[detID]) ) {
81 detectors.Append(detNameOff[detID]) ;
82 detectors.Append(" ") ;
86 if ( !detectors.IsNull() )
89 if ( !detectors.IsNull() ) {
90 qam->SetMaxEvents(-1) ;
91 qam->SetTasks(Form("%d", AliQAv1::kRAWS));
92 detectorsW = qam->Run(detectors, rawReader) ;
95 printf("ERROR: No valid detectors found") ;
98 eventsProcessed += qam->GetCurrentEvent() ;
102 printf("\n\n********** Summary for run %d **********", run) ;
103 printf(" data file : %s\n", filename);
104 printf(" detectors present in the run : %s\n", detectors.Data()) ;
105 printf(" detectors present in the run with QA: %s\n", detectorsW.Data()) ;
106 printf(" number of files/events processed : %d/%d\n", filesProcessed, eventsProcessed) ;
107 //const char * qaFileName = AliQAv1::GetQAResultFileName() ;
108 // TFile * qaResult = TFile::Open(qaFileName) ;
109 TFile * qaResult = TFile::Open("QA.root") ;
111 AliQAv1 * qa = dynamic_cast<AliQAv1 *>(qaResult->Get(AliQAv1::GetQAName())) ;
113 for (Int_t index = 0 ; index < AliQAv1::kNDET ; index++)
114 if (detectorsW.Contains(AliQAv1::GetDetName(index)))
115 qa->Show((AliQAv1::GetDetIndex(AliQAv1::GetDetName(index)))) ;
117 printf("ERROR: %s not found in %s !", AliQAv1::GetQAName(), AliQAv1::GetQAResultFileName()) ;
120 printf("ERROR: %s has not been produced !", AliQAv1::GetQAResultFileName()) ;