Update of the TRD PID Response:
[u/mrichter/AliRoot.git] / ANALYSIS / TenderSupplies / AddTaskTender.C
1 AliAnalysisTask *AddTaskTender(Bool_t useV0=kFALSE){
2   //get the current analysis manager
3   Bool_t checkEvtSelection = useV0;
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
10   if (!mgr->GetInputEventHandler()->InheritsFrom(AliESDInputHandler::Class())) {
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");
18   tender->SetCheckEventSelection(checkEvtSelection);
19   tender->SetDefaultCDBStorage("raw://");
20   mgr->AddTask(tender);
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   }   
27   
28   //========= Attach VZERO supply ======
29   if (useV0) {
30      AliVZEROTenderSupply *vzeroSupply=new AliVZEROTenderSupply("VZEROtender");
31      vzeroSupply->SetDebug(kFALSE);
32      tender->AddSupply(vzeroSupply);
33   }   
34   //========= Attach TPC supply ======
35   AliTPCTenderSupply *tpcSupply=new AliTPCTenderSupply("TPCtender");
36   tpcSupply->SetDebugLevel(2);
37   //tpcSupply->SetMip(50.);
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   trdSupply->SetLoadReferencesFromCDB();
47   // Mask Bad chambers
48   trdSupply->AddBadChamber(265);      // low drift
49   trdSupply->AddBadChamber(50);
50   trdSupply->AddBadChamber(524);      // low drift
51   trdSupply->AddBadChamber(32);       // intermediate gain
52   trdSupply->AddBadChamber(15);
53   trdSupply->AddBadChamber(231);      // low gain
54   trdSupply->AddBadChamber(273);      // intermediate gain
55   trdSupply->AddBadChamber(532);
56   trdSupply->AddBadChamber(5);        // low drift
57   trdSupply->AddBadChamber(227);
58   trdSupply->AddBadChamber(287);      // low drift
59   trdSupply->AddBadChamber(212);      // intermediate gain
60   trdSupply->AddBadChamber(228);      // low gain
61   trdSupply->AddBadChamber(52);       // low gain
62   trdSupply->AddBadChamber(169);      // low drift
63   trdSupply->AddBadChamber(236);      // low drift
64
65   trdSupply->SetPIDmethod(AliTRDTenderSupply::k1DLQpid);
66   trdSupply->SetNormalizationFactor(1./7.603);
67   tender->AddSupply(trdSupply);
68
69   //========= Attach PID supply ======
70   tender->AddSupply(new AliPIDTenderSupply("PIDtender"));
71
72   //========= Attach Primary Vertex supply ======
73   tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
74   
75   //================================================
76   //              data containers
77   //================================================
78
79     //            define output containers, please use 'username'_'somename'
80   AliAnalysisDataContainer *coutput1 =
81       mgr->CreateContainer("tender_event", AliESDEvent::Class(),
82                            AliAnalysisManager::kExchangeContainer,"default_tender");
83  
84   //           connect containers
85   mgr->ConnectInput  (tender,  0, mgr->GetCommonInputContainer() );
86   mgr->ConnectOutput (tender,  1, coutput1);
87  
88   return tender;
89 }