1 AliAnalysisTaskEMCALTriggerQA * AddTaskEMCALTriggerQA(TString outputFile = "", Bool_t rmBadCells = kTRUE, Int_t run = 0){
4 // Get the pointer to the existing analysis manager via the static access method.
5 //==============================================================================
6 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
8 ::Error("AddTaskEMCALTriggerQA", "No analysis manager to connect to.");
12 // Check the analysis type using the event handlers connected to the analysis manager.
13 //==============================================================================
14 if (!mgr->GetInputEventHandler()) {
15 ::Error("AddTaskEMCALTriggerQA", "This task requires an input event handler");
19 AliAnalysisTaskEMCALTriggerQA * qatrigger = new AliAnalysisTaskEMCALTriggerQA("QATrigger");
23 AliEMCALRecoUtils * reco = qatrigger->GetRecoUtils();
24 reco->SwitchOnRejectExoticCluster();
26 // Pass the bad channels, need to access run number
27 TString fileName="$ALICE_ROOT/OADB/EMCAL/EMCALBadChannels.root";
28 AliOADBContainer *contBC=new AliOADBContainer("");
29 contBC->InitFromFile((char*)fileName.Data(),"AliEMCALBadChannels");
30 TObjArray *arrayBC=(TObjArray*)contBC->GetObject(run);
32 TObjArray *arrayBCpass=(TObjArray*)arrayBC->FindObject("pass1");
35 reco->SwitchOnBadChannelsRemoval();
36 printf("*** EMCAL trigger QA: REMOVE bad cells \n");
38 for (Int_t i=0; i<12; ++i) {
39 TH2I *hbm = reco->GetEMCALChannelStatusMap(i);
42 hbm=(TH2I*)arrayBCpass->FindObject(Form("EMCALBadChannelMap_Mod%d",i));
45 AliError(Form("Can not get EMCALBadChannelMap_Mod%d",i));
50 reco->SetEMCALChannelStatusMap(i,hbm);
52 } else printf("trigger AliEMCALRecoUtils ---Do NOT remove bad channels 1\n");
53 } else printf("trigger AliEMCALRecoUtils ---Do NOT remove bad channels 2\n");
56 if(outputFile.Length()==0)outputFile = AliAnalysisManager::GetCommonFileName();
58 AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
60 AliAnalysisDataContainer *coutput = 0;
61 if(outputFile.Length()==0)
62 coutput = mgr->CreateContainer("EMCALQATrigger", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EMCALQATrigger",outputFile.Data()));
64 coutput = mgr->CreateContainer("EMCALQATrigger", TList::Class(), AliAnalysisManager::kOutputContainer, outputFile.Data());
66 mgr->AddTask(qatrigger);
67 mgr->ConnectInput (qatrigger, 0, cinput1);
68 mgr->ConnectOutput (qatrigger, 1, coutput);