Fixed bug in the computation of dip angle value
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / AddTaskFMD.C
CommitLineData
7e4038b5 1/**
2 * This is the macro to include the Forward multiplicity in a train.
3 *
4 * @ingroup pwg2_forward_analysis_scripts
5 */
2d68d438 6AliAnalysisTask*
7e4038b5 7AddTaskFMD(Int_t nCutBins=1, Float_t correctionCut=0.1)
8{
9 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
10 if (!mgr) {
11 Error("AddTaskFMD", "No analysis manager to connect to.");
12 return NULL;
13 }
14
6b908a3f 15 // --- Make the task and add it to the manager ---------------------
7e4038b5 16 AliForwardMultiplicity* task = new AliForwardMultiplicity("FMD");
6b908a3f 17 mgr->AddTask(task);
18
19 // --- Set parameters on the algorithms ----------------------------
20 // Set the number of SPD tracklets for which we consider the event a
21 // low flux event
22 task->GetEventInspector().SetLowFluxCut(1000);
23 // Set the maximum error on v_z [cm]
24 task->GetEventInspector().SetMaxVzErr(0.2);
25 // Set the eta axis to use - note, this overrides whatever is used
26 // by the rest of the algorithms - but only for the energy fitter
27 // algorithm.
28 task->GetEnergyFitter().SetEtaAxis(200, -4, 6);
29 // Set the low cut used for energy
30 task->GetEnergyFitter().SetLowCut(0.4);
31 // Set the number of bins to subtract from maximum of distributions
32 // to get the lower bound of the fit range
33 task->GetEnergyFitter().SetBinsToSubtract(4);
34 // Set the maximum number of landaus to try to fit (max 5)
35 task->GetEnergyFitter().SetNLandau(5);
36 // Set the minimum number of entries in the distribution before
37 // trying to fit to the data
38 task->GetEnergyFitter().SetMinEntries(1000);
39 // Set maximum energy loss to consider
40 task->GetEnergyFitter().SetMaxE(10);
41 // Set number of energy loss bins
42 task->GetEnergyFitter().SetNEbins(300);
43 // Set whether to use increasing bin sizes
44 task->GetEnergyFitter().SetUseIncreasingBins(true);
45 // Set the low cut used for sharing
46 task->GetSharingFilter().SetLowCut(0.3);
47 // Set the number of extra bins (beyond the secondary map border)
7e4038b5 48 task->GetHistCollector().SetNCutBins(nCutBins);
6b908a3f 49 // Set the correction cut, that is, when bins in the secondary map
50 // is smaller than this, they are considered empty
7e4038b5 51 task->GetHistCollector().SetCorrectionCut(correctionCut);
6b908a3f 52 // Set the overall debug level (1: some output, 3: a lot of output)
53 task->SetDebug(0);
54 // Set the debug level of a single algorithm
55 task->GetEnergyFitter().SetDebug(3);
7e4038b5 56
6b908a3f 57 // --- Set up the parameer manager ---------------------------------
7e4038b5 58 AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
59 AliMCEventHandler* mcHandler =
60 dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler());
61 Info("AddTaskFMD", "MC handler %p", mcHandler);
62 if(mcHandler) {
63 pars->SetRealData(kFALSE);
64 pars->SetProcessPrimary(kTRUE);
65 pars->SetProcessHits(kFALSE);
66 }
67 else {
68 pars->SetRealData(kTRUE);
69 pars->SetProcessPrimary(kFALSE);
70 pars->SetProcessHits(kFALSE);
71 }
72 pars->Init();
73
6b908a3f 74 // --- Makek the output container and connect it -------------------
7e4038b5 75 TString outputfile = AliAnalysisManager::GetCommonFileName();
76 outputfile += Form(":%s",pars->GetDndetaAnalysisName());
77 AliAnalysisDataContainer* histOut =
78 mgr->CreateContainer("Forward", TList::Class(),
79 AliAnalysisManager::kOutputContainer,outputfile);
7e4038b5 80 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
81 mgr->ConnectOutput(task, 1, histOut);
82
83 return task;
84}