1 AliAnalysisTask *AddTaskTender(Bool_t useV0=kFALSE,
9 Bool_t usePtFix=kFALSE)
11 if (!(useV0 | useTPC | useTOF | useTRD | usePID | useVTX | | useT0 | useEmc | usePtFix)) {
12 ::Error("AddTaskTender", "No supply added to tender, so tender not created");
15 //get the current analysis manager
16 Bool_t checkEvtSelection = useV0;
17 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
19 ::Error("AddTaskTender", "No analysis manager found.");
22 // currently don't accept AOD input
23 if (!mgr->GetInputEventHandler()->InheritsFrom(AliESDInputHandler::Class())) {
24 ::Error("AddTask_tender_Tender","The analysis tender only works with ESD input!");
28 //========= Add tender to the ANALYSIS manager and set default storage =====
29 AliTender *tender=new AliTender("AnalysisTender");
30 tender->SetCheckEventSelection(checkEvtSelection);
31 tender->SetDefaultCDBStorage("raw://");
34 //check that that tender is the first task after the pid response
35 TString firstName(mgr->GetTasks()->First()->GetName());
36 Bool_t isSecond=(mgr->GetTasks()->At(1) == (TObject*)tender);
38 if (! (firstName=="PIDResponseTask" && isSecond )){
39 Fatal("AddTaskTender","When using the tender the first task needs to be the PIDResponse and the tender the second task!!!");
43 //========= Attach VZERO supply ======
45 AliVZEROTenderSupply *vzeroSupply=new AliVZEROTenderSupply("VZEROtender");
46 vzeroSupply->SetDebug(kFALSE);
47 tender->AddSupply(vzeroSupply);
51 //========= Attach TPC supply ======
53 AliTPCTenderSupply *tpcSupply=new AliTPCTenderSupply("TPCtender");
54 tpcSupply->SetDebugLevel(2);
55 //tpcSupply->SetMip(50.);
56 tender->AddSupply(tpcSupply);
59 //========= Attach track 1/pt correction supply ======
61 AliTrackFixTenderSupply *trfixSupply=new AliTrackFixTenderSupply("PTInvFix");
62 //trfixSupply->SetDebugLevel(2);
63 tender->AddSupply(trfixSupply);
66 //========= Attach T0 supply ======
68 AliT0TenderSupply *t0Tender = new AliT0TenderSupply("T0tender");
69 t0Tender ->SetPass4LHC11aCorrection(kTRUE);
70 tender->AddSupply(t0Tender);
73 //========= Attach TOF supply ======
75 AliTOFTenderSupply *tofTender = new AliTOFTenderSupply("TOFtender");
76 tender->AddSupply(tofTender);
79 //========= Attach TRD supply ======
81 AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender");
83 trdSupply->SetLoadDeadChambersFromCDB(); // Mask Bad chambers
84 trdSupply->SetPIDmethod(AliTRDTenderSupply::k1DLQpid);
85 trdSupply->SwitchOffGainCorrection(); // Correction only on pass 1
86 trdSupply->SetNormalizationFactor(0.12697,114737,130850); // 1 otherwise
87 trdSupply->SetRedoTRDMatching(kTRUE);
88 tender->AddSupply(trdSupply);
91 //========= Attach Primary Vertex supply ======
93 tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
96 //========= Attach EMCAL supply ======
98 AliEMCALTenderSupply *emcSupply = new AliEMCALTenderSupply("EmcTender");
99 emcSupply->SetDefaults();
100 tender->AddSupply(emcSupply);
103 //========= Attach PID supply ======
105 AliPIDTenderSupply *pidSupply=new AliPIDTenderSupply("PIDtender");
106 tender->AddSupply(pidSupply);
109 //================================================
111 //================================================
113 // define output containers, please use 'username'_'somename'
114 AliAnalysisDataContainer *coutput1 =
115 mgr->CreateContainer("tender_event", AliESDEvent::Class(),
116 AliAnalysisManager::kExchangeContainer,"default_tender");
118 // connect containers
119 mgr->ConnectInput (tender, 0, mgr->GetCommonInputContainer() );
120 mgr->ConnectOutput (tender, 1, coutput1);