]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AddTaskForwardQA.C
Merge branch 'feature-movesplit'
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / AddTaskForwardQA.C
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  Include the Forward QA task in a train.  
7  * 
8  * @ingroup pwglf_forward_scripts_tasks
9  */
10 /**
11  * @defgroup pwglf_forward_qa Quality Assurance
12  * 
13  * Code to deal with Quality Assurance 
14  *
15  * @ingroup pwglf_forward_topical
16  */
17 /**
18  * This is the macro to include the Forward QA task in a train.  
19  * 
20  * @param mc       Monte-carlo input 
21  * @param useCent  Use centrality 
22  *
23  * @return newly constructured task object 
24  *
25  * @ingroup pwglf_forward_eloss
26  */
27 AliAnalysisTask*
28 AddTaskForwardQA(Bool_t mc=false, Bool_t useCent=false)
29 {
30   // --- Load libraries ----------------------------------------------
31   gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
32
33   // --- Make the task and add it to the manager ---------------------
34   AliForwardQATask* task = new AliForwardQATask("forwardQA");
35
36   // --- Cuts --------------------------------------------------------
37   // Note, the absolute lowest signal to consider - ever -
38   // irrespective of MC or real data, is 0.15.  Signals below this
39   // will contain remenants of the pedestal (yes, the width of the
40   // pedestal is small, but there are many _many_ channels with only
41   // pedestal value in them, so the absolute number of high-value
42   // pedestal signals is large - despite the low probablity).
43   AliFMDMultCuts cSharingLow(AliFMDMultCuts::kFixed,0.15);
44   AliFMDMultCuts cSharingHigh(AliFMDMultCuts::kLandauSigmaWidth,1);
45   AliFMDMultCuts cDensity(AliFMDMultCuts::kLandauSigmaWidth,1);
46
47   // --- Set parameters on the algorithms ----------------------------
48   // Set the number of SPD tracklets for which we consider the event a
49   // low flux event
50   task->GetEventInspector().SetLowFluxCut(1000); 
51   // Set the maximum error on v_z [cm]
52   task->GetEventInspector().SetMaxVzErr(0.2);
53   // Disable use of code from 1st Physics
54   task->GetEventInspector().SetUseFirstPhysicsVtx(kFALSE);
55
56   // --- Set parameters on energy loss fitter ------------------------
57   // Set the eta axis to use - note, this overrides whatever is used
58   // by the rest of the algorithms - but only for the energy fitter
59   // algorithm. 
60   task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
61   // Set maximum energy loss to consider 
62   task->GetEnergyFitter().SetMaxE(15); 
63   // Set number of energy loss bins 
64   task->GetEnergyFitter().SetNEbins(500);
65   // Set whether to use increasing bin sizes 
66   task->GetEnergyFitter().SetUseIncreasingBins(true);
67   // Set whether to do fit the energy distributions 
68   task->GetEnergyFitter().SetDoFits(kTRUE);
69   // Set whether to make the correction object 
70   task->GetEnergyFitter().SetDoMakeObject(kFALSE);
71   // Set the low cut used for energy
72   task->GetEnergyFitter().SetLowCut(0.4);
73   // Set the number of bins to subtract from maximum of distributions
74   // to get the lower bound of the fit range
75   task->GetEnergyFitter().SetFitRangeBinWidth(4);
76   // Set the minimum number of entries in the distribution before
77   // trying to fit to the data
78   task->GetEnergyFitter().SetMinEntries(1000);
79
80   // --- Sharing filter ----------------------------------------------
81   // Enable use of angle corrected signals in the algorithm 
82   task->GetSharingFilter().SetUseAngleCorrectedSignals(true);
83   // Disable use of angle corrected signals in the algorithm 
84   task->GetSharingFilter().SetZeroSharedHitsBelowThreshold(false);
85   // Enable use of angle corrected signals in the algorithm 
86   task->GetSharingFilter().SetHCuts(cSharingHigh);
87   // Lower cuts from object
88   task->GetSharingFilter().SetLCuts(cSharingLow);
89   // Whether to use simple merging algorithm
90   task->GetSharingFilter().SetUseSimpleSharing(true);
91   // Whether to allow for 3 strip hits - deprecated
92   task->GetSharingFilter().SetAllow3Strips(false);
93
94   // --- Density calculator ------------------------------------------
95   // Least acceptable quality of ELoss fits
96   task->GetDensityCalculator().SetMinQuality(8);
97   // Set the maximum number of particle to try to reconstruct 
98   task->GetDensityCalculator().SetMaxParticles(3);
99   // Wet whether to use poisson statistics to estimate N_ch
100   task->GetDensityCalculator().SetUsePoisson(true);
101   // How to lump for Poisson calculator - 64 strips, 4 regions
102   task->GetDensityCalculator().SetLumping(32,4);
103   // Set whether or not to include sigma in cut
104   task->GetDensityCalculator().SetCuts(cDensity);
105   // Set the maximum ratio of outlier bins to the total number of bins
106   // task->GetDensityCalculator().SetMaxOutliers(.10);
107   task->GetDensityCalculator().SetMaxOutliers(1.0);//Disable filter
108   // Set whether or not to use the phi acceptance
109   //   AliFMDDensityCalculator::kPhiNoCorrect
110   //   AliFMDDensityCalculator::kPhiCorrectNch
111   //   AliFMDDensityCalculator::kPhiCorrectELoss
112   task->GetDensityCalculator()
113     .SetUsePhiAcceptance(AliFMDDensityCalculator::kPhiCorrectNch);
114
115   // --- Set limits on fits the energy -------------------------------
116   // Maximum relative error on parameters 
117   // AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
118   // Least weight to use 
119   // AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
120   // Maximum value of reduced chi^2 
121   // AliFMDCorrELossFit::ELossFit::fgMaxChi2nu   = 20;
122
123   // --- Debug -------------------------------------------------------
124   // Set the overall debug level (1: some output, 3: a lot of output)
125   task->SetDebug(1);
126     
127   // --- Make the output container and connect it --------------------
128   task->Connect(AliAnalysisManager::GetCommonFileName(), "trending.root");
129
130   return task;
131 }
132 //
133 // EOF
134 //