1 #include "TrainSetup.C"
3 //====================================================================
5 * Analysis train to do energy loss fits
7 * @ingroup pwg2_forward_trains
9 class MakeQATrain : public TrainSetup
13 * Constructor. Date and time must be specified when running this
14 * in Termiante mode on Grid
16 * @param name Name of train
17 * @param useCent Whether to use centrality or not
18 * @param dateTime Append date and time to name
25 MakeQATrain(const char* name = "Forward QA",
26 Bool_t useCent = false,
27 Bool_t dateTime = false,
33 : TrainSetup(name, dateTime, year, month, day, hour, min),
36 //__________________________________________________________________
41 * @param oper Operation
42 * @param nEvents Number of events (negative means all)
43 * @param mc If true, assume simulated events
44 * @param par IF true, use par files
46 void Run(const char* mode, const char* oper,
47 Int_t nEvents=-1, Bool_t mc=false, Bool_t par=false)
49 Exec("ESD", mode, oper, nEvents, mc, par);
51 //__________________________________________________________________
56 * @param oper Operation
57 * @param nEvents Number of events (negative means all)
58 * @param mc If true, assume simulated events
59 * @param par IF true, use par files
61 void Run(EMode mode, EOper oper, Int_t nEvents=-1, Bool_t mc=false,
64 Exec(kESD, mode, oper, nEvents, mc, par);
67 //__________________________________________________________________
71 * @param mode Processing mode
72 * @param par Whether to use par files
73 * @param mgr Analysis manager
75 void CreateTasks(EMode mode, Bool_t par, AliAnalysisManager* mgr)
77 // --- Output file name ------------------------------------------
78 AliAnalysisManager::SetCommonFileName("forward_qa.root");
80 // --- Load libraries/pars ---------------------------------------
81 LoadLibrary("PWG2forward2", mode, par, true);
83 // --- Set load path ---------------------------------------------
84 gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWG2/FORWARD/analysis2",
85 gROOT->GetMacroPath()));
87 // --- Check if this is MC ---------------------------------------
88 Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
90 // --- Add the task ----------------------------------------------
91 gROOT->Macro(Form("AddTaskForwardQA.C(%d,%d)", mc, fUseCent));
94 * Create entrality selection if enabled
96 * @param mc Whether this is MC or not
97 * @param mgr Analysis manager
99 virtual void CreateCentralitySelection(Bool_t mc, AliAnalysisManager* mgr)
101 if (!fUseCent) return;
103 gROOT->Macro("AddTaskCentrality.C");
104 AliCentralitySelectionTask* ctask =
105 dynamic_cast<AliCentralitySelectionTask*>(mgr->GetTask("CentralitySelection"));
107 ctask->SetPass(fESDPass);
108 if (mc) ctask->SetMCInput();
111 * Crete output handler - we don't want one here.
115 AliVEventHandler* CreateOutputHandler(EType) { return 0; }
116 Bool_t fUseCent; // Whether to use centrality or not