6 #include <TGridResult.h>
12 #include "AliCDBManager.h"
13 #include "AliCDBEntry.h"
15 #include "AliGRPObject.h"
18 #include "AliQAManager.h"
19 #include "AliRawReader.h"
20 #include "AliRawReaderRoot.h"
21 #include "AliGeomManager.h"
22 #include "AliRecoParam.h"
24 TString ClassName() { return "rawqa" ; }
26 //________________________________qa______________________________________
27 void rawqa(Char_t * filename, Int_t run, AliRecoParam::EventSpecie_t es=AliRecoParam::kDefault)
29 // TGrid * grid = TGrid::Connect("alien://") ;
32 // filename = Form("alien:///alice/data/2009/LHC09c/000085034/raw/09000085034023.40.root") ;
34 // filename = "raw.root" ;
37 // Set the CDB storage location
38 AliCDBManager * man = AliCDBManager::Instance();
39 // man->SetDefaultStorage("local://cdb2");
40 man->SetDefaultStorage("raw://");
42 AliCDBEntry * entry = man->Get("GRP/GRP/Data");
45 AliGRPObject * fGRPData = dynamic_cast<AliGRPObject*>(entry->GetObject());
47 printf("ERROR: No GRP entry found in OCDB") ;
50 Int_t activeDetectors = fGRPData->GetDetectorMask();
51 const char * detNameOff[AliDAQ::kNDetectors] = {
66 "VZERO", // Name to be changed to V0 ?
74 TString detectors = "";
76 for(Int_t iDet = 0; iDet < (AliDAQ::kNDetectors-1); iDet++) {
77 if ((activeDetectors >> iDet) & 0x1) {
78 if (!detectors.Contains(detNameOff[iDet])) {
79 detectors +=detNameOff[iDet] ;
84 AliQAv1::SetQARefStorage("local://$ALICE_ROOT/QAref") ;
86 AliLog::SetGlobalDebugLevel(0) ;
88 AliQAManager * qam = AliQAManager::QAManager(AliQAv1::kRECMODE) ;
89 qam->SetEventSpecie(AliRecoParam::kCosmic) ;
90 AliQAv1::Instance()->SetEventSpecie(es) ;
91 // TString detectorsW = "";
92 UShort_t eventsProcessed = 0 ;
93 UShort_t filesProcessed = 1 ;
94 AliGeomManager::LoadGeometry();
95 printf("INFO: Proccessing detectors %s from file %s\n", detectors.Data(), filename) ;
96 if ( !detectors.IsNull() ) {
97 qam->SetMaxEvents(-1) ;
98 qam->SetTasks(Form("%d", AliQAv1::kRAWS));
99 AliRawReader * rawReader = new AliRawReaderRoot(Form("alien://%s", filename));
100 detectorsW = qam->Run(detectors, rawReader) ;
103 printf("ERROR: No valid detectors found") ;
105 eventsProcessed += qam->GetCurrentEvent() ;
109 printf("\n\n********** Summary for run %d **********", run) ;
110 printf(" data file : %s\n", filename);
111 printf(" detectors present in the run : %s\n", detectors.Data()) ;
112 printf(" detectors present in the run with QA: %s\n", detectorsW.Data()) ;
113 printf(" number of files/events processed : %d/%d\n", filesProcessed, eventsProcessed) ;
114 //const char * qaFileName = AliQAv1::GetQAResultFileName() ;
115 // TFile * qaResult = TFile::Open(qaFileName) ;
116 TFile * qaResult = TFile::Open("QA.root") ;
118 AliQAv1 * qa = dynamic_cast<AliQAv1 *>(qaResult->Get(AliQAv1::GetQAName())) ;
120 for (Int_t index = 0 ; index < AliQAv1::kNDET ; index++)
121 if (detectorsW.Contains(AliQAv1::GetDetName(index)))
122 qa->Show((AliQAv1::GetDetIndex(AliQAv1::GetDetName(index)))) ;
124 printf("ERROR: %s not found in %s !", AliQAv1::GetQAName(), AliQAv1::GetQAResultFileName()) ;
127 printf("ERROR: %s has not been produced !", AliQAv1::GetQAResultFileName()) ;