Minor stuff
[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 ---------------------------------------------------
ec82df5b 55 // Forward
b2e7f2d6 56 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/AddTaskForwarddNdeta.C");
94dc5546 57 AddTaskForwarddNdeta(trig, vzMin, vzMax);
58
ec82df5b 59 // Central
60 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/AddTaskCentraldNdeta.C");
61 AddTaskCentraldNdeta(trig, vzMin, vzMax);
62
b2e7f2d6 63
64 // --- Run the analysis --------------------------------------------
65 TStopwatch t;
66 if (!mgr->InitAnalysis()) {
67 Error("MakedNdeta", "Failed to initialize analysis train!");
68 return;
69 }
70 // Skip terminate if we're so requested and not in Proof or full mode
71 mgr->SetSkipTerminate(false);
72 // Some informative output
73 mgr->PrintStatus();
74 // mgr->SetDebugLevel(3);
75 if (mgr->GetDebugLevel() < 1 && !proof)
bad9a3c1 76 mgr->SetUseProgressBar(kTRUE,100);
b2e7f2d6 77
78 // Run the train
79 t.Start();
80 Printf("=== RUNNING ANALYSIS ==================================");
81 mgr->StartAnalysis(proof ? "proof" : "local", chain, nEvents);
82 t.Stop();
83 t.Print();
84}
85//
86// EOF
87//