]>
Commit | Line | Data |
---|---|---|
ad7be237 | 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 | */ | |
23 | void CreateResponseMatrices(const char* aoddir=".", | |
24 | Int_t nEvents=-1, | |
25 | const char* trig="INEL", | |
26 | Double_t vzMin=-10, | |
27 | Double_t vzMax=10, | |
28 | char* output="responseMatrices.root", | |
29 | Int_t proof=0) | |
30 | { | |
31 | // --- Libraries to load ------------------------------------------- | |
32 | gROOT->Macro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/LoadLibs.C"); | |
33 | ||
34 | // --- Check for proof mode, and possibly upload pars -------------- | |
35 | if (proof> 0) { | |
36 | gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/LoadPars.C"); | |
37 | LoadPars(proof); | |
38 | } | |
39 | ||
40 | // --- Our data chain ---------------------------------------------- | |
41 | gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/scripts/MakeChain.C"); | |
42 | TChain* chain = MakeChain("AOD", aoddir,true); | |
43 | // If 0 or less events is select, choose all | |
44 | if (nEvents <= 0) nEvents = chain->GetEntries(); | |
45 | ||
46 | // --- Creating the manager and handlers --------------------------- | |
47 | AliAnalysisManager *mgr = new AliAnalysisManager("Forward Train", | |
48 | "Forward Multiplicity"); | |
49 | AliAnalysisManager::SetCommonFileName(output); | |
50 | ||
51 | // --- ESD input handler ------------------------------------------- | |
52 | AliAODInputHandler *aodInputHandler = new AliAODInputHandler(); | |
53 | mgr->SetInputEventHandler(aodInputHandler); | |
54 | ||
55 | // --- Add tasks --------------------------------------------------- | |
56 | // Forward | |
57 | gROOT->LoadMacro("$ALICE_ROOT/PWGLF/FORWARD/analysis2/AddTaskCreateResponseMatrices.C"); | |
58 | AddTaskCreateResponseMatrices(trig, vzMin, vzMax); | |
59 | ||
60 | ||
61 | // --- Run the analysis -------------------------------------------- | |
62 | TStopwatch t; | |
63 | if (!mgr->InitAnalysis()) { | |
64 | Error("MakeMult", "Failed to initialize analysis train!"); | |
65 | return; | |
66 | } | |
67 | // Skip terminate if we're so requested and not in Proof or full mode | |
68 | mgr->SetSkipTerminate(false); | |
69 | // Some informative output | |
70 | mgr->PrintStatus(); | |
71 | // mgr->SetDebugLevel(3); | |
72 | if (mgr->GetDebugLevel() < 1 && !proof) | |
73 | mgr->SetUseProgressBar(kTRUE,100); | |
74 | ||
75 | // Run the train | |
76 | t.Start(); | |
77 | Printf("=== RUNNING ANALYSIS =================================="); | |
78 | mgr->StartAnalysis(proof ? "proof" : "local", chain, nEvents); | |
79 | t.Stop(); | |
80 | t.Print(); | |
81 | } | |
82 | // | |
83 | // EOF | |
84 | // |