]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWGLF/FORWARD/analysis2/ForwardAOD.cfg
Updates
[u/mrichter/AliRoot.git] / PWGLF / FORWARD / analysis2 / ForwardAOD.cfg
1 #
2 # Task configuration for use with AliAnalysisTaskCfg
3 #
4 # This sets up the forward ESD->AOD filtering task
5 #
6 #Module.Begin         ForwardAOD
7 #Module.Libs          PWGLFforward2
8 #Module.Deps          PhysicsSelection, CentralitySelection, CopyHeader
9 #Module.DataTypes     ESD
10 #Module.MacroName     AddTaskForwardAOD
11 # Not used when giving full macro 
12 #Module.MacroArgs     false, 0, 0, 0
13 #Module.OutputFile    forward.root
14 #Module.TerminateFile 
15 #Module.StartMacro
16 AliAnalysisTask*
17 AddTaskForwardAOD(Bool_t   mc=false, 
18                   UShort_t sys=0, 
19                   UShort_t sNN=0, 
20                   Short_t  field=0)
21 {
22   // --- Get analysis manager ----------------------------------------
23   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
24   if (!mgr) { 
25     std::cerr << "Failed to get manager");
26     Error("AddTaskForwardAOD", "No manager");
27     return 0;
28   }
29
30   // --- Make the task and add it to the manager ---------------------
31   AliForwardMultiplicityBase* task = 0;
32   if (mc) task = new AliForwardMCMultiplicityTask("FMD");
33   else    task = new AliForwardMultiplicityTask("FMD");
34   Info("AddTaskForwardAOD", "Adding task");
35   Printf("Adding the task");
36   mgr->AddTask(task);
37   
38   // --- Do a local initialisation with assumed values ---------------
39   if (sys > 0 && sNN > 0) {
40     UInt_t what = AliForwardCorrectionManager::kAll;
41     what ^= AliForwardCorrectionManager::kDoubleHit;
42     what ^= AliForwardCorrectionManager::kVertexBias;
43     what ^= AliForwardCorrectionManager::kMergingEfficiency;
44     if (!AliForwardCorrectionManager::Instance().Init(sys,sNN,field,mc,what))
45       Fatal("AddTaskForwardMult", "Failed to initialize corrections");
46   }
47   
48   // --- Make the output container and connect it --------------------
49   TString outputfile = "forward.root"; // AliAnalysisManager::GetCommonFileName();
50   AliAnalysisDataContainer* histOut = 
51     mgr->CreateContainer("Forward", TList::Class(), 
52                          AliAnalysisManager::kOutputContainer,outputfile);
53   mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
54   mgr->ConnectOutput(task, 1, histOut);
55
56   Info("AddTaskForwardAOD", "Returning task");
57   return task;
58 }
59 #Module.EndMacro
60 #Module.StartConfig
61   // --- Cast to type ------------------------------------------------
62   AliForwardMultiplicityBase* task = static_cast<AliForwardMultiplicityBase*>(__R_ADDTASK__);
63   // --- General parameters ------------------------------------------
64   // Whether to enable low flux specific code 
65   task->SetEnableLowFlux(kFALSE);
66
67   // Would like to use dynamic cast but CINT interprets that as a 
68   // static cast - sigh!
69   Bool_t mc = false;
70   if (task->IsA() == AliForwardMCMultiplicityTask::Class()) 
71     mc = true;
72   
73   Double_t nXi = mc ? 2 : 2;   //HHD test
74   Bool_t   includeSigma = false; //true;
75
76   AliFMDMultCuts cSharing;
77   cSharing.SetMultCuts(0.3, 0.3, 0.3, 0.3, 0.3);
78  
79   AliFMDMultCuts cDensity;
80   cDensity.SetMultCuts(0.3, 0.3, 0.3, 0.3, 0.3);
81   
82   
83   // --- Event inspector ---------------------------------------------
84   // Set the number of SPD tracklets for which we consider the event a
85   // low flux event
86   task->GetEventInspector().SetLowFluxCut(1000); 
87   // Set the maximum error on v_z [cm]
88   task->GetEventInspector().SetMaxVzErr(0.2);
89   // Least number of constributors to 2nd pile-up vertex
90   task->GetEventInspector().SetMinPileupContributors(3);
91   // Least distance from primary to 2nd pile-up vertex (cm)
92   task->GetEventInspector().SetMinPileupDistance(.8);
93   // V0-AND triggered events flagged as NSD 
94   task->GetEventInspector().SetUseV0AndForNSD(true);
95   // Use primary vertex selection from 1st physics WG
96   // task->GetEventInspector().SetUseFirstPhysicsVtx(true);
97
98   // --- Sharing filter ----------------------------------------------
99   // Set the low cut used for sharing - overrides settings in eloss fits
100   //  Float_t factor = 1.;
101   //if(mc) factor = 1.2;
102   //task->GetSharingFilter().SetLowCut(0.3*factor);
103   // Enable use of angle corrected signals in the algorithm 
104   task->GetSharingFilter().SetUseAngleCorrectedSignals(true);
105   // Disable use of angle corrected signals in the algorithm 
106   task->GetSharingFilter().SetZeroSharedHitsBelowThreshold(false);
107   // Whether to use simple merging algorithm
108   task->GetSharingFilter().SetUseSimpleSharing(false);
109   // Whether to allow for 3 strip hits 
110   task->GetSharingFilter().SetAllow3Strips(true);
111   // Do not cut fixed/hard on multiplicity 
112   task->GetSharingFilter().GetHCuts().SetMultCuts(-1);
113   // Set the number of xi's (width of landau peak) to stop at 
114   task->GetSharingFilter().GetHCuts().SetNXi(nXi);
115   // Set whether or not to include sigma in cut
116   task->GetSharingFilter().GetHCuts().SetIncludeSigma(includeSigma);
117   // Enable use of angle corrected signals in the algorithm 
118   task->GetSharingFilter().SetLCuts(cSharing);
119   
120    
121   // --- Density calculator ------------------------------------------
122   // Set the maximum number of particle to try to reconstruct 
123   task->GetDensityCalculator().SetMaxParticles(10);
124   // Wet whether to use poisson statistics to estimate N_ch
125   task->GetDensityCalculator().SetUsePoisson(true);
126   // Set to use the running average in Poisson 
127   // task->GetDensityCalculator().SetUseRunningAverage(false);
128   // Set whether or not to include sigma in cut
129   task->GetDensityCalculator().SetCuts(cDensity);
130   // Set lumping (nEta,nPhi)
131   task->GetDensityCalculator().SetLumping(32,4);
132   // Set whether or not to use the phi acceptance
133   //   AliFMDDensityCalculator::kPhiNoCorrect
134   //   AliFMDDensityCalculator::kPhiCorrectNch
135   //   AliFMDDensityCalculator::kPhiCorrectELoss
136   task->GetDensityCalculator()
137     .SetUsePhiAcceptance(AliFMDDensityCalculator::kPhiCorrectNch);
138
139   // --- Corrector ---------------------------------------------------
140   // Whether to use the secondary map correction
141   task->GetCorrections().SetUseSecondaryMap(true);
142   // Whether to use the vertex bias correction
143   task->GetCorrections().SetUseVertexBias(false);
144   // Whether to use the vertex bias correction
145   task->GetCorrections().SetUseAcceptance(true);
146   // Whether to use the merging efficiency correction 
147   task->GetCorrections().SetUseMergingEfficiency(false);
148
149   // --- Histogram Collector -----------------------------------------
150   // Set the number of extra bins (beyond the secondary map border) 
151   task->GetHistCollector().SetNCutBins(2);
152   // Set the correction cut, that is, when bins in the secondary map 
153   // is smaller than this, they are considered empty 
154   task->GetHistCollector().SetCorrectionCut(0.5);
155   // How to calculate the value of overlapping bins. 
156   // Possible values are 
157   //    kStraightMean 
158   //    kStraightMeanNoZero 
159   //    kWeightedMean 
160   //    kLeastError 
161   task->GetHistCollector().SetMergeMethod(AliFMDHistCollector::kStraightMean);
162   // How to find the fiducial area of the secondary maps 
163   // Possible values are 
164   //   kByCut    Only bins larger that cut are trusted 
165   //   kDistance Only bins that are more than half the size of it neighbors
166   task->GetHistCollector().SetFiducialMethod(AliFMDHistCollector::kByCut);
167
168   // --- Debug -------------------------------------------------------
169   // Set the overall debug level (1: some output, 3: a lot of output)
170   // task->SetDebug(0);
171   // Set the debug level of a single algorithm 
172   // task->GetSharingFilter().SetDebug(3);
173
174   // --- Eventplane Finder -------------------------------------------
175   task->GetEventPlaneFinder().SetUsePhiWeights(false);
176
177   // --- Set limits on fits the energy -------------------------------
178   // Maximum relative error on parameters 
179   AliFMDCorrELossFit::ELossFit::fgMaxRelError = .12;
180   // Least weight to use 
181   AliFMDCorrELossFit::ELossFit::fgLeastWeight = 1e-5;
182   // Maximum value of reduced chi^2 
183   AliFMDCorrELossFit::ELossFit::fgMaxChi2nu   = 20;
184 #Module.EndConfig
185 #
186 # EOF
187 #