.so cleanup: removed from gSystem->Load()
[u/mrichter/AliRoot.git] / PWGGA / PHOSTasks / CaloCellQA / macros / ana_example.C
CommitLineData
4dfe4df7 1void ana_example()
2{
3 // Example macro to run QA
4
5 // load relevant library
4070f709 6 gSystem->Load("libPWGGAPHOSTasks");
4dfe4df7 7
8 // change next line to a working code
9 TChain* chain = NULL; //CreateChain("wn.xml");
10 if (!chain) {
d30ac678 11 fprintf(stderr, "FATAL: the chain is NULL\n");
4dfe4df7 12 abort();
13 }
14
15 AliAnalysisManager *mgr = new AliAnalysisManager("Manager");
16
17 AliESDInputHandler* esdH = new AliESDInputHandler();
18 mgr->SetInputEventHandler(esdH);
19
20 // event selection task
21 gROOT->LoadMacro("$ALICE_ROOT/ANALYSIS/macros/AddTaskPhysicsSelection.C");
22 AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
23
24 // EMCAL
25 Int_t nbadEMCAL = 44;
26 Int_t badcellsEMCAL[44] = {
27 74,152,495,871,917,1059,1263,1275,1276,1288,1376,1384,1519,1712,1967,2026,2112,
28 2114,2115,2116,2117,2120,2123,2298,2671,2768,2769,2770,2771,2773,2774,2776,
29 2777,2778,2779,2780,2783,3544,3567,
30 103,1382,1961,2047,2540
31 };
32
33 // with PS + no pileup
34 AliAnalysisTaskCaloCellsQA *task1 = AddTaskCaloCellsQA(4, 0, "CellsQAEMCAL.root");
35 task1->SelectCollisionCandidates(AliVEvent::kMB);
36 task1->SetBadCells(badcellsEMCAL, nbadEMCAL);
37
38 // with PS + with pileup
39 AliAnalysisTaskCaloCellsQA *task2 = AddTaskCaloCellsQA(4, 0, "CellsQAEMCAL2.root");
40 task2->SelectCollisionCandidates(AliVEvent::kMB);
41 task2->SetBadCells(badcellsEMCAL, nbadEMCAL);
42 task2->SetAvoidPileup(kFALSE);
43
44 // no PS + with pileup
45 AliAnalysisTaskCaloCellsQA *task3 = AddTaskCaloCellsQA(4, 0, "CellsQAEMCAL3.root");
46 task3->SetBadCells(badcellsEMCAL, nbadEMCAL);
47 task3->SetAvoidPileup(kFALSE);
48
49 // PHOS
50 Int_t nbadPHOS = 1;
51 Int_t badcellsPHOS[1] = {9938};
52
53 // with PS + no pileup
54 AliAnalysisTaskCaloCellsQA *task4 = AddTaskCaloCellsQA(4, 1, "CellsQAPHOS.root");
55 task4->SelectCollisionCandidates(AliVEvent::kMB);
56 task4->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.1); // increase statistics
57 task4->SetBadCells(badcellsPHOS, nbadPHOS);
58
59 // with PS + with pileup
60 AliAnalysisTaskCaloCellsQA *task5 = AddTaskCaloCellsQA(4, 1, "CellsQAPHOS2.root");
61 task5->SelectCollisionCandidates(AliVEvent::kMB);
62 task5->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.1);
63 task5->SetBadCells(badcellsPHOS, nbadPHOS);
64 task5->SetAvoidPileup(kFALSE);
65
66 // no PS + with pileup
67 AliAnalysisTaskCaloCellsQA *task6 = AddTaskCaloCellsQA(4, 1, "CellsQAPHOS3.root");
68 task6->GetCaloCellsQA()->SetClusterEnergyCuts(0.3,0.1);
69 task6->SetBadCells(badcellsPHOS, nbadPHOS);
70 task6->SetAvoidPileup(kFALSE);
71
72
73 if (!mgr->InitAnalysis()) abort();
74 mgr->StartAnalysis("local", chain);
75}