]>
Commit | Line | Data |
---|---|---|
fdfd93b4 | 1 | /** |
2 | * @file MakeFMDELossTrain.C | |
3 | * @author Christian Holm Christensen <cholm@master.hehi.nbi.dk> | |
4 | * @date Fri Jun 1 13:53:02 2012 | |
5 | * | |
6 | * @brief | |
7 | * | |
8 | * | |
9 | * @ingroup pwglf_forward_trains_specific | |
10 | */ | |
11 | #include "TrainSetup.C" | |
12 | ||
13 | //==================================================================== | |
14 | /** | |
15 | * Analysis train to do energy loss fits | |
16 | * | |
17 | * @ingroup pwglf_forward_trains_specific | |
18 | * @ingroup pwglf_forward_eloss | |
19 | */ | |
20 | class MakeFMDELossTrain : public TrainSetup | |
21 | { | |
22 | public: | |
23 | /** | |
24 | * Constructor. | |
25 | * | |
26 | * @param name Name of train | |
27 | */ | |
28 | MakeFMDELossTrain(const char* name = "FMD Energy Loss") | |
29 | : TrainSetup(name) | |
30 | { | |
31 | fOptions.Add("cent", "Use centrality"); | |
32 | } | |
33 | protected: | |
34 | //------------------------------------------------------------------ | |
35 | /** | |
36 | * Create the analysis manager | |
37 | * | |
38 | * @param name Name of the analysis | |
39 | * | |
40 | * @return Created analysis manager | |
41 | */ | |
42 | virtual AliAnalysisManager* CreateAnalysisManager(const char* name) | |
43 | { | |
44 | AliAnalysisManager* mgr = TrainSetup::CreateAnalysisManager(name); | |
45 | // mgr->SetAutoBranchLoading(false); | |
46 | return mgr; | |
47 | } | |
48 | //__________________________________________________________________ | |
49 | /** | |
50 | * Create the tasks | |
51 | * | |
52 | * @param par Whether to use par files | |
53 | * @param mgr Analysis manager | |
54 | */ | |
55 | void CreateTasks(AliAnalysisManager* mgr) | |
56 | { | |
57 | // --- Output file name ------------------------------------------ | |
58 | AliAnalysisManager::SetCommonFileName("forward_eloss.root"); | |
59 | ||
60 | // --- Load libraries/pars --------------------------------------- | |
9201c66b | 61 | fHelper->LoadLibrary("PWGLFforward2"); |
fdfd93b4 | 62 | |
63 | // --- Set load path --------------------------------------------- | |
64 | gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2", | |
65 | gROOT->GetMacroPath())); | |
66 | ||
67 | // --- Check if this is MC --------------------------------------- | |
68 | Bool_t mc = mgr->GetMCtruthEventHandler() != 0; | |
69 | Bool_t cent = fOptions.Has("cent"); | |
70 | ||
71 | // --- Add the task ---------------------------------------------- | |
72 | gROOT->Macro(Form("AddTaskFMDELoss.C(%d,%d)", mc, cent)); | |
73 | } | |
74 | /** | |
75 | * Create entrality selection if enabled | |
76 | * | |
77 | * @param mc Whether this is MC or not | |
78 | * @param mgr Analysis manager | |
79 | */ | |
80 | virtual void CreateCentralitySelection(Bool_t mc, AliAnalysisManager* mgr) | |
81 | { | |
82 | if (!fOptions.Has("cent")) return; | |
83 | ||
84 | const char* name = "CentralitySelection"; | |
85 | gROOT->Macro("AddTaskCentrality.C"); | |
86 | AliCentralitySelectionTask* ctask = | |
87 | dynamic_cast<AliCentralitySelectionTask*>(mgr->GetTask(name)); | |
88 | if (!ctask) return; | |
89 | // ctask->SetPass(fESDPass); | |
90 | if (mc) ctask->SetMCInput(); | |
91 | } | |
92 | /** | |
93 | * Crete output handler - we don't want one here. | |
94 | * | |
95 | * @return 0 | |
96 | */ | |
97 | AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; } | |
98 | //__________________________________________________________________ | |
99 | const char* ClassName() const { return "MakeFMDElossTrain"; } | |
100 | }; | |
101 | ||
102 | // | |
103 | // EOF | |
104 | // |