Added posibility to add V0 tender, by default this is off
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AddTaskTender.C
CommitLineData
2d28db9f 1AliAnalysisTask *AddTaskTender(Bool_t useV0=kFALSE){
e75408ba 2 //get the current analysis manager
2d28db9f 3 Bool_t checkEvtSelection = useV0;
e75408ba 4 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
5 if (!mgr) {
6 Error("AddTask_tender_Tender", "No analysis manager found.");
7 return 0;
8 }
9 // currently don't accept AOD input
b34c9f51 10 if (!mgr->GetInputEventHandler()->InheritsFrom(AliESDInputHandler::Class())) {
e75408ba 11 Error("AddTask_tender_Tender","The analysis tender only works with ESD input!");
12 return 0;
13 }
14
15
16 //========= Add tender to the ANALYSIS manager and set default storage =====
17 AliTender *tender=new AliTender("AnalysisTender");
aaf2d706 18 tender->SetCheckEventSelection(checkEvtSelection);
e75408ba 19 tender->SetDefaultCDBStorage("raw://");
20 mgr->AddTask(tender);
aaf2d706 21 if (checkEvtSelection) {
22 if (mgr->GetTasks()->First() != (TObject*)tender) {
23 ::Error("When setting the tender to check the event selection, it has to be the first wagon ! Aborting.");
24 return NULL;
25 }
26 }
e75408ba 27
9259172d 28 //========= Attach VZERO supply ======
2d28db9f 29 if (useV0) {
30 AliVZEROTenderSupply *vzeroSupply=new AliVZEROTenderSupply("VZEROtender");
31 vzeroSupply->SetDebug(kFALSE);
32 tender->AddSupply(vzeroSupply);
33 }
e75408ba 34 //========= Attach TPC supply ======
35 AliTPCTenderSupply *tpcSupply=new AliTPCTenderSupply("TPCtender");
f19a0c5e 36 tpcSupply->SetDebugLevel(2);
37 tpcSupply->SetMip(50.);
e75408ba 38 tender->AddSupply(tpcSupply);
39
40 //========= Attach TOF supply ======
41 AliTOFTenderSupply *TOFtender = new AliTOFTenderSupply("TOFtender");
42 tender->AddSupply(TOFtender);
43
44 //========= Attach TRD supply ======
45 AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender");
46 tender->AddSupply(trdSupply);
47
48 //========= Attach PID supply ======
49 tender->AddSupply(new AliPIDTenderSupply("PIDtender"));
50
51 //========= Attach Primary Vertex supply ======
52 tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
53
54 //================================================
55 // data containers
56 //================================================
57
58 // define output containers, please use 'username'_'somename'
59 AliAnalysisDataContainer *coutput1 =
60 mgr->CreateContainer("tender_event", AliESDEvent::Class(),
61 AliAnalysisManager::kExchangeContainer,"default_tender");
62
63 // connect containers
64 mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() );
aa269eb9 65 mgr->ConnectOutput (tender, 1, coutput1);
e75408ba 66
67 return tender;
68}