4 * @ingroup pwg2_forward_scripts
8 * Run first pass of the analysis - that is read in ESD and produce AOD
10 * @param esddir ESD input directory. Any file matching the pattern
11 * *AliESDs*.root are added to the chain
12 * @param nEvents Number of events to process. If 0 or less, then
13 * all events are analysed
14 * @param proof Run in proof mode
15 * @param mc Run over MC data
17 * If PROOF mode is selected, then Terminate will be run on the master node
21 * @ingroup pwg2_forward_scripts
23 void MakeMultiplicityDistributions(const char* aoddir=".",
25 const char* trig="INEL",
30 char* output="forward_multiplicity.root",
34 // --- Libraries to load -------------------------------------------
35 gROOT->Macro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/LoadLibs.C");
37 // --- Check for proof mode, and possibly upload pars --------------
39 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/LoadPars.C");
43 // --- Our data chain ----------------------------------------------
44 std::cout << "making chain of files" << std::endl;
45 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/MakeChain.C");
46 TChain* chain = MakeChain("AOD", aoddir,true);
47 // If 0 or less events is select, choose all
48 if (nEvents <= 0) nEvents = chain->GetEntries();
50 // --- Creating the manager and handlers ---------------------------
51 AliAnalysisManager *mgr = new AliAnalysisManager("Forward Train",
52 "Forward Multiplicity");
55 AliAnalysisManager::SetCommonFileName(output);
57 Char_t* name = Form("%s_cent_%d_%d.root",output,lowCent, highCent);
58 AliAnalysisManager::SetCommonFileName(name);
60 // --- ESD input handler -------------------------------------------
61 AliAODInputHandler *aodInputHandler = new AliAODInputHandler();
62 mgr->SetInputEventHandler(aodInputHandler);
64 // --- Add tasks ---------------------------------------------------
66 gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/AddTaskMultiplicity.C");
67 AddTaskMultiplicity(trig, vzMin, vzMax, lowCent, highCent, nBins);
70 // --- Run the analysis --------------------------------------------
72 if (!mgr->InitAnalysis()) {
73 Error("MakeMult", "Failed to initialize analysis train!");
76 // Skip terminate if we're so requested and not in Proof or full mode
77 mgr->SetSkipTerminate(false);
78 // Some informative output
80 // mgr->SetDebugLevel(3);
81 if (mgr->GetDebugLevel() < 1 && !proof)
82 mgr->SetUseProgressBar(kTRUE,100);
86 Printf("=== RUNNING ANALYSIS ==================================");
87 mgr->StartAnalysis(proof ? "proof" : "local", chain, nEvents);