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
13 * @ingroup pwglf_forward_topical
17 * This is the macro to include the FMD energy fitter in a train.
19 * @ingroup pwglf_forward_eloss
22 AddTaskFMDELoss(Bool_t mc, Bool_t useCent)
24 // --- Load libraries ----------------------------------------------
25 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
27 // --- Get analysis manager ----------------------------------------
28 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
30 Error("AddTaskFMDELoss", "No analysis manager to connect to.");
34 // --- Make the task and add it to the manager ---------------------
35 AliFMDEnergyFitterTask* task = new AliFMDEnergyFitterTask("fmdEnergyFitter");
36 // task->SetBLow(blow);
37 // task->SetBLow(bhigh);
40 // --- Set parameters on the algorithms ----------------------------
41 // Set the number of SPD tracklets for which we consider the event a
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
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
53 task->GetEnergyFitter().SetNEbins(500);
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
76 AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 20;
78 // --- Make the output container and connect it --------------------
79 TString outputfile = ;
80 // outputfile += ":PWGLFforwardDnDeta";
81 // Form(":%s",pars->GetDndetaAnalysisName());
82 AliAnalysisDataContainer* histOut =
83 mgr->CreateContainer("Forward", TList::Class(),
84 AliAnalysisManager::kOutputContainer,
85 AliAnalysisManager::GetCommonFileName());
86 AliAnalysisDataContainer *output =
87 mgr->CreateContainer("ForwardResults", TList::Class(),
88 AliAnalysisManager::kParamContainer,
89 AliAnalysisManager::GetCommonFileName());
90 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
91 mgr->ConnectOutput(task, 1, histOut);
92 mgr->ConnectOutput(task, 2, output);