]>
Commit | Line | Data |
---|---|---|
a8d74d4a | 1 | AliAnalysisTaskCaloConv * AddTaskCaloConv(){ |
2 | //Macro to add class CaloConv (conversion+calorimeters pi0 analysis) to train | |
3 | //Argument is the path to the PHOS recalibration parameters (file with OCDB entry) | |
4 | //Default path to the file with unit recalibration == no recalibnration | |
5 | //If file does not exist, no recalibration histograms will be filled | |
6 | ||
7 | // Get the pointer to the existing analysis manager via the static access method. | |
8 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
9 | if (!mgr) { | |
10 | ::Error("AddTaskCaloConv", "No analysis manager to connect to."); | |
11 | return NULL; | |
12 | } | |
13 | ||
14 | // Check the analysis type using the event handlers connected to the analysis manager. | |
15 | if (!mgr->GetInputEventHandler()) { | |
16 | ::Error("AddTaskCaloConv", "This task requires an input event handler"); | |
17 | return NULL; | |
18 | } | |
19 | ||
20 | // Add task | |
21 | AliAnalysisTaskCaloConv *task = new AliAnalysisTaskCaloConv("CaloConv"); | |
22 | mgr->AddTask(task); | |
23 | ||
1c0ffc7f | 24 | TDirectory* saveDir = gDirectory; |
25 | TGrid a; | |
26 | if(a.IsConnected()){ | |
27 | TFile *fBadMap = TFile::Open("alien:///alice/cern.ch/user/p/prsnko/BadMaps/BadMap_LHC10b.root") ; | |
28 | if(fBadMap->IsOpen()){ | |
29 | if (saveDir) saveDir->cd(); else gROOT->cd(); | |
30 | ||
31 | printf("Adding PHOS and EMCAL bad maps \n") ; | |
32 | char key[55] ; | |
33 | for(Int_t mod=1;mod<4; mod++){ | |
34 | sprintf(key,"PHOS_BadMap_mod%d",mod) ; | |
35 | TH2I * h = (TH2I*)fBadMap->Get(key) ; | |
36 | if(h) | |
37 | task->SetPHOSBadMap(mod,h) ; | |
38 | } | |
39 | for(Int_t sm=0; sm<5; sm++){ | |
40 | sprintf(key,"EMCAL_BadMap_mod%d",sm) ; | |
41 | TH2I * h = (TH2I*)fBadMap->Get(key) ; | |
42 | if(h) | |
43 | task->SetEMCALBadMap(mod,h) ; | |
44 | } | |
45 | fBadMap->Close() ; | |
46 | } | |
47 | } | |
48 | else{ | |
49 | printf("Can not open Bad Map file \n") ; | |
50 | } | |
51 | ||
52 | ||
a8d74d4a | 53 | // Create containers for input/output |
54 | AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer(); | |
55 | mgr->ConnectInput(task, 0, cinput); | |
56 | ||
57 | TString outputfile = AliAnalysisManager::GetCommonFileName(); | |
58 | AliAnalysisDataContainer *coutput = mgr->CreateContainer("CaloConv", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:PWG4_CaloConv",outputfile.Data())); | |
59 | mgr->ConnectOutput(task, 1, coutput); | |
60 | AliAnalysisDataContainer *coutput2 = mgr->CreateContainer("CFCaloConv", TList::Class(), AliAnalysisManager::kOutputContainer, Form("%s:PWG4_CFCaloConv",outputfile.Data())); | |
61 | mgr->ConnectOutput(task, 2, coutput2); | |
62 | ||
63 | return task ; | |
64 | ||
65 | } |