]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AddTaskFMD.C
Doc updates
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskFMD.C
CommitLineData
7c1a1f1d 1/**
2 * @defgroup pwg2_forward_scripts Scripts used in the analysis
3 *
4 * @ingroup pwg2_forward
5 */
6/**
7 * @file
8 * @ingroup pwg2_forward_scripts
9 *
10 */
7e4038b5 11/**
12 * This is the macro to include the Forward multiplicity in a train.
13 *
7c1a1f1d 14 * @ingroup pwg2_forward_scripts
7e4038b5 15 */
2d68d438 16AliAnalysisTask*
e797efbb 17AddTaskFMD(Bool_t mc)
7e4038b5 18{
1c762251 19 gSystem->Load("libPWG2forward2");
20
7e4038b5 21 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
22 if (!mgr) {
23 Error("AddTaskFMD", "No analysis manager to connect to.");
24 return NULL;
25 }
26
6b908a3f 27 // --- Make the task and add it to the manager ---------------------
e797efbb 28 AliForwardMultiplicityBase* task = 0;
29 if (mc) task = new AliForwardMCMultiplicityTask("FMD");
30 else task = new AliForwardMultiplicityTask("FMD");
6b908a3f 31 mgr->AddTask(task);
32
0bd4b00f 33 // Whether to enable low flux specific code
34 task->SetEnableLowFlux(kFALSE);
6b908a3f 35 // Set the number of SPD tracklets for which we consider the event a
36 // low flux event
37 task->GetEventInspector().SetLowFluxCut(1000);
38 // Set the maximum error on v_z [cm]
39 task->GetEventInspector().SetMaxVzErr(0.2);
40 // Set the eta axis to use - note, this overrides whatever is used
41 // by the rest of the algorithms - but only for the energy fitter
42 // algorithm.
43 task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
c389303e 44 // Set maximum energy loss to consider
45 task->GetEnergyFitter().SetMaxE(10);
46 // Set number of energy loss bins
47 task->GetEnergyFitter().SetNEbins(300);
48 // Set whether to use increasing bin sizes
49 task->GetEnergyFitter().SetUseIncreasingBins(true);
50 // Set whether to do fit the energy distributions
0bd4b00f 51 task->GetEnergyFitter().SetDoFits(kFALSE);
52 // Set whether to make the correction object
53 task->GetEnergyFitter().SetDoMakeObject(kFALSE);
6b908a3f 54 // Set the low cut used for energy
55 task->GetEnergyFitter().SetLowCut(0.4);
56 // Set the number of bins to subtract from maximum of distributions
57 // to get the lower bound of the fit range
c389303e 58 task->GetEnergyFitter().SetFitRangeBinWidth(4);
6b908a3f 59 // Set the maximum number of landaus to try to fit (max 5)
c389303e 60 task->GetEnergyFitter().SetNParticles(5);
6b908a3f 61 // Set the minimum number of entries in the distribution before
62 // trying to fit to the data
63 task->GetEnergyFitter().SetMinEntries(1000);
0bd4b00f 64 // Set the low cut used for sharing - overrides settings in eloss fits
81eda625 65 task->GetSharingFilter().SetLowCut(0.3);
0bd4b00f 66 // Set the number of xi's (width of landau peak) to stop at
67 task->GetSharingFilter().SetNXi(1);
68 // Set the maximum number of particle to try to reconstruct
69 task->GetDensityCalculator().SetMaxParticles(2);
70 // Set the lower multiplicity cut. Overrides setting in energy loss fits.
81eda625 71 task->GetDensityCalculator().SetMultCut(0.3);
72 // Whether to use the merging efficiency correction
1174780f 73 task->GetCorrections().SetUseMergingEfficiency(false);
6b908a3f 74 // Set the number of extra bins (beyond the secondary map border)
e333578d 75 task->GetHistCollector().SetNCutBins(2);
6b908a3f 76 // Set the correction cut, that is, when bins in the secondary map
77 // is smaller than this, they are considered empty
e333578d 78 task->GetHistCollector().SetCorrectionCut(0.5);
6b908a3f 79 // Set the overall debug level (1: some output, 3: a lot of output)
80 task->SetDebug(0);
81 // Set the debug level of a single algorithm
0bd4b00f 82 // task->GetEventInspector().SetDebug(4);
83 // --- Set limits on fits the energy -------------------------------
84 // Maximum relative error on parameters
85 AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
86 // Least weight to use
87 AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
88 // Maximum value of reduced chi^2
89 AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 5;
90
7e4038b5 91
0bd4b00f 92 // --- Make the output container and connect it --------------------
7e4038b5 93 TString outputfile = AliAnalysisManager::GetCommonFileName();
0bd4b00f 94 // outputfile += ":PWG2forwardDnDeta";
95 // Form(":%s",pars->GetDndetaAnalysisName());
7e4038b5 96 AliAnalysisDataContainer* histOut =
97 mgr->CreateContainer("Forward", TList::Class(),
98 AliAnalysisManager::kOutputContainer,outputfile);
7e4038b5 99 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
100 mgr->ConnectOutput(task, 1, histOut);
101
102 return task;
103}