AliPhysics  4a7363b (4a7363b)
MakeFMDMCHitTrain.C
Go to the documentation of this file.
1 
10 #include "TrainSetup.C"
11 // #include "ParUtilities.C"
12 
13 //====================================================================
22 {
23 public:
30  MakeFMDMCHitTrain(const char* name)
31  : TrainSetup(name)
32  {
33  fOptions.Add("use-tuple", "Whether to make an NTuple of hits");
34  fOptions.Set("type", "ESD");
35  }
36 protected:
43  {
44  // --- Output file name ------------------------------------------
45  AliAnalysisManager::SetCommonFileName("forward_mchits.root");
46 
47 
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");
58 
59  // --- Set load path ---------------------------------------------
60  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2",
61  gROOT->GetMacroPath()));
62 
63  // --- Check if this is MC ---------------------------------------
64  if (!mgr->GetMCtruthEventHandler())
65  Fatal("CreateTasks", "No MC truth handler");
66 
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");
72  }
73  //__________________________________________________________________
81  AliAnalysisManager* mgr)
82  {
84 
85  // --- Get input event handler -----------------------------------
86  AliInputEventHandler* ih =
87  dynamic_cast<AliInputEventHandler*>(mgr->GetInputEventHandler());
88  if (!ih)
89  Fatal("CreatePhysicsSelection", "Couldn't get input handler (%p)", ih);
90 
91  // --- Get Physics selection -------------------------------------
92  AliPhysicsSelection* ps =
93  dynamic_cast<AliPhysicsSelection*>(ih->GetEventSelection());
94  if (!ps)
95  Fatal("CreatePhysicsSelection", "Couldn't get PhysicsSelection (%p)", ps);
96 
97  // --- Ignore trigger class when selecting events. This means ---
98  // --- that we get offline+(A,C,E) events too --------------------
99  // ps->SetSkipTriggerClassSelection(true);
100  }
101  //__________________________________________________________________
105  virtual AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
109  // void CreateCentralitySelection(Bool_t) {}
110  //__________________________________________________________________
111  const char* ClassName() const { return "MakeFMDMCHitTrain"; }
112 };
113 
114 //
115 // EOF
116 //
Railway * fRailway
Definition: TrainSetup.C:1674
Bool_t AsBool(const TString &name) const
Definition: Option.C:631
const char * ClassName() const
Int_t AsInt(const TString &name, Int_t def=0) const
Definition: Option.C:645
MakeFMDMCHitTrain(const char *name)
void Set(const TString &name, const TString &value)
Definition: Option.C:736
void CreateTasks(AliAnalysisManager *mgr)
Base classs for train specifications.
Option * Add(const TString &name, const TString &arg, const TString &desc, const TString &val="")
Definition: Option.C:421
void CreatePhysicsSelection(Bool_t mc, AliAnalysisManager *mgr)
OptionList fOptions
Definition: TrainSetup.C:1673
unsigned short UShort_t
Definition: External.C:28
virtual AliVEventHandler * CreateOutputHandler(UShort_t)
bool Bool_t
Definition: External.C:53
virtual AliAnalysisTask * CoupleCar(const TString &macro, const TString &args)
Definition: TrainSetup.C:841
virtual void CreatePhysicsSelection(Bool_t mc, AliAnalysisManager *mgr)
Definition: TrainSetup.C:694
virtual Bool_t LoadLibrary(const TString &name, Bool_t slave=true, Bool_t forcePar=false)=0