AliPhysics  9b6b435 (9b6b435)
MakeQATrain.C
Go to the documentation of this file.
1 
11 #include "TrainSetup.C"
12 
13 //====================================================================
20 class MakeQATrain : public TrainSetup
21 {
22 public:
29  MakeQATrain(const char* name = "Forward QA")
30  : TrainSetup(name)
31  {
32  fOptions.Add("cent", "Use centrality");
33  fOptions.Set("type", "ESD");
34  fOptions.Add("corr", "DIR", "Corrections dir", "");
35  }
36 protected:
37  //__________________________________________________________________
44  {
45  // --- Output file name ------------------------------------------
46  AliAnalysisManager::SetCommonFileName("forward_qa.root");
47 
48  // --- Load libraries/pars ---------------------------------------
49  fRailway->LoadLibrary("PWGLFforward2");
50 
51  // --- Set load path ---------------------------------------------
52  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2",
53  gROOT->GetMacroPath()));
54 
55  // --- Check if this is MC ---------------------------------------
56  Bool_t mc = mgr->GetMCtruthEventHandler() != 0;
57 
58  // --- Add the task ----------------------------------------------
59  if (!CoupleSECar("AddTaskForwardQA.C",
60  Form("%d,%d", mc, fOptions.Has("cent")),
61  AliVEvent::kAny))
62  Fatal("CreateTasks", "Failed to add ForwardQA task");
63 
64  TString cor = "";
65  if (fOptions.Has("corr")) cor = fOptions.Get("corr");
66  if (!cor.IsNull()) {
67  fRailway->LoadAux(Form("%s/fmd_corrections.root",cor.Data()), true);
68  }
69  }
76  {
77  if (!fOptions.Has("cent")) return;
79  }
85  AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
86  //__________________________________________________________________
87  const char* ClassName() const { return "MakeQATrain"; }
88 };
89 
90 //
91 // EOF
92 //
virtual void CreateCentralitySelection(Bool_t mc)
Definition: TrainSetup.C:760
Railway * fRailway
Definition: TrainSetup.C:1674
AliVEventHandler * CreateOutputHandler(UShort_t)
Definition: MakeQATrain.C:85
const TString & Get(const TString &name) const
Definition: Option.C:596
const char * ClassName() const
Definition: MakeQATrain.C:87
Bool_t Has(const TString &name) const
Definition: Option.C:584
void Set(const TString &name, const TString &value)
Definition: Option.C:736
void CreateTasks(AliAnalysisManager *mgr)
Definition: MakeQATrain.C:43
Base classs for train specifications.
Option * Add(const TString &name, const TString &arg, const TString &desc, const TString &val="")
Definition: Option.C:421
virtual Bool_t LoadAux(const TString &name, Bool_t copy=false)
Definition: Railway.C:255
virtual void CreateCentralitySelection(Bool_t mc)
Definition: MakeQATrain.C:75
OptionList fOptions
Definition: TrainSetup.C:1673
MakeQATrain(const char *name="Forward QA")
Definition: MakeQATrain.C:29
unsigned short UShort_t
Definition: External.C:28
bool Bool_t
Definition: External.C:53
virtual AliAnalysisTaskSE * CoupleSECar(const TString &macro, const TString &args, UInt_t mask=0)
Definition: TrainSetup.C:883
virtual Bool_t LoadLibrary(const TString &name, Bool_t slave=true, Bool_t forcePar=false)=0