]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PWG2/FORWARD/analysis2/Pass2.C
More code clean up.
[u/mrichter/AliRoot.git] / PWG2 / FORWARD / analysis2 / Pass2.C
CommitLineData
7e4038b5 1/**
2 * Read in AOD and generate @f$ dN/d\eta@f$ for the selected
3 * trigger classes and vertex ranges
4 *
5 * @param file Input file (AOD)
6 * @param triggers Triggers to investigate
7 * @param energy Energy (only used for comparisons)
8 * @param vzMin Minimum interaction point z coordinate
9 * @param vzMax Maximum interaction point z coordinate
10 * @param rebin How many bins to group
11 * @param title Title to put on the plot
c389303e 12 * @param hhd Whether to do HHD comparison
13 * @param comp Whether to do comparisons
7e4038b5 14 *
15 * @ingroup pwg2_forward_analysis_scripts
16 */
17void
18Pass2(const char* file="AliAODs.root",
19 const char* triggers="INEL",
20 Int_t energy=900,
21 Double_t vzMin=-10,
22 Double_t vzMax=10,
23 Int_t rebin=5,
f4494b7a 24 const char* title="",
0bd4b00f 25 bool hhd=true,
f4494b7a 26 bool comp=true)
7e4038b5 27{
0bd4b00f 28 gROOT->LoadMacro("$ALICE_ROOT/PWG2/FORWARD/analysis2/scripts/Compile.C");
7e4038b5 29 Compile("$ALICE_ROOT/PWG2/FORWARD/analysis2/DrawRes.C","g");
30
31 Int_t trgMask;
32 TString trgs(triggers);
33 trgs.ToUpper();
34 TObjString* trg;
35 TIter next(trgs.Tokenize(" ,|"));
36 while ((trg = static_cast<TObjString*>(next()))) {
37 TString s(trg->GetString());
38 if (s.IsNull()) continue;
39 if (s.CompareTo("INEL") == 0) trgMask = AliAODForwardMult::kInel;
40 else if (s.CompareTo("INEL>0")== 0) trgMask = AliAODForwardMult::kInelGt0;
41 else if (s.CompareTo("NSD") == 0) trgMask = AliAODForwardMult::kNSD;
42 else
43 Warning("Pass2", "Unknown trigger %s", s.Data());
44 }
45 if (trgMask == 0) {
46 trgMask = 1;
47 trgs.Append("INEL");
48 }
0bd4b00f 49 TString tit(title);
50 tit.ReplaceAll("@", " ");
51
7e4038b5 52 printf("--------------------------------------\n"
53 "Settings for this:\n"
54 " Input AOD: %s\n"
55 " Vertex range: %+4.1f -> %+4.1f cm\n"
56 " Rebinning: %d\n"
57 " Trigger mask: 0x%02x (%s)\n"
58 " Energy: %dGeV\n"
59 " Title: %s\n"
f4494b7a 60 " HHD comp.: %s\n"
61 " Other comp.: %s\n"
7e4038b5 62 "--------------------------------------\n",
0bd4b00f 63 file, vzMin, vzMax, rebin, trgMask, trgs.Data(), energy, tit.Data(),
f4494b7a 64 hhd ? "yes" : "no", comp ? "yes" : "no");
7e4038b5 65
66 DrawRes dr;
65a1e0cd 67 TStopwatch t;
68 t.Start();
0bd4b00f 69 dr.Run(file, vzMin, vzMax, rebin, trgMask, energy, tit.Data(), hhd, comp);
65a1e0cd 70 t.Stop();
71 t.Print();
7e4038b5 72}
73//
74// EOF
75//
76
77