]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/AddTaskForwardQA.C
Fixed references from PWG2 -> PWGLF - very efficiently done using ETags.
[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  * @ingroup pwglf_forward_topical
13  */
14 /**
15  * This is the macro to include the Forward QA task in a train.  
16  * 
17  * @param mc       Monte-carlo input 
18  * @param useCent  Use centrality 
19  *
20  * @ingroup pwglf_forward_eloss
21  */
22 AliAnalysisTask*
23 AddTaskForwardQA(Bool_t mc=false, Bool_t useCent=false)
24 {
25   // --- Load libraries ----------------------------------------------
26   gROOT->LoadClass("AliAODForwardMult", "libPWGLFforward2");
27
28   // --- Get analysis manager ----------------------------------------
29   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
30   if (!mgr) {
31     Error("AddTaskForwardQA", "No analysis manager to connect to.");
32     return NULL;
33   }   
34   
35   // --- Make the task and add it to the manager ---------------------
36   AliForwardQATask* task = new AliForwardQATask("forwardQA");
37   mgr->AddTask(task);
38
39
40   // --- Cuts --------------------------------------------------------
41   // Old style cuts
42   Double_t nXi = mc ? 2 : 2;   //HHD test
43   Bool_t   includeSigma = false; //true;
44   // High cuts for sharing filter
45   AliFMDMultCuts cHigh;
46   cHigh.SetMPVFraction(0.7);
47   cHigh.SetMultCuts(-1);
48   // Low cuts for sharing and density calculator
49   AliFMDMultCuts cLow;
50   cLow.SetMultCuts(0.1, 0.1, 0.12, 0.1, 0.12);
51   // Density cuts
52   AliFMDMultCuts cDensity;
53   cDensity.SetMPVFraction(0.7);
54   cDensity.SetMultCuts(-1);
55
56   
57   // --- Set parameters on the algorithms ----------------------------
58   // Set the number of SPD tracklets for which we consider the event a
59   // low flux event
60   task->GetEventInspector().SetLowFluxCut(1000); 
61   // Set the maximum error on v_z [cm]
62   task->GetEventInspector().SetMaxVzErr(0.2);
63   // Disable use of code from 1st Physics
64   task->GetEventInspector().SetUseFirstPhysicsVtx(kFALSE);
65
66   // --- Set parameters on energy loss fitter ------------------------
67   // Set the eta axis to use - note, this overrides whatever is used
68   // by the rest of the algorithms - but only for the energy fitter
69   // algorithm. 
70   task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
71   // Set maximum energy loss to consider 
72   task->GetEnergyFitter().SetMaxE(15); 
73   // Set number of energy loss bins 
74   task->GetEnergyFitter().SetNEbins(500);
75   // Set whether to use increasing bin sizes 
76   task->GetEnergyFitter().SetUseIncreasingBins(true);
77   // Set whether to do fit the energy distributions 
78   task->GetEnergyFitter().SetDoFits(kTRUE);
79   // Set whether to make the correction object 
80   task->GetEnergyFitter().SetDoMakeObject(kFALSE);
81   // Set the low cut used for energy
82   task->GetEnergyFitter().SetLowCut(0.4);
83   // Set the number of bins to subtract from maximum of distributions
84   // to get the lower bound of the fit range
85   task->GetEnergyFitter().SetFitRangeBinWidth(4);
86   // Set the minimum number of entries in the distribution before
87   // trying to fit to the data
88   task->GetEnergyFitter().SetMinEntries(1000);
89
90   // --- Sharing filter ----------------------------------------------
91   // Enable use of angle corrected signals in the algorithm 
92   task->GetSharingFilter().SetUseAngleCorrectedSignals(true);
93   // Disable use of angle corrected signals in the algorithm 
94   task->GetSharingFilter().SetZeroSharedHitsBelowThreshold(false);
95   // Enable use of angle corrected signals in the algorithm 
96   task->GetSharingFilter().SetHCuts(cHigh);
97   // Multiplicity cut 
98   // task->GetSharingFilter().GetHCuts().SetMultCuts(-1);
99   // Set the number of xi's (width of landau peak) to stop at 
100   // task->GetSharingFilter().GetHCuts().SetNXi(nXi);
101   // Set whether or not to include sigma in cut
102   // task->GetSharingFilter().GetHCuts().SetIncludeSigma(includeSigma);
103   // Lower cuts from object
104   task->GetSharingFilter().SetLCuts(cLow);
105   // Use simplified sharing algorithm 
106   task->GetSharingFilter().SetUseSimpleSharing(kTRUE);
107
108   // --- Density calculator ------------------------------------------
109   // Set the maximum number of particle to try to reconstruct 
110   task->GetDensityCalculator().SetMaxParticles(3);
111   // Wet whether to use poisson statistics to estimate N_ch
112   task->GetDensityCalculator().SetUsePoisson(true);
113   // How to lump for Poisson calculator - 64 strips, 4 regions
114   task->GetDensityCalculator().SetLumping(64,4);
115   // Set whether or not to include sigma in cut
116   task->GetDensityCalculator().SetCuts(cDensity);
117   // Set whether or not to use the phi acceptance
118   //   AliFMDDensityCalculator::kPhiNoCorrect
119   //   AliFMDDensityCalculator::kPhiCorrectNch
120   //   AliFMDDensityCalculator::kPhiCorrectELoss
121   task->GetDensityCalculator().
122     SetUsePhiAcceptance(AliFMDDensityCalculator::kPhiNoCorrect);
123
124   // --- Set limits on fits the energy -------------------------------
125   // Maximum relative error on parameters 
126   AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
127   // Least weight to use 
128   AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
129   // Maximum value of reduced chi^2 
130   AliFMDCorrELossFit::ELossFit::fgMaxChi2nu   = 20;
131
132   // --- Debug -------------------------------------------------------
133   // Set the overall debug level (1: some output, 3: a lot of output)
134   task->SetDebug(3);
135     
136   // --- Make the output container and connect it --------------------
137   // TString outputfile = ;
138   // outputfile += ":PWGLFforwardDnDeta"; 
139   // Form(":%s",pars->GetDndetaAnalysisName());
140   AliAnalysisDataContainer* histOut = 
141     mgr->CreateContainer("Forward", TList::Class(), 
142                          AliAnalysisManager::kOutputContainer,
143                          AliAnalysisManager::GetCommonFileName());
144   AliAnalysisDataContainer *output = 
145     mgr->CreateContainer("ForwardResults", TList::Class(), 
146                          AliAnalysisManager::kParamContainer, 
147                          "trending.root");
148                          // AliAnalysisManager::GetCommonFileName());
149   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
150   mgr->ConnectOutput(task, 1, histOut);
151   mgr->ConnectOutput(task, 2, output);
152
153   return task;
154 }
155 //
156 // EOF
157 //