]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/MakedNdeta.C
Set init parameters from args
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / MakedNdeta.C
CommitLineData
b2e7f2d6 1/**
2 * @file
3 *
4 * @ingroup pwg2_forward_scripts
5 */
6
7/**
8 * Run first pass of the analysis - that is read in ESD and produce AOD
9 *
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
16 *
17 * If PROOF mode is selected, then Terminate will be run on the master node
18 * in any case.
19 *
20 *
21 * @ingroup pwg2_forward_scripts
22 */
23void MakedNdeta(const char* aoddir=".",
24 Int_t nEvents=-1,
25 const char* trig="INEL",
26 Double_t vzMin=-10,
27 Double_t vzMax=10,
28 Int_t proof=0)
29{
30 // --- Libraries to load -------------------------------------------
31 gROOT->Macro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadLibs.C");
32
33 // --- Check for proof mode, and possibly upload pars --------------
34 if (proof> 0) {
35 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/LoadPars.C");
36 LoadPars(proof);
37 }
38
39 // --- Our data chain ----------------------------------------------
40 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/MakeChain.C");
41 TChain* chain = MakeChain("AOD", aoddir,true);
42 // If 0 or less events is select, choose all
43 if (nEvents <= 0) nEvents = chain->GetEntries();
44
45 // --- Creating the manager and handlers ---------------------------
46 AliAnalysisManager *mgr = new AliAnalysisManager("Forward Train",
47 "Forward dN/deta");
48 AliAnalysisManager::SetCommonFileName("forward_dndeta.root");
49
50 // --- ESD input handler -------------------------------------------
51 AliAODInputHandler *aodInputHandler = new AliAODInputHandler();
52 mgr->SetInputEventHandler(aodInputHandler);
53
54 // --- Add tasks ---------------------------------------------------
55 // Centrality
56 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C");
57 AddTaskForwarddNdeta(trig, vzMin, vzMax);
58
59 // --- Run the analysis --------------------------------------------
60 TStopwatch t;
61 if (!mgr->InitAnalysis()) {
62 Error("MakedNdeta", "Failed to initialize analysis train!");
63 return;
64 }
65 // Skip terminate if we're so requested and not in Proof or full mode
66 mgr->SetSkipTerminate(false);
67 // Some informative output
68 mgr->PrintStatus();
69 // mgr->SetDebugLevel(3);
70 if (mgr->GetDebugLevel() < 1 && !proof)
bad9a3c1 71 mgr->SetUseProgressBar(kTRUE,100);
b2e7f2d6 72
73 // Run the train
74 t.Start();
75 Printf("=== RUNNING ANALYSIS ==================================");
76 mgr->StartAnalysis(proof ? "proof" : "local", chain, nEvents);
77 t.Stop();
78 t.Print();
79}
80//
81// EOF
82//