]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/TenderSupplies/AddTaskTender.C
fix bug in merging routine
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AddTaskTender.C
CommitLineData
aaf2d706 1AliAnalysisTask *AddTaskTender(Bool_t checkEvtSelection=kFALSE){
e75408ba 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");
aaf2d706 17 tender->SetCheckEventSelection(checkEvtSelection);
e75408ba 18 tender->SetDefaultCDBStorage("raw://");
19 mgr->AddTask(tender);
aaf2d706 20 if (checkEvtSelection) {
21 if (mgr->GetTasks()->First() != (TObject*)tender) {
22 ::Error("When setting the tender to check the event selection, it has to be the first wagon ! Aborting.");
23 return NULL;
24 }
25 }
e75408ba 26
9259172d 27 //========= Attach VZERO supply ======
28 AliVZEROTenderSupply *vzeroSupply=new AliVZEROTenderSupply("VZEROtender");
29 vzeroSupply->SetDebug(kFALSE);
30 tender->AddSupply(vzeroSupply);
e75408ba 31 //========= Attach TPC supply ======
32 AliTPCTenderSupply *tpcSupply=new AliTPCTenderSupply("TPCtender");
f19a0c5e 33 tpcSupply->SetDebugLevel(2);
34 tpcSupply->SetMip(50.);
e75408ba 35 tender->AddSupply(tpcSupply);
36
37 //========= Attach TOF supply ======
38 AliTOFTenderSupply *TOFtender = new AliTOFTenderSupply("TOFtender");
39 tender->AddSupply(TOFtender);
40
41 //========= Attach TRD supply ======
42 AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender");
43 tender->AddSupply(trdSupply);
44
45 //========= Attach PID supply ======
46 tender->AddSupply(new AliPIDTenderSupply("PIDtender"));
47
48 //========= Attach Primary Vertex supply ======
49 tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
50
51 //================================================
52 // data containers
53 //================================================
54
55 // define output containers, please use 'username'_'somename'
56 AliAnalysisDataContainer *coutput1 =
57 mgr->CreateContainer("tender_event", AliESDEvent::Class(),
58 AliAnalysisManager::kExchangeContainer,"default_tender");
59
60 // connect containers
61 mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() );
aa269eb9 62 mgr->ConnectOutput (tender, 1, coutput1);
e75408ba 63
64 return tender;
65}