]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C
Fixes for CAF, etc
[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 *
bd6f5206 9 * @ingroup pwglf_forward_scripts_tasks
a08de1fb 10 */
ffca499d 11/**
bd6f5206 12 * @defgroup pwglf_forward_eloss Energy Loss Fits
290052e7 13 *
14 * Fitting the energy loss @f$\Delta/\Delta_{mip}@f$ spectra
15 *
bd6f5206 16 * @ingroup pwglf_forward_topical
ffca499d 17 */
18
a08de1fb 19/**
20 * This is the macro to include the FMD energy fitter in a train.
21 *
290052e7 22 * @param mc Assume MC input
23 * @param useCent Use centrality information
24 *
25 * @return Newly created task
26 *
bd6f5206 27 * @ingroup pwglf_forward_eloss
a08de1fb 28 */
29AliAnalysisTask*
44e2877f 30AddTaskFMDELoss(Bool_t mc, Bool_t useCent, Int_t debug=0)
a08de1fb 31{
56236b95 32 // --- Load libraries ----------------------------------------------
bd6f5206 33 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
a08de1fb 34
56236b95 35 // --- Get analysis manager ----------------------------------------
a08de1fb 36 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
37 if (!mgr) {
ffca499d 38 Error("AddTaskFMDELoss", "No analysis manager to connect to.");
a08de1fb 39 return NULL;
40 }
e28f5fc5 41
a08de1fb 42 // --- Make the task and add it to the manager ---------------------
43 AliFMDEnergyFitterTask* task = new AliFMDEnergyFitterTask("fmdEnergyFitter");
9453b19e 44 // task->SetBLow(blow);
45 // task->SetBLow(bhigh);
a08de1fb 46 mgr->AddTask(task);
e28f5fc5 47
48 // --- Set parameters on the algorithms ----------------------------
a08de1fb 49 // Set the number of SPD tracklets for which we consider the event a
50 // low flux event
51 task->GetEventInspector().SetLowFluxCut(1000);
52 // Set the maximum error on v_z [cm]
53 task->GetEventInspector().SetMaxVzErr(0.2);
54 // Set the eta axis to use - note, this overrides whatever is used
55 // by the rest of the algorithms - but only for the energy fitter
56 // algorithm.
57 task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
58 // Set maximum energy loss to consider
59 task->GetEnergyFitter().SetMaxE(15);
60 // Set number of energy loss bins
37079f20 61 task->GetEnergyFitter().SetNEbins(500);
a08de1fb 62 // Set whether to use increasing bin sizes
63 task->GetEnergyFitter().SetUseIncreasingBins(true);
64 // Set whether to do fit the energy distributions
65 task->GetEnergyFitter().SetDoFits(kTRUE);
66 // Set whether to make the correction object
67 task->GetEnergyFitter().SetDoMakeObject(kTRUE);
68 // Set the low cut used for energy
69 task->GetEnergyFitter().SetLowCut(0.4);
70 // Set the number of bins to subtract from maximum of distributions
71 // to get the lower bound of the fit range
72 task->GetEnergyFitter().SetFitRangeBinWidth(4);
73 // Set the maximum number of landaus to try to fit (max 5)
74 task->GetEnergyFitter().SetNParticles(5);
75 // Set the minimum number of entries in the distribution before
76 // trying to fit to the data
77 task->GetEnergyFitter().SetMinEntries(1000);
44e2877f 78 // Debug
79 task->SetDebug(debug);
80
a08de1fb 81 // --- Set limits on fits the energy -------------------------------
82 // Maximum relative error on parameters
83 AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
84 // Least weight to use
85 AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
86 // Maximum value of reduced chi^2
37079f20 87 AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 20;
a08de1fb 88
89 // --- Make the output container and connect it --------------------
a08de1fb 90 AliAnalysisDataContainer* histOut =
91 mgr->CreateContainer("Forward", TList::Class(),
03418c15 92 AliAnalysisManager::kOutputContainer,
93 AliAnalysisManager::GetCommonFileName());
94 AliAnalysisDataContainer *output =
95 mgr->CreateContainer("ForwardResults", TList::Class(),
96 AliAnalysisManager::kParamContainer,
97 AliAnalysisManager::GetCommonFileName());
a08de1fb 98 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
99 mgr->ConnectOutput(task, 1, histOut);
03418c15 100 mgr->ConnectOutput(task, 2, output);
101
a08de1fb 102
103 return task;
104}