2 * @file MakeFMDMCHitTrain.C
3 * @author Christian Holm Christensen <cholm@nbi.dk>
4 * @date Fri Jun 1 13:54:47 2012
8 * @ingroup pwglf_forward_trains_specific
10 #include "TrainSetup.C"
11 // #include "ParUtilities.C"
13 //====================================================================
15 * Analysis train to make Forward and Central MC corrections
18 * @ingroup pwglf_forward_mc
19 * @ingroup pwglf_forward_trains_specific
21 class MakeFMDMCHitTrain : public TrainSetup
25 * Constructor. Date and time must be specified when running this
26 * in Termiante mode on Grid
28 * @param name Name of train (free form)
30 MakeFMDMCHitTrain(const char* name)
33 fOptions.Add("use-tuple", "Whether to make an NTuple of hits");
34 fOptions.Set("type", "ESD");
40 * @param mgr Analysis manager
42 void CreateTasks(AliAnalysisManager* mgr)
44 // --- Output file name ------------------------------------------
45 AliAnalysisManager::SetCommonFileName("forward_mchits.root");
48 // --- Load libraries/pars ---------------------------------------
49 fRailway->LoadLibrary("PWGLFforward2");
50 fRailway->LoadLibrary("Proof");
51 fRailway->LoadLibrary("Gui"); // Sigh! CDB depends on GUI!
52 fRailway->LoadLibrary("CDB");
53 fRailway->LoadLibrary("RAWDatabase");
54 fRailway->LoadLibrary("STEER");
55 fRailway->LoadLibrary("FMDbase");
56 fRailway->LoadLibrary("FMDsim");
57 fRailway->LoadLibrary("PWGLFforwardhit");
59 // --- Set load path ---------------------------------------------
60 gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/PWGLF/FORWARD/analysis2",
61 gROOT->GetMacroPath()));
63 // --- Check if this is MC ---------------------------------------
64 if (!mgr->GetMCtruthEventHandler())
65 Fatal("CreateTasks", "No MC truth handler");
67 TString args = TString::Format("%d,%d",
68 fOptions.AsBool("use-tuple"),
69 fOptions.AsInt("verbose"));
70 if (!CoupleCar("AddTaskFMDMCHit.C", args))
71 Fatal("CreateTasks", "Couldn't add our task");
73 //__________________________________________________________________
75 * Create physics selection , and add to manager
77 * @param mc Whether this is for MC
80 void CreatePhysicsSelection(Bool_t mc,
81 AliAnalysisManager* mgr)
83 TrainSetup::CreatePhysicsSelection(mc, mgr);
85 // --- Get input event handler -----------------------------------
86 AliInputEventHandler* ih =
87 dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
89 Fatal("CreatePhysicsSelection", "Couldn't get input handler (%p)", ih);
91 // --- Get Physics selection -------------------------------------
92 AliPhysicsSelection* ps =
93 dynamic_cast<AliPhysicsSelection*>(ih->GetEventSelection());
95 Fatal("CreatePhysicsSelection", "Couldn't get PhysicsSelection (%p)", ps);
97 // --- Ignore trigger class when selecting events. This means ---
98 // --- that we get offline+(A,C,E) events too --------------------
99 // ps->SetSkipTriggerClassSelection(true);
101 //__________________________________________________________________
103 * @return 0 - AOD disabled
105 virtual AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
107 * Do not the centrality selection
109 // void CreateCentralitySelection(Bool_t) {}
110 //__________________________________________________________________
111 const char* ClassName() const { return "MakeFMDMCHitTrain"; }