2 * @file AddTaskFMDELoss.C
3 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
4 * @date Wed Mar 23 12:14:03 2011
9 * @ingroup pwglf_forward_scripts_tasks
12 * @defgroup pwglf_forward_eloss Energy Loss Fits
14 * Fitting the energy loss @f$\Delta/\Delta_{mip}@f$ spectra
16 * @ingroup pwglf_forward_topical
20 * This is the macro to include the FMD energy fitter in a train.
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
26 * @param residuals If set, also do residuals
28 * @return Newly created task
30 * @ingroup pwglf_forward_eloss
33 AddTaskFMDELoss(Bool_t mc,
35 const Char_t* config="elossFitConfig.C",
36 const Char_t* corrs="")
38 // --- Load libraries ----------------------------------------------
39 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
41 // --- Get analysis manager ----------------------------------------
42 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
44 Error("AddTaskFMDELoss", "No analysis manager to connect to.");
48 // --- Set alternative corrections path ----------------------------
49 AliForwardCorrectionManager& cm = AliForwardCorrectionManager::Instance();
50 if (corrs && corrs[0] != '\0') cm.SetPrefix(corrs);
52 // --- Make the task and add it to the manager ---------------------
53 AliFMDEnergyFitterTask* task = new AliFMDEnergyFitterTask("ForwardELoss");
54 // --- Set parameters on the algorithms ----------------------------
55 task->Configure(config);
57 // For MC input we explicitly disable the noise correction
58 if (mc) task->GetESDFixer().SetRecoNoiseFactor(4);
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);
65 // --- Make the output container and connect it --------------------
68 Printf("Returning task %p", task);