// Usage: // makeResults.C("tasks", "file_list", kGRID) // tasks : "ALL" or one/more of the following separated by space: // "EFF" : TRD Tracking Efficiency // "EFFC" : TRD Tracking Efficiency Combined (barrel + stand alone) - only in case of simulations // "RES" : TRD tracking Resolution // "PID" : TRD PID - pion efficiency // "DET" : Basic TRD Detector checks // "NOFR" : Data set does not have AliESDfriends.root // "NOMC" : Data set does not have Monte Carlo Informations (real data), so all tasks which rely // on MC information are switched off // file_list : is the list of the files to be processed. // They should contain the full path. Here is an example: // /lustre/alice/local/TRDdata/SIM/P-Flat/TRUNK/RUN0/TRD.Performance.root // or for GRID alien:///alice/cern.ch/user/m/mfasel/MinBiasProd/results/ppMinBias80000/1/TRD.Performance.root // kGRID : specify if files are comming from a GRID collection [default kFALSE] // // HOW TO BUILD THE FILE LIST // 1. locally // ls -1 BaseDir/RUN*/TRD.Performance.root > files.lst // // 2. on Grid // char *BaseDir="/alice/cern.ch/user/m/mfasel/MinBiasProd/results/ppMinBias80000/"; // TGrid::Connect("alien://"); // TGridResult *res = gGrid->Query(BaseDir, "%/TRD.Performance.root"); // TGridCollection *col = gGrid->OpenCollectionQuery(res); // col->Reset(); // TMap *map = 0x0; // while(map = (TMap*)col->Next()){ // TIter it((TCollection*)map); // TObjString *info = 0x0; // while(info=(TObjString*)it()){ // printf("alien://%s\n", col->GetLFN(info->GetString().Data())); // } // } // // The files which will be processed are the intersection between the // condition on the tasks and the files in the file list. // // Authors: // Alex Bercuci (A.Bercuci@gsi.de) // Markus Fasel (m.Fasel@gsi.de) // #if ! defined (__CINT__) || defined (__MAKECINT__) #include #include "TError.h" #include #include #include #include #include #include #include #include #include #include #include #include #include "qaRec/AliTRDrecoTask.h" #endif #include "AliTRDperformanceTrain.h" //#include "../../PWG1/macros/AddPerformanceTask.h" Char_t *libs[] = {"libProofPlayer.so", "libANALYSIS.so", "libTRDqaRec.so"}; // define setup TCanvas *c = 0x0; Bool_t mc(kFALSE), friends(kFALSE); void processTRD(TNamed* task); void processAliTask(TNamed* task); void makeResults(Char_t *opt = "ALL", const Char_t *files=0x0, Bool_t kGRID=kFALSE) { if(kGRID){ if(!gSystem->Getenv("GSHELL_ROOT")){ Error("makeResults.C", "AliEn not initialized."); return; } TGrid::Connect("alien://"); } // Load Libraries in interactive mode Int_t nlibs = static_cast(sizeof(libs)/sizeof(Char_t *)); for(Int_t ilib=0; ilibLoad(libs[ilib]) >= 0) continue; Error("makeResults.C", Form("Failed to load %s.", libs[ilib])); return; } mc = HasReadMCData(opt); friends = HasReadFriendData(opt); gStyle->SetOptStat(0); gStyle->SetOptFit(0); if(files) mergeProd("TRD.Performance.root", files); Int_t fSteerTask = ParseOptions(opt); if(!c) c=new TCanvas("c", "Performance", 10, 10, 800, 500); TClass *ctask = new TClass; AliAnalysisTask *task = 0x0; for(Int_t itask = NTRDQATASKS; itask--;){ if(!TSTBIT(fSteerTask, itask)) continue; new(ctask) TClass(fgkTRDtaskClassName[itask]); task = (AliAnalysisTask*)ctask->New(); if(task->IsA()->InheritsFrom("AliTRDrecoTask")) processTRD(task); else processAliTask(task); } delete ctask; delete c; } //______________________________________________________ void processTRD(TNamed *otask) { AliTRDrecoTask *task = dynamic_cast(otask); task->SetDebugLevel(0); task->SetMCdata(mc); task->SetFriends(friends); if(!task->Load(Form("%s/TRD.Performance.root", gSystem->ExpandPathName("$PWD")))){ Error("makeResults.C", Form("Load data container for task %s failed.", task->GetName())); delete task; return; } if(!task->PostProcess()){ Error("makeResults.C", Form("Processing data container for task %s failed.", task->GetName())); delete task; return; } for(Int_t ipic=0; ipicGetNRefFigures(); ipic++){ c->Clear(); if(!task->GetRefFigure(ipic)) continue; c->SaveAs(Form("%s_Fig%02d.gif", task->GetName(), ipic)); } delete task; } //______________________________________________________ void processAliTask(TNamed *otask) { AliAnalysisTask *task = dynamic_cast(otask); Info("makeResults.C", Form("Processing of task %s not implemented yet.", task->GetName())); delete task; }