2 * @file AddTaskForwardQA.C
3 * @author Christian Holm Christensen <cholm@dalsgaard.hehi.nbi.dk>
4 * @date Wed Mar 23 12:14:03 2011
6 * @brief Include the Forward QA task in a train.
8 * @ingroup pwglf_forward_scripts_tasks
11 * @defgroup pwglf_forward_qa Quality Assurance
13 * Code to deal with Quality Assurance
15 * @ingroup pwglf_forward_topical
18 * This is the macro to include the Forward QA task in a train.
20 * @param mc Monte-carlo input
21 * @param useCent Use centrality
23 * @return newly constructured task object
25 * @ingroup pwglf_forward_eloss
28 AddTaskForwardQA(Bool_t mc=false, Bool_t useCent=false)
30 // --- Load libraries ----------------------------------------------
31 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
33 // --- Get analysis manager ----------------------------------------
34 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
36 Error("AddTaskForwardQA", "No analysis manager to connect to.");
40 // --- Make the task and add it to the manager ---------------------
41 AliForwardQATask* task = new AliForwardQATask("forwardQA");
45 // --- Cuts --------------------------------------------------------
47 // Double_t nXi = mc ? 2 : 2; //HHD test
48 // Bool_t includeSigma = false; //true;
49 // High cuts for sharing filter
51 cHigh.SetMPVFraction(0.7);
52 cHigh.SetMultCuts(-1);
54 // cHigh.SetMultCuts(100);
55 // Low cuts for sharing and density calculator
57 // cLow.SetMultCuts(0.1, 0.1, 0.12, 0.1, 0.12);
58 cLow.SetMultCuts(0.3, 0.3, 0.3, 0.3, 0.3);
60 AliFMDMultCuts cDensity;
61 // cDensity.SetMPVFraction(0.7);
62 // cDensity.SetMultCuts(100);
63 cDensity.SetMultCuts(0.3, 0.3, 0.3, 0.3, 0.3);
66 // --- Set parameters on the algorithms ----------------------------
67 // Set the number of SPD tracklets for which we consider the event a
69 task->GetEventInspector().SetLowFluxCut(1000);
70 // Set the maximum error on v_z [cm]
71 task->GetEventInspector().SetMaxVzErr(0.2);
72 // Disable use of code from 1st Physics
73 task->GetEventInspector().SetUseFirstPhysicsVtx(kFALSE);
75 // --- Set parameters on energy loss fitter ------------------------
76 // Set the eta axis to use - note, this overrides whatever is used
77 // by the rest of the algorithms - but only for the energy fitter
79 task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
80 // Set maximum energy loss to consider
81 task->GetEnergyFitter().SetMaxE(15);
82 // Set number of energy loss bins
83 task->GetEnergyFitter().SetNEbins(500);
84 // Set whether to use increasing bin sizes
85 task->GetEnergyFitter().SetUseIncreasingBins(true);
86 // Set whether to do fit the energy distributions
87 task->GetEnergyFitter().SetDoFits(kTRUE);
88 // Set whether to make the correction object
89 task->GetEnergyFitter().SetDoMakeObject(kFALSE);
90 // Set the low cut used for energy
91 task->GetEnergyFitter().SetLowCut(0.4);
92 // Set the number of bins to subtract from maximum of distributions
93 // to get the lower bound of the fit range
94 task->GetEnergyFitter().SetFitRangeBinWidth(4);
95 // Set the minimum number of entries in the distribution before
96 // trying to fit to the data
97 task->GetEnergyFitter().SetMinEntries(1000);
99 // --- Sharing filter ----------------------------------------------
100 // Enable use of angle corrected signals in the algorithm
101 task->GetSharingFilter().SetUseAngleCorrectedSignals(true);
102 // Disable use of angle corrected signals in the algorithm
103 task->GetSharingFilter().SetZeroSharedHitsBelowThreshold(false);
104 // Enable use of angle corrected signals in the algorithm
105 task->GetSharingFilter().SetHCuts(cHigh);
107 // task->GetSharingFilter().GetHCuts().SetMultCuts(-1);
108 // Set the number of xi's (width of landau peak) to stop at
109 // task->GetSharingFilter().GetHCuts().SetNXi(nXi);
110 // Set whether or not to include sigma in cut
111 // task->GetSharingFilter().GetHCuts().SetIncludeSigma(includeSigma);
112 // Lower cuts from object
113 task->GetSharingFilter().SetLCuts(cLow);
114 // Use simplified sharing algorithm
115 task->GetSharingFilter().SetUseSimpleSharing(kTRUE);
117 // --- Density calculator ------------------------------------------
118 // Set the maximum number of particle to try to reconstruct
119 task->GetDensityCalculator().SetMaxParticles(3);
120 // Wet whether to use poisson statistics to estimate N_ch
121 task->GetDensityCalculator().SetUsePoisson(true);
122 // How to lump for Poisson calculator - 64 strips, 4 regions
123 task->GetDensityCalculator().SetLumping(64,4);
124 // Set whether or not to include sigma in cut
125 task->GetDensityCalculator().SetCuts(cDensity);
126 // Set whether or not to use the phi acceptance
127 // AliFMDDensityCalculator::kPhiNoCorrect
128 // AliFMDDensityCalculator::kPhiCorrectNch
129 // AliFMDDensityCalculator::kPhiCorrectELoss
130 task->GetDensityCalculator().
131 SetUsePhiAcceptance(AliFMDDensityCalculator::kPhiNoCorrect);
133 // --- Set limits on fits the energy -------------------------------
134 // Maximum relative error on parameters
135 AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
136 // Least weight to use
137 AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
138 // Maximum value of reduced chi^2
139 AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 20;
141 // --- Debug -------------------------------------------------------
142 // Set the overall debug level (1: some output, 3: a lot of output)
145 // --- Make the output container and connect it --------------------
146 // TString outputfile = ;
147 // outputfile += ":PWGLFforwardDnDeta";
148 // Form(":%s",pars->GetDndetaAnalysisName());
149 AliAnalysisDataContainer* histOut =
150 mgr->CreateContainer("Forward", TList::Class(),
151 AliAnalysisManager::kOutputContainer,
152 AliAnalysisManager::GetCommonFileName());
153 AliAnalysisDataContainer *output =
154 mgr->CreateContainer("ForwardResults", TList::Class(),
155 AliAnalysisManager::kParamContainer,
157 // AliAnalysisManager::GetCommonFileName());
158 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
159 mgr->ConnectOutput(task, 1, histOut);
160 mgr->ConnectOutput(task, 2, output);