]>
Commit | Line | Data |
---|---|---|
477c5cd2 | 1 | // $Id: AliAnalysisTaskEMCALPi0CalibSelection 56196 2012-05-03 20:53:20Z gconesab $ |
2 | ||
3 | AliAnalysisTaskEMCALPi0CalibSelection * AddTaskEMCALPi0Calibration(TString outputFile = "", // AnalysisResults.root | |
4 | TString trigger ="CEMC7", | |
5 | Bool_t recalE = kFALSE, | |
6 | Bool_t recalT = kFALSE, | |
7 | Bool_t rmBad = kFALSE, | |
8 | Bool_t nonlin = kTRUE, | |
9 | Bool_t simu = kFALSE) | |
10 | { | |
11 | // Get the pointer to the existing analysis manager via the static access method. | |
12 | //============================================================================== | |
13 | AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager(); | |
14 | if (!mgr) | |
15 | { | |
16 | ::Error("AddTaskEMCALTriggerQA", "No analysis manager to connect to."); | |
17 | return NULL; | |
18 | } | |
19 | ||
20 | // Check the analysis type using the event handlers connected to the analysis manager. | |
21 | //============================================================================== | |
22 | if (!mgr->GetInputEventHandler()) | |
23 | { | |
24 | ::Error("AddTaskEMCALPi0Calibration", "This task requires an input event handler"); | |
25 | return NULL; | |
26 | } | |
27 | ||
28 | ||
29 | // Create containers for input/output | |
30 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
31 | ||
32 | AliAnalysisTaskEMCALPi0CalibSelection * pi0calib = new AliAnalysisTaskEMCALPi0CalibSelection ("EMCALPi0Calibration"); | |
477c5cd2 | 33 | //pi0calib->SetDebugLevel(10); |
34 | //pi0calib->UseFilteredEventAsInput(); | |
35 | pi0calib->SetClusterMinEnergy(0.3); | |
36 | pi0calib->SetClusterMaxEnergy(10.); | |
37 | pi0calib->SetClusterLambda0Cuts(0.1,0.5); | |
38 | pi0calib->SetAsymmetryCut(1.); | |
39 | pi0calib->SetClusterMinNCells(1); | |
40 | pi0calib->SetNCellsGroup(0); | |
41 | pi0calib->SwitchOnSameSM(); | |
7dcf6978 | 42 | pi0calib->SetPairDTimeCut(20); |
477c5cd2 | 43 | pi0calib->SetClusterMinTime(560); |
44 | pi0calib->SetClusterMaxTime(610); | |
45 | ||
46 | pi0calib->SetTriggerName(trigger); | |
47 | ||
48 | // Cluster recalculation, Reco Utils configuration | |
49 | ||
477c5cd2 | 50 | |
51 | AliEMCALRecoUtils * reco = pi0calib->GetEMCALRecoUtils(); | |
52 | ||
53 | gROOT->LoadMacro("$ALICE_ROOT/PWGGA/EMCALTasks/macros/ConfigureEMCALRecoUtils.C"); | |
54 | ||
55 | ConfigureEMCALRecoUtils(reco, | |
56 | simu, | |
57 | kTRUE, // exotic | |
58 | nonlin, | |
59 | recalE, | |
60 | rmBad, | |
7b2d541a | 61 | recalT); |
477c5cd2 | 62 | |
a8dc7d71 | 63 | reco->SetNumberOfCellsFromEMCALBorder(0); // Do not remove clusters in borders! |
7b2d541a | 64 | |
65 | // recalibrate energy and do corrections because of Temperature corrections | |
66 | pi0calib->SwitchOnClusterCorrection(); | |
67 | reco->SwitchOnRecalibration(); | |
68 | reco->SwitchOnRunDepCorrection(); | |
69 | ||
477c5cd2 | 70 | //reco->Print(""); |
71 | ||
477c5cd2 | 72 | //--------------------- |
73 | // Geometry alignment | |
74 | //--------------------- | |
75 | ||
76 | //pi0calib->SetGeometryName("EMCAL_COMPLETE12SMV1"); | |
77 | pi0calib->SetGeometryName("EMCAL_COMPLETEV1"); | |
78 | ||
a8dc7d71 | 79 | pi0calib->SwitchOnLoadOwnGeometryMatrices(); |
477c5cd2 | 80 | |
81 | ||
82 | //--------------------- | |
83 | // Recalibration | |
84 | //--------------------- | |
85 | ||
86 | if(recalE) | |
87 | { | |
477c5cd2 | 88 | TFile * f = new TFile("RecalibrationFactors.root","read"); |
89 | for(Int_t ism = 0; ism < 12; ism++) | |
90 | { | |
91 | TH2F * h = (TH2F*)f->Get("EMCALRecalFactors_SM0"); | |
92 | reco->SetEMCALChannelRecalibrationFactors(0,h); | |
93 | } | |
94 | } | |
95 | ||
96 | pi0calib->PrintInfo(); | |
97 | ||
98 | mgr->AddTask(pi0calib); | |
99 | ||
100 | if(outputFile.Length()==0) outputFile = AliAnalysisManager::GetCommonFileName(); | |
101 | ||
102 | AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer(); | |
103 | AliAnalysisDataContainer *coutput = mgr->CreateContainer(Form("Pi0Calibration_Trig%s",trigger.Data()), | |
104 | TList::Class(), AliAnalysisManager::kOutputContainer, | |
105 | outputFile.Data()); | |
106 | ||
107 | AliAnalysisDataContainer *cout_cuts = mgr->CreateContainer(Form("ParamsPi0Calibration_Trig%s",trigger.Data()), | |
108 | TList::Class(), AliAnalysisManager::kOutputContainer, | |
109 | "AnalysisParameters.root"); | |
110 | ||
111 | mgr->AddTask(pi0calib); | |
112 | ||
113 | mgr->ConnectInput (pi0calib, 0, cinput1); | |
114 | mgr->ConnectOutput (pi0calib, 1, coutput); | |
115 | mgr->ConnectOutput (pi0calib, 2, cout_cuts); | |
116 | ||
117 | return pi0calib; | |
118 | } |