AddTask macro for the tender to apply the 1/pt corrections during analysis
[u/mrichter/AliRoot.git] / PWGPP / macros / AddTaskTrackFixTenderSupply.C
CommitLineData
a2716521 1//______________________________________________________________________________
2AliAnalysisTask* AddTaskTrackFixTenderSupply(const char* passName,
3 const char* objOADBpath="$OADB/PWGPP/data/CorrPTInv.root",
4 const char* ocdb="raw://" )
5{
6 //adds a tender to fix the momenta of tracks.
7 //passName has to be provided as the correction are reconstruction pass dependent
8 //the corresponding containers in OADB are named after the pass "passName"
9 //TODO: make the pass detection automatic
10 gSystem->Load("libTENDER");
11 gSystem->Load("libTENDERSupplies");
12
13 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
14
15 // Tender and supplies. Needs to be called for every event.
16 AliTender *tender=new AliTender("AnalysisTender");
17 tender->SetDefaultCDBStorage(ocdb);
18
19 AliTrackFixTenderSupply* ptinvCor = new AliTrackFixTenderSupply("ptinvCorrSupply");
20 //ptinvCor->SetDebugLevel(0);
21 ptinvCor->SetOADBObjPath(objOADBpath);
22 ptinvCor->SetOADBObjName(passName);
23
24 tender->AddSupply(ptinvCor);
25 mgr->AddTask(tender);
26
27 AliAnalysisDataContainer *coutput1 = mgr->CreateContainer(
28 "trackFixCorrectionTender",
29 AliESDEvent::Class(),
30 AliAnalysisManager::kExchangeContainer,
31 "default_tender");
32
33 // connect containers
34 mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() );
35 mgr->ConnectOutput (tender, 1, coutput1);
36
37 return tender;
38}