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 useTuple If true, create NTuple of hits
23 * @param debug Debug level
25 * @return Newly created task
27 * @ingroup pwglf_forward_eloss
30 AddTaskFMDMCTracks(Bool_t useTuple=false,
34 // --- Load libraries ----------------------------------------------
35 gROOT->LoadClass("AliFMDMCTrackELoss", "PWGLFforward2");
37 // --- Get analysis manager ----------------------------------------
38 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
40 Error("AddTaskFMDELoss", "No analysis manager to connect to.");
44 // --- Make the task and add it to the manager ---------------------
45 AliFMDMCTrackInspectorTask* task =
46 new AliFMDMCTrackInspectorTask("ForwardTracks",
48 // --- Set parameters on the algorithms ----------------------------
49 // Set the number of SPD tracklets for which we consider the event a
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
57 task->GetTrackInspector().SetEtaAxis(100, -4, 6);
58 // Set maximum energy loss to consider
59 task->GetTrackInspector().SetMaxE(15);
60 // Set number of energy loss bins
61 task->GetTrackInspector().SetNEbins(500);
62 // Set whether to use increasing bin sizes
63 task->GetTrackInspector().SetUseIncreasingBins(true);
64 // Set whether to do fit the energy distributions
65 task->GetTrackInspector().SetDoFits(kTRUE);
66 // Set whether to make the correction object
67 // task->GetTrackInspector().SetDoMakeObject(kTRUE);
68 // Set the low cut used for energy
69 task->GetTrackInspector().SetLowCut(0.05);
70 // Set the number of bins to subtract from maximum of distributions
71 // to get the lower bound of the fit range
72 task->GetTrackInspector().SetFitRangeBinWidth(4);
73 // Set the maximum number of landaus to try to fit (max 5)
74 task->GetTrackInspector().SetNParticles(1);
75 // Set the minimum number of entries in the distribution before
76 // trying to fit to the data - 10K seems the absolute minimum
77 task->GetTrackInspector().SetMinEntries(3000 /*10000*/);
78 // Set maximum number of strips per 'cluster'
79 task->GetTrackInspector().GetTracker().SetMaxConsequtiveStrips(maxStrips);
80 // If set, only collect statistics for MB. This is to prevent a
81 // bias when looping over data where the MB trigger is downscaled.
82 // task->SetOnlyMB(onlyMB);
84 task->SetDebug(debug);
86 // --- Set limits on fits the energy -------------------------------
87 // DO NOT CHANGE THESE UNLESS YOU KNOW WHAT YOU ARE DOING
88 // Maximum relative error on parameters
89 // AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
90 // Least weight to use
91 // AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
92 // Maximum value of reduced chi^2
93 // AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 20;
95 // --- Make the output container and connect it --------------------
98 AliAnalysisDataContainer* tuple =
99 mgr->CreateContainer("tuple", TTree::Class(),
100 AliAnalysisManager::kOutputContainer,
102 /*AliAnalysisManager::GetCommonFileName()*/);
103 mgr->ConnectOutput(task, 3, tuple);
106 Printf("Returning task %p", task);