]>
Commit | Line | Data |
---|---|---|
fa5be4b4 | 1 | AliAnalysisTaskEMCALTriggerQA * AddTaskEMCALTriggerQA(TString outputFile = "", Int_t run = 0){ |
311ee5f3 | 2 | |
3 | ||
4 | // Get the pointer to the existing analysis manager via the static access method. | |
5 | //============================================================================== | |
6 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
7 | if (!mgr) { | |
8 | ::Error("AddTaskEMCALTriggerQA", "No analysis manager to connect to."); | |
9 | return NULL; | |
10 | } | |
11 | ||
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"); | |
16 | return NULL; | |
17 | } | |
18 | ||
19 | AliAnalysisTaskEMCALTriggerQA * qatrigger = new AliAnalysisTaskEMCALTriggerQA("QATrigger"); | |
20 | ||
21 | AliEMCALRecoUtils * reco = qatrigger->GetRecoUtils(); | |
22 | reco->SwitchOnRejectExoticCluster(); | |
23 | ||
fa5be4b4 | 24 | // Pass the bad channels, need to access run number |
311ee5f3 | 25 | TString fileName="$ALICE_ROOT/OADB/EMCAL/EMCALBadChannels.root"; |
26 | AliOADBContainer *contBC=new AliOADBContainer(""); | |
27 | contBC->InitFromFile((char*)fileName.Data(),"AliEMCALBadChannels"); | |
fa5be4b4 | 28 | TObjArray *arrayBC=(TObjArray*)contBC->GetObject(run); |
311ee5f3 | 29 | if(arrayBC){ |
30 | TObjArray *arrayBCpass=(TObjArray*)arrayBC->FindObject("pass1"); | |
31 | if(arrayBCpass){ | |
32 | ||
33 | reco->SwitchOnBadChannelsRemoval(); | |
34 | printf("trigger REMOVE bad cells \n"); | |
35 | ||
36 | for (Int_t i=0; i<10; ++i) { | |
37 | TH2I *hbm = reco->GetEMCALChannelStatusMap(i); | |
38 | if (hbm) | |
39 | delete hbm; | |
40 | hbm=(TH2I*)arrayBCpass->FindObject(Form("EMCALBadChannelMap_Mod%d",i)); | |
41 | ||
42 | if (!hbm) { | |
43 | AliError(Form("Can not get EMCALBadChannelMap_Mod%d",i)); | |
44 | continue; | |
45 | } | |
46 | ||
47 | hbm->SetDirectory(0); | |
48 | reco->SetEMCALChannelStatusMap(i,hbm); | |
49 | } | |
50 | } else printf("trigger AliEMCALRecoUtils ---Do NOT remove bad channels 1\n"); | |
51 | } else printf("trigger AliEMCALRecoUtils ---Do NOT remove bad channels 2\n"); | |
fa5be4b4 | 52 | |
311ee5f3 | 53 | if(outputFile.Length()==0)outputFile = AliAnalysisManager::GetCommonFileName(); |
54 | ||
55 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
56 | ||
57 | AliAnalysisDataContainer *coutput = | |
58 | mgr->CreateContainer("EMCALQATrigger", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:EMCALQATrigger",outputFile.Data())); | |
59 | mgr->AddTask(qatrigger); | |
60 | mgr->ConnectInput (qatrigger, 0, cinput1); | |
61 | mgr->ConnectOutput (qatrigger, 1, coutput); | |
62 | ||
63 | return qatrigger; | |
64 | ||
65 | } |