]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWGLF/FORWARD/analysis2/AddTaskForwardQA.C
Merge branch 'workdir'
[u/mrichter/AliRoot.git] / PWGLF / 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 *
56236b95 6 * @brief Include the Forward QA task in a train.
96624385 7 *
bd6f5206 8 * @ingroup pwglf_forward_scripts_tasks
96624385 9 */
10/**
bd6f5206 11 * @defgroup pwglf_forward_qa Quality Assurance
290052e7 12 *
13 * Code to deal with Quality Assurance
14 *
bd6f5206 15 * @ingroup pwglf_forward_topical
96624385 16 */
96624385 17/**
56236b95 18 * This is the macro to include the Forward QA task in a train.
96624385 19 *
56236b95 20 * @param mc Monte-carlo input
21 * @param useCent Use centrality
22 *
290052e7 23 * @return newly constructured task object
24 *
bd6f5206 25 * @ingroup pwglf_forward_eloss
96624385 26 */
27AliAnalysisTask*
e2213ed5 28AddTaskForwardQA(Bool_t mc=false, Bool_t useCent=false)
96624385 29{
56236b95 30 // --- Load libraries ----------------------------------------------
bd6f5206 31 gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
96624385 32
56236b95 33 // --- Get analysis manager ----------------------------------------
96624385 34 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
35 if (!mgr) {
36 Error("AddTaskForwardQA", "No analysis manager to connect to.");
37 return NULL;
38 }
39
40 // --- Make the task and add it to the manager ---------------------
41 AliForwardQATask* task = new AliForwardQATask("forwardQA");
96624385 42 mgr->AddTask(task);
43
9b2f2e39 44
45 // --- Cuts --------------------------------------------------------
46 // Old style cuts
57522224 47 // Double_t nXi = mc ? 2 : 2; //HHD test
48 // Bool_t includeSigma = false; //true;
9b2f2e39 49 // High cuts for sharing filter
50 AliFMDMultCuts cHigh;
51 cHigh.SetMPVFraction(0.7);
57522224 52 cHigh.SetMultCuts(-1);
53 cHigh.SetNXi(2);
54 // cHigh.SetMultCuts(100);
9b2f2e39 55 // Low cuts for sharing and density calculator
56 AliFMDMultCuts cLow;
57522224 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);
9b2f2e39 59 // Density cuts
96624385 60 AliFMDMultCuts cDensity;
57522224 61 // cDensity.SetMPVFraction(0.7);
62 // cDensity.SetMultCuts(100);
63 cDensity.SetMultCuts(0.3, 0.3, 0.3, 0.3, 0.3);
9b2f2e39 64
96624385 65
66 // --- Set parameters on the algorithms ----------------------------
67 // Set the number of SPD tracklets for which we consider the event a
68 // low flux event
69 task->GetEventInspector().SetLowFluxCut(1000);
70 // Set the maximum error on v_z [cm]
71 task->GetEventInspector().SetMaxVzErr(0.2);
9b2f2e39 72 // Disable use of code from 1st Physics
73 task->GetEventInspector().SetUseFirstPhysicsVtx(kFALSE);
96624385 74
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
78 // algorithm.
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);
98
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
9b2f2e39 105 task->GetSharingFilter().SetHCuts(cHigh);
106 // Multiplicity cut
107 // task->GetSharingFilter().GetHCuts().SetMultCuts(-1);
96624385 108 // Set the number of xi's (width of landau peak) to stop at
9b2f2e39 109 // task->GetSharingFilter().GetHCuts().SetNXi(nXi);
96624385 110 // Set whether or not to include sigma in cut
9b2f2e39 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);
96624385 116
117 // --- Density calculator ------------------------------------------
118 // Set the maximum number of particle to try to reconstruct
9b2f2e39 119 task->GetDensityCalculator().SetMaxParticles(3);
96624385 120 // Wet whether to use poisson statistics to estimate N_ch
121 task->GetDensityCalculator().SetUsePoisson(true);
9b2f2e39 122 // How to lump for Poisson calculator - 64 strips, 4 regions
123 task->GetDensityCalculator().SetLumping(64,4);
96624385 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
9b2f2e39 130 task->GetDensityCalculator().
131 SetUsePhiAcceptance(AliFMDDensityCalculator::kPhiNoCorrect);
132
96624385 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;
9b2f2e39 140
141 // --- Debug -------------------------------------------------------
142 // Set the overall debug level (1: some output, 3: a lot of output)
143 task->SetDebug(3);
96624385 144
145 // --- Make the output container and connect it --------------------
146 // TString outputfile = ;
bd6f5206 147 // outputfile += ":PWGLFforwardDnDeta";
96624385 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,
9b2f2e39 156 "trending.root");
157 // AliAnalysisManager::GetCommonFileName());
96624385 158 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
159 mgr->ConnectOutput(task, 1, histOut);
160 mgr->ConnectOutput(task, 2, output);
161
96624385 162 return task;
163}
9b2f2e39 164//
165// EOF
166//