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