AliPhysics  97344c9 (97344c9)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TrackletAODTrain.C
Go to the documentation of this file.
1 
11 #include "TrainSetup.C"
12 #ifndef __CINT__
13 #include <AliESDInputHandlerRP.h>
14 // #include <AliMixInputEventHandler.h>
15 // #include <AliMixEventPool.h>
16 // #include <AliMixEventCutObj.h>
17 #include <TMacro.h>
18 #else
19 class AliAnalysisTaskSE;
20 #endif
21 
46 {
52  TrackletAODTrain(const char* name)
53  : TrainSetup(name)
54  {
55  // Define all our options here
56  fOptions.Add("max-delta", "X","Cut on weighted distance",25.);
57  fOptions.Add("scale-dtheta", "Scale dTheta" , true);
58  fOptions.Add("dphi-window", "X","dPhi window", 0.06);
59  fOptions.Add("dtheta-window", "X","dTheta window", 0.025);
60  fOptions.Add("dphi-shift", "X","Bending shift", 0.0045);
61  fOptions.Add("phi-overlap-cut", "X","Phi overlap cut", 0.005);
62  fOptions.Add("z-eta-overlap-cut","X","Z-Eta overlap cut", 0.05);
63  fOptions.Add("copy", "LIST","',' separated list to copy","cent,v0");
64  fOptions.Add("filter-str", "MODE","Filter strange clusters", 0);
65  fOptions.SetDescription("Create branch in AOD with tracklet info");
66 
67  }
78  AliVEventHandler* CreateInputHandler(UShort_t type, Bool_t needRec=false)
79  {
80  Bool_t needRP = true;
81  return TrainSetup::CreateInputHandler(type, needRP);
82  }
92  AliVEventHandler* CreateMCHandler(UShort_t type, bool mc)
93  {
94  AliMCEventHandler* ret =
95  static_cast<AliMCEventHandler*>(TrainSetup::CreateMCHandler(type,mc));
96  if (ret) ret->SetPreReadMode(AliMCEventHandler::kLmPreRead);
97  return ret;
98  }
105  {
106  Info("CreateTasks", "Loading code");
107  fRailway->LoadSource("FixPaths.C");
108  fRailway->LoadSource("AliAODSimpleHeader.C");
109  fRailway->LoadSource("AliSimpleHeaderTask.C");
110  fRailway->LoadSource("AliAODTracklet.C");
111  fRailway->LoadSource("AliTrackletAODTask.C");
112 
113  // --- Task to copy header information ---------------------------
114  TString cpy = fOptions.Get("copy");
115  Info("", "What to copy: %s", cpy.Data());
116  CoupleSECar("AddTaskCopyHeader.C", Form("\"%s\"", cpy.Data()),
117  AliVEvent::kAny);
118 
119  // --- Task to create simple header ------------------------------
120  if (!gROOT->ProcessLine("AliSimpleHeaderTask::Create()"))
121  return;
122 
123  // --- Create the task using interpreter -------------------------
124  Long_t ret =
125  gROOT->ProcessLine("AliTrackletAODTask::Create()");
126  AliAnalysisTaskSE* task = reinterpret_cast<AliAnalysisTaskSE*>(ret);
127  if (!task) return;
128 
129  // --- Set various options on task -------------------------------
130  FromOption(task, "MaxDelta", "max-delta", 25.);
131  FromOption(task, "ScaleDTheta", "scale-dtheta", true);
132  FromOption(task, "DPhiWindow", "dphi-window", 0.06);
133  FromOption(task, "DThetaWindow", "dtheta-window", 0.025);
134  FromOption(task, "DPhiShift", "dphi-shift", 0.0045);
135  FromOption(task, "PhiOverlapCut", "phi-overlap-cut" , 0.005);
136  FromOption(task, "ZEtaOverlapCut", "z-eta-overlap-cut", 0.05);
137  FromOption(task, "FilterStrange", "filter-str", 0);
138 
139  task->Print("");
140  }
146  const char* ClassName() const { return "TrackletAODTrain"; }
147 };
148 //
149 // EOF
150 //
virtual AliVEventHandler * CreateInputHandler(UShort_t type, Bool_t esdRecPoints=false)
Definition: TrainSetup.C:539
Railway * fRailway
Definition: TrainSetup.C:1666
TrackletAODTrain(const char *name)
AliVEventHandler * CreateInputHandler(UShort_t type, Bool_t needRec=false)
virtual AliVEventHandler * CreateMCHandler(UShort_t, bool mc)
Definition: TrainSetup.C:582
const TString & Get(const TString &name) const
Definition: Option.C:596
const char * ClassName() const
void SetDescription(const TString &d)
Definition: Option.C:359
Base classs for train specifications.
Option * Add(const TString &name, const TString &arg, const TString &desc, const TString &val="")
Definition: Option.C:421
void FromOption(AliAnalysisTaskSE *task, const char *what, const char *opt, Double_t defval)
Definition: TrainSetup.C:1228
OptionList fOptions
Definition: TrainSetup.C:1665
unsigned short UShort_t
Definition: External.C:28
AliVEventHandler * CreateMCHandler(UShort_t type, bool mc)
void CreateTasks(AliAnalysisManager *mgr)
bool Bool_t
Definition: External.C:53
virtual AliAnalysisTaskSE * CoupleSECar(const TString &macro, const TString &args, UInt_t mask=0)
Definition: TrainSetup.C:875
virtual Bool_t LoadSource(const TString &name, bool copy=false)
Definition: Railway.C:231