Fix in the include
[u/mrichter/AliRoot.git] / PWGPP / TRD / macros / AddTRDresolution.C
CommitLineData
1ee39b3a 1#if ! defined (__CINT__) || defined (__MAKECINT__)
2#include "TTree.h"
a7fa310f 3#include "TError.h"
3f19c2cd 4#include "AliLog.h"
1ee39b3a 5#include "AliAnalysisManager.h"
6#include "AliAnalysisDataContainer.h"
808ae983 7#include "AliTRDgeometry.h"
2bfe5463 8#include "PWGPP/TRD/AliTRDpwgppHelper.h"
9#include "PWGPP/TRD/AliTRDresolution.h"
10#include "PWGPP/TRD/AliTRDclusterResolution.h"
11#include "PWGPP/TRD/AliTRDalignmentTask.h"
1ee39b3a 12#endif
13
a7fa310f 14void AddTRDresolution(AliAnalysisManager *mgr, Int_t map, AliAnalysisDataContainer **ci)
1ee39b3a 15{
f073d500 16 Info("AddTRDresolution", Form("[0]=\"%s\" [1]=\"%s\" [2]=\"%s\" [3]=\"%s\" [4]=\"%s\"", ci[0]->GetName(), ci[1]->GetName(), ci[2]->GetName(), ci[3]->GetName(), ci[4]->GetName()));
94b94be0 17 AliAnalysisDataContainer *evInfoContainer = ci[3];
3f19c2cd 18
99535225 19 //AliLog::SetClassDebugLevel("AliTRDrecoTask", 2);
20 //AliLog::SetClassDebugLevel("AliTRDresolution", 2);
705f8b0a 21 AliTRDresolution *res(NULL);
95d47440 22 const Char_t *suffix[]={"", "ITS", "K"};
3d2a3dff 23 for(Int_t itq=0; itq<1/*3*/; itq++){
24 mgr->AddTask(res = new AliTRDresolution(Form("TRDresolution%s", suffix[itq])));
25 res->SetMCdata(mgr->GetMCtruthEventHandler());
26 res->SetPostProcess(kFALSE);
95d47440 27 res->SetDebugLevel(0);
3ceb45ae 28 res->SetPtThreshold(0.2);
dffc3357 29 //res->SetTriggerList("CINT7WUHJT-S-NOPF-CENT CINT7WUHSE-S-NOPF-CENT CINT7WUHQU-S-NOPF-CENT CEMC7WU-S-NOPF-ALL");
3d2a3dff 30 res->SetNameId(suffix[itq]);
94b94be0 31 mgr->ConnectInput(res, 0, mgr->GetCommonInputContainer()); // connect main (ESD) container
32 mgr->ConnectInput(res, 1, ci[itq]); // conect track info container
33 mgr->ConnectInput(res, 2, evInfoContainer); // conect event info container
f073d500 34 mgr->ConnectInput(res, 3, ci[4]); // conect clusters container
997f86cb 35 mgr->ConnectOutput(res,1, mgr->CreateContainer(res->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Performance", mgr->GetCommonFileName())));
3d2a3dff 36
37 // Create output containers for calibration tasks
38 AliAnalysisDataContainer *co(NULL);
64096f2e 39 co = mgr->CreateContainer(Form("%sCl2Trk%s", res->GetName(), suffix[itq]), TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
3d2a3dff 40 mgr->ConnectOutput(res, AliTRDresolution::kClToTrk, co);
64096f2e 41 co = mgr->CreateContainer(Form("%sCl2MC%s", res->GetName(), suffix[itq]), TObjArray::Class(), AliAnalysisManager::kExchangeContainer);
3d2a3dff 42 mgr->ConnectOutput(res, AliTRDresolution::kClToMC, co);
3d2a3dff 43
44 TObjArray *coa = mgr->GetContainers();
45 // Cluster Error Parameterization
2bfe5463 46 if(TESTBIT(map, AliTRDpwgppHelper::kClErrParam)){
3d2a3dff 47 AliTRDclusterResolution *taskCl(NULL);
37097f6f 48 AliLog::SetClassDebugLevel("AliTRDclusterResolution", 2);
801d4d50 49 for(Int_t idet(10); idet<11/*AliTRDgeometry::kNdet*/; idet++){
37097f6f 50 mgr->AddTask(taskCl = new AliTRDclusterResolution(Form("ClErrCalib%03d", idet)));
801d4d50 51 taskCl->SetCalibrationRegion(idet);
e9d62bd2 52 taskCl->SetDebugLevel(0);
94b94be0 53 mgr->ConnectInput(taskCl, 0, mgr->GetCommonInputContainer()); // connect main (ESD) container
37097f6f 54 mgr->ConnectInput(taskCl, 1, (AliAnalysisDataContainer*)coa->FindObject(Form("%sCl2Trk%s", res->GetName(), suffix[itq])));
94b94be0 55 mgr->ConnectInput(taskCl, 2, evInfoContainer);
d0967050 56 mgr->ConnectOutput(taskCl, 1, mgr->CreateContainer(taskCl->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Calibration", mgr->GetCommonFileName())));
37097f6f 57 if(mgr->GetMCtruthEventHandler()){
58 mgr->AddTask(taskCl = new AliTRDclusterResolution(Form("ClErrCalibMC%03d", idet)));
801d4d50 59 taskCl->SetCalibrationRegion(idet);
37097f6f 60 taskCl->SetDebugLevel(0);
61 mgr->ConnectInput(taskCl, 0, mgr->GetCommonInputContainer());
62 mgr->ConnectInput(taskCl, 1, (AliAnalysisDataContainer*)coa->FindObject(Form("%sCl2MC%s", res->GetName(), suffix[itq])));
94b94be0 63 mgr->ConnectInput(taskCl, 2, evInfoContainer);
d0967050 64 mgr->ConnectOutput(taskCl, 1, mgr->CreateContainer(taskCl->GetName(), TObjArray::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Calibration", mgr->GetCommonFileName())));
37097f6f 65 }
e9d62bd2 66 }
3d2a3dff 67 }
1ee39b3a 68 }
69
70 // TRD alignment
2bfe5463 71 if(TESTBIT(map, AliTRDpwgppHelper::kAlignment)){
705f8b0a 72 AliTRDalignmentTask *taskAlign(NULL);
73 mgr->AddTask(taskAlign = new AliTRDalignmentTask((char*)"TRDalignment"));
74 taskAlign->SetDebugLevel(0);
75 //AliLog::SetClassDebugLevel("AliTRDalignmentTask", 5);
76 mgr->ConnectInput(taskAlign, 0, mgr->GetCommonInputContainer());
87c9fc00 77 mgr->ConnectInput(taskAlign, 1, ci[0]);
94b94be0 78 mgr->ConnectInput(taskAlign, 2, evInfoContainer);
eb05d549 79 mgr->ConnectInput(taskAlign, 3, ci[4]); // conect clusters container
705f8b0a 80 mgr->ConnectOutput(taskAlign, 1, mgr->CreateContainer(Form("h%s", taskAlign->GetName()), TObjArray::Class(), AliAnalysisManager::kExchangeContainer));
d0967050 81 mgr->ConnectOutput(taskAlign, 2, mgr->CreateContainer(taskAlign->GetName(), TTree::Class(), AliAnalysisManager::kOutputContainer, Form("%s:TRD_Alignment",mgr->GetCommonFileName())));
1ee39b3a 82 }
83}
84