//__________________________________________________________________
AliTRDpidRefMakerLQ::AliTRDpidRefMakerLQ()
- :AliTRDpidRefMaker("PidRefMakerLQ", "PID(LQ) Reference Maker")
+ :AliTRDpidRefMaker("pidRefMakerLQ", "PID(LQ) Reference Maker")
,fPbin(-1)
,fSbin(-1)
,fResults(0x0)
}
// visual on-line monitoring
pdf.DrawBins(0,1,-5.,5.,-8.,8.);cc->Modified(); cc->Update(); cc->SaveAs(Form("pdf_%s%02d.gif", AliPID::ParticleShortName(is), ip));
+ cc->SaveAs(Form("%s_%s%02d.gif", GetName(), AliPID::ParticleShortName(is), ip));
// save a discretization of the PDF for result monitoring
TH2 *h2s = (TH2D*)((TObjArray*)fResults->At(ip))->At(is);
#define CLRBIT(n,i) ((n) &= ~BIT(i))
#define NTRDQATASKS 6
-#define NTRDCALIBTASKS 6
+#define NTRDCALIBTASKS 7
const Int_t NTRDTASKS = NTRDQATASKS+NTRDCALIBTASKS;
enum AliTRDrecoTasks{
,kCalibration = 6
,kEfficiencyMC = 7
,kAlignment = 8
- ,kPIDRefMaker = 9
- ,kClErrParam =10
- ,kMultiplicity =11
+ ,kPIDRefMakerLQ = 9
+ ,kPIDRefMakerNN =10
+ ,kClErrParam =11
+ ,kMultiplicity =12
};
const Char_t* fgkTRDtaskClassName[NTRDTASKS] = {
,"AliTRDcalibration"
,"AliTRDefficiencyMC"
,"AliTRDalignmentTask"
- ,"AliTRDpidRefMaker"
+ ,"AliTRDpidRefMakerLQ"
+ ,"AliTRDpidRefMakerNN"
,"AliTRDclusterResolution"
,"AliTRDmultiplicity"
};
,"CAL"
,"EFFC"
,"ALGN"
- ,"PIDR"
+ ,"LQR"
+ ,"NNR"
,"CLRES"
,"MULT"
,"ALL"
};
#if ! defined (__CINT__) || defined (__MAKECINT__)
+#include "TFileMerger.h"
+#include "TSystem.h"
#include "TString.h"
#include "TObjString.h"
#include "TObjArray.h"
#include <cstring>
//____________________________________________
+Bool_t HasReadMCData(Char_t *opt){
+ return !(Bool_t)strstr(opt, "NOMC");
+}
+
+//____________________________________________
+Bool_t HasReadFriendData(Char_t *opt){
+ return !(Bool_t)strstr(opt, "NOFR");
+}
+
+//____________________________________________
Int_t ParseOptions(Char_t *trd)
{
Int_t fSteerTask = 1;
}
}
// extra rules for calibration tasks
- if(TSTBIT(fSteerTask, kCalibration)) SETBIT(fSteerTask, kCheckDET);
- if(TSTBIT(fSteerTask, kMultiplicity)) SETBIT(fSteerTask, kEfficiency);
- if(TSTBIT(fSteerTask, kEfficiencyMC)) SETBIT(fSteerTask, kEfficiency);
- if(TSTBIT(fSteerTask, kClErrParam)) SETBIT(fSteerTask, kResolution);
- if(TSTBIT(fSteerTask, kAlignment)) SETBIT(fSteerTask, kResolution);
- if(TSTBIT(fSteerTask, kPIDRefMaker)) SETBIT(fSteerTask, kCheckPID);
+// if(TSTBIT(fSteerTask, kCalibration)) SETBIT(fSteerTask, kCheckDET);
+// if(TSTBIT(fSteerTask, kMultiplicity)) SETBIT(fSteerTask, kEfficiency);
+// if(TSTBIT(fSteerTask, kEfficiencyMC)) SETBIT(fSteerTask, kEfficiency);
+// if(TSTBIT(fSteerTask, kClErrParam)) SETBIT(fSteerTask, kResolution);
+// if(TSTBIT(fSteerTask, kAlignment)) SETBIT(fSteerTask, kResolution);
+// if(TSTBIT(fSteerTask, kPIDRefMaker)) SETBIT(fSteerTask, kCheckPID);
return fSteerTask;
}
-//____________________________________________
-Bool_t HasReadMCData(Char_t *opt){
- return !(Bool_t)strstr(opt, "NOMC");
-}
+//______________________________________________________
+void mergeProd(const Char_t *mark, const Char_t *files)
+{
+ const Int_t kBatch = 20;
-//____________________________________________
-Bool_t HasReadFriendData(Char_t *opt){
- return !(Bool_t)strstr(opt, "NOFR");
+ TFileMerger *fFM = new TFileMerger(1);
+ fFM->OutputFile(Form("%s/0_%s", gSystem->ExpandPathName("$PWD"), mark));
+
+ Int_t jbatch = 0, nbatch = 0;
+ string filename;
+ ifstream file(files);
+ while(getline(file, filename)){
+ if(Int_t(filename.find(mark)) < 0) continue;
+ fFM->AddFile(filename.c_str()); nbatch++;
+ if(nbatch==kBatch){
+ //printf("MERGE BATCH %d [%d]\n", jbatch, nbatch);
+ fFM->Merge(); jbatch++;
+ new(fFM) TFileMerger(kTRUE);
+ fFM->OutputFile(Form("%s/%d_%s", gSystem->ExpandPathName("$PWD"), jbatch, mark));
+ nbatch=0;
+ }
+ }
+ if(nbatch){
+ //printf("MERGE BATCH %d[%d]\n", jbatch, nbatch);
+ fFM->Merge();
+ jbatch++;
+ }
+ if(!jbatch){
+ delete fFM;
+ return;
+ }
+
+ new(fFM) TFileMerger(kTRUE);
+ fFM->OutputFile(Form("%s/%s", gSystem->ExpandPathName("$PWD"), mark));
+ for(Int_t ib=jbatch; ib--;){
+ fFM->AddFile(Form("%s/%d_%s", gSystem->ExpandPathName("$PWD"), ib, mark));
+ gSystem->Exec(Form("rm -f %s/%d_%s", gSystem->ExpandPathName("$PWD"), ib, mark));
+ }
+ fFM->Merge();
+ delete fFM;
}
+
#endif
--- /dev/null
+// Usage:
+// makeCalibResults.C("task", "file_list", kGRID)
+// tasks : "one/more of the following separated by space:
+// "CAL" : TRD calibration
+// "ALGN" : TRD alignment
+// "PIDR" : TRD PID - reference data
+// "CLRES": Cluster position and error parameterization
+// "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.CalibName.root
+// or for GRID alien:///alice/cern.ch/user/m/mfasel/MinBiasProd/results/ppMinBias80000/1/TRD.Calib%.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.Calib*.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.Calib%.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.
+//
+// In compiled mode :
+// Don't forget to load first the libraries
+// gSystem->Load("libMemStat.so")
+// gSystem->Load("libMemStatGui.so")
+// gSystem->Load("libANALYSIS.so")
+// gSystem->Load("libANALYSISalice.so")
+// gSystem->Load("libTRDqaRec.so")
+// gSystem->Load("libSTAT.so")
+// gSystem->Load("libPWG1.so");
+// gSystem->Load("libNetx.so") ;
+// gSystem->Load("libRAliEn.so");
+//
+// Authors:
+// Alex Bercuci (A.Bercuci@gsi.de)
+// Markus Fasel (m.Fasel@gsi.de)
+//
+
+#if ! defined (__CINT__) || defined (__MAKECINT__)
+
+#include "qaRec/AliTRDrecoTask.h"
+#include <fstream>
+#include <TCanvas.h>
+#include <TStyle.h>
+#include <TGrid.h>
+#include <TGridResult.h>
+#include <TGridCollection.h>
+
+#endif
+
+#include "AliTRDperformanceTrain.h"
+//#include "../../PWG1/macros/AddPerformanceTask.h"
+
+Char_t *libs[] = {"libProofPlayer.so", "libANALYSIS.so", "libTRDqaRec.so", "libSTAT.so"};
+// define setup
+TCanvas *c = 0x0;
+Bool_t mc(kFALSE), friends(kFALSE);
+
+void calibrateTRD(TNamed* task);
+void makeCalibResults(Char_t *opt, const Char_t *files=0x0, Bool_t kGRID=kFALSE)
+{
+ if(kGRID){
+ if(!gSystem->Getenv("GSHELL_ROOT")){
+ Error("makeCalibResults.C", "AliEn not initialized.");
+ return;
+ }
+ TGrid::Connect("alien://");
+ }
+
+ // Load Libraries in interactive mode
+ Int_t nlibs = static_cast<Int_t>(sizeof(libs)/sizeof(Char_t *));
+ for(Int_t ilib=0; ilib<nlibs; ilib++){
+ if(gSystem->Load(libs[ilib]) >= 0) continue;
+ Error("makeCalibResults.C", Form("Failed to load %s.", libs[ilib]));
+ return;
+ }
+
+ mc = HasReadMCData(opt);
+ friends = HasReadFriendData(opt);
+
+ gStyle->SetOptStat(0);
+ gStyle->SetOptFit(0);
+ Int_t fSteerTask = ParseOptions(opt);
+
+ if(!c) c=new TCanvas("c", "Calibration", 10, 10, 800, 500);
+
+ TClass *ctask = new TClass;
+ AliAnalysisTask *task = 0x0;
+ for(Int_t itask = NTRDQATASKS; itask<NTRDTASKS; itask++){
+ if(!TSTBIT(fSteerTask, itask)) continue;
+ new(ctask) TClass(fgkTRDtaskClassName[itask]);
+ task = (AliAnalysisTask*)ctask->New();
+ if(files) mergeProd(Form("TRD.Calib%s.root", task->GetName()), files);
+
+ if(task->IsA()->InheritsFrom("AliTRDrecoTask")) calibrateTRD(task);
+ }
+ delete ctask;
+ delete c;
+}
+
+
+//______________________________________________________
+void calibrateTRD(TNamed *otask)
+{
+ AliTRDrecoTask *task = dynamic_cast<AliTRDrecoTask*>(otask);
+ task->SetDebugLevel(0);
+
+ AliLog::SetClassDebugLevel(Form("AliTRD%s", task->GetName()), 3);
+ task->SetMCdata(mc);
+ task->SetFriends(friends);
+
+ if(!task->Load(Form("%s/TRD.Calib%s.root", gSystem->ExpandPathName("$PWD"), task->GetName()))){
+ Error("makeCalibResults.C", Form("Load data container for task %s failed.", task->GetName()));
+ delete task;
+ return;
+ }
+
+ if(!task->PostProcess()){
+ Error("makeCalibResults.C", Form("Processing data container for task %s failed.", task->GetName()));
+ delete task;
+ return;
+ }
+ for(Int_t ipic=0; ipic<task->GetNRefFigures(); ipic++){
+ c->Clear();
+ if(!task->GetRefFigure(ipic)) continue;
+ c->SaveAs(Form("%s_Fig%02d.gif", task->GetName(), ipic));
+ }
+ delete task;
+}
+
// "EFF" : TRD Tracking Efficiency
// "EFFC" : TRD Tracking Efficiency Combined (barrel + stand alone) - only in case of simulations
// "RES" : TRD tracking Resolution
-// "CAL" : TRD calibration
// "PID" : TRD PID - pion efficiency
-// "PIDR" : TRD PID - reference data
// "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
// 2. on Grid
// char *BaseDir="/alice/cern.ch/user/m/mfasel/MinBiasProd/results/ppMinBias80000/";
// TGrid::Connect("alien://");
-// TGridResult *res = gGrid->Query(BaseDir, "%/TRD.Task%.root");
+// TGridResult *res = gGrid->Query(BaseDir, "%/TRD.Performance.root");
// TGridCollection *col = gGrid->OpenCollectionQuery(res);
// col->Reset();
// TMap *map = 0x0;
#include <fstream>
#include "TError.h"
#include <TClass.h>
-#include <TFileMerger.h>
#include <TCanvas.h>
#include <TH1.h>
#include <TGraph.h>
#include <TObjString.h>
#include <TString.h>
#include <TROOT.h>
-#include <TSystem.h>
#include <TStyle.h>
+#include <TGrid.h>
+#include <TGridResult.h>
+#include <TGridCollection.h>
#include "qaRec/AliTRDrecoTask.h"
TCanvas *c = 0x0;
Bool_t mc(kFALSE), friends(kFALSE);
-void mergeProd(const Char_t *mark="TRD.Performance.root", const Char_t *files=0);
void processTRD(TNamed* task);
void processAliTask(TNamed* task);
void makeResults(Char_t *opt = "ALL", const Char_t *files=0x0, Bool_t kGRID=kFALSE)
TClass *ctask = new TClass;
AliAnalysisTask *task = 0x0;
- AliTRDrecoTask *trd = 0x0;
for(Int_t itask = NTRDQATASKS; itask--;){
if(!TSTBIT(fSteerTask, itask)) continue;
new(ctask) TClass(fgkTRDtaskClassName[itask]);
delete c;
}
-//______________________________________________________
-void mergeProd(const Char_t *mark, const Char_t *files)
-{
- const Int_t kBatch = 20;
-
- TFileMerger *fFM = new TFileMerger(1);
- fFM->OutputFile(Form("%s/0_%s", gSystem->ExpandPathName("$PWD"), mark));
-
- Int_t jbatch = 0, nbatch = 0;
- string filename;
- ifstream file(files);
- while(getline(file, filename)){
- if(Int_t(filename.find(mark)) < 0) continue;
- fFM->AddFile(filename.c_str()); nbatch++;
- if(nbatch==kBatch){
- //printf("MERGE BATCH %d [%d]\n", jbatch, nbatch);
- fFM->Merge(); jbatch++;
- new(fFM) TFileMerger(kTRUE);
- fFM->OutputFile(Form("%s/%d_%s", gSystem->ExpandPathName("$PWD"), jbatch, mark));
- nbatch=0;
- }
- }
- if(nbatch){
- //printf("MERGE BATCH %d[%d]\n", jbatch, nbatch);
- fFM->Merge();
- jbatch++;
- }
- if(!jbatch){
- delete fFM;
- return;
- }
-
- new(fFM) TFileMerger(kTRUE);
- fFM->OutputFile(Form("%s/%s", gSystem->ExpandPathName("$PWD"), mark));
- for(Int_t ib=jbatch; ib--;){
- fFM->AddFile(Form("%s/%d_%s", gSystem->ExpandPathName("$PWD"), ib, mark));
- gSystem->Exec(Form("rm -f %s/%d_%s", gSystem->ExpandPathName("$PWD"), ib, mark));
- }
- fFM->Merge();
- delete fFM;
-}
//______________________________________________________
void processTRD(TNamed *otask)