Tender macro should check derivation from AliESDInputHandler (to work also for RP).
[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
b34c9f51 9 if (!mgr->GetInputEventHandler()->InheritsFrom(AliESDInputHandler::Class())) {
e75408ba 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");
f19a0c5e 22 tpcSupply->SetDebugLevel(2);
23 tpcSupply->SetMip(50.);
e75408ba 24 tender->AddSupply(tpcSupply);
25
26 //========= Attach TOF supply ======
27 AliTOFTenderSupply *TOFtender = new AliTOFTenderSupply("TOFtender");
28 tender->AddSupply(TOFtender);
29
30 //========= Attach TRD supply ======
31 AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender");
32 tender->AddSupply(trdSupply);
33
34 //========= Attach PID supply ======
35 tender->AddSupply(new AliPIDTenderSupply("PIDtender"));
36
37 //========= Attach Primary Vertex supply ======
38 tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
39
40 //================================================
41 // data containers
42 //================================================
43
44 // define output containers, please use 'username'_'somename'
45 AliAnalysisDataContainer *coutput1 =
46 mgr->CreateContainer("tender_event", AliESDEvent::Class(),
47 AliAnalysisManager::kExchangeContainer,"default_tender");
48
49 // connect containers
50 mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() );
51 mgr->ConnectOutput (tender, 0, coutput1);
52
53 return tender;
54}