]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/AddTaskForwardQA.C
Added first go at a QA task
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskForwardQA.C
CommitLineData
96624385 1/**
2 * @file AddTaskForwardQA.C
3 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
4 * @date Wed Mar 23 12:14:03 2011
5 *
6 * @brief
7 *
8 *
9 * @ingroup pwg2_forward_scripts_tasks
10 */
11/**
12 * @defgroup pwg2_forward_eloss Energy Loss Fits
13 * @ingroup pwg2_forward_topical
14 */
15
16/**
17 * This is the macro to include the FMD energy fitter in a train.
18 *
19 * @ingroup pwg2_forward_eloss
20 */
21AliAnalysisTask*
22AddTaskForwardQA(Bool_t mc, Bool_t useCent)
23{
24 gSystem->Load("libPWG2forward2");
25
26 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
27 if (!mgr) {
28 Error("AddTaskForwardQA", "No analysis manager to connect to.");
29 return NULL;
30 }
31
32 // --- Make the task and add it to the manager ---------------------
33 AliForwardQATask* task = new AliForwardQATask("forwardQA");
34 // task->SetBLow(blow);
35 // task->SetBLow(bhigh);
36 mgr->AddTask(task);
37
38 Double_t nXi = mc ? 2 : 2; //HHD test
39 Bool_t includeSigma = false; //true;
40
41 AliFMDMultCuts cDensity;
42 //c2.SetNXi(mc ? 1 : 1);
43 // c2.SetIncludeSigma(false);
44 //c2.SetMPVFraction(0.5);
45 //Double_t factor = 1.2;
46 cDensity.SetMultCuts(0.3, 0.3, 0.3, 0.3, 0.3);
47
48 // --- Set parameters on the algorithms ----------------------------
49 // Set the number of SPD tracklets for which we consider the event a
50 // low flux event
51 task->GetEventInspector().SetLowFluxCut(1000);
52 // Set the maximum error on v_z [cm]
53 task->GetEventInspector().SetMaxVzErr(0.2);
54
55 // --- Set parameters on energy loss fitter ------------------------
56 // Set the eta axis to use - note, this overrides whatever is used
57 // by the rest of the algorithms - but only for the energy fitter
58 // algorithm.
59 task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
60 // Set maximum energy loss to consider
61 task->GetEnergyFitter().SetMaxE(15);
62 // Set number of energy loss bins
63 task->GetEnergyFitter().SetNEbins(500);
64 // Set whether to use increasing bin sizes
65 task->GetEnergyFitter().SetUseIncreasingBins(true);
66 // Set whether to do fit the energy distributions
67 task->GetEnergyFitter().SetDoFits(kTRUE);
68 // Set whether to make the correction object
69 task->GetEnergyFitter().SetDoMakeObject(kFALSE);
70 // Set the low cut used for energy
71 task->GetEnergyFitter().SetLowCut(0.4);
72 // Set the number of bins to subtract from maximum of distributions
73 // to get the lower bound of the fit range
74 task->GetEnergyFitter().SetFitRangeBinWidth(4);
75 // Set the minimum number of entries in the distribution before
76 // trying to fit to the data
77 task->GetEnergyFitter().SetMinEntries(1000);
78
79 // --- Sharing filter ----------------------------------------------
80 // Enable use of angle corrected signals in the algorithm
81 task->GetSharingFilter().SetUseAngleCorrectedSignals(true);
82 // Disable use of angle corrected signals in the algorithm
83 task->GetSharingFilter().SetZeroSharedHitsBelowThreshold(false);
84 // Enable use of angle corrected signals in the algorithm
85 task->GetSharingFilter().GetHCuts().SetMultCuts(-1);
86 // Set the number of xi's (width of landau peak) to stop at
87 task->GetSharingFilter().GetHCuts().SetNXi(nXi);
88 // Set whether or not to include sigma in cut
89 task->GetSharingFilter().GetHCuts().SetIncludeSigma(includeSigma);
90 // Enable use of angle corrected signals in the algorithm
91 task->GetSharingFilter().SetLCuts(cDensity);
92
93 // --- Density calculator ------------------------------------------
94 // Set the maximum number of particle to try to reconstruct
95 task->GetDensityCalculator().SetMaxParticles(10);
96 // Wet whether to use poisson statistics to estimate N_ch
97 task->GetDensityCalculator().SetUsePoisson(true);
98 // Set whether or not to include sigma in cut
99 task->GetDensityCalculator().SetCuts(cDensity);
100 // Set whether or not to use the phi acceptance
101 // AliFMDDensityCalculator::kPhiNoCorrect
102 // AliFMDDensityCalculator::kPhiCorrectNch
103 // AliFMDDensityCalculator::kPhiCorrectELoss
104 task->GetDensityCalculator()
105 .SetUsePhiAcceptance(AliFMDDensityCalculator::kPhiCorrectNch);
106 // --- Set limits on fits the energy -------------------------------
107 // Maximum relative error on parameters
108 AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
109 // Least weight to use
110 AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
111 // Maximum value of reduced chi^2
112 AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 20;
113
114 // --- Make the output container and connect it --------------------
115 // TString outputfile = ;
116 // outputfile += ":PWG2forwardDnDeta";
117 // Form(":%s",pars->GetDndetaAnalysisName());
118 AliAnalysisDataContainer* histOut =
119 mgr->CreateContainer("Forward", TList::Class(),
120 AliAnalysisManager::kOutputContainer,
121 AliAnalysisManager::GetCommonFileName());
122 AliAnalysisDataContainer *output =
123 mgr->CreateContainer("ForwardResults", TList::Class(),
124 AliAnalysisManager::kParamContainer,
125 AliAnalysisManager::GetCommonFileName());
126 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
127 mgr->ConnectOutput(task, 1, histOut);
128 mgr->ConnectOutput(task, 2, output);
129
130
131 return task;
132}