]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AddTaskForwardQA.C
Fixes for pA indenfication of events
[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   // --- Get analysis manager ----------------------------------------
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");
42   mgr->AddTask(task);
43
44
45   // --- Cuts --------------------------------------------------------
46   // Old style cuts
47   Double_t nXi = mc ? 2 : 2;   //HHD test
48   Bool_t   includeSigma = false; //true;
49   // High cuts for sharing filter
50   AliFMDMultCuts cHigh;
51   cHigh.SetMPVFraction(0.7);
52   cHigh.SetMultCuts(100);
53   // Low cuts for sharing and density calculator
54   AliFMDMultCuts cLow;
55   cLow.SetMultCuts(0.1, 0.1, 0.12, 0.1, 0.12);
56   // Density cuts
57   AliFMDMultCuts cDensity;
58   cDensity.SetMPVFraction(0.7);
59   cDensity.SetMultCuts(100);
60
61   
62   // --- Set parameters on the algorithms ----------------------------
63   // Set the number of SPD tracklets for which we consider the event a
64   // low flux event
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);
70
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
74   // algorithm. 
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);
94
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);
102   // Multiplicity cut 
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);
112
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);
128
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;
136
137   // --- Debug -------------------------------------------------------
138   // Set the overall debug level (1: some output, 3: a lot of output)
139   task->SetDebug(3);
140     
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, 
152                          "trending.root");
153                          // AliAnalysisManager::GetCommonFileName());
154   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
155   mgr->ConnectOutput(task, 1, histOut);
156   mgr->ConnectOutput(task, 2, output);
157
158   return task;
159 }
160 //
161 // EOF
162 //