better ESD performance plot
[u/mrichter/AliRoot.git] / TRD / qaRec / macros / AddTRDresolution.C
CommitLineData
873458ab 1#if ! defined (__CINT__) || defined (__MAKECINT__)
2#include "TTree.h"
3#include "AliAnalysisManager.h"
4#include "AliAnalysisDataContainer.h"
6da3eee3 5#include "TRD/qaRec/macros/AliTRDperformanceTrain.h"
873458ab 6#include "TRD/qaRec/AliTRDresolution.h"
7#include "TRD/qaRec/AliTRDclusterResolution.h"
8#include "TRD/qaRec/AliTRDalignmentTask.h"
9#endif
10
c82c70b6 11#include "TRD/qaRec/macros/helper.C"
6da3eee3 12void AddTRDresolution(AliAnalysisManager *mgr, Char_t *trd, AliAnalysisDataContainer **ci/*, AliAnalysisDataContainer **co*/)
873458ab 13{
6da3eee3 14 Int_t map = ParseOptions(trd);
873458ab 15 AliTRDresolution *task = 0x0;
3be74089 16 if(!TSTBIT(map, kResolution)) return;
17 mgr->AddTask(task = new AliTRDresolution());
18 task->SetMCdata(mgr->GetMCtruthEventHandler());
19 task->SetPostProcess(kFALSE);
20 task->SetDebugLevel(1);
21 mgr->ConnectInput( task, 0, ci[0]);
22 mgr->ConnectOutput(task, 0, mgr->CreateContainer(task->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, "TRD.Performance.root"));
23
24 // Create output containers for calibration tasks
25 const Int_t nc = 4;
26 const Char_t *cn[nc] = {"Cl", "Trklt", "MC_Cl", "MC_Trklt"};
27 AliAnalysisDataContainer *co[] = {0x0, 0x0, 0x0, 0x0};
28 for(Int_t ic = 0; ic<nc; ic++){
29 co[ic] = mgr->CreateContainer(Form("%s%s", task->GetName(), cn[ic]), TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
30 mgr->ConnectOutput(task, 1+ic, co[ic]);
873458ab 31 }
3be74089 32
873458ab 33 // Cluster Error Parameterization
34 if(TSTBIT(map, kClErrParam)){
35 AliTRDclusterResolution *taskCl = 0x0;
bc05c5ac 36 mgr->AddTask(taskCl = new AliTRDclusterResolution("ESD", "ESD Cluster error parameterization"));
873458ab 37 taskCl->SetExB();
38 mgr->ConnectInput(taskCl, 0, co[0]);
bc05c5ac 39 mgr->ConnectOutput(taskCl, 0, mgr->CreateContainer(taskCl->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, "TRD.CalibClErrParam.root"));
873458ab 40
bc05c5ac 41 mgr->AddTask(taskCl = new AliTRDclusterResolution("MC", "MC Cluster error parameterization"));
873458ab 42 taskCl->SetExB();
43 mgr->ConnectInput(taskCl, 0, co[2]);
bc05c5ac 44 mgr->ConnectOutput(taskCl, 0, mgr->CreateContainer(taskCl->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, "TRD.CalibClErrParam.root"));
873458ab 45 }
46
47 // TRD alignment
bc05c5ac 48 if(TSTBIT(map, kAlignment)){
49 AliTRDalignmentTask *taskAl = 0x0;
50 mgr->AddTask(taskAl = new AliTRDalignmentTask());
51 taskAl->SetDebugLevel(0);
52 mgr->ConnectInput(taskAl, 0, ci[0]);
53 mgr->ConnectOutput(taskAl, 0, mgr->CreateContainer(Form("h%s", taskAl->GetName()), TObjArray::Class(), AliAnalysisManager::kExchangeContainer));
54 mgr->ConnectOutput(taskAl, 1, mgr->CreateContainer(task->GetName(), TTree::Class(), AliAnalysisManager::kOutputContainer, Form("TRD.Calib%s.root", task->GetName())));
55 }
873458ab 56}
57