First version of the TenderSupplies for TPC/TOF/TRD
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AddTaskTender.C
CommitLineData
e75408ba 1AliAnalysisTask *AddTaskTender(){
2 //get the current analysis manager
3 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
4 if (!mgr) {
5 Error("AddTask_tender_Tender", "No analysis manager found.");
6 return 0;
7 }
8 // currently don't accept AOD input
9 if (mgr->GetInputEventHandler()->IsA()!=AliESDInputHandler::Class()) {
10 Error("AddTask_tender_Tender","The analysis tender only works with ESD input!");
11 return 0;
12 }
13
14
15 //========= Add tender to the ANALYSIS manager and set default storage =====
16 AliTender *tender=new AliTender("AnalysisTender");
17 tender->SetDefaultCDBStorage("raw://");
18 mgr->AddTask(tender);
19
20 //========= Attach TPC supply ======
21 AliTPCTenderSupply *tpcSupply=new AliTPCTenderSupply("TPCtender");
22 tender->AddSupply(tpcSupply);
23
24 //========= Attach TOF supply ======
25 AliTOFTenderSupply *TOFtender = new AliTOFTenderSupply("TOFtender");
26 tender->AddSupply(TOFtender);
27
28 //========= Attach TRD supply ======
29 AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender");
30 tender->AddSupply(trdSupply);
31
32 //========= Attach PID supply ======
33 tender->AddSupply(new AliPIDTenderSupply("PIDtender"));
34
35 //========= Attach Primary Vertex supply ======
36 tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
37
38 //================================================
39 // data containers
40 //================================================
41
42 // define output containers, please use 'username'_'somename'
43 AliAnalysisDataContainer *coutput1 =
44 mgr->CreateContainer("tender_event", AliESDEvent::Class(),
45 AliAnalysisManager::kExchangeContainer,"default_tender");
46
47 // connect containers
48 mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() );
49 mgr->ConnectOutput (tender, 0, coutput1);
50
51 return tender;
52}