AliPhysics  2c6b7ad (2c6b7ad)
MakeFlowTrain.C
Go to the documentation of this file.
1 
10 #include "TrainSetup.C"
11 
12 //====================================================================
19 class MakeFlowTrain : public TrainSetup
20 {
21 public:
27  MakeFlowTrain(const char* name)
28  : TrainSetup(name)
29  {
30  // General options
31  fOptions.Add("sys", "SYSTEM", "1:pp, 2:PbPb, 3:pPb", "");
32  fOptions.Add("mc", "Do MC analysis");
33  fOptions.Add("max-mom", "2|3|4|5", "Max flow moment to analyse", "5");
34  fOptions.Add("use-cent", "Whether to use the impact parameter "
35  "for centrality");
36  fOptions.Add("mc-vtx", "Whether to get the vertex from the MC header");
37  fOptions.Add("fwd-dets", "[fmd,vzero]", "Forward detectors", "fmd+vzero");
38  fOptions.Add("afterburner", "Whether to afterburn");
39  fOptions.Set("type", "AOD");
40  fOptions.Show(std::cout);
41  // QC specific options
42  fOptions.Add("QC", "Add QC tasks (requires AODs with FMD and SPD objects)");
43  fOptions.Add("qc-type", "[std,eta-gap,3cor,all]",
44  "Which types of QC's to do", "all");
45  fOptions.Add("eg-value", "EGVALUE",
46  "Set value in |eta| of the eta gap", "2.0");
47  fOptions.Add("tracks", "[tpc,hybrid,only]",
48  "Whether or only to use tracks for reference flow",
49  "tpc+hybrid");
50  fOptions.Add("sat-vtx", "Whether to use satellite interactions");
51  fOptions.Add("outlier-fmd", "NSIGMA", "Outlier cut for FMD", "4.0");
52  fOptions.Add("outlier-spd", "NSIGMA", "Outlier cut for SPD", "4.0");
53  // EP specific options
54  fOptions.Add("EP", "Add EP tasks (requires VZERO AOD objects)");
55  }
56 protected:
57  //__________________________________________________________________
63  {
64  // --- Output file name ------------------------------------------
65  AliAnalysisManager::SetCommonFileName("forward_flow.root");
66 
67  // --- Load libraries/pars ---------------------------------------
68  fRailway->LoadLibrary("PWGLFforward2");
69 
70  // --- Set load path ---------------------------------------------
71  gROOT->SetMacroPath(Form("%s:$(ALICE_PHYSICS)/PWGLF/FORWARD/analysis2",
72  gROOT->GetMacroPath()));
73  gROOT->SetMacroPath(Form("%s:$(ALICE_ROOT)/ANALYSIS/macros",
74  gROOT->GetMacroPath()));
75 
76  // --- Add the tasks ---------------------------------------------
77  Bool_t doQC = fOptions.AsBool("QC");
78  Bool_t doEP = fOptions.AsBool("EP");
79  if (doQC) AddQCTasks();
80  if (doEP) AddEPTasks();
81  if (!doQC && !doEP) Fatal("CreateTasks", "No flow tasks were added");
82 
83  }
84  //__________________________________________________________________
88  void AddQCTasks()
89  {
90  // --- Get the parameters ----------------------------------------
91  UShort_t sys = fOptions.AsInt("sys", 0);
92  Int_t moment = fOptions.AsInt("max-mom");
93  TString fwdDets = fOptions.Get("fwd-dets");
94  TString types = fOptions.Get("qc-type");
95  Double_t egValue = fOptions.AsDouble("eg-value");
96  TString tracks = fOptions.Get("tracks");
97  Bool_t useCent = fOptions.AsBool("use-cent");
98  Bool_t useMCVtx = fOptions.AsBool("mc-vtx");
99  Bool_t addFlow = fOptions.AsBool("afterburner");
100  Bool_t satVtx = fOptions.AsBool("sat-vtx");
101  Double_t fmdCut = fOptions.AsDouble("outlier-fmd");
102  Double_t spdCut = fOptions.AsDouble("outlier-spd");
103  Bool_t mc = fOptions.AsBool("mc");
104 
105  types.ToLower();
106  fwdDets.ToUpper();
107  Bool_t doFMD = fwdDets.Contains("FMD");
108  Bool_t doVZERO = fwdDets.Contains("VZERO");
109  tracks.ToLower();
110  Bool_t onlyTr = tracks.Contains("only");
111  Bool_t tpcTr = tracks.Contains("tpc");
112  Bool_t hybridTr = tracks.Contains("hybrid");
113  Bool_t ispA = (sys == 3 ? kTRUE : kFALSE);
114 
115  // Notice the place holders at arg=2,3,4, and 9, These are
116  //
117  // 2: Detector to use (FMD/VZERO)
118  // 3: Whether to use eta gap (true/false)
119  // 4: Do 3-subevent correlations (true/false)
120  // 9: Use tracks for referernce flow (true/false)
121  TString args;
122  args = TString::Format("%d,\"%%s\",%%d,%%d,%d,%f,%f,%f,%%d,%d,%d,%d,%d,%d",
123  moment,
124  mc,
125  fmdCut,
126  spdCut,
127  egValue,
128  useCent,
129  ispA,
130  useMCVtx,
131  satVtx,
132  addFlow);
133 
134  // --- Add the task ----------------------------------------------
135  const char* mac = "AddTaskForwardFlowQC.C";
136  if (doFMD) {
137  if (types.Contains("std") || types.Contains("all")) {
138  if (!onlyTr)
139  CoupleCar(mac, Form(args.Data(), "FMD", false, false, 0));
140  if (tpcTr)
141  CoupleCar(mac, Form(args.Data(), "FMD", false, false, 1));
142  if (hybridTr)
143  CoupleCar(mac, Form(args.Data(), "FMD", false, false, 2));
144  }
145  if (types.Contains("eta-gap") || types.Contains("all")) {
146  if (!onlyTr)
147  CoupleCar(mac, Form(args.Data(), "FMD", true, false, 0));
148  if (tpcTr)
149  CoupleCar(mac, Form(args.Data(), "FMD", true, false, 1));
150  if (hybridTr)
151  CoupleCar(mac, Form(args.Data(), "FMD", true, false, 2));
152  }
153  if (types.Contains("3cor") || types.Contains("all")) {
154  if (!onlyTr)
155  CoupleCar(mac, Form(args.Data(), "FMD", false, true, 0));
156  }
157  }
158  if (doVZERO) {
159  if (types.Contains("std") || types.Contains("all")) {
160  if (!onlyTr)
161  CoupleCar(mac, Form(args.Data(), "VZERO", false, false, 0));
162  if (tpcTr)
163  CoupleCar(mac, Form(args.Data(), "VZERO", false, false, 1));
164  if (hybridTr)
165  CoupleCar(mac, Form(args.Data(), "VZERO", false, false, 2));
166  }
167  if (types.Contains("eta-gap") || types.Contains("all")) {
168  if (!onlyTr)
169  CoupleCar(mac, Form(args.Data(), "VZERO", true, false, 0));
170  if (tpcTr)
171  CoupleCar(mac, Form(args.Data(), "VZERO", true, false, 1));
172  if (hybridTr)
173  CoupleCar(mac, Form(args.Data(), "VZERO", true, false, 2));
174  }
175  if (types.Contains("3cor") || types.Contains("all")) {
176  if (!onlyTr)
177  CoupleCar(mac, Form(args.Data(), "VZERO", false, true, 0));
178  }
179  }
180  }
181  //__________________________________________________________________
185  void AddEPTasks()
186  {
187  // --- Get the parameters ----------------------------------------
188  Int_t moment = fOptions.AsInt("max-mom");
189  TString etaGap = fOptions.Get("eta-gap");
190  TString addFlow = fOptions.Get("afterburner");
191  Bool_t mc = fOptions.AsBool("mc");
192  TString fwdDets = fOptions.Get("fwd-dets");
193 
194  // --- Add the task ----------------------------------------------
195  CoupleCar("AddTaskEventplane.C","");
196  CoupleCar("AddTaskForwardFlowEP.C",
197  Form("%d, %d, \"%s\"", mc, moment, fwdDets.Data()));
198  }
199  //__________________________________________________________________
204  //__________________________________________________________________
210  AliVEventHandler* CreateOutputHandler(UShort_t) { return 0; }
211  //__________________________________________________________________
221  AliVEventHandler* CreateMCHandler(UShort_t, bool)
222  {
223  return 0;
224  }
225  //__________________________________________________________________
231  const char* ClassName() const { return "MakeFlowTrain"; }
232  //__________________________________________________________________
233 };
234 //
235 // EOF
236 //
Double_t AsDouble(const TString &name, Double_t def=0) const
Definition: Option.C:673
double Double_t
Definition: External.C:58
Railway * fRailway
Definition: TrainSetup.C:1674
Bool_t AsBool(const TString &name) const
Definition: Option.C:631
Int_t types
Int_t AsInt(const TString &name, Int_t def=0) const
Definition: Option.C:645
const TString & Get(const TString &name) const
Definition: Option.C:596
void CreateCentralitySelection(Bool_t)
int Int_t
Definition: External.C:63
void CreateTasks(AliAnalysisManager *)
Definition: MakeFlowTrain.C:62
void Set(const TString &name, const TString &value)
Definition: Option.C:736
AliVEventHandler * CreateOutputHandler(UShort_t)
Base classs for train specifications.
Option * Add(const TString &name, const TString &arg, const TString &desc, const TString &val="")
Definition: Option.C:421
MakeFlowTrain(const char *name)
Definition: MakeFlowTrain.C:27
AliVEventHandler * CreateMCHandler(UShort_t, bool)
OptionList fOptions
Definition: TrainSetup.C:1673
unsigned short UShort_t
Definition: External.C:28
void Show(std::ostream &o, const char *prefix=" ") const
Definition: Option.C:928
bool Bool_t
Definition: External.C:53
virtual AliAnalysisTask * CoupleCar(const TString &macro, const TString &args)
Definition: TrainSetup.C:841
const char * ClassName() const
void AddQCTasks()
Definition: MakeFlowTrain.C:88
virtual Bool_t LoadLibrary(const TString &name, Bool_t slave=true, Bool_t forcePar=false)=0