]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C
Transition PWG2/FORWARD -> PWGLF
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskFMDELoss.C
CommitLineData
a08de1fb 1/**
ffca499d 2 * @file AddTaskFMDELoss.C
3 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
4 * @date Wed Mar 23 12:14:03 2011
5 *
6 * @brief
7 *
a08de1fb 8 *
ffca499d 9 * @ingroup pwg2_forward_scripts_tasks
a08de1fb 10 */
ffca499d 11/**
12 * @defgroup pwg2_forward_eloss Energy Loss Fits
13 * @ingroup pwg2_forward_topical
14 */
15
a08de1fb 16/**
17 * This is the macro to include the FMD energy fitter in a train.
18 *
ffca499d 19 * @ingroup pwg2_forward_eloss
a08de1fb 20 */
21AliAnalysisTask*
9453b19e 22AddTaskFMDELoss(Bool_t mc, Bool_t useCent)
a08de1fb 23{
56236b95 24 // --- Load libraries ----------------------------------------------
25 gROOT->LoadClass("AliAODForwardMult", "libPWG2forward2");
a08de1fb 26
56236b95 27 // --- Get analysis manager ----------------------------------------
a08de1fb 28 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
29 if (!mgr) {
ffca499d 30 Error("AddTaskFMDELoss", "No analysis manager to connect to.");
a08de1fb 31 return NULL;
32 }
e28f5fc5 33
a08de1fb 34 // --- Make the task and add it to the manager ---------------------
35 AliFMDEnergyFitterTask* task = new AliFMDEnergyFitterTask("fmdEnergyFitter");
9453b19e 36 // task->SetBLow(blow);
37 // task->SetBLow(bhigh);
a08de1fb 38 mgr->AddTask(task);
e28f5fc5 39
40 // --- Set parameters on the algorithms ----------------------------
a08de1fb 41 // Set the number of SPD tracklets for which we consider the event a
42 // low flux event
43 task->GetEventInspector().SetLowFluxCut(1000);
44 // Set the maximum error on v_z [cm]
45 task->GetEventInspector().SetMaxVzErr(0.2);
46 // Set the eta axis to use - note, this overrides whatever is used
47 // by the rest of the algorithms - but only for the energy fitter
48 // algorithm.
49 task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
50 // Set maximum energy loss to consider
51 task->GetEnergyFitter().SetMaxE(15);
52 // Set number of energy loss bins
37079f20 53 task->GetEnergyFitter().SetNEbins(500);
a08de1fb 54 // Set whether to use increasing bin sizes
55 task->GetEnergyFitter().SetUseIncreasingBins(true);
56 // Set whether to do fit the energy distributions
57 task->GetEnergyFitter().SetDoFits(kTRUE);
58 // Set whether to make the correction object
59 task->GetEnergyFitter().SetDoMakeObject(kTRUE);
60 // Set the low cut used for energy
61 task->GetEnergyFitter().SetLowCut(0.4);
62 // Set the number of bins to subtract from maximum of distributions
63 // to get the lower bound of the fit range
64 task->GetEnergyFitter().SetFitRangeBinWidth(4);
65 // Set the maximum number of landaus to try to fit (max 5)
66 task->GetEnergyFitter().SetNParticles(5);
67 // Set the minimum number of entries in the distribution before
68 // trying to fit to the data
69 task->GetEnergyFitter().SetMinEntries(1000);
70 // --- Set limits on fits the energy -------------------------------
71 // Maximum relative error on parameters
72 AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
73 // Least weight to use
74 AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
75 // Maximum value of reduced chi^2
37079f20 76 AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 20;
a08de1fb 77
78 // --- Make the output container and connect it --------------------
03418c15 79 TString outputfile = ;
a08de1fb 80 // outputfile += ":PWG2forwardDnDeta";
81 // Form(":%s",pars->GetDndetaAnalysisName());
82 AliAnalysisDataContainer* histOut =
83 mgr->CreateContainer("Forward", TList::Class(),
03418c15 84 AliAnalysisManager::kOutputContainer,
85 AliAnalysisManager::GetCommonFileName());
86 AliAnalysisDataContainer *output =
87 mgr->CreateContainer("ForwardResults", TList::Class(),
88 AliAnalysisManager::kParamContainer,
89 AliAnalysisManager::GetCommonFileName());
a08de1fb 90 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
91 mgr->ConnectOutput(task, 1, histOut);
03418c15 92 mgr->ConnectOutput(task, 2, output);
93
a08de1fb 94
95 return task;
96}