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(100);
53 // Low cuts for sharing and density calculator
55 cLow.SetMultCuts(0.1, 0.1, 0.12, 0.1, 0.12);
57 AliFMDMultCuts cDensity;
58 cDensity.SetMPVFraction(0.7);
59 cDensity.SetMultCuts(100);
62 // --- Set parameters on the algorithms ----------------------------
63 // Set the number of SPD tracklets for which we consider the event a
65 task->GetEventInspector().SetLowFluxCut(1000);
66 // Set the maximum error on v_z [cm]
67 task->GetEventInspector().SetMaxVzErr(0.2);
68 // Disable use of code from 1st Physics
69 task->GetEventInspector().SetUseFirstPhysicsVtx(kFALSE);
71 // --- Set parameters on energy loss fitter ------------------------
72 // Set the eta axis to use - note, this overrides whatever is used
73 // by the rest of the algorithms - but only for the energy fitter
75 task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
76 // Set maximum energy loss to consider
77 task->GetEnergyFitter().SetMaxE(15);
78 // Set number of energy loss bins
79 task->GetEnergyFitter().SetNEbins(500);
80 // Set whether to use increasing bin sizes
81 task->GetEnergyFitter().SetUseIncreasingBins(true);
82 // Set whether to do fit the energy distributions
83 task->GetEnergyFitter().SetDoFits(kTRUE);
84 // Set whether to make the correction object
85 task->GetEnergyFitter().SetDoMakeObject(kFALSE);
86 // Set the low cut used for energy
87 task->GetEnergyFitter().SetLowCut(0.4);
88 // Set the number of bins to subtract from maximum of distributions
89 // to get the lower bound of the fit range
90 task->GetEnergyFitter().SetFitRangeBinWidth(4);
91 // Set the minimum number of entries in the distribution before
92 // trying to fit to the data
93 task->GetEnergyFitter().SetMinEntries(1000);
95 // --- Sharing filter ----------------------------------------------
96 // Enable use of angle corrected signals in the algorithm
97 task->GetSharingFilter().SetUseAngleCorrectedSignals(true);
98 // Disable use of angle corrected signals in the algorithm
99 task->GetSharingFilter().SetZeroSharedHitsBelowThreshold(false);
100 // Enable use of angle corrected signals in the algorithm
101 task->GetSharingFilter().SetHCuts(cHigh);
103 // task->GetSharingFilter().GetHCuts().SetMultCuts(-1);
104 // Set the number of xi's (width of landau peak) to stop at
105 // task->GetSharingFilter().GetHCuts().SetNXi(nXi);
106 // Set whether or not to include sigma in cut
107 // task->GetSharingFilter().GetHCuts().SetIncludeSigma(includeSigma);
108 // Lower cuts from object
109 task->GetSharingFilter().SetLCuts(cLow);
110 // Use simplified sharing algorithm
111 task->GetSharingFilter().SetUseSimpleSharing(kTRUE);
113 // --- Density calculator ------------------------------------------
114 // Set the maximum number of particle to try to reconstruct
115 task->GetDensityCalculator().SetMaxParticles(3);
116 // Wet whether to use poisson statistics to estimate N_ch
117 task->GetDensityCalculator().SetUsePoisson(true);
118 // How to lump for Poisson calculator - 64 strips, 4 regions
119 task->GetDensityCalculator().SetLumping(64,4);
120 // Set whether or not to include sigma in cut
121 task->GetDensityCalculator().SetCuts(cDensity);
122 // Set whether or not to use the phi acceptance
123 // AliFMDDensityCalculator::kPhiNoCorrect
124 // AliFMDDensityCalculator::kPhiCorrectNch
125 // AliFMDDensityCalculator::kPhiCorrectELoss
126 task->GetDensityCalculator().
127 SetUsePhiAcceptance(AliFMDDensityCalculator::kPhiNoCorrect);
129 // --- Set limits on fits the energy -------------------------------
130 // Maximum relative error on parameters
131 AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
132 // Least weight to use
133 AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
134 // Maximum value of reduced chi^2
135 AliFMDCorrELossFit::ELossFit::fgMaxChi2nu = 20;
137 // --- Debug -------------------------------------------------------
138 // Set the overall debug level (1: some output, 3: a lot of output)
141 // --- Make the output container and connect it --------------------
142 // TString outputfile = ;
143 // outputfile += ":PWGLFforwardDnDeta";
144 // Form(":%s",pars->GetDndetaAnalysisName());
145 AliAnalysisDataContainer* histOut =
146 mgr->CreateContainer("Forward", TList::Class(),
147 AliAnalysisManager::kOutputContainer,
148 AliAnalysisManager::GetCommonFileName());
149 AliAnalysisDataContainer *output =
150 mgr->CreateContainer("ForwardResults", TList::Class(),
151 AliAnalysisManager::kParamContainer,
153 // AliAnalysisManager::GetCommonFileName());
154 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
155 mgr->ConnectOutput(task, 1, histOut);
156 mgr->ConnectOutput(task, 2, output);