]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskFMDELoss.C
Merge branch 'feature-movesplit'
[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 *
a03f01f7 22 * @param mc Assume MC input
23 * @param useCent Use centrality information
24 * @param onlyMB Only collect statistics for MB (INEL) events
25 * @param debug Debug level
c8b1a7db 26 * @param residuals If set, also do residuals
290052e7 27 *
28 * @return Newly created task
29 *
bd6f5206 30 * @ingroup pwglf_forward_eloss
a08de1fb 31 */
32AliAnalysisTask*
a03f01f7 33AddTaskFMDELoss(Bool_t mc,
a03f01f7 34 Bool_t onlyMB=false,
a923716b 35 const Char_t* config="elossFitConfig.C",
0ccdab7b 36 const Char_t* corrs="")
a08de1fb 37{
56236b95 38 // --- Load libraries ----------------------------------------------
bd6f5206 39 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
a08de1fb 40
56236b95 41 // --- Get analysis manager ----------------------------------------
a08de1fb 42 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
43 if (!mgr) {
ffca499d 44 Error("AddTaskFMDELoss", "No analysis manager to connect to.");
a08de1fb 45 return NULL;
46 }
e28f5fc5 47
0ccdab7b 48 // --- Set alternative corrections path ----------------------------
49 AliForwardCorrectionManager& cm = AliForwardCorrectionManager::Instance();
50 if (corrs && corrs[0] != '\0') cm.SetPrefix(corrs);
51
a08de1fb 52 // --- Make the task and add it to the manager ---------------------
c8b1a7db 53 AliFMDEnergyFitterTask* task = new AliFMDEnergyFitterTask("ForwardELoss");
e28f5fc5 54 // --- Set parameters on the algorithms ----------------------------
a923716b 55 task->Configure(config);
0ccdab7b 56
0ccdab7b 57 // For MC input we explicitly disable the noise correction
58 if (mc) task->GetESDFixer().SetRecoNoiseFactor(4);
0ccdab7b 59
60 // --- General -----------------------------------------------------
61 // If set, only collect statistics for MB. This is to prevent a
62 // bias when looping over data where the MB trigger is downscaled.
63 task->SetOnlyMB(onlyMB);
0ccdab7b 64
a08de1fb 65 // --- Make the output container and connect it --------------------
c8b1a7db 66 task->Connect(0,0);
a08de1fb 67
0b7de667 68 Printf("Returning task %p", task);
a08de1fb 69 return task;
70}
0b7de667 71//
72// EOF
73//