count correctly the number of libraries
[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 /*
30   if (useV0) {
31      AliVZEROTenderSupply *vzeroSupply=new AliVZEROTenderSupply("VZEROtender");
32      vzeroSupply->SetDebug(kFALSE);
33      tender->AddSupply(vzeroSupply);
34   }   
35 */
36
37 /*  
38   //========= Attach TPC supply ======
39   AliTPCTenderSupply *tpcSupply=new AliTPCTenderSupply("TPCtender");
40   tpcSupply->SetDebugLevel(2);
41   //tpcSupply->SetMip(50.);
42   tender->AddSupply(tpcSupply);
43 */
44   //========= Attach TOF supply ======
45   AliTOFTenderSupply *tofTender = new AliTOFTenderSupply("TOFtender");
46   tender->AddSupply(tofTender);
47
48 /*  
49   //========= Attach TRD supply ======
50   AliTRDTenderSupply *trdSupply=new AliTRDTenderSupply("TRDtender");
51   trdSupply->SetLoadReferencesFromCDB();
52   // Mask Bad chambers
53   trdSupply->AddBadChamber(265);      // low drift
54   trdSupply->AddBadChamber(50);
55   trdSupply->AddBadChamber(524);      // low drift
56   trdSupply->AddBadChamber(32);       // intermediate gain
57   trdSupply->AddBadChamber(15);
58   trdSupply->AddBadChamber(231);      // low gain
59   trdSupply->AddBadChamber(273);      // intermediate gain
60   trdSupply->AddBadChamber(532);
61   trdSupply->AddBadChamber(5);        // low drift
62   trdSupply->AddBadChamber(227);
63   trdSupply->AddBadChamber(287);      // low drift
64   trdSupply->AddBadChamber(212);      // intermediate gain
65   trdSupply->AddBadChamber(228);      // low gain
66   trdSupply->AddBadChamber(52);       // low gain
67   trdSupply->AddBadChamber(169);      // low drift
68   trdSupply->AddBadChamber(236);      // low drift
69
70   trdSupply->SetPIDmethod(AliTRDTenderSupply::k1DLQpid);
71   trdSupply->SetNormalizationFactor(1./7.603);
72   tender->AddSupply(trdSupply);
73
74   //========= Attach PID supply ======
75   tender->AddSupply(new AliPIDTenderSupply("PIDtender"));
76
77   //========= Attach Primary Vertex supply ======
78   tender->AddSupply(new AliVtxTenderSupply("PriVtxtender"));
79 */  
80   //================================================
81   //              data containers
82   //================================================
83
84     //            define output containers, please use 'username'_'somename'
85   AliAnalysisDataContainer *coutput1 =
86       mgr->CreateContainer("tender_event", AliESDEvent::Class(),
87                            AliAnalysisManager::kExchangeContainer,"default_tender");
88  
89   //           connect containers
90   mgr->ConnectInput  (tender,  0, mgr->GetCommonInputContainer() );
91   mgr->ConnectOutput (tender,  1, coutput1);
92  
93   return tender;
94 }