switched back to raw:// CDB
[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);
351c53ea 19 tender->SetDefaultCDBStorage("raw://");
e75408ba 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);
ee981ab3 37 //tpcSupply->SetMip(50.);
e75408ba 38 tender->AddSupply(tpcSupply);
39
40 //========= Attach TOF supply ======
ee981ab3 41 AliTOFTenderSupply *tofTender = new AliTOFTenderSupply("TOFtender");
42 tofTender->SetTimeZeroType(AliESDpid::kTOF_T0);
43 tender->AddSupply(tofTender);
e75408ba 44
45 //========= Attach TRD supply ======
46 AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender");
47 tender->AddSupply(trdSupply);
48
49 //========= Attach PID supply ======
50 tender->AddSupply(new AliPIDTenderSupply("PIDtender"));
51
52 //========= Attach Primary Vertex supply ======
53 tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
54
55 //================================================
56 // data containers
57 //================================================
58
59 // define output containers, please use 'username'_'somename'
60 AliAnalysisDataContainer *coutput1 =
61 mgr->CreateContainer("tender_event", AliESDEvent::Class(),
62 AliAnalysisManager::kExchangeContainer,"default_tender");
63
64 // connect containers
65 mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() );
aa269eb9 66 mgr->ConnectOutput (tender, 1, coutput1);
e75408ba 67
68 return tender;
69}