]>
Commit | Line | Data |
---|---|---|
bfab35d9 | 1 | /** |
2 | * @file MakeMultDistsTrain.C | |
3 | * @author Christian Holm Christensen <cholm@master.hehi.nbi.dk> | |
4 | * @date Fri Jun 1 13:51:26 2012 | |
5 | * | |
6 | * @brief | |
7 | * | |
8 | * @ingroup pwglf_forward_trains_specific | |
9 | * | |
10 | */ | |
11 | ||
12 | #include "TrainSetup.C" | |
13 | ||
14 | //==================================================================== | |
15 | /** | |
16 | * Analysis train to make @f$ dN/d\eta@f$ | |
17 | * | |
18 | * | |
19 | * @ingroup pwglf_forward_dndeta | |
20 | * @ingroup pwglf_forward_trains_specific | |
21 | */ | |
22 | class MakeMultDistsTrain : public TrainSetup | |
23 | { | |
24 | public: | |
25 | /** | |
26 | * Constructor. | |
27 | * | |
28 | * @param name Name of train (free form) | |
29 | */ | |
30 | MakeMultDistsTrain(const char* name) | |
31 | : TrainSetup(name) | |
32 | { | |
33 | fOptions.Add("trig", "TYPE", "Trigger type", "V0AND"); | |
34 | fOptions.Add("vzMin", "CENTIMETER", "Min Ip Z", -4); | |
35 | fOptions.Add("vzMax", "CENTIMETER", "Max Ip Z", +4); | |
36 | fOptions.Add("max-n", "NUMBER", "Maximum Nch", 150); | |
37 | fOptions.Add("phi-acc", "Use stored phi acceptance", true); | |
38 | fOptions.Add("asymmetric", "Make asymmetric (+/-) bins", true); | |
39 | } | |
40 | protected: | |
41 | /** | |
42 | * Create the tasks | |
43 | * | |
44 | */ | |
45 | void CreateTasks(AliAnalysisManager*) | |
46 | { | |
47 | // --- Output file name ------------------------------------------ | |
48 | AliAnalysisManager::SetCommonFileName("forward_multdists.root"); | |
49 | ||
50 | // --- Load libraries/pars --------------------------------------- | |
51 | fHelper->LoadLibrary("PWGLFforward2"); | |
52 | ||
53 | // --- Set load path --------------------------------------------- | |
54 | gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2", | |
55 | gROOT->GetMacroPath())); | |
56 | ||
57 | // --- Get parameters -------------------------------------------- | |
58 | TString trig = fOptions.AsString("trig", "V0AND"); | |
59 | Double_t vzMin = fOptions.AsDouble("vzmin", -4); | |
60 | Double_t vzMax = fOptions.AsDouble("vzmax", +4); | |
61 | Int_t maxN = fOptions.AsInt("max-n", 150); | |
62 | Bool_t phiAcc = fOptions.AsBool("phi-acc"); | |
63 | Bool_t aSymm = fOptions.AsBool("asymmetric"); | |
64 | ||
65 | // --- Form arguments -------------------------------------------- | |
66 | TString args; | |
67 | args.Form("\"%s\",%f,%f,%d,%d,%d", | |
68 | trig.Data(), vzMin, vzMax, maxN, phiAcc, aSymm); | |
69 | // --- Add the task ---------------------------------------------- | |
70 | gROOT->Macro(Form("AddTaskForwardMultDists.C(%s);", args.Data())); | |
71 | } | |
72 | //__________________________________________________________________ | |
73 | /** | |
74 | * Do not the centrality selection | |
75 | */ | |
76 | //__________________________________________________________________ | |
77 | void CreateCentralitySelection(Bool_t, AliAnalysisManager*) {} | |
78 | /** | |
79 | * Do not create MC input handler | |
80 | * | |
81 | * @return Always null | |
82 | */ | |
83 | AliVEventHandler* CreateMCHandler(UShort_t, bool) { return 0; } | |
84 | //__________________________________________________________________ | |
85 | /** | |
86 | * Crete output handler - we don't want one here. | |
87 | * | |
88 | * @return 0 | |
89 | */ | |
90 | AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; } | |
91 | //__________________________________________________________________ | |
92 | const char* ClassName() const { return "MakeMultDistsTrain"; } | |
93 | //__________________________________________________________________ | |
94 | /** | |
95 | * Overloaded to create new draw.C | |
96 | * | |
97 | * @param asShellScript | |
98 | */ | |
99 | void SaveSetup(Bool_t asShellScript) | |
100 | { | |
101 | TrainSetup::SaveSetup(asShellScript); | |
102 | ||
103 | SaveSummarize(); | |
104 | } | |
105 | void SaveSummarize() | |
106 | { | |
107 | std::ofstream f("Summarize.C"); | |
108 | if (!f) { | |
109 | Error("SaveSummarize", "Failed to open Summarize.C script"); | |
110 | return; | |
111 | } | |
112 | f << "// Generated by " << ClassName() << "\n" | |
113 | << "// WHAT is a bit mask of\n" | |
114 | << "// 0x001 Forward\n" | |
115 | << "// 0x002 Central\n" | |
116 | << "// 0x004 Sums\n" | |
117 | << "// 0x008 Results\n" | |
118 | << "// 0x010 Only min-bias (no centrality)\n" | |
119 | << "// 0x020 Landscape\n" | |
120 | << "// 0x040 Pause\n" | |
121 | << "//\n" | |
122 | << "void Summarize(const char* filename=\"forward_multdists.root\",\n" | |
123 | << " UShort_t what=0xF)\n" | |
124 | << "{\n" | |
125 | << " gROOT->LoadMacro(\"$ALICE_ROOT/PWGLF/FORWARD/analysis2/DrawMultDistsSummary.C\");\n" | |
126 | << " DrawMultDistsSummary(filename,what);\n" | |
127 | << "}\n" | |
128 | << "// EOF" << std::endl; | |
129 | f.close(); | |
130 | } | |
131 | }; | |
132 | // | |
133 | // EOF | |
134 | // |