2 * This is the macro to include the Forward multiplicity in a train.
4 * @ingroup pwg2_forward_analysis_scripts
7 AddTaskFMD(Int_t nCutBins=1, Float_t correctionCut=0.1)
9 AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
11 Error("AddTaskFMD", "No analysis manager to connect to.");
15 // --- Make the task and add it to the manager ---------------------
16 AliForwardMultiplicity* task = new AliForwardMultiplicity("FMD");
19 // --- Set parameters on the algorithms ----------------------------
20 // Set the number of SPD tracklets for which we consider the event a
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
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)
48 task->GetHistCollector().SetNCutBins(nCutBins);
49 // Set the correction cut, that is, when bins in the secondary map
50 // is smaller than this, they are considered empty
51 task->GetHistCollector().SetCorrectionCut(correctionCut);
52 // Set the overall debug level (1: some output, 3: a lot of output)
54 // Set the debug level of a single algorithm
55 task->GetEnergyFitter().SetDebug(3);
57 // --- Set up the parameer manager ---------------------------------
58 AliFMDAnaParameters* pars = AliFMDAnaParameters::Instance();
59 AliMCEventHandler* mcHandler =
60 dynamic_cast<AliMCEventHandler*>(mgr->GetMCtruthEventHandler());
61 Info("AddTaskFMD", "MC handler %p", mcHandler);
63 pars->SetRealData(kFALSE);
64 pars->SetProcessPrimary(kTRUE);
65 pars->SetProcessHits(kFALSE);
68 pars->SetRealData(kTRUE);
69 pars->SetProcessPrimary(kFALSE);
70 pars->SetProcessHits(kFALSE);
74 // --- Makek the output container and connect it -------------------
75 TString outputfile = AliAnalysisManager::GetCommonFileName();
76 outputfile += Form(":%s",pars->GetDndetaAnalysisName());
77 AliAnalysisDataContainer* histOut =
78 mgr->CreateContainer("Forward", TList::Class(),
79 AliAnalysisManager::kOutputContainer,outputfile);
80 mgr->ConnectInput(task, 0, mgr->GetCommonInputContainer());
81 mgr->ConnectOutput(task, 1, histOut);