]>
Commit | Line | Data |
---|---|---|
2d28db9f | 1 | AliAnalysisTask *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); |
307f55b2 | 19 | // tender->SetDefaultCDBStorage("raw://"); |
20 | tender->SetDefaultCDBStorage("alien://?Folder=/alice/data/2010/OCDB"); | |
e75408ba | 21 | mgr->AddTask(tender); |
aaf2d706 | 22 | if (checkEvtSelection) { |
23 | if (mgr->GetTasks()->First() != (TObject*)tender) { | |
24 | ::Error("When setting the tender to check the event selection, it has to be the first wagon ! Aborting."); | |
25 | return NULL; | |
26 | } | |
27 | } | |
e75408ba | 28 | |
9259172d | 29 | //========= Attach VZERO supply ====== |
2d28db9f | 30 | if (useV0) { |
31 | AliVZEROTenderSupply *vzeroSupply=new AliVZEROTenderSupply("VZEROtender"); | |
32 | vzeroSupply->SetDebug(kFALSE); | |
33 | tender->AddSupply(vzeroSupply); | |
34 | } | |
e75408ba | 35 | //========= Attach TPC supply ====== |
36 | AliTPCTenderSupply *tpcSupply=new AliTPCTenderSupply("TPCtender"); | |
f19a0c5e | 37 | tpcSupply->SetDebugLevel(2); |
ee981ab3 | 38 | //tpcSupply->SetMip(50.); |
e75408ba | 39 | tender->AddSupply(tpcSupply); |
40 | ||
41 | //========= Attach TOF supply ====== | |
ee981ab3 | 42 | AliTOFTenderSupply *tofTender = new AliTOFTenderSupply("TOFtender"); |
43 | tofTender->SetTimeZeroType(AliESDpid::kTOF_T0); | |
44 | tender->AddSupply(tofTender); | |
e75408ba | 45 | |
46 | //========= Attach TRD supply ====== | |
47 | AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender"); | |
48 | tender->AddSupply(trdSupply); | |
49 | ||
50 | //========= Attach PID supply ====== | |
51 | tender->AddSupply(new AliPIDTenderSupply("PIDtender")); | |
52 | ||
53 | //========= Attach Primary Vertex supply ====== | |
54 | tender->AddSupply(new AliVtxTenderSupply("PriVtxtender")); | |
55 | ||
56 | //================================================ | |
57 | // data containers | |
58 | //================================================ | |
59 | ||
60 | // define output containers, please use 'username'_'somename' | |
61 | AliAnalysisDataContainer *coutput1 = | |
62 | mgr->CreateContainer("tender_event", AliESDEvent::Class(), | |
63 | AliAnalysisManager::kExchangeContainer,"default_tender"); | |
64 | ||
65 | // connect containers | |
66 | mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() ); | |
aa269eb9 | 67 | mgr->ConnectOutput (tender, 1, coutput1); |
e75408ba | 68 | |
69 | return tender; | |
70 | } |